3 #include "../mp4/mp4ids.h"
5 #include "../exceptions.h"
7 #include <c++utilities/conversion/stringbuilder.h>
8 #include <c++utilities/conversion/stringconversion.h>
25 static const string context(
"parsing IVF header");
31 if (m_reader.readUInt32BE() != 0x444B4946u) {
32 diag.emplace_back(DiagLevel::Critical,
"Signature not \"DKIF\".", context);
35 const auto version = m_reader.readUInt16LE();
38 diag.emplace_back(DiagLevel::Warning, argsToString(
"Version ",
version,
" is not supported."), context);
42 m_headerLength = m_reader.readUInt16LE();
43 const auto formatId = m_reader.readUInt32BE();
44 m_formatId = interpretIntegerAsString(formatId);
45 m_pixelSize.setWidth(m_reader.readUInt16LE());
46 m_pixelSize.setHeight(m_reader.readUInt16LE());
47 m_fps = m_reader.readUInt32LE();
48 m_timeScale = m_reader.readUInt32LE();
49 m_sampleCount = m_reader.readUInt32LE();
53 m_duration = TimeSpan::fromSeconds(static_cast<double>(m_sampleCount) / m_fps);
56 m_istream->seekg(4, ios_base::cur);
61 m_frames.emplace_back();
62 m_frames.back().parseHeader(m_reader, diag);