Tag Parser: matroska/matroskatrack.cpp Source File

Tag Parser 12.5.2 C++ library for reading and writing MP4 (iTunes), ID3, Vorbis, Opus, FLAC and Matroska tags

Loading...
Searching...
No Matches
matroskatrack.cpp
Go to the documentation of this file.
1#include "./matroskatrack.h"
2#include "./ebmlelement.h"
3#include "./matroskacontainer.h"
4#include "./matroskaid.h"
5#include "./matroskatag.h"
6
7#include "../avi/bitmapinfoheader.h"
8
9#include "../wav/waveaudiostream.h"
10
11#include "../avc/avcconfiguration.h"
12
13#include "../mp4/mp4ids.h"
14#include "../mp4/mp4track.h"
15
16#include "../exceptions.h"
17#include "../mediaformat.h"
18
19#include <c++utilities/conversion/stringconversion.h>
20
21using namespace std;
22using namespace CppUtilities;
23
24namespace TagParser {
25
30
37MatroskaTrack::MatroskaTrack(EbmlElement &trackElement)
38 : AbstractTrack(trackElement.stream(), trackElement.startOffset())
39 , m_trackElement(&trackElement)
40{
41}
42
46MatroskaTrack::~MatroskaTrack()
47{
48}
49
50 TrackType MatroskaTrack::type() const
51{
52 return TrackType::MatroskaTrack;
53}
54
59 MediaFormat MatroskaTrack::codecIdToMediaFormat(const string &codecId)
60{
61 auto parts = splitString<vector<string>>(codecId, "/", EmptyPartsTreat::Keep, 3);
62 parts.resize(3);
63 const auto &part1 = parts[0], &part2 = parts[1], &part3 = parts[2];
64 MediaFormat fmt;
65 if (part1 == "V_MS" && part2 == "VFW" && part3 == "FOURCC") {
66 fmt.general = GeneralMediaFormat::MicrosoftVideoCodecManager;
67 } else if (part1 == "V_UNCOMPRESSED") {
68 fmt.general = GeneralMediaFormat::UncompressedVideoFrames;
69 } else if (part1 == "V_MPEG4") {
70 fmt.general = GeneralMediaFormat::Mpeg4Video;
71 if (part2 == "ISO") {
72 if (part3 == "SP") {
73 fmt.sub = SubFormats::Mpeg4SimpleProfile1;
74 } else if (part3 == "ASP") {
75 fmt.sub = SubFormats::Mpeg4AdvancedSimpleProfile1;
76 } else if (part3 == "AVC") {
77 fmt.general = GeneralMediaFormat::Avc;
78 }
79 } else if (part2 == "MS" && part3 == "V3") {
80 fmt.sub = SubFormats::Mpeg4SimpleProfile1;
81 }
82 } else if (part1 == "V_MPEG1") {
83 fmt.general = GeneralMediaFormat::Mpeg1Video;
84 } else if (part1 == "V_MPEG2") {
85 fmt.general = GeneralMediaFormat::Mpeg2Video;
86 } else if (part1 == "V_REAL") {
87 fmt.general = GeneralMediaFormat::RealVideo;
88 } else if (part1 == "V_QUICKTIME") {
89 fmt.general = GeneralMediaFormat::QuicktimeVideo;
90 } else if (part1 == "V_THEORA") {
91 fmt.general = GeneralMediaFormat::Theora;
92 } else if (part1 == "V_PRORES") {
93 fmt.general = GeneralMediaFormat::ProRes;
94 } else if (part1 == "V_VP8") {
95 fmt.general = GeneralMediaFormat::Vp8;
96 } else if (part1 == "V_VP9") {
97 fmt.general = GeneralMediaFormat::Vp9;
98 } else if (part1 == "V_AV1") {
99 fmt.general = GeneralMediaFormat::Av1;
100 } else if (part1 == "A_MPEG") {
101 fmt.general = GeneralMediaFormat::Mpeg1Audio;
102 if (part2 == "L1") {
103 fmt.sub = SubFormats::Mpeg1Layer1;
104 } else if (part2 == "L2") {
105 fmt.sub = SubFormats::Mpeg1Layer2;
106 } else if (part2 == "L3") {
107 fmt.sub = SubFormats::Mpeg1Layer3;
108 }
109 } else if (part1 == "V_MPEGH" && part2 == "ISO" && part3 == "HEVC") {
110 fmt.general = GeneralMediaFormat::Hevc;
111 } else if (part1 == "A_PCM") {
112 fmt.general = GeneralMediaFormat::Pcm;
113 if (part2 == "INT") {
114 if (part3 == "BIG") {
115 fmt.sub = SubFormats::PcmIntBe;
116 } else if (part3 == "LIT") {
117 fmt.sub = SubFormats::PcmIntLe;
118 }
119 } else if (part2 == "FLOAT" && part3 == "IEEE") {
120 fmt.sub = SubFormats::PcmFloatIeee;
121 }
122 } else if (part1 == "A_MPC") {
123 fmt.general = GeneralMediaFormat::Mpc;
124 } else if (part1 == "A_AC3") {
125 fmt.general = GeneralMediaFormat::Ac3;
126 } else if (part1 == "A_EAC3") {
127 fmt.general = GeneralMediaFormat::EAc3;
128 } else if (part1 == "A_ALAC") {
129 fmt.general = GeneralMediaFormat::Alac;
130 } else if (part1 == "A_DTS") {
131 fmt.general = GeneralMediaFormat::Dts;
132 if (part2 == "EXPRESS") {
133 fmt.sub = SubFormats::DtsExpress;
134 } else if (part2 == "LOSSLESS") {
135 fmt.sub = SubFormats::DtsLossless;
136 }
137 } else if (part1 == "A_VORBIS") {
138 fmt.general = GeneralMediaFormat::Vorbis;
139 } else if (part1 == "A_FLAC") {
140 fmt.general = GeneralMediaFormat::Flac;
141 } else if (part1 == "A_OPUS") {
142 fmt.general = GeneralMediaFormat::Opus;
143 } else if (part1 == "A_REAL") {
144 fmt.general = GeneralMediaFormat::RealAudio;
145 } else if (part1 == "A_MS" && part2 == "ACM") {
146 fmt.general = GeneralMediaFormat::MicrosoftAudioCodecManager;
147 } else if (part1 == "A_AAC") {
148 fmt.general = GeneralMediaFormat::Aac;
149 if (part2 == "MPEG2") {
150 if (part3 == "MAIN") {
151 fmt.sub = SubFormats::AacMpeg2MainProfile;
152 } else if (part3 == "LC") {
153 fmt.sub = SubFormats::AacMpeg2LowComplexityProfile;
154 } else if (part3 == "SBR") {
155 fmt.sub = SubFormats::AacMpeg2LowComplexityProfile;
156 fmt.extension = ExtensionFormats::SpectralBandReplication;
157 } else if (part3 == "SSR") {
158 fmt.sub = SubFormats::AacMpeg2ScalableSamplingRateProfile;
159 }
160 } else if (part2 == "MPEG4") {
161 if (part3 == "MAIN") {
162 fmt.sub = SubFormats::AacMpeg4MainProfile;
163 } else if (part3 == "LC") {
164 fmt.sub = SubFormats::AacMpeg4LowComplexityProfile;
165 } else if (part3 == "SBR") {
166 fmt.sub = SubFormats::AacMpeg4LowComplexityProfile;
167 fmt.extension = ExtensionFormats::SpectralBandReplication;
168 } else if (part3 == "SSR") {
169 fmt.sub = SubFormats::AacMpeg4ScalableSamplingRateProfile;
170 } else if (part3 == "LTP") {
171 fmt.sub = SubFormats::AacMpeg4LongTermPrediction;
172 }
173 }
174 } else if (part1 == "A_QUICKTIME") {
175 fmt.general = GeneralMediaFormat::QuicktimeAudio;
176 } else if (part1 == "A_TTA1") {
177 fmt.general = GeneralMediaFormat::Tta;
178 } else if (part1 == "A_WAVPACK4") {
179 fmt.general = GeneralMediaFormat::WavPack;
180 } else if (part1 == "S_TEXT") {
181 fmt.general = GeneralMediaFormat::TextSubtitle;
182 if (part2 == "UTF8") {
183 fmt.sub = SubFormats::PlainUtf8Subtitle;
184 } else if (part2 == "SSA") {
185 fmt.sub = SubFormats::SubStationAlpha;
186 } else if (part2 == "ASS") {
187 fmt.sub = SubFormats::AdvancedSubStationAlpha;
188 } else if (part2 == "USF") {
189 fmt.sub = SubFormats::UniversalSubtitleFormat;
190 } else if (part2 == "WEBVTT") {
191 fmt.sub = SubFormats::WebVideoTextTracksFormat;
192 }
193 } else if (part1 == "S_IMAGE") {
194 fmt.general = GeneralMediaFormat::ImageSubtitle;
195 if (part2 == "BMP") {
196 fmt.sub = SubFormats::ImgSubBmp;
197 }
198 } else if (part1 == "S_VOBSUB") {
199 fmt.general = GeneralMediaFormat::VobSub;
200 } else if (part1 == "S_KATE") {
201 fmt.general = GeneralMediaFormat::OggKate;
202 } else if (part1 == "B_VOBBTN") {
203 fmt.general = GeneralMediaFormat::VobBtn;
204 } else if (part1 == "S_DVBSUB") {
205 fmt.general = GeneralMediaFormat::DvbSub;
206 } else if (part1 == "V_MSWMV") {
207 fmt.general = GeneralMediaFormat::Vc1;
208 }
209 return fmt;
210}
211
213
214template <typename PropertyType, typename ConversionFunction>
215void MatroskaTrack::assignPropertyFromTagValue(const std::unique_ptr<MatroskaTag> &tag, std::string_view fieldId, PropertyType &property,
216 const ConversionFunction &conversionFunction, Diagnostics &diag)
217{
218 const TagValue &value = tag->value(std::string(fieldId));
219 if (!value.isEmpty()) {
220 try {
221 property = conversionFunction(value);
222 } catch (const ConversionException &) {
223 string message;
224 try {
225 message = argsToString("Ignoring invalid value \"", value.toString(TagTextEncoding::Utf8), "\" of \"", fieldId, '\"', '.');
226 } catch (const ConversionException &) {
227 message = argsToString("Ignoring invalid value of \"", fieldId, '\"', '.');
228 }
229 diag.emplace_back(DiagLevel::Warning, message, argsToString("reading track statatistic from \"", tag->toString(), '\"'));
230 }
231 }
232}
233
234template <typename NumberType, Traits::EnableIf<std::is_integral<NumberType>> * = nullptr> NumberType tagValueToNumber(const TagValue &tagValue)
235{
236 // optimization for Latin1/UTF-8 strings
237 if (tagValue.type() == TagDataType::Text) {
238 switch (tagValue.dataEncoding()) {
239 case TagTextEncoding::Latin1:
240 case TagTextEncoding::Utf8:
241 return bufferToNumber<NumberType>(tagValue.dataPointer(), tagValue.dataSize());
242 default:;
243 }
244 }
245 // generic conversion
246 return stringToNumber<NumberType>(tagValue.toString(TagTextEncoding::Utf8));
247}
248
249template <typename NumberType, Traits::EnableIf<std::is_floating_point<NumberType>> * = nullptr>
250NumberType tagValueToBitrate(const TagValue &tagValue)
251{
252 return stringToNumber<NumberType>(tagValue.toString(TagTextEncoding::Utf8)) / 1000;
253}
254
256
266 void MatroskaTrack::readStatisticsFromTags(const std::vector<std::unique_ptr<MatroskaTag>> &tags, Diagnostics &diag)
267{
268 using namespace std::placeholders;
269 using namespace MatroskaTagIds::TrackSpecific;
270 for (const auto &tag : tags) {
271 const TagTarget &target = tag->target();
272 if (find(target.tracks().cbegin(), target.tracks().cend(), id()) == target.tracks().cend()) {
273 continue;
274 }
275 assignPropertyFromTagValue(tag, numberOfBytes(), m_size, &tagValueToNumber<std::uint64_t>, diag);
276 assignPropertyFromTagValue(tag, numberOfFrames(), m_sampleCount, &tagValueToNumber<std::uint64_t>, diag);
277 assignPropertyFromTagValue(tag, MatroskaTagIds::TrackSpecific::duration(), m_duration, bind(&TagValue::toTimeSpan, _1), diag);
278 assignPropertyFromTagValue(tag, MatroskaTagIds::TrackSpecific::bitrate(), m_bitrate, &tagValueToBitrate<double>, diag);
279 assignPropertyFromTagValue(tag, writingDate(), m_modificationTime, bind(&TagValue::toDateTime, _1), diag);
280 if (m_creationTime.isNull()) {
281 m_creationTime = m_modificationTime;
282 }
283 }
284}
285
286 void MatroskaTrack::internalParseHeader(Diagnostics &diag, AbortableProgressFeedback &progress)
287{
288 CPP_UTILITIES_UNUSED(progress)
289
290 static const string context("parsing header of Matroska track");
291 try {
292 m_trackElement->parse(diag);
293 } catch (const Failure &) {
294 diag.emplace_back(DiagLevel::Critical, "Unable to parse track element.", context);
295 throw;
296 }
297 // read information about the track from the children of the track entry element
298 auto hasIsoLanguage = false;
299 m_flags = TrackFlags::Default | TrackFlags::Enabled;
300 for (EbmlElement *trackInfoElement = m_trackElement->firstChild(), *subElement = nullptr; trackInfoElement;
301 trackInfoElement = trackInfoElement->nextSibling()) {
302 try {
303 trackInfoElement->parse(diag);
304 } catch (const Failure &) {
305 diag.emplace_back(DiagLevel::Critical, "Unable to parse track information element.", context);
306 break;
307 }
308 std::uint64_t defaultDuration = 0;
309 switch (trackInfoElement->id()) {
310 case MatroskaIds::TrackType:
311 switch (trackInfoElement->readUInteger()) {
312 case MatroskaTrackType::Video:
313 m_mediaType = MediaType::Video;
314 break;
315 case MatroskaTrackType::Audio:
316 m_mediaType = MediaType::Audio;
317 break;
318 case MatroskaTrackType::Subtitle:
319 m_mediaType = MediaType::Text;
320 break;
321 case MatroskaTrackType::Buttons:
322 m_mediaType = MediaType::Buttons;
323 break;
324 case MatroskaTrackType::Control:
325 m_mediaType = MediaType::Control;
326 break;
327 default:
328 m_mediaType = MediaType::Unknown;
329 }
330 break;
331 case MatroskaIds::TrackVideo:
332 for (subElement = trackInfoElement->firstChild(); subElement; subElement = subElement->nextSibling()) {
333 try {
334 subElement->parse(diag);
335 } catch (const Failure &) {
336 diag.emplace_back(DiagLevel::Critical, "Unable to parse video track element.", context);
337 break;
338 }
339 switch (subElement->id()) {
340 case MatroskaIds::DisplayWidth:
341 m_displaySize.setWidth(static_cast<std::uint32_t>(subElement->readUInteger()));
342 break;
343 case MatroskaIds::DisplayHeight:
344 m_displaySize.setHeight(static_cast<std::uint32_t>(subElement->readUInteger()));
345 break;
346 case MatroskaIds::PixelWidth:
347 m_pixelSize.setWidth(static_cast<std::uint32_t>(subElement->readUInteger()));
348 break;
349 case MatroskaIds::PixelHeight:
350 m_pixelSize.setHeight(static_cast<std::uint32_t>(subElement->readUInteger()));
351 break;
352 case MatroskaIds::PixelCropTop:
353 m_cropping.setTop(static_cast<std::uint32_t>(subElement->readUInteger()));
354 break;
355 case MatroskaIds::PixelCropLeft:
356 m_cropping.setLeft(static_cast<std::uint32_t>(subElement->readUInteger()));
357 break;
358 case MatroskaIds::PixelCropBottom:
359 m_cropping.setBottom(static_cast<std::uint32_t>(subElement->readUInteger()));
360 break;
361 case MatroskaIds::PixelCropRight:
362 m_cropping.setRight(static_cast<std::uint32_t>(subElement->readUInteger()));
363 break;
364 case MatroskaIds::FrameRate:
365 m_fps = static_cast<std::uint32_t>(subElement->readFloat());
366 break;
367 case MatroskaIds::FlagInterlaced:
368 modFlagEnum(m_flags, TrackFlags::Interlaced, subElement->readUInteger());
369 break;
370 case MatroskaIds::ColorSpace:
371 m_colorSpace = static_cast<std::uint32_t>(subElement->readUInteger());
372 break;
373 default:;
374 }
375 }
376 break;
377 case MatroskaIds::TrackAudio:
378 for (subElement = trackInfoElement->firstChild(); subElement; subElement = subElement->nextSibling()) {
379 try {
380 subElement->parse(diag);
381 } catch (const Failure &) {
382 diag.emplace_back(DiagLevel::Critical, "Unable to parse audio track element.", context);
383 break;
384 }
385 switch (subElement->id()) {
386 case MatroskaIds::BitDepth:
387 m_bitsPerSample = static_cast<std::uint16_t>(subElement->readUInteger());
388 break;
389 case MatroskaIds::Channels:
390 m_channelCount = static_cast<std::uint16_t>(subElement->readUInteger());
391 break;
392 case MatroskaIds::SamplingFrequency:
393 if (!m_samplingFrequency) {
394 m_samplingFrequency = static_cast<std::uint32_t>(subElement->readFloat());
395 }
396 break;
397 case MatroskaIds::OutputSamplingFrequency:
398 if (!m_extensionSamplingFrequency) {
399 m_extensionSamplingFrequency = static_cast<std::uint32_t>(subElement->readFloat());
400 }
401 break;
402 default:;
403 }
404 }
405 break;
406 case MatroskaIds::TrackNumber:
407 m_trackNumber = static_cast<std::uint32_t>(trackInfoElement->readUInteger());
408 break;
409 case MatroskaIds::TrackUID:
410 m_id = trackInfoElement->readUInteger();
411 break;
412 case MatroskaIds::TrackName:
413 m_name = trackInfoElement->readString();
414 break;
415 case MatroskaIds::TrackLanguage:
416 m_locale.emplace_back(trackInfoElement->readString(), LocaleFormat::ISO_639_2_B);
417 hasIsoLanguage = true;
418 break;
419 case MatroskaIds::TrackLanguageIETF:
420 m_locale.emplace_back(trackInfoElement->readString(), LocaleFormat::BCP_47);
421 break;
422 case MatroskaIds::CodecID:
423 m_format = codecIdToMediaFormat(m_formatId = trackInfoElement->readString());
424 break;
425 case MatroskaIds::CodecName:
426 m_formatName = trackInfoElement->readString();
427 break;
428 case MatroskaIds::CodecDelay:
429 break; // TODO
430 case MatroskaIds::TrackFlagEnabled:
431 modFlagEnum(m_flags, TrackFlags::Enabled, trackInfoElement->readUInteger());
432 break;
433 case MatroskaIds::TrackFlagDefault:
434 modFlagEnum(m_flags, TrackFlags::Default, trackInfoElement->readUInteger());
435 break;
436 case MatroskaIds::TrackFlagForced:
437 modFlagEnum(m_flags, TrackFlags::Forced, trackInfoElement->readUInteger());
438 break;
439 case MatroskaIds::TrackFlagLacing:
440 modFlagEnum(m_flags, TrackFlags::Lacing, trackInfoElement->readUInteger());
441 break;
442 case MatroskaIds::DefaultDuration:
443 defaultDuration = trackInfoElement->readUInteger();
444 break;
445 default:;
446 }
447 switch (m_mediaType) {
448 case MediaType::Video:
449 if (!m_fps && defaultDuration) {
450 m_fps = static_cast<std::uint32_t>(1000000000.0 / static_cast<double>(defaultDuration));
451 }
452 break;
453 default:;
454 }
455 }
456
457 // read further information from the CodecPrivate element for some codecs
458 EbmlElement *codecPrivateElement;
459 switch (m_format.general) {
460 case GeneralMediaFormat::MicrosoftVideoCodecManager:
461 if ((codecPrivateElement = m_trackElement->childById(MatroskaIds::CodecPrivate, diag))) {
462 // parse bitmap info header to determine actual format
463 if (codecPrivateElement->dataSize() >= 0x28) {
464 m_istream->seekg(static_cast<streamoff>(codecPrivateElement->dataOffset()));
465 BitmapInfoHeader bitmapInfoHeader;
466 bitmapInfoHeader.parse(reader());
467 m_formatId.reserve(m_formatId.size() + 7);
468 m_formatId += " \"";
469 m_formatId += interpretIntegerAsString(bitmapInfoHeader.compression);
470 m_formatId += "\"";
471 m_format += FourccIds::fourccToMediaFormat(bitmapInfoHeader.compression);
472 } else {
473 diag.emplace_back(DiagLevel::Critical, "BITMAPINFOHEADER structure (in \"CodecPrivate\"-element) is truncated.", context);
474 }
475 }
476 break;
477 case GeneralMediaFormat::MicrosoftAudioCodecManager:
478 if ((codecPrivateElement = m_trackElement->childById(MatroskaIds::CodecPrivate, diag))) {
479 // parse WAVE header to determine actual format
480 m_istream->seekg(static_cast<streamoff>(codecPrivateElement->dataOffset()));
481 WaveFormatHeader waveFormatHeader;
482 waveFormatHeader.parse(reader(), codecPrivateElement->dataSize(), diag);
483 WaveAudioStream::addInfo(waveFormatHeader, *this);
484 }
485 break;
486 case GeneralMediaFormat::Aac:
487 if ((codecPrivateElement = m_trackElement->childById(MatroskaIds::CodecPrivate, diag))) {
488 auto audioSpecificConfig
489 = Mp4Track::parseAudioSpecificConfig(*m_istream, codecPrivateElement->dataOffset(), codecPrivateElement->dataSize(), diag);
490 m_format += Mpeg4AudioObjectIds::idToMediaFormat(
491 audioSpecificConfig->audioObjectType, audioSpecificConfig->sbrPresent, audioSpecificConfig->psPresent);
492 if (audioSpecificConfig->sampleFrequencyIndex == 0xF) {
493 //m_samplingFrequency = audioSpecificConfig->sampleFrequency;
494 } else if (audioSpecificConfig->sampleFrequencyIndex < sizeof(mpeg4SamplingFrequencyTable)) {
495 //m_samplingFrequency = mpeg4SamplingFrequencyTable[audioSpecificConfig->sampleFrequencyIndex];
496 } else {
497 diag.emplace_back(DiagLevel::Warning, "Audio specific config has invalid sample frequency index.", context);
498 }
499 if (audioSpecificConfig->extensionSampleFrequencyIndex == 0xF) {
500 //m_extensionSamplingFrequency = audioSpecificConfig->extensionSampleFrequency;
501 } else if (audioSpecificConfig->extensionSampleFrequencyIndex < sizeof(mpeg4SamplingFrequencyTable)) {
502 //m_extensionSamplingFrequency = mpeg4SamplingFrequencyTable[audioSpecificConfig->extensionSampleFrequencyIndex];
503 } else {
504 diag.emplace_back(DiagLevel::Warning, "Audio specific config has invalid extension sample frequency index.", context);
505 }
506 m_channelConfig = audioSpecificConfig->channelConfiguration;
507 m_extensionChannelConfig = audioSpecificConfig->extensionChannelConfiguration;
508 }
509 break;
510 case GeneralMediaFormat::Avc:
511 if ((codecPrivateElement = m_trackElement->childById(MatroskaIds::CodecPrivate, diag))) {
512 auto avcConfig = make_unique<TagParser::AvcConfiguration>();
513 try {
514 m_istream->seekg(static_cast<streamoff>(codecPrivateElement->dataOffset()));
515 avcConfig->parse(m_reader, codecPrivateElement->dataSize(), diag);
516 Mp4Track::addInfo(*avcConfig, *this);
517 } catch (const TruncatedDataException &) {
518 diag.emplace_back(DiagLevel::Critical, "AVC configuration is truncated.", context);
519 } catch (const Failure &) {
520 diag.emplace_back(DiagLevel::Critical, "AVC configuration is invalid.", context);
521 }
522 }
523 break;
524 default:;
525 }
526
527 // parse format name for unknown formats
528 if (m_format.general == GeneralMediaFormat::Unknown && m_formatName.empty()) {
529 if (startsWith<string>(m_formatId, "V_") || startsWith<string>(m_formatId, "A_") || startsWith<string>(m_formatId, "S_")) {
530 m_formatName = m_formatId.substr(2);
531 } else {
532 m_formatName = m_formatId;
533 }
534 m_formatName.append(" (unknown)");
535 }
536
537 // use pixel size as display size if display size not specified
538 if (!m_displaySize.width()) {
539 m_displaySize.setWidth(m_pixelSize.width());
540 }
541 if (!m_displaySize.height()) {
542 m_displaySize.setHeight(m_pixelSize.height());
543 }
544
545 // set English if no ISO language has been specified (it is the default value of MatroskaIds::TrackLanguage)
546 if (!hasIsoLanguage) {
547 m_locale.emplace_back("eng"sv, LocaleFormat::ISO_639_2_B);
548 }
549}
550
557
562MatroskaTrackHeaderMaker::MatroskaTrackHeaderMaker(const MatroskaTrack &track, Diagnostics &diag)
563 : m_track(track)
564 , m_language(m_track.locale().abbreviatedName(LocaleFormat::ISO_639_2_B, LocaleFormat::Unknown))
565 , m_languageIETF(m_track.locale().abbreviatedName(LocaleFormat::BCP_47))
566 , m_dataSize(0)
567{
568 CPP_UTILITIES_UNUSED(diag);
569
570 // calculate size for recognized elements
571 m_dataSize += 2u + 1u + EbmlElement::calculateUIntegerLength(m_track.id());
572 m_dataSize += 1u + 1u + EbmlElement::calculateUIntegerLength(m_track.trackNumber());
573 m_dataSize += 1u + 1u + EbmlElement::calculateUIntegerLength(m_track.isEnabled());
574 m_dataSize += 1u + 1u + EbmlElement::calculateUIntegerLength(m_track.isDefault());
575 m_dataSize += 2u + 1u + EbmlElement::calculateUIntegerLength(m_track.isForced());
576 if (!m_track.name().empty()) {
577 m_dataSize += 2u + EbmlElement::calculateSizeDenotationLength(m_track.name().size()) + m_track.name().size();
578 }
579
580 // compute size of the mandatory "Language" element (if there's no language set, the 3 byte long value "und" is used)
581 const auto languageSize = m_language.empty() ? 3 : m_language.size();
582 const auto languageElementSize = 3 + EbmlElement::calculateSizeDenotationLength(languageSize) + languageSize;
583 // compute size of the optional "LanguageIETF" element
584 const auto languageIETFElementSize
585 = m_languageIETF.empty() ? 0 : (3 + EbmlElement::calculateSizeDenotationLength(m_languageIETF.size()) + m_languageIETF.size());
586 m_dataSize += languageElementSize + languageIETFElementSize;
587
588 // calculate size for other elements
589 for (EbmlElement *trackInfoElement = m_track.m_trackElement->firstChild(); trackInfoElement; trackInfoElement = trackInfoElement->nextSibling()) {
590 switch (trackInfoElement->id()) {
591 case MatroskaIds::TrackNumber:
592 case MatroskaIds::TrackUID:
593 case MatroskaIds::TrackName:
594 case MatroskaIds::TrackLanguage:
595 case MatroskaIds::TrackLanguageIETF:
596 case MatroskaIds::TrackFlagEnabled:
597 case MatroskaIds::TrackFlagDefault:
598 case MatroskaIds::TrackFlagForced:
599 // skip recognized elements
600 break;
601 default:
602 trackInfoElement->makeBuffer();
603 m_dataSize += trackInfoElement->totalSize();
604 }
605 }
606 m_sizeDenotationLength = EbmlElement::calculateSizeDenotationLength(m_dataSize);
607 m_requiredSize = 1u + m_sizeDenotationLength + m_dataSize;
608}
609
617 void MatroskaTrackHeaderMaker::make(ostream &stream) const
618{
619 // make ID and size
620 char buffer[9];
621 *buffer = static_cast<char>(MatroskaIds::TrackEntry);
622 EbmlElement::makeSizeDenotation(m_dataSize, buffer + 1);
623 stream.write(buffer, 1 + m_sizeDenotationLength);
624
625 // make recognized elements
626 EbmlElement::makeSimpleElement(stream, MatroskaIds::TrackUID, m_track.id());
627 EbmlElement::makeSimpleElement(stream, MatroskaIds::TrackNumber, m_track.trackNumber());
628 EbmlElement::makeSimpleElement(stream, MatroskaIds::TrackFlagEnabled, m_track.isEnabled());
629 EbmlElement::makeSimpleElement(stream, MatroskaIds::TrackFlagDefault, m_track.isDefault());
630 EbmlElement::makeSimpleElement(stream, MatroskaIds::TrackFlagForced, m_track.isForced());
631 if (!m_track.name().empty()) {
632 EbmlElement::makeSimpleElement(stream, MatroskaIds::TrackName, m_track.name());
633 }
634 EbmlElement::makeSimpleElement(stream, MatroskaIds::TrackLanguage, m_language.empty() ? "und" : m_language);
635 if (!m_languageIETF.empty()) {
636 EbmlElement::makeSimpleElement(stream, MatroskaIds::TrackLanguageIETF, m_languageIETF);
637 }
638
639 // make other elements
640 for (EbmlElement *trackInfoElement = m_track.m_trackElement->firstChild(); trackInfoElement; trackInfoElement = trackInfoElement->nextSibling()) {
641 switch (trackInfoElement->id()) {
642 case MatroskaIds::TrackNumber:
643 case MatroskaIds::TrackUID:
644 case MatroskaIds::TrackName:
645 case MatroskaIds::TrackLanguage:
646 case MatroskaIds::TrackLanguageIETF:
647 case MatroskaIds::TrackFlagEnabled:
648 case MatroskaIds::TrackFlagDefault:
649 case MatroskaIds::TrackFlagForced:
650 // skip recognized elements
651 break;
652 default:
653 trackInfoElement->copyBuffer(stream);
654 }
655 }
656}
657
658} // namespace TagParser
avcconfiguration.h
bitmapinfoheader.h
TagParser::AbortableProgressFeedback
The AbortableProgressFeedback class provides feedback about an ongoing operation via callbacks.
Definition progressfeedback.h:186
TagParser::AbstractTrack::m_flags
TrackFlags m_flags
Definition abstracttrack.h:197
TagParser::AbstractTrack::m_colorSpace
std::uint32_t m_colorSpace
Definition abstracttrack.h:232
TagParser::AbstractTrack::m_extensionChannelConfig
std::uint8_t m_extensionChannelConfig
Definition abstracttrack.h:219
TagParser::AbstractTrack::m_displaySize
Size m_displaySize
Definition abstracttrack.h:224
TagParser::AbstractTrack::m_sampleCount
std::uint64_t m_sampleCount
Definition abstracttrack.h:221
TagParser::AbstractTrack::startOffset
std::uint64_t startOffset() const
Returns the start offset of the track in the associated stream.
Definition abstracttrack.h:316
TagParser::AbstractTrack::m_formatName
std::string m_formatName
Definition abstracttrack.h:200
TagParser::AbstractTrack::m_size
std::uint64_t m_size
Definition abstracttrack.h:203
TagParser::AbstractTrack::m_bitsPerSample
std::uint16_t m_bitsPerSample
Definition abstracttrack.h:215
TagParser::AbstractTrack::m_trackNumber
std::uint32_t m_trackNumber
Definition abstracttrack.h:204
TagParser::AbstractTrack::m_name
std::string m_name
Definition abstracttrack.h:206
TagParser::AbstractTrack::m_formatId
std::string m_formatId
Definition abstracttrack.h:199
TagParser::AbstractTrack::m_pixelSize
Size m_pixelSize
Definition abstracttrack.h:223
TagParser::AbstractTrack::m_cropping
Margin m_cropping
Definition abstracttrack.h:233
TagParser::AbstractTrack::AbstractTrack
AbstractTrack(std::istream &inputStream, std::ostream &outputStream, std::uint64_t startOffset)
Constructs a new track.
Definition abstracttrack.cpp:33
TagParser::AbstractTrack::m_channelCount
std::uint16_t m_channelCount
Definition abstracttrack.h:217
TagParser::AbstractTrack::m_channelConfig
std::uint8_t m_channelConfig
Definition abstracttrack.h:218
TagParser::AbstractTrack::reader
CppUtilities::BinaryReader & reader()
Returns a binary reader for the associated stream.
Definition abstracttrack.h:289
TagParser::AbstractTrack::m_duration
CppUtilities::TimeSpan m_duration
Definition abstracttrack.h:207
TagParser::AbstractTrack::m_reader
CppUtilities::BinaryReader m_reader
Definition abstracttrack.h:194
TagParser::AbstractTrack::m_modificationTime
CppUtilities::DateTime m_modificationTime
Definition abstracttrack.h:211
TagParser::AbstractTrack::m_fps
std::uint32_t m_fps
Definition abstracttrack.h:228
TagParser::AbstractTrack::m_extensionSamplingFrequency
std::uint32_t m_extensionSamplingFrequency
Definition abstracttrack.h:214
TagParser::AbstractTrack::m_locale
Locale m_locale
Definition abstracttrack.h:212
TagParser::AbstractTrack::m_creationTime
CppUtilities::DateTime m_creationTime
Definition abstracttrack.h:210
TagParser::AbstractTrack::m_format
MediaFormat m_format
Definition abstracttrack.h:198
TagParser::AbstractTrack::m_bitrate
double m_bitrate
Definition abstracttrack.h:208
TagParser::AbstractTrack::m_istream
std::istream * m_istream
Definition abstracttrack.h:192
TagParser::AbstractTrack::m_samplingFrequency
std::uint32_t m_samplingFrequency
Definition abstracttrack.h:213
TagParser::AbstractTrack::m_id
std::uint64_t m_id
Definition abstracttrack.h:205
TagParser::AbstractTrack::m_mediaType
MediaType m_mediaType
Definition abstracttrack.h:201
TagParser::BitmapInfoHeader
The BitmapInfoHeader class parses the BITMAPINFOHEADER structure defined by MS.
Definition bitmapinfoheader.h:14
TagParser::BitmapInfoHeader::parse
void parse(CppUtilities::BinaryReader &reader)
Parses the BITMAPINFOHEADER structure using the specified reader.
Definition bitmapinfoheader.cpp:36
TagParser::BitmapInfoHeader::compression
std::uint32_t compression
Definition bitmapinfoheader.h:25
TagParser::Diagnostics
The Diagnostics class is a container for DiagMessage.
Definition diagnostics.h:156
TagParser::EbmlElement
The EbmlElement class helps to parse EBML files such as Matroska files.
Definition ebmlelement.h:32
TagParser::EbmlElement::makeSimpleElement
static void makeSimpleElement(std::ostream &stream, IdentifierType id, std::uint64_t content)
Makes a simple EBML element.
Definition ebmlelement.cpp:514
TagParser::EbmlElement::calculateSizeDenotationLength
static std::uint8_t calculateSizeDenotationLength(std::uint64_t size)
Returns the length of the size denotation for the specified size in byte.
Definition ebmlelement.cpp:288
TagParser::EbmlElement::makeSizeDenotation
static std::uint8_t makeSizeDenotation(std::uint64_t size, char *buff)
Makes the size denotation for the specified size and stores it to buff.
Definition ebmlelement.cpp:343
TagParser::EbmlElement::calculateUIntegerLength
static std::uint8_t calculateUIntegerLength(std::uint64_t integer)
Returns the length of the specified unsigned integer in byte.
Definition ebmlelement.cpp:416
TagParser::Failure
The class inherits from std::exception and serves as base class for exceptions thrown by the elements...
Definition exceptions.h:11
TagParser::GenericFileElement::childById
ImplementationType * childById(const IdentifierType &id, Diagnostics &diag)
Returns the first child with the specified id.
Definition genericfileelement.h:610
TagParser::GenericFileElement::nextSibling
ImplementationType * nextSibling()
Returns the next sibling of the element.
Definition genericfileelement.h:439
TagParser::GenericFileElement::firstChild
ImplementationType * firstChild()
Returns the first child of the element.
Definition genericfileelement.h:465
TagParser::GenericFileElement::dataSize
DataSizeType dataSize() const
Returns the data size of the element in byte.
Definition genericfileelement.h:320
TagParser::GenericFileElement::dataOffset
std::uint64_t dataOffset() const
Returns the data offset of the element in the related stream.
Definition genericfileelement.h:338
TagParser::MatroskaTrackHeaderMaker::make
void make(std::ostream &stream) const
Saves the header for the track (specified when constructing the object) to the specified stream (make...
Definition matroskatrack.cpp:617
TagParser::MatroskaTrack
Implementation of TagParser::AbstractTrack for the Matroska container.
Definition matroskatrack.h:48
TagParser::MatroskaTrack::codecIdToMediaFormat
static MediaFormat codecIdToMediaFormat(const std::string &codecId)
Returns the MediaFormat for the specified Matroska codec ID.
Definition matroskatrack.cpp:59
TagParser::MatroskaTrack::type
TrackType type() const override
Returns the type of the track if known; otherwise returns TrackType::Unspecified.
Definition matroskatrack.cpp:50
TagParser::MatroskaTrack::readStatisticsFromTags
void readStatisticsFromTags(const std::vector< std::unique_ptr< MatroskaTag > > &tags, Diagnostics &diag)
Reads track-specific statistics from the specified tags.
Definition matroskatrack.cpp:266
TagParser::MatroskaTrack::MatroskaTrack
MatroskaTrack(EbmlElement &trackElement)
Constructs a new track for the specified trackElement.
Definition matroskatrack.cpp:37
TagParser::MatroskaTrack::internalParseHeader
void internalParseHeader(Diagnostics &diag, AbortableProgressFeedback &progress) override
This method is internally called to parse header information.
Definition matroskatrack.cpp:286
TagParser::MatroskaTrack::~MatroskaTrack
~MatroskaTrack() override
Destroys the track.
Definition matroskatrack.cpp:46
TagParser::MediaFormat
The MediaFormat class specifies the format of media data.
Definition mediaformat.h:247
TagParser::MediaFormat::sub
unsigned char sub
Definition mediaformat.h:261
TagParser::MediaFormat::extension
unsigned char extension
Definition mediaformat.h:262
TagParser::MediaFormat::general
GeneralMediaFormat general
Definition mediaformat.h:260
TagParser::Mp4Track::addInfo
static void addInfo(const AvcConfiguration &avcConfig, AbstractTrack &track)
Adds the information from the specified avcConfig to the specified track.
Definition mp4track.cpp:1074
TagParser::Mp4Track::parseAudioSpecificConfig
static std::unique_ptr< Mpeg4AudioSpecificConfig > parseAudioSpecificConfig(std::istream &stream, std::uint64_t startOffset, std::uint64_t size, Diagnostics &diag)
Parses the audio specific configuration for the track.
Definition mp4track.cpp:706
TagParser::TagTarget
The TagTarget class specifies the target of a tag.
Definition tagtarget.h:20
TagParser::TagTarget::tracks
const IdContainerType & tracks() const
Returns the tracks.
Definition tagtarget.h:105
TagParser::TagValue
The TagValue class wraps values of different types.
Definition tagvalue.h:147
TagParser::TagValue::toDateTime
CppUtilities::DateTime toDateTime() const
Converts the value of the current TagValue object to its equivalent DateTime representation (using th...
Definition tagvalue.cpp:763
TagParser::TagValue::toString
std::string toString(TagTextEncoding encoding=TagTextEncoding::Unspecified) const
Converts the value of the current TagValue object to its equivalent std::string representation.
Definition tagvalue.h:450
TagParser::TagValue::isEmpty
bool isEmpty() const
Returns whether no or an empty value is assigned.
Definition tagvalue.h:490
TagParser::TagValue::toTimeSpan
CppUtilities::TimeSpan toTimeSpan() const
Converts the value of the current TagValue object to its equivalent TimeSpan representation.
Definition tagvalue.cpp:724
TagParser::TruncatedDataException
The exception that is thrown when the data to be parsed is truncated and therefore can not be parsed ...
Definition exceptions.h:39
TagParser::WaveAudioStream::addInfo
static void addInfo(const WaveFormatHeader &waveHeader, AbstractTrack &track)
Adds the information from the specified waveHeader to the specified track.
Definition waveaudiostream.cpp:135
TagParser::WaveFormatHeader
The WaveFormatHeader class parses the WAVEFORMATEX structure defined by MS.
Definition waveaudiostream.h:8
TagParser::WaveFormatHeader::parse
std::uint64_t parse(CppUtilities::BinaryReader &reader, std::uint64_t maxSize, Diagnostics &diag)
Parses the WAVE "fmt " header segment using the specified reader.
Definition waveaudiostream.cpp:25
ebmlelement.h
exceptions.h
matroskacontainer.h
matroskaid.h
matroskatag.h
matroskatrack.h
mediaformat.h
mp4ids.h
mp4track.h
CppUtilities
Definition abstractcontainer.h:16
TagParser::ExtensionFormats::SpectralBandReplication
@ SpectralBandReplication
Definition mediaformat.h:244
TagParser::FourccIds::fourccToMediaFormat
TAG_PARSER_EXPORT MediaFormat fourccToMediaFormat(std::uint32_t fourccId)
Definition mp4ids.cpp:51
TagParser::MatroskaIds::TrackVideo
@ TrackVideo
Definition matroskaid.h:111
TagParser::MatroskaIds::CodecName
@ CodecName
Definition matroskaid.h:100
TagParser::MatroskaIds::TrackType
@ TrackType
Definition matroskaid.h:78
TagParser::MatroskaIds::TrackFlagEnabled
@ TrackFlagEnabled
Definition matroskaid.h:79
TagParser::MatroskaIds::TrackLanguageIETF
@ TrackLanguageIETF
Definition matroskaid.h:97
TagParser::MatroskaIds::CodecID
@ CodecID
Definition matroskaid.h:98
TagParser::MatroskaIds::TrackUID
@ TrackUID
Definition matroskaid.h:77
TagParser::MatroskaIds::CodecDelay
@ CodecDelay
Definition matroskaid.h:107
TagParser::MatroskaIds::TrackFlagLacing
@ TrackFlagLacing
Definition matroskaid.h:87
TagParser::MatroskaIds::CodecPrivate
@ CodecPrivate
Definition matroskaid.h:99
TagParser::MatroskaIds::TrackFlagDefault
@ TrackFlagDefault
Definition matroskaid.h:80
TagParser::MatroskaIds::TrackName
@ TrackName
Definition matroskaid.h:95
TagParser::MatroskaIds::TrackNumber
@ TrackNumber
Definition matroskaid.h:76
TagParser::MatroskaIds::DefaultDuration
@ DefaultDuration
Definition matroskaid.h:90
TagParser::MatroskaIds::TrackFlagForced
@ TrackFlagForced
Definition matroskaid.h:81
TagParser::MatroskaIds::TrackAudio
@ TrackAudio
Definition matroskaid.h:110
TagParser::MatroskaIds::TrackLanguage
@ TrackLanguage
Definition matroskaid.h:96
TagParser::MatroskaIds::TrackEntry
@ TrackEntry
Definition matroskaid.h:69
TagParser::MatroskaIds::Channels
@ Channels
Definition matroskaid.h:152
TagParser::MatroskaIds::OutputSamplingFrequency
@ OutputSamplingFrequency
Definition matroskaid.h:152
TagParser::MatroskaIds::BitDepth
@ BitDepth
Definition matroskaid.h:152
TagParser::MatroskaIds::SamplingFrequency
@ SamplingFrequency
Definition matroskaid.h:152
TagParser::MatroskaIds::ColorSpace
@ ColorSpace
Definition matroskaid.h:144
TagParser::MatroskaIds::FlagInterlaced
@ FlagInterlaced
Definition matroskaid.h:130
TagParser::MatroskaIds::PixelCropRight
@ PixelCropRight
Definition matroskaid.h:139
TagParser::MatroskaIds::FrameRate
@ FrameRate
Definition matroskaid.h:146
TagParser::MatroskaIds::DisplayWidth
@ DisplayWidth
Definition matroskaid.h:140
TagParser::MatroskaIds::PixelCropBottom
@ PixelCropBottom
Definition matroskaid.h:136
TagParser::MatroskaIds::PixelHeight
@ PixelHeight
Definition matroskaid.h:135
TagParser::MatroskaIds::PixelWidth
@ PixelWidth
Definition matroskaid.h:134
TagParser::MatroskaIds::PixelCropTop
@ PixelCropTop
Definition matroskaid.h:137
TagParser::MatroskaIds::PixelCropLeft
@ PixelCropLeft
Definition matroskaid.h:138
TagParser::MatroskaIds::DisplayHeight
@ DisplayHeight
Definition matroskaid.h:141
TagParser::MatroskaTagIds::TrackSpecific
Encapsulates track-specific Matroska tag IDs written by mkvmerge 7.0.0 or newer.
Definition matroskatagid.h:487
TagParser::MatroskaTagIds::TrackSpecific::duration
constexpr TAG_PARSER_EXPORT std::string_view duration()
Definition matroskatagid.h:496
TagParser::MatroskaTagIds::TrackSpecific::bitrate
constexpr TAG_PARSER_EXPORT std::string_view bitrate()
The track's bit rate in bits per second.
Definition matroskatagid.h:501
TagParser::MatroskaTrackType::Control
@ Control
Definition matroskaid.h:411
TagParser::MatroskaTrackType::Audio
@ Audio
Definition matroskaid.h:411
TagParser::MatroskaTrackType::Subtitle
@ Subtitle
Definition matroskaid.h:411
TagParser::MatroskaTrackType::Buttons
@ Buttons
Definition matroskaid.h:411
TagParser::MatroskaTrackType::Video
@ Video
Definition matroskaid.h:411
TagParser::Mpeg4AudioObjectIds::idToMediaFormat
TAG_PARSER_EXPORT MediaFormat idToMediaFormat(std::uint8_t mpeg4AudioObjectId, bool sbrPresent=false, bool psPresent=false)
Definition mp4ids.cpp:373
TagParser::SubFormats::AacMpeg4MainProfile
@ AacMpeg4MainProfile
Definition mediaformat.h:120
TagParser::SubFormats::AacMpeg4LowComplexityProfile
@ AacMpeg4LowComplexityProfile
Definition mediaformat.h:121
TagParser::SubFormats::AacMpeg2LowComplexityProfile
@ AacMpeg2LowComplexityProfile
Definition mediaformat.h:118
TagParser::SubFormats::AacMpeg2ScalableSamplingRateProfile
@ AacMpeg2ScalableSamplingRateProfile
Definition mediaformat.h:119
TagParser::SubFormats::AacMpeg2MainProfile
@ AacMpeg2MainProfile
Definition mediaformat.h:117
TagParser::SubFormats::AacMpeg4ScalableSamplingRateProfile
@ AacMpeg4ScalableSamplingRateProfile
Definition mediaformat.h:122
TagParser::SubFormats::AacMpeg4LongTermPrediction
@ AacMpeg4LongTermPrediction
Definition mediaformat.h:123
TagParser::SubFormats::DtsLossless
@ DtsLossless
Definition mediaformat.h:221
TagParser::SubFormats::DtsExpress
@ DtsExpress
Definition mediaformat.h:220
TagParser::SubFormats::Mpeg1Layer2
@ Mpeg1Layer2
Definition mediaformat.h:114
TagParser::SubFormats::Mpeg1Layer1
@ Mpeg1Layer1
Definition mediaformat.h:114
TagParser::SubFormats::Mpeg1Layer3
@ Mpeg1Layer3
Definition mediaformat.h:114
TagParser::SubFormats::PcmIntBe
@ PcmIntBe
Definition mediaformat.h:226
TagParser::SubFormats::PcmIntLe
@ PcmIntLe
Definition mediaformat.h:226
TagParser::SubFormats::PcmFloatIeee
@ PcmFloatIeee
Definition mediaformat.h:226
TagParser::SubFormats::Mpeg4AdvancedSimpleProfile1
@ Mpeg4AdvancedSimpleProfile1
Definition mediaformat.h:188
TagParser::SubFormats::Mpeg4SimpleProfile1
@ Mpeg4SimpleProfile1
Definition mediaformat.h:141
TagParser::SubFormats::SubStationAlpha
@ SubStationAlpha
Definition mediaformat.h:230
TagParser::SubFormats::PlainUtf8Subtitle
@ PlainUtf8Subtitle
Definition mediaformat.h:229
TagParser::SubFormats::WebVideoTextTracksFormat
@ WebVideoTextTracksFormat
Definition mediaformat.h:233
TagParser::SubFormats::AdvancedSubStationAlpha
@ AdvancedSubStationAlpha
Definition mediaformat.h:231
TagParser::SubFormats::UniversalSubtitleFormat
@ UniversalSubtitleFormat
Definition mediaformat.h:232
TagParser::SubFormats::ImgSubBmp
@ ImgSubBmp
Definition mediaformat.h:236
TagParser
Contains all classes and functions of the TagInfo library.
Definition aaccodebook.h:10
TagParser::LocaleFormat
LocaleFormat
The LocaleFormat enum class specifies the format used by a LocaleDetail.
Definition localehelper.h:14
TagParser::LocaleFormat::BCP_47
@ BCP_47
Definition localehelper.h:20
TagParser::LocaleFormat::ISO_639_2_B
@ ISO_639_2_B
Definition localehelper.h:19
TagParser::StereoMode::Unknown
@ Unknown
Definition abstracttrack.h:77
TagParser::TagTextEncoding::Latin1
@ Latin1
Definition tagvalue.h:30
TagParser::TagTextEncoding::Utf8
@ Utf8
Definition tagvalue.h:31
TagParser::DiagLevel::Warning
@ Warning
Definition diagnostics.h:20
TagParser::DiagLevel::Critical
@ Critical
Definition diagnostics.h:21
TagParser::MediaType::Video
@ Video
Definition mediaformat.h:17
TagParser::MediaType::Buttons
@ Buttons
Definition mediaformat.h:19
TagParser::MediaType::Unknown
@ Unknown
Definition mediaformat.h:15
TagParser::MediaType::Text
@ Text
Definition mediaformat.h:18
TagParser::MediaType::Control
@ Control
Definition mediaformat.h:20
TagParser::MediaType::Audio
@ Audio
Definition mediaformat.h:16
TagParser::TagDataType::Text
@ Text
Definition tagvalue.h:120
TagParser::GeneralMediaFormat::Vp8
@ Vp8
Definition mediaformat.h:97
TagParser::GeneralMediaFormat::Alac
@ Alac
Definition mediaformat.h:37
TagParser::GeneralMediaFormat::Vorbis
@ Vorbis
Definition mediaformat.h:96
TagParser::GeneralMediaFormat::RealVideo
@ RealVideo
Definition mediaformat.h:80
TagParser::GeneralMediaFormat::Tta
@ Tta
Definition mediaformat.h:91
TagParser::GeneralMediaFormat::Vp9
@ Vp9
Definition mediaformat.h:98
TagParser::GeneralMediaFormat::MicrosoftVideoCodecManager
@ MicrosoftVideoCodecManager
Definition mediaformat.h:62
TagParser::GeneralMediaFormat::Hevc
@ Hevc
Definition mediaformat.h:55
TagParser::GeneralMediaFormat::Av1
@ Av1
Definition mediaformat.h:41
TagParser::GeneralMediaFormat::VobBtn
@ VobBtn
Definition mediaformat.h:94
TagParser::GeneralMediaFormat::QuicktimeVideo
@ QuicktimeVideo
Definition mediaformat.h:78
TagParser::GeneralMediaFormat::RealAudio
@ RealAudio
Definition mediaformat.h:79
TagParser::GeneralMediaFormat::Ac3
@ Ac3
Definition mediaformat.h:33
TagParser::GeneralMediaFormat::Flac
@ Flac
Definition mediaformat.h:51
TagParser::GeneralMediaFormat::Pcm
@ Pcm
Definition mediaformat.h:73
TagParser::GeneralMediaFormat::Theora
@ Theora
Definition mediaformat.h:88
TagParser::GeneralMediaFormat::Mpc
@ Mpc
Definition mediaformat.h:64
TagParser::GeneralMediaFormat::MicrosoftAudioCodecManager
@ MicrosoftAudioCodecManager
Definition mediaformat.h:60
TagParser::GeneralMediaFormat::Avc
@ Avc
Definition mediaformat.h:40
TagParser::GeneralMediaFormat::Aac
@ Aac
Definition mediaformat.h:32
TagParser::GeneralMediaFormat::DvbSub
@ DvbSub
Definition mediaformat.h:48
TagParser::GeneralMediaFormat::OggKate
@ OggKate
Definition mediaformat.h:71
TagParser::GeneralMediaFormat::Unknown
@ Unknown
Definition mediaformat.h:31
TagParser::GeneralMediaFormat::WavPack
@ WavPack
Definition mediaformat.h:99
TagParser::GeneralMediaFormat::UncompressedVideoFrames
@ UncompressedVideoFrames
Definition mediaformat.h:92
TagParser::GeneralMediaFormat::ProRes
@ ProRes
Definition mediaformat.h:75
TagParser::GeneralMediaFormat::VobSub
@ VobSub
Definition mediaformat.h:95
TagParser::GeneralMediaFormat::TextSubtitle
@ TextSubtitle
Definition mediaformat.h:87
TagParser::GeneralMediaFormat::ImageSubtitle
@ ImageSubtitle
Definition mediaformat.h:57
TagParser::GeneralMediaFormat::Mpeg2Video
@ Mpeg2Video
Definition mediaformat.h:68
TagParser::GeneralMediaFormat::Mpeg1Video
@ Mpeg1Video
Definition mediaformat.h:66
TagParser::GeneralMediaFormat::QuicktimeAudio
@ QuicktimeAudio
Definition mediaformat.h:77
TagParser::GeneralMediaFormat::Mpeg1Audio
@ Mpeg1Audio
Definition mediaformat.h:65
TagParser::GeneralMediaFormat::Mpeg4Video
@ Mpeg4Video
Definition mediaformat.h:70
TagParser::GeneralMediaFormat::Vc1
@ Vc1
Definition mediaformat.h:93
TagParser::GeneralMediaFormat::Opus
@ Opus
Definition mediaformat.h:72
TagParser::GeneralMediaFormat::EAc3
@ EAc3
Definition mediaformat.h:49
TagParser::GeneralMediaFormat::Dts
@ Dts
Definition mediaformat.h:46
TagParser::mpeg4SamplingFrequencyTable
std::uint32_t mpeg4SamplingFrequencyTable[13]
Definition mp4ids.cpp:429
TagParser::TrackType
TrackType
The TrackType enum specifies the underlying file type of a track and the concrete class of the track ...
Definition abstracttrack.h:32
TagParser::TrackType::MatroskaTrack
@ MatroskaTrack
Definition abstracttrack.h:34
TagParser::TrackFlags::Enabled
@ Enabled
Definition abstracttrack.h:50
TagParser::TrackFlags::Interlaced
@ Interlaced
Definition abstracttrack.h:57
TagParser::TrackFlags::Default
@ Default
Definition abstracttrack.h:51
TagParser::TrackFlags::Lacing
@ Lacing
Definition abstracttrack.h:53
TagParser::TrackFlags::Forced
@ Forced
Definition abstracttrack.h:52
waveaudiostream.h