3 #include "../mp4/mp4ids.h"
5 #include "../exceptions.h"
7 #include <c++utilities/conversion/stringbuilder.h>
8 #include <c++utilities/conversion/stringconversion.h>
25 CPP_UTILITIES_UNUSED(progress)
27 static const string context(
"parsing IVF header");
33 if (m_reader.readUInt32BE() != 0x444B4946u) {
34 diag.emplace_back(DiagLevel::Critical,
"Signature not \"DKIF\".", context);
37 const auto version = m_reader.readUInt16LE();
40 diag.emplace_back(DiagLevel::Warning, argsToString(
"Version ",
version,
" is not supported."), context);
44 m_headerLength = m_reader.readUInt16LE();
45 const auto formatId = m_reader.readUInt32BE();
46 m_formatId = interpretIntegerAsString(formatId);
47 m_pixelSize.setWidth(m_reader.readUInt16LE());
48 m_pixelSize.setHeight(m_reader.readUInt16LE());
49 m_fps = m_reader.readUInt32LE();
50 m_timeScale = m_reader.readUInt32LE();
51 m_sampleCount = m_reader.readUInt32LE();
55 m_duration = TimeSpan::fromSeconds(
static_cast<double>(m_sampleCount) / m_fps);
58 m_istream->seekg(4, ios_base::cur);
63 m_frames.emplace_back();
64 m_frames.back().parseHeader(m_reader, diag);
The AbortableProgressFeedback class provides feedback about an ongoing operation via callbacks.
The Diagnostics class is a container for DiagMessage.
The exception that is thrown when the data to be parsed or to be made seems invalid and therefore can...
The exception that is thrown when the data to be parsed holds no parsable information (e....
TAG_PARSER_EXPORT MediaFormat fourccToMediaFormat(std::uint32_t fourccId)
Contains all classes and functions of the TagInfo library.