1 #ifndef TAG_PARSER_MP4TRACK_H
2 #define TAG_PARSER_MP4TRACK_H
4 #include "../abstracttrack.h"
12 class Mpeg4Descriptor;
15 struct TrackHeaderInfo;
54 bool dependencyFlag()
const;
57 std::uint8_t priority()
const;
58 std::uint8_t streamTypeId()
const;
59 bool upstream()
const;
126 const std::vector<std::uint32_t> &sampleSizes()
const;
127 unsigned int chunkOffsetSize()
const;
128 std::uint32_t chunkCount()
const;
129 std::uint32_t sampleToChunkEntryCount()
const;
135 static std::unique_ptr<Mpeg4ElementaryStreamInfo> parseMpeg4ElementaryStreamInfo(
137 static std::unique_ptr<Mpeg4AudioSpecificConfig> parseAudioSpecificConfig(
138 std::istream &stream, std::uint64_t startOffset, std::uint64_t size,
Diagnostics &diag);
139 static std::unique_ptr<Mpeg4VideoSpecificConfig> parseVideoSpecificConfig(
140 CppUtilities::BinaryReader &reader, std::uint64_t startOffset, std::uint64_t size,
Diagnostics &diag);
143 std::vector<std::uint64_t> readChunkOffsets(
bool parseFragments,
Diagnostics &diag);
144 std::vector<std::tuple<std::uint32_t, std::uint32_t, std::uint32_t>> readSampleToChunkTable(
Diagnostics &diag);
149 std::uint64_t requiredSize(
Diagnostics &diag)
const;
157 void updateChunkOffsets(
const std::vector<std::int64_t> &oldMdatOffsets,
const std::vector<std::int64_t> &newMdatOffsets);
158 void updateChunkOffsets(
const std::vector<std::uint64_t> &chunkOffsets);
159 void updateChunkOffset(std::uint32_t chunkIndex, std::uint64_t offset);
169 std::uint64_t accumulateSampleSizes(std::size_t &sampleIndex, std::size_t count,
Diagnostics &diag);
170 void addChunkSizeEntries(
171 std::vector<std::uint64_t> &chunkSizeTable, std::size_t count, std::size_t &sampleIndex, std::uint32_t sampleCount,
Diagnostics &diag);
185 std::uint32_t m_rawMediaType;
186 std::uint16_t m_framesPerSample;
187 std::vector<std::uint32_t> m_sampleSizes;
188 unsigned int m_chunkOffsetSize;
189 std::uint32_t m_chunkCount;
190 std::uint32_t m_sampleToChunkEntryCount;
191 std::unique_ptr<Mpeg4ElementaryStreamInfo> m_esInfo;
192 std::unique_ptr<AvcConfiguration> m_avcConfig;
193 std::unique_ptr<Av1Configuration> m_av1Config;
213 return m_sampleSizes;
223 return m_chunkOffsetSize;
239 return m_sampleToChunkEntryCount;
251 return m_esInfo.get();
262 return m_avcConfig.get();
273 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 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 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.