1 #ifndef TAG_PARSER_MP4TRACK_H 2 #define TAG_PARSER_MP4TRACK_H 4 #include "../abstracttrack.h" 12 class Mpeg4Descriptor;
14 struct TrackHeaderInfo;
53 bool dependencyFlag()
const;
56 byte priority()
const;
57 byte streamTypeId()
const;
58 bool upstream()
const;
125 const std::vector<uint32> &sampleSizes()
const;
126 unsigned int chunkOffsetSize()
const;
127 uint32 chunkCount()
const;
128 uint32 sampleToChunkEntryCount()
const;
133 static std::unique_ptr<Mpeg4ElementaryStreamInfo> parseMpeg4ElementaryStreamInfo(
135 static std::unique_ptr<Mpeg4AudioSpecificConfig> parseAudioSpecificConfig(
136 std::istream &stream, uint64 startOffset, uint64 size,
Diagnostics &diag);
137 static std::unique_ptr<Mpeg4VideoSpecificConfig> parseVideoSpecificConfig(
138 IoUtilities::BinaryReader &reader, uint64 startOffset, uint64 size,
Diagnostics &diag);
141 std::vector<uint64> readChunkOffsets(
bool parseFragments,
Diagnostics &diag);
142 std::vector<std::tuple<uint32, uint32, uint32>> readSampleToChunkTable(
Diagnostics &diag);
155 void updateChunkOffsets(
const std::vector<int64> &oldMdatOffsets,
const std::vector<int64> &newMdatOffsets);
156 void updateChunkOffsets(
const std::vector<uint64> &chunkOffsets);
157 void updateChunkOffset(uint32 chunkIndex, uint64 offset);
162 void internalParseHeader(
Diagnostics &diag)
override;
166 uint64 accumulateSampleSizes(
size_t &sampleIndex,
size_t count,
Diagnostics &diag);
167 void addChunkSizeEntries(std::vector<uint64> &chunkSizeTable,
size_t count,
size_t &sampleIndex, uint32 sampleCount,
Diagnostics &diag);
181 uint16 m_framesPerSample;
182 std::vector<uint32> m_sampleSizes;
183 unsigned int m_chunkOffsetSize;
185 uint32 m_sampleToChunkEntryCount;
186 std::unique_ptr<Mpeg4ElementaryStreamInfo> m_esInfo;
187 std::unique_ptr<AvcConfiguration> m_avcConfig;
207 return m_sampleSizes;
217 return m_chunkOffsetSize;
233 return m_sampleToChunkEntryCount;
245 return m_esInfo.get();
256 return m_avcConfig.get();
261 #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 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...
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.