1#ifndef TAG_PARSER_MP4TRACK_H
2#define TAG_PARSER_MP4TRACK_H
16struct TrackHeaderInfo;
56 bool dependencyFlag()
const;
59 std::uint8_t priority()
const;
60 std::uint8_t streamTypeId()
const;
61 bool upstream()
const;
128 const std::vector<std::uint32_t> &sampleSizes()
const;
129 unsigned int chunkOffsetSize()
const;
130 void setChunkOffsetSize(
unsigned int chunkOffsetSize);
131 std::uint32_t chunkCount()
const;
132 std::uint32_t sampleToChunkEntryCount()
const;
138 static std::unique_ptr<Mpeg4ElementaryStreamInfo> parseMpeg4ElementaryStreamInfo(
140 static std::unique_ptr<Mpeg4AudioSpecificConfig> parseAudioSpecificConfig(
141 std::istream &stream, std::uint64_t startOffset, std::uint64_t size,
Diagnostics &diag);
142 static std::unique_ptr<Mpeg4VideoSpecificConfig> parseVideoSpecificConfig(
143 CppUtilities::BinaryReader &reader, std::uint64_t startOffset, std::uint64_t size,
Diagnostics &diag);
146 std::vector<std::uint64_t> readChunkOffsets(
bool parseFragments,
Diagnostics &diag);
147 std::vector<std::tuple<std::uint32_t, std::uint32_t, std::uint32_t>> readSampleToChunkTable(
Diagnostics &diag);
152 std::uint64_t chunkOffsetAtomSize(
Diagnostics &diag)
const;
153 std::uint64_t requiredSize(
Diagnostics &diag)
const;
161 void updateChunkOffsets(
const std::vector<std::int64_t> &oldMdatOffsets,
const std::vector<std::int64_t> &newMdatOffsets);
162 void updateChunkOffsets(
const std::vector<std::uint64_t> &chunkOffsets);
163 void updateChunkOffset(std::uint32_t chunkIndex, std::uint64_t offset);
173 std::uint64_t accumulateSampleSizes(std::size_t &sampleIndex, std::size_t count,
Diagnostics &diag);
174 void addChunkSizeEntries(
175 std::vector<std::uint64_t> &chunkSizeTable, std::size_t count, std::size_t &sampleIndex, std::uint32_t sampleCount,
Diagnostics &diag);
178 std::tuple<std::uint64_t, std::uint64_t> calculateSampleTableSize(
Diagnostics &diag)
const;
191 std::uint32_t m_rawMediaType;
192 std::uint16_t m_framesPerSample;
193 std::vector<std::uint32_t> m_sampleSizes;
194 unsigned int m_chunkOffsetSize;
195 std::uint32_t m_chunkCount;
196 std::uint32_t m_sampleToChunkEntryCount;
197 std::uint64_t m_rawTkhdCreationTime;
198 std::uint64_t m_rawMdhdCreationTime;
199 std::uint64_t m_rawTkhdModificationTime;
200 std::uint64_t m_rawMdhdModificationTime;
201 std::uint64_t m_rawTkhdDuration;
202 std::uint64_t m_rawMdhdDuration;
203 std::unique_ptr<Mpeg4ElementaryStreamInfo> m_esInfo;
204 std::unique_ptr<AvcConfiguration> m_avcConfig;
205 std::unique_ptr<Av1Configuration> m_av1Config;
206 mutable std::unique_ptr<TrackHeaderInfo> m_trackHeaderInfo;
226 return m_sampleSizes;
239 return m_chunkOffsetSize;
264 return m_sampleToChunkEntryCount;
276 return m_esInfo.get();
287 return m_avcConfig.get();
298 return m_av1Config.get();
The AbortableProgressFeedback class provides feedback about an ongoing operation via callbacks.
The AbstractTrack class parses and stores technical information about video, audio and other kinds of...
The Diagnostics class is a container for DiagMessage.
The Mp4Atom class helps to parse MP4 files.
Implementation of TagParser::AbstractTrack for the MP4 container.
const Av1Configuration * av1Configuration() const
Returns the AV1 configuration.
std::uint32_t chunkCount() const
Returns the number of chunks denoted by the stco/co64 atom.
void setChunkOffsetSize(unsigned int chunkOffsetSize)
Sets the size of a single chunk offset denotation within the stco/co64 atom.
std::uint32_t sampleToChunkEntryCount() const
Returns the number of "sample to chunk" entries within the stsc atom.
const std::vector< std::uint32_t > & sampleSizes() const
Returns the sample size table for the track.
unsigned int chunkOffsetSize() const
Returns the size of a single chunk offset denotation within the stco/co64 atom.
const Mpeg4ElementaryStreamInfo * mpeg4ElementaryStreamInfo() const
Returns information about the MPEG-4 elementary stream.
const AvcConfiguration * avcConfiguration() const
Returns the AVC configuration.
Mp4Atom & trakAtom()
Returns the trak atom for the current instance.
The Mpeg4AudioSpecificConfig class holds MPEG-4 audio specific config parsed using Mp4Track::parseAud...
std::uint32_t sampleFrequency
std::uint16_t layerLength
std::uint32_t extensionSampleFrequency
std::uint8_t resilienceFlags
std::uint8_t extensionChannelConfiguration
std::uint16_t coreCoderDelay
std::uint8_t extensionSampleFrequencyIndex
std::uint8_t channelConfiguration
std::uint8_t extensionFlag
std::uint8_t sampleFrequencyIndex
std::uint8_t audioObjectType
std::uint8_t extensionAudioObjectType
std::uint8_t numOfSubFrame
The Mpeg4ElementaryStreamInfo class holds MPEG-4 elementary stream info parsed using Mp4Track::parseM...
std::unique_ptr< Mpeg4AudioSpecificConfig > audioSpecificConfig
std::uint8_t priority() const
bool dependencyFlag() const
std::uint32_t averageBitrate
std::uint8_t decCfgDescFlags
Mpeg4ElementaryStreamInfo()
std::uint8_t streamTypeId() const
std::uint16_t dependsOnId
std::uint8_t objectTypeId
std::unique_ptr< Mpeg4VideoSpecificConfig > videoSpecificConfig
The Mpeg4VideoSpecificConfig class holds MPEG-4 video specific config parsed using Mp4Track::parseVid...
#define TAG_PARSER_EXPORT
Marks the symbol to be exported by the tagparser library.
Contains all classes and functions of the TagInfo library.
TrackType
The TrackType enum specifies the underlying file type of a track and the concrete class of the track ...
The Av1Configuration struct provides a parser for AV1 configuration found in ISOBMFF files.
The AvcConfiguration struct provides a parser for AVC configuration.
The Mp4Timings struct holds timing values found in multiple MP4 atoms.