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 byte priority()
const;
58 byte streamTypeId()
const;
59 bool upstream()
const;
126 const std::vector<uint32> &sampleSizes()
const;
127 unsigned int chunkOffsetSize()
const;
128 uint32 chunkCount()
const;
129 uint32 sampleToChunkEntryCount()
const;
135 static std::unique_ptr<Mpeg4ElementaryStreamInfo> parseMpeg4ElementaryStreamInfo(
137 static std::unique_ptr<Mpeg4AudioSpecificConfig> parseAudioSpecificConfig(
138 std::istream &stream, uint64 startOffset, uint64 size,
Diagnostics &diag);
139 static std::unique_ptr<Mpeg4VideoSpecificConfig> parseVideoSpecificConfig(
140 IoUtilities::BinaryReader &reader, uint64 startOffset, uint64 size,
Diagnostics &diag);
143 std::vector<uint64> readChunkOffsets(
bool parseFragments,
Diagnostics &diag);
144 std::vector<std::tuple<uint32, uint32, uint32>> readSampleToChunkTable(
Diagnostics &diag);
157 void updateChunkOffsets(
const std::vector<int64> &oldMdatOffsets,
const std::vector<int64> &newMdatOffsets);
158 void updateChunkOffsets(
const std::vector<uint64> &chunkOffsets);
159 void updateChunkOffset(uint32 chunkIndex, uint64 offset);
165 void internalParseHeader(
Diagnostics &diag)
override;
169 uint64 accumulateSampleSizes(
size_t &sampleIndex,
size_t count,
Diagnostics &diag);
170 void addChunkSizeEntries(std::vector<uint64> &chunkSizeTable,
size_t count,
size_t &sampleIndex, uint32 sampleCount,
Diagnostics &diag);
184 uint16 m_framesPerSample;
185 std::vector<uint32> m_sampleSizes;
186 unsigned int m_chunkOffsetSize;
188 uint32 m_sampleToChunkEntryCount;
189 std::unique_ptr<Mpeg4ElementaryStreamInfo> m_esInfo;
190 std::unique_ptr<AvcConfiguration> m_avcConfig;
191 std::unique_ptr<Av1Configuration> m_av1Config;
211 return m_sampleSizes;
221 return m_chunkOffsetSize;
237 return m_sampleToChunkEntryCount;
249 return m_esInfo.get();
260 return m_avcConfig.get();
271 return m_av1Config.get();
276 #endif // TAG_PARSER_MP4TRACK_H const std::vector< uint32 > & sampleSizes() const
Returns the sample size table for the track.
byte extensionAudioObjectType
const AvcConfiguration * avcConfiguration() const
Returns the AVC configuration.
The Mpeg4ElementaryStreamInfo class holds MPEG-4 elementary stream info parsed using Mp4Track::parseM...
byte channelConfiguration
const Mpeg4ElementaryStreamInfo * mpeg4ElementaryStreamInfo() const
Returns information about the MPEG-4 elementary stream.
uint32 chunkCount() const
Returns the number of chunks denoted by the stco atom.
The Av1Configuration struct provides a parser for AV1 configuration found in ISOBMFF files.
The Mp4Atom class helps to parse MP4 files.
unsigned int chunkOffsetSize() const
Returns the size of a single chunk offset denotation within the stco atom.
The Mpeg4VideoSpecificConfig class holds MPEG-4 video specific config parsed using Mp4Track::parseVid...
byte streamTypeId() const
The AvcConfiguration struct provides a parser for AVC configuration.
Implementation of TagParser::AbstractTrack for the MP4 container.
uint32 extensionSampleFrequency
Mp4Atom & trakAtom()
Returns the trak atom for the current instance.
bool dependencyFlag() const
byte extensionSampleFrequencyIndex
The Mpeg4AudioSpecificConfig class holds MPEG-4 audio specific config parsed using Mp4Track::parseAud...
const Av1Configuration * av1Configuration() const
Returns the AV1 configuration.
byte extensionChannelConfiguration
The AbstractTrack class parses and stores technical information about video, audio and other kinds of...
uint32 sampleToChunkEntryCount() const
Returns the number of "sample to chunk" entries within the stsc atom.
Mpeg4ElementaryStreamInfo()
std::unique_ptr< Mpeg4AudioSpecificConfig > audioSpecificConfig
byte sampleFrequencyIndex
std::unique_ptr< Mpeg4VideoSpecificConfig > videoSpecificConfig
Contains all classes and functions of the TagInfo library.
#define TAG_PARSER_EXPORT
Marks the symbol to be exported by the tagparser library.
TrackType
Specifies the track type.
The Diagnostics class is a container for DiagMessage.