Tag Parser  6.5.0
C++ library for reading and writing MP4 (iTunes), ID3, Vorbis, Opus, FLAC and Matroska tags
mediaformat.cpp
Go to the documentation of this file.
1 #include "./mediaformat.h"
2 
3 namespace Media {
4 
5 using namespace SubFormats;
6 
17 const char *MediaFormat::name() const
18 {
19  switch(general) {
21  switch(sub) {
22  case AacMpeg2MainProfile: return "Advanced Audio Coding Main Profile";
23  case AacMpeg2LowComplexityProfile: return "Advanced Audio Coding Low Complexity Profile";
24  case AacMpeg2ScalableSamplingRateProfile: return "Advanced Audio Coding Scalable Sampling Rate Profile";
25  case AacMpeg4MainProfile: return "Advanced Audio Coding Main Profile";
26  case AacMpeg4LowComplexityProfile: return "Advanced Audio Coding Low Complexity Profile";
27  case AacMpeg4ScalableSamplingRateProfile: return "Advanced Audio Coding Scaleable Sampling Rate Profile";
28  case AacMpeg4LongTermPrediction: return "Advanced Audio Coding Long Term Predicition";
29  case AacMpeg4ERLowComplecityProfile: return "Advanced Audio Coding Error Resilient Low Complexity Profile";
30  case AacMpeg4ERScalableSampingRateProfile: return "Advanced Audio Coding Error Resilient Scalable Sampling Rate Profile";
31  case AacMpeg4ERLongTermPrediction: return "Advanced Audio Coding Error Resilient Long Term Predicition";
32  case AacMpeg4ERLowDelay: return "Advanced Audio Coding Error Resilient Low Delay";
33  case AacMpeg4EREnhancedLowDelay: return "Advanced Audio Coding Error Resilient Enhanced Low Delay";
34  default: return "Advanced Audio Coding";
35  }
36  case GeneralMediaFormat::Ac3: return "Dolby Digital";
37  case GeneralMediaFormat::Ac4: return "AC-4";
38  case GeneralMediaFormat::AdpcmAcm: return "ADPCM ACM";
39  case GeneralMediaFormat::AfxStream: return "AFX Stream";
40  case GeneralMediaFormat::Alac: return "Apple Lossless Audio Codec";
41  case GeneralMediaFormat::Als: return "ALS";
42  case GeneralMediaFormat::Amr: return "Adaptive Multi-Rate audio codec";
44  switch(sub) {
45  case AvcCavlc444IntraProfile: return "Advanced Video Coding CAVLC 4:4:4 Intra Profile";
46  case AvcBaselineProfile: return "Advanced Video Coding Basline Profile";
47  case AvcMainProfile: return "Advanced Video Coding Main Profile";
48  case AvcScalableBaselineProfile: return "Advanced Video Coding Scalable Basline Profile";
49  case AvcScalableHighProfile: return "Advanced Video Coding Scalable High Profile";
50  case AvcExtendedProfile: return "Advanced Video Coding Extended Profile";
51  case AvcHighProfile: return "Advanced Video Coding High Profile";
52  case AvcHigh10Profile: return "Advanced Video Coding High 10 Profile";
53  case AvcHighMultiviewProfile: return "Advanced Video Coding Multiview Profile";
54  case AvcHigh422Profile: return "Advanced Video Coding High 4:2:2 Profile";
55  case AvcStereoHighProfile: return "Advanced Video Coding Stereo High Profile";
56  case AvcHighMultiviewDepthProfile: return "Advanced Video Coding Multiview Depth High Profile";
57  case AvcHigh444Profile: return "Advanced Video Coding High 4:4:4 Profile";
58  case AvcHigh444PredictiveProfile: return "Advanced Video Coding High 4:4:4 Predictive Profile";
59  default: return "Advanced Video Coding";
60  }
61  case GeneralMediaFormat::Bitmap: return "Windows Bitmap";
62  case GeneralMediaFormat::Daala: return "Daala";
63  case GeneralMediaFormat::Dirac: return "Dirac";
65  switch(sub) {
66  case DtsLossless: return "DTS Lossless";
67  case DtsExpress: return "DTS Express";
68  default: return "DTS";
69  }
71  switch(sub) {
72  case DtsHdHighResolution: return "DTS-HD High Resolution";
73  case DtsHdMasterAudio: return "DTS-HD Master Audio";
74  case DtsExpress: return "DTS-HD Express";
75  default: return "DTS-HD";
76  }
77  case GeneralMediaFormat::EAc3: return "Dolby Digital Plus";
78  case GeneralMediaFormat::Evrc: return "EVRC";
79  case GeneralMediaFormat::Flac: return "Free Lossless Audio Codec";
80  case GeneralMediaFormat::FontDataStream: return "Font Data Stream";
81  case GeneralMediaFormat::Gif: return "GIF";
82  case GeneralMediaFormat::Gpp2Cmf: return "3GPP2 Compact Multimedia Format (CMF)";
83  case GeneralMediaFormat::Hevc: return "High Efficiency Video Coding";
84  case GeneralMediaFormat::ImaadpcmAcm: return "IMAADPCM ACM";
86  switch(sub) {
87  case SubFormats::ImgSubBmp: return "Bitmap subtitle";
88  default: return "Image subtitle";
89  }
90  case GeneralMediaFormat::InteractionStream: return "Interaction Stream";
91  case GeneralMediaFormat::Jpeg: return "JPEG";
92  case GeneralMediaFormat::OggKate: return "Karaoke And Text Encapsulation";
93  case GeneralMediaFormat::Opus: return "Opus";
94  case GeneralMediaFormat::MicrosoftAudioCodecManager: return "Microsoft Audio Codec Manager";
96  switch(sub) {
97  case 1: return "Microsoft MPEG-4 version 1";
98  case 2: return "Microsoft MPEG-4 version 2";
99  case 3: return "Microsoft MPEG-4 version 3";
100  default: return "Microsoft MPEG-4";
101  }
102  case GeneralMediaFormat::MicrosoftVideoCodecManager: return "Microsoft Video Codec Manager";
103  case GeneralMediaFormat::DolbyMlp: return "Dolby TrueHD";
105  switch(sub) {
106  case Mpeg1Layer1: return "MPEG-1 Layer 1";
107  case Mpeg1Layer2: return "MPEG-1 Layer 2";
108  case Mpeg1Layer3: return "MPEG-1 Layer 3";
109  default: return "MPEG-1 Audio";
110  }
111  case GeneralMediaFormat::Mpeg1Video: return "MPEG-1 Video";
113  switch(sub) {
114  case Mpeg1Layer1: return "MPEG-2 Layer 1";
115  case Mpeg1Layer2: return "MPEG-2 Layer 2";
116  case Mpeg1Layer3: return "MPEG-2 Layer 3";
117  default: return "MPEG-2 Audio";
118  }
120  switch(sub) {
121  case Mpeg2SimpleProfile: return "MPEG-2 Video Simple Profile";
122  case Mpeg2MainProfile: return "MPEG-2 Video Main Profile";
123  case Mpeg2SnrProfile: return "MPEG-2 Video SNR Profile";
124  case Mpeg2SpatialProfile: return "MPEG-2 Video Spatial Profile";
125  case Mpeg2HighProfile: return "MPEG-2 Video High Profile";
126  case Mpeg2422Profile: return "MPEG-2 Video 422 Profile";
127  default: return "MPEG-2 Video";
128  }
130  switch(sub) {
131  case Mpeg4SimpleProfile1: return "MPEG-4 Simple Profile L1";
132  case Mpeg4SimpleProfile2: return "MPEG-4 Simple Profile L2";
133  case Mpeg4SimpleProfile3: return "MPEG-4 Simple Profile L2";
134  case Mpeg4SimpleProfile0: return "MPEG-4 Simple Profile";
135  case Mpeg4SimpleScalableProfile0: return "MPEG-4 Simple Scalable Profile";
136  case Mpeg4SimpleScalableProfile1: return "MPEG-4 Simple Scalable Profile L1";
137  case Mpeg4SimpleScalableProfile2: return "MPEG-4 Simple Scalable Profile L2";
138  case Mpeg4CoreProfile1: return "MPEG-4 Core Profile L1";
139  case Mpeg4CoreProfiel2: return "MPEG-4 Core Profile L2";
140  case Mpeg4MainProfile2: return "MPEG-4 Main Profile L2";
141  case Mpeg4MainProfile3: return "MPEG-4 Main Profile L3";
142  case Mpeg4MainProfile4: return "MPEG-4 Main Profile L4";
143  case Mpeg4NBitPrifle2: return "MPEG-4 N-Bit Profile L2";
144  case Mpeg4ScalableTextureProfile1: return "MPEG-4 Scalable Texture Profile L1";
145  case Mpeg4SimpleFaceAnimationProfile1: return "MPEG-4 Simple Face Animation Profile L1";
146  case Mpeg4SimpleFaceAnimationProfile2: return "MPEG-4 Simple Face Animation Profile L2";
147  case Mpeg4SimpleFbaProfile1: return "MPEG-4 Simple FBA Profile L1";
148  case Mpeg4SimpleFbaProfile2: return "MPEG-4 Simple FBA Profile L2";
149  case Mpeg4BasicAnimatedTextureProfiel1: return "MPEG-4 Basic Animated Texture Profile L1";
150  case Mpeg4BasicAnimatedTextureProfiel2: return "MPEG-4 Basic Animated Texture Profile L2";
151  case Mpeg4AvcProfile: return "MPEG-4 Advanced Audio Coding Profile";
152  case Mpeg4HybridProfile1: return "MPEG-4 Hybrid Profile L1";
153  case Mpeg4HybridProfile2: return "MPEG-4 Hybrid Profile L2";
154  case Mpeg4AdvancedRealTimeSimpleProfile1: return "MPEG-4 Basic Animated Texture Profile L1";
155  case Mpeg4AdvancedRealTimeSimpleProfile2: return "MPEG-4 Basic Animated Texture Profile L2";
156  case Mpeg4AdvancedRealTimeSimpleProfile3: return "MPEG-4 Basic Animated Texture Profile L3";
157  case Mpeg4AdvancedRealTimeSimpleProfile4: return "MPEG-4 Basic Animated Texture Profile L4";
158  case Mpeg4CoreScalableProfile1: return "MPEG-4 Core Scalable Profile L1";
159  case Mpeg4CoreScalableProfile2: return "MPEG-4 Core Scalable Profile L2";
160  case Mpeg4CoreScalableProfile3: return "MPEG-4 Core Scalable Profile L3";
161  case Mpeg4AdvancedCodingEfficiencyProfile1: return "MPEG-4 Advanced Coding Efficiency Profile L1";
162  case Mpeg4AdvancedCodingEfficiencyProfile2: return "MPEG-4 Advanced Coding Efficiency Profile L2";
163  case Mpeg4AdvancedCodingEfficiencyProfile3: return "MPEG-4 Advanced Coding Efficiency Profile L3";
164  case Mpeg4AdvancedCodingEfficiencyProfile4: return "MPEG-4 Advanced Coding Efficiency Profile L4";
165  case Mpeg4AdvancedCoreProfile1: return "MPEG-4 Advanced Core Profile L1";
166  case Mpeg4AdvancedCoreProfile2: return "MPEG-4 Advanced Core Profile L2";
167  case Mpeg4AdvancedScalableTexture1: return "MPEG-4 Advanced Scalable Texture L1";
168  case Mpeg4AdvancedScalableTexture2: return "MPEG-4 Advanced Scalable Texture L2";
169  case Mpeg4SimpleStudioProfile1: return "MPEG-4 Simple Studio Profile L1";
170  case Mpeg4SimpleStudioProfile2: return "MPEG-4 Simple Studio Profile L2";
171  case Mpeg4SimpleStudioProfile3: return "MPEG-4 Simple Studio Profile L3";
172  case Mpeg4SimpleStudioProfile4: return "MPEG-4 Simple Studio Profile L4";
173  case Mpeg4CoreStudioProfile1: return "MPEG-4 Core Studio Profile L1";
174  case Mpeg4CoreStudioProfile2: return "MPEG-4 Core Studio Profile L2";
175  case Mpeg4CoreStudioProfile3: return "MPEG-4 Core Studio Profile L3";
176  case Mpeg4CoreStudioProfile4: return "MPEG-4 Core Studio Profile L4";
177  case Mpeg4AdvancedSimpleProfile0: return "MPEG-4 Advanced Simple Profile";
178  case Mpeg4AdvancedSimpleProfile1: return "MPEG-4 Advanced Simple Profile L1";
179  case Mpeg4AdvancedSimpleProfile2: return "MPEG-4 Advanced Simple Profile L2";
180  case Mpeg4AdvancedSimpleProfile3: return "MPEG-4 Advanced Simple Profile L3";
181  case Mpeg4AdvancedSimpleProfile4: return "MPEG-4 Advanced Simple Profile L4";
182  case Mpeg4AdvancedSimpleProfile5: return "MPEG-4 Advanced Simple Profile L5";
183  case Mpeg4AdvancedSimpleProfile3b: return "MPEG-4 Advanced Simple Profile L3b";
184  case Mpeg4FineGranularityScalableProfile0: return "MPEG-4 Fine Granularity Scalable Profile";
185  case Mpeg4FineGranularityScalableProfile1: return "MPEG-4 Fine Granularity Scalable Profile L1";
186  case Mpeg4FineGranularityScalableProfile2: return "MPEG-4 Fine Granularity Scalable Profile L2";
187  case Mpeg4FineGranularityScalableProfile3: return "MPEG-4 Fine Granularity Scalable Profile L3";
188  case Mpeg4FineGranularityScalableProfile4: return "MPEG-4 Fine Granularity Scalable Profile L4";
189  case Mpeg4FineGranularityScalableProfile5: return "MPEG-4 Fine Granularity Scalable Profile L5";
190  default: return "MPEG-4 Visual";
191  }
192  case GeneralMediaFormat::Mpeg4TimedText: return "MPEG-4 Timed Text";
193  case GeneralMediaFormat::Mpc: return "Musepack SV8";
195  switch(sub) {
196  case PcmIntBe: return "Pulse Code Modulation (integer, big endian)";
197  case PcmIntLe: return "Pulse Code Modulation (integer, little endian)";
198  case PcmFloatIeee: return "Pulse Code Modulation (float, IEEE)";
199  default: return "Pulse Code Modulation";
200  }
201  case GeneralMediaFormat::Png: return "Portable Network Graphics";
202  case GeneralMediaFormat::ProRes: return "ProRes";
203  case GeneralMediaFormat::Qcelp: return "QCELP";
204  case GeneralMediaFormat::QuicktimeAudio: return "Quicktime Audio";
205  case GeneralMediaFormat::QuicktimeVideo: return "Quicktime Video";
206  case GeneralMediaFormat::RealAudio: return "Real Audio";
207  case GeneralMediaFormat::RealVideo: return "Real Video";
208  case GeneralMediaFormat::Sa0c: return "SAOC";
209  case GeneralMediaFormat::Smv: return "SMV";
210  case GeneralMediaFormat::StreamingTextStream: return "Streaming Text Stream";
211  case GeneralMediaFormat::SynthesizedTextureStream: return "Synthesized Texture Stream";
213  switch(sub) {
214  case 2: return "Systems v2";
215  default: return "Systems";
216  }
218  switch(sub) {
219  case SubFormats::PlainUtf8Subtitle: return "plain UTF-8 subtitle";
220  case SubFormats::SubStationAlpha: return "SubStation Alpha";
221  case SubFormats::AdvancedSubStationAlpha: return "Advanced SubStation Alpha";
222  case SubFormats::UniversalSubtitleFormat: return "Universal Subtitle Format";
223  case SubFormats::WebVideoTextTracksFormat: return "Web Video Text Tracks Format";
224  default: return "Text subtitle";
225  }
226  case GeneralMediaFormat::Theora: return "Theora";
227  case GeneralMediaFormat::Tiff: return "Tagged Image File Format";
228  case GeneralMediaFormat::TimedText: return "Timed Text";
229  case GeneralMediaFormat::Tta: return "The True Audio";
230  case GeneralMediaFormat::UncompressedVideoFrames: return "uncompressed video frames";
231  case GeneralMediaFormat::Vc1: return "Windows Media Video";
232  case GeneralMediaFormat::VobBtn: return "VobBtn Buttons";
233  case GeneralMediaFormat::VobSub: return "VobSub";
234  case GeneralMediaFormat::Vorbis: return "Vorbis";
235  case GeneralMediaFormat::Vp8: return "VP8";
236  case GeneralMediaFormat::Vp9: return "VP9";
237  case GeneralMediaFormat::WavPack: return "WavPack";
238  case GeneralMediaFormat::WindowsMediaAudio: return "Windows Media Audio";
240  switch(sub) {
241  case 1: return "Windows Media Video v1/v7";
242  case 2: return "Windows Media Video v2/v8";
243  default: return "Windows Media Video";
244  }
245  case GeneralMediaFormat::DvbSub: return "DVB subtitles";
246  case GeneralMediaFormat::Speex: return "Speex";
247  case GeneralMediaFormat::MonkeysAudio: return "Monkey's Audio";
248  default: return "unknown";
249  }
250 }
251 
257 const char *MediaFormat::abbreviation() const
258 {
259  switch(general) {
261  switch(sub) {
262  case AacMpeg2MainProfile: return "MPEG-2 AAC Main";
263  case AacMpeg2LowComplexityProfile: return "MPEG-2 AAC-LC";
264  case AacMpeg2ScalableSamplingRateProfile: return "MPEG-2 AAC-SSR";
265  case AacMpeg4MainProfile: return "MPEG-4 AAC Main";
266  case AacMpeg4LowComplexityProfile: return "MPEG-4 AAC-LC";
267  case AacMpeg4ScalableSamplingRateProfile: return "MPEG-4 AAC-SSR";
268  case AacMpeg4LongTermPrediction: return "MPEG-4 AAC-LTP";
269  case AacMpeg4ERLowComplecityProfile: return "MPEG-4 ER AAC-LC";
270  case AacMpeg4ERScalableSampingRateProfile: return "MPEG-4 ER AAC-LC";
271  case AacMpeg4ERLongTermPrediction: return "MPEG-4 ER AAC-LTP";
272  case AacMpeg4ERLowDelay: return "MPEG-4 ER AAC-LD";
273  case AacMpeg4EREnhancedLowDelay: return "MPEG-4 ER AAC-ELD";
274  default: return "AAC";
275  }
276  case GeneralMediaFormat::Ac3: return "AC-3";
277  case GeneralMediaFormat::Ac4: return "AC-4";
278  case GeneralMediaFormat::AdpcmAcm: return "ADPCM ACM";
279  case GeneralMediaFormat::AfxStream: return "AFX";
280  case GeneralMediaFormat::Alac: return "ALAC";
281  case GeneralMediaFormat::Als: return "ALS";
282  case GeneralMediaFormat::Amr: return "AMR";
283  case GeneralMediaFormat::Avc: return "H.264";
284  case GeneralMediaFormat::Bitmap: return "BMP";
285  case GeneralMediaFormat::Daala: return "Daala";
286  case GeneralMediaFormat::Dirac: return "Dirac";
288  switch(sub) {
289  case DtsLossless: return "DTS Lossless";
290  case DtsExpress: return "DTS LBR";
291  default: return "DTS";
292  }
294  switch(sub) {
295  case DtsHdHighResolution: return "DTS-HD High Resolution";
296  case DtsHdMasterAudio: return "DTS-HD Master Audio";
297  case DtsExpress: return "DTS-HD Express";
298  default: return "DTS-HD";
299  }
300  case GeneralMediaFormat::EAc3: return "E-AC-3";
301  case GeneralMediaFormat::Evrc: return "EVRC";
302  case GeneralMediaFormat::Flac: return "FLAC";
303  case GeneralMediaFormat::FontDataStream: return "FDS";
304  case GeneralMediaFormat::Gif: return "GIF";
305  case GeneralMediaFormat::Gpp2Cmf: return "3GPP2 CMF";
306  case GeneralMediaFormat::Hevc: return "H.265";
307  case GeneralMediaFormat::ImaadpcmAcm: return "IMAADPCM ACM";
309  switch(sub) {
310  case SubFormats::ImgSubBmp: return "BMP subtitle";
311  default: return "Image subtitle";
312  }
313  case GeneralMediaFormat::InteractionStream: return "Interaction Stream";
314  case GeneralMediaFormat::Jpeg: return "JPEG";
315  case GeneralMediaFormat::OggKate: return "OggKate";
316  case GeneralMediaFormat::Opus: return "Opus";
319  switch(sub) {
320  case 1: return "MS MPEG-4 v1";
321  case 2: return "MS MPEG-4 v2";
322  case 3: return "MS MPEG-4 v3";
323  default: return "MS MPEG-4";
324  }
326  case GeneralMediaFormat::DolbyMlp: return "Dolby TrueHD";
328  switch(sub) {
329  case Mpeg1Layer1: return "MP1";
330  case Mpeg1Layer2: return "MP2";
331  case Mpeg1Layer3: return "MP3";
332  default: return "MPEG-1 Audio";
333  }
334  case GeneralMediaFormat::Mpeg1Video: return "MP1";
336  switch(sub) {
337  case Mpeg1Layer1: return "MP1";
338  case Mpeg1Layer2: return "MP2";
339  case Mpeg1Layer3: return "MP3";
340  default: return "MPEG-2 Audio";
341  }
343  switch(sub) {
344  case Mpeg2SimpleProfile: return "MPEG-2 SP";
345  case Mpeg2MainProfile: return "MPEG-2 Main";
346  case Mpeg2SnrProfile: return "MPEG-2 SNR";
347  case Mpeg2SpatialProfile: return "MPEG-2 Spatial";
348  case Mpeg2HighProfile: return "MPEG-2 High";
349  case Mpeg2422Profile: return "MPEG-2 422";
350  default: return "MPEG-2 Video";
351  }
353  switch(sub) {
354  case Mpeg4SimpleProfile1:
355  case Mpeg4SimpleProfile2:
356  case Mpeg4SimpleProfile3:
357  case Mpeg4SimpleProfile0:
358  return "MPEG-4 SP";
366  return "H.263";
367  case Mpeg4AvcProfile:
368  return "H.264";
369  default: return "MPEG-4 Visual";
370  }
371  case GeneralMediaFormat::Mpc: return "MPC";
373  switch(sub) {
374  case PcmIntBe: return "PCM (int, BE)";
375  case PcmIntLe: return "PCM (int, LE)";
376  case PcmFloatIeee: return "PCM IEEE";
377  default: return "PCM";
378  }
379  case GeneralMediaFormat::Png: return "PNG";
380  case GeneralMediaFormat::ProRes: return "ProRes";
381  case GeneralMediaFormat::Qcelp: return "QCELP";
382  case GeneralMediaFormat::QuicktimeAudio: return "Quicktime Audio";
383  case GeneralMediaFormat::QuicktimeVideo: return "Quicktime Video";
384  case GeneralMediaFormat::RealAudio: return "Real Audio";
385  case GeneralMediaFormat::RealVideo: return "Real Video";
386  case GeneralMediaFormat::Sa0c: return "SAOC";
387  case GeneralMediaFormat::Smv: return "SMV";
388  case GeneralMediaFormat::StreamingTextStream: return "Streaming Text Stream";
389  case GeneralMediaFormat::SynthesizedTextureStream: return "Synthesized Texture Stream";
391  switch(sub) {
392  case 2: return "Systems v2";
393  default: return "Systems";
394  }
396  switch(sub) {
397  case SubFormats::PlainUtf8Subtitle: return "";
398  case SubFormats::SubStationAlpha: return "SSA";
399  case SubFormats::AdvancedSubStationAlpha: return "ASS";
400  case SubFormats::UniversalSubtitleFormat: return "USF";
401  case SubFormats::WebVideoTextTracksFormat: return "WebVTT";
402  default: return "";
403  }
404  case GeneralMediaFormat::Theora: return "Theora";
405  case GeneralMediaFormat::Tiff: return "TIFF";
406  case GeneralMediaFormat::TimedText: return "Timed Text";
407  case GeneralMediaFormat::Tta: return "TTA";
408  case GeneralMediaFormat::UncompressedVideoFrames: return "uncompressed video frames";
409  case GeneralMediaFormat::Vc1: return "VC-1";
410  case GeneralMediaFormat::VobBtn: return "VobBtn";
411  case GeneralMediaFormat::VobSub: return "VobSub";
412  case GeneralMediaFormat::Vorbis: return "Vorbis";
413  case GeneralMediaFormat::Vp8: return "VP8";
414  case GeneralMediaFormat::Vp9: return "VP9";
415  case GeneralMediaFormat::WavPack: return "WavPack";
416  case GeneralMediaFormat::WindowsMediaAudio: return "WMA";
417  case GeneralMediaFormat::WindowsMediaVideo: return "WMV";
418  case GeneralMediaFormat::DvbSub: return "DVBSUB";
419  case GeneralMediaFormat::Speex: return "Speex";
420  default: return "";
421  }
422 }
423 
430 {
431  switch(general) {
433  switch(sub) {
434  case AacMpeg2MainProfile:
435  case AacMpeg4MainProfile: return "AAC-Main";
439  switch(extension) {
440  using namespace ExtensionFormats;
442  case ParametricStereo:
444  return "HE-AAC";
445  default:
446  return "AAC-LC";
447  }
448  case AacMpeg4ERScalableSampingRateProfile: return "AAC-LC";
450  case AacMpeg4ScalableSamplingRateProfile: return "AAC-SSR";
452  case AacMpeg4ERLongTermPrediction: return "AAC-LTP";
453  case AacMpeg4ERLowDelay: return "AAC-LD";
454  case AacMpeg4EREnhancedLowDelay: return "AAC-ELD";
455  default: return "AAC";
456  }
457  case GeneralMediaFormat::Ac3: return "AC3";
458  case GeneralMediaFormat::Ac4: return "AC4";
459  case GeneralMediaFormat::AdpcmAcm: return "ADPCM-ACM";
460  case GeneralMediaFormat::AfxStream: return "AFX";
461  case GeneralMediaFormat::Alac: return "ALAC";
462  case GeneralMediaFormat::Als: return "ALS";
463  case GeneralMediaFormat::Amr: return "AMR";
464  case GeneralMediaFormat::Avc: return "H.264";
465  case GeneralMediaFormat::Bitmap: return "BMP";
466  case GeneralMediaFormat::Daala: return "Daala";
467  case GeneralMediaFormat::Dirac: return "Dirac";
469  switch(sub) {
470  case DtsLossless: return "DTS-Lossless";
471  case DtsExpress: return "DTS-LBR";
472  default: return "DTS";
473  }
474  case GeneralMediaFormat::DtsHd: return "DTS-HD";
475  case GeneralMediaFormat::EAc3: return "E-AC-3";
476  case GeneralMediaFormat::Evrc: return "EVRC";
477  case GeneralMediaFormat::Flac: return "FLAC";
478  case GeneralMediaFormat::FontDataStream: return "FDS";
479  case GeneralMediaFormat::Gif: return "GIF";
480  case GeneralMediaFormat::Gpp2Cmf: return "3GPP2-CMF";
481  case GeneralMediaFormat::Hevc: return "H.265";
482  case GeneralMediaFormat::ImaadpcmAcm: return "IMAADPCM-ACM";
483  case GeneralMediaFormat::ImageSubtitle: return "BMP";
484  case GeneralMediaFormat::Jpeg: return "JPEG";
485  case GeneralMediaFormat::OggKate: return "OggKate";
486  case GeneralMediaFormat::Opus: return "Opus";
488  case GeneralMediaFormat::MicrosoftMpeg4: return "MS-MPEG-4";
490  case GeneralMediaFormat::DolbyMlp: return "TrueHD";
492  switch(sub) {
493  case Mpeg1Layer1: return "MP1";
494  case Mpeg1Layer2: return "MP2";
495  default:
496  // since MP3 is backward compatible, it is ok to use it also as fallback
497  return "MP3";
498  }
499  case GeneralMediaFormat::Mpeg1Video: return "MP1";
501  switch(sub) {
502  case Mpeg1Layer1: return "MP1";
503  case Mpeg1Layer2: return "MP2";
504  default:
505  // since MP3 is backward compatible, it is ok to use it also as fallback
506  return "MP3";
507  }
509  switch(sub) {
510  case Mpeg2SimpleProfile: return "MPEG-2-SP";
511  case Mpeg2MainProfile: return "MPEG-2-Main";
512  case Mpeg2SnrProfile: return "MPEG-2-SNR";
513  case Mpeg2SpatialProfile: return "MPEG-2-Spatial";
514  case Mpeg2HighProfile: return "MPEG-2-High";
515  case Mpeg2422Profile: return "MPEG-2-422";
516  default: return "MPEG-2";
517  }
519  switch(sub) {
520  case Mpeg4SimpleProfile1:
521  case Mpeg4SimpleProfile2:
522  case Mpeg4SimpleProfile3:
523  case Mpeg4SimpleProfile0:
524  return "MPEG-4-SP";
532  return "H.263";
533  case Mpeg4AvcProfile:
534  return "H.264";
535  default: return "MPEG-4-Visual";
536  }
537  case GeneralMediaFormat::Mpc: return "MPC";
538  case GeneralMediaFormat::Pcm: return "PCM";
539  case GeneralMediaFormat::Png: return "PNG";
540  case GeneralMediaFormat::ProRes: return "ProRes";
541  case GeneralMediaFormat::Qcelp: return "QCELP";
542  case GeneralMediaFormat::QuicktimeAudio: return "Qt-Audio";
543  case GeneralMediaFormat::QuicktimeVideo: return "Qt-Video";
544  case GeneralMediaFormat::RealAudio: return "Real-Audio";
545  case GeneralMediaFormat::RealVideo: return "Real-Video";
546  case GeneralMediaFormat::Sa0c: return "SAOC";
547  case GeneralMediaFormat::Smv: return "SMV";
548  case GeneralMediaFormat::Systems: return "Systems";
550  switch(sub) {
551  case SubFormats::PlainUtf8Subtitle: return "UTF-8";
552  case SubFormats::SubStationAlpha: return "SSA";
553  case SubFormats::AdvancedSubStationAlpha: return "ASS";
554  case SubFormats::UniversalSubtitleFormat: return "USF";
555  case SubFormats::WebVideoTextTracksFormat: return "WebVTT";
556  default: return "";
557  }
558  case GeneralMediaFormat::Theora: return "Theora";
559  case GeneralMediaFormat::Tiff: return "TIFF";
560  case GeneralMediaFormat::TimedText: return "Timed-Text";
561  case GeneralMediaFormat::Tta: return "TTA";
563  case GeneralMediaFormat::Vc1: return "VC-1";
564  case GeneralMediaFormat::VobBtn: return "VobBtn";
565  case GeneralMediaFormat::VobSub: return "VobSub";
566  case GeneralMediaFormat::Vorbis: return "Vorbis";
567  case GeneralMediaFormat::Vp8: return "VP8";
568  case GeneralMediaFormat::Vp9: return "VP9";
569  case GeneralMediaFormat::WavPack: return "WavPack";
570  case GeneralMediaFormat::WindowsMediaAudio: return "WMA";
571  case GeneralMediaFormat::WindowsMediaVideo: return "WMV";
572  case GeneralMediaFormat::DvbSub: return "DVBSUB";
573  case GeneralMediaFormat::Speex: return "Speex";
574  case GeneralMediaFormat::MonkeysAudio: return "APE";
575  default: return "";
576  }
577 }
578 
584 const char *MediaFormat::extensionName() const
585 {
586  switch(general) {
587  using namespace ExtensionFormats;
589  switch(extension) {
591  return "Spectral Band Replication / HE-AAC";
592  case ParametricStereo:
593  return "Parametric Stereo / HE-AAC v2"; // PS always implies SBR?
595  return "Spectral Band Replication and Parametric Stereo / HE-AAC v2";
596  default:
597  ;
598  }
599  break;
600  default:
601  ;
602  }
603  return "";
604 }
605 
609 const char *mediaTypeName(MediaType mediaType)
610 {
611  switch(mediaType) {
612  case MediaType::Audio:
613  return "Audio";
614  case MediaType::Video:
615  return "Video";
616  case MediaType::Text:
617  return "Subititle";
618  case MediaType::Hint:
619  return "Hint";
620  case MediaType::Buttons:
621  return "Buttons";
622  case MediaType::Control:
623  return "Control";
624  case MediaType::Unknown:
625  return "Other";
626  default:
627  return "";
628  }
629 }
630 
631 }
MediaType
The MediaType enum specifies the type of media data (audio, video, text, ...).
Definition: mediaformat.h:13
const char * name() const
Returns the name of the media format as C-style string.
Definition: mediaformat.cpp:17
const char * extensionName() const
Returns the abbreviation of the media format as C-style string.
const char * shortAbbreviation() const
Returns a short abbreviation of the media format as C-style string.
const char * abbreviation() const
Returns the abbreviation of the media format as C-style string.
Contains all classes and functions of the TagInfo library.
Definition: exceptions.h:9
const char *TAG_PARSER_EXPORT mediaTypeName(MediaType mediaType)
Returns the string representation for the specified mediaType.