Tag Parser  10.0.1
C++ library for reading and writing MP4 (iTunes), ID3, Vorbis, Opus, FLAC and Matroska tags
matroskaid.h
Go to the documentation of this file.
1 #ifndef TAG_PARSER_MATROSKAIDS_H
2 #define TAG_PARSER_MATROSKAIDS_H
3 
4 #include "../global.h"
5 
6 #include <cstdint>
7 #include <string_view>
8 
9 namespace TagParser {
10 
11 namespace MatroskaIds {
12 
17  Segment = 0x18538067,
18  SegmentInfo = 0x1549A966,
19  Tracks = 0x1654AE6B,
20  Cues = 0x1C53BB6B,
21  Tags = 0x1254C367,
22  SeekHead = 0x114D9B74,
23  Cluster = 0x1F43B675,
24  Attachments = 0x1941A469,
25  Chapters = 0x1043A770
26 };
27 
32  Seek = 0x4DBB,
33 };
34 
38 enum SeekIds { SeekID = 0x53AB, SeekPosition = 0x53AC };
39 
44  TimeCodeScale = 0x2AD7B1,
45  Duration = 0x4489,
46  WrittingApp = 0x5741,
47  MuxingApp = 0x4D80,
48  DateUTC = 0x4461,
49  SegmentUID = 0x73A4,
50  SegmentFileName = 0x7384,
51  PrevUID = 0x3CB923,
52  PrevFileName = 0x3C83AB,
53  NexUID = 0x3EB923,
54  NextFileName = 0x3E83BB,
55  Title = 0x7BA9,
56  SegmentFamily = 0x4444,
57  ChapterTranslate = 0x6924
58 };
59 
64 
68 enum TracksIds {
69  TrackEntry = 0xAE,
70 };
71 
76  TrackNumber = 0xD7,
77  TrackUID = 0x73C5,
78  TrackType = 0x83,
81  TrackFlagForced = 0x55AA,
83  MinCache = 0x6DE7,
84  MaxCache = 0x6DF8,
85  DefaultDuration = 0x23E383,
87  TrackTimeCodeScale = 0x23314F,
88  TrackOffset = 0x537F,
90  TrackName = 0x536E,
91  TrackLanguage = 0x22B59C,
92  TrackLanguageIETF = 0x22B59D,
93  CodecID = 0x86,
94  CodecPrivate = 0x63A2,
95  CodecName = 0x258688,
96  AttachmentLink = 0x7446,
97  CodecSettings = 0x3A9697,
98  CodecInfoUrl = 0x3B4040,
99  CodecDownloadUrl = 0x26B240,
101  TrackOverlay = 0x6FAB,
102  CodecDelay = 0x56aa,
103  SeekPreRoll = 0x56bb,
104  TrackTranslate = 0x6624,
105  TrackAudio = 0xE1,
106  TrackVideo = 0xE0,
113  ContentEncodings = 0x6D80
114 };
115 
120 
126  StereoMode = 0x53B8,
127  AlphaMode = 0x53c0,
128  OldStereoMode = 0x53b9,
129  PixelWidth = 0xB0,
130  PixelHeight = 0xBA,
131  PixelCropBottom = 0x54AA,
132  PixelCropTop = 0x54BB,
133  PixelCropLeft = 0x54CC,
134  PixelCropRight = 0x54DD,
135  DisplayWidth = 0x54B0,
136  DisplayHeight = 0x54BA,
137  DisplayUnit = 0x54B2,
138  AspectRatioType = 0x54B3,
139  ColorSpace = 0x2EB524,
140  GammaValue = 0x2FB523,
141  FrameRate = 0x2383E3
142 };
143 
147 enum TrackAudioIds { SamplingFrequency = 0xB5, OutputSamplingFrequency = 0x78B5, Channels = 0x9F, ChannelsPositions = 0x7D7B, BitDepth = 0x6264 };
148 
153 
158 
163 
168 
173 
182  ContentEncryption = 0x5035
183 };
184 
189 
194  ContentEncAlgo = 0x47e1,
195  ContentEncKeyID = 0x47e2,
197  ContentSigKeyID = 0x47e4,
198  ContentSigAlgo = 0x47e5,
199  ContentSigHashAlgo = 0x47e6
200 };
201 
205 enum TagsIds {
206  Tag = 0x7373,
207 };
208 
212 enum TagIds {
213  SimpleTag = 0x67C8,
214  Targets = 0x63C0,
215 };
216 
221  TagName = 0x45A3,
222  TagString = 0x4487,
223  TagLanguage = 0x447A,
224  TagLanguageIETF = 0x447B,
225  TagDefault = 0x4484,
226  TagBinary = 0x4485,
227 };
228 
233  TargetTypeValue = 0x68ca,
234  TargetType = 0x63ca,
235  TagTrackUID = 0x63c5,
236  TagEditionUID = 0x63c9,
237  TagChapterUID = 0x63c4,
238  TagAttachmentUID = 0x63c6
239 };
240 
244 enum CuesIds { CuePoint = 0xbb };
245 
249 enum CuePointIds { CueTime = 0xb3, CueTrackPositions = 0xb7 };
250 
255  CueTrack = 0xf7,
258  CueDuration = 0xb2,
259  CueBlockNumber = 0x5378,
261  CueReference = 0xdb
262 };
263 
267 enum CueReferenceIds { CueRefTime = 0x96, CueRefCluster = 0x97, CueRefNumber = 0x535f, CueRefCodecState = 0xeb };
268 
272 enum AttachmentsIds { AttachedFile = 0x61a7 };
273 
278  FileDescription = 0x467e,
279  FileName = 0x466e,
280  FileMimeType = 0x4660,
281  FileData = 0x465c,
282  FileUID = 0x46ae,
283  FileReferral = 0x4675,
285  FileUsedEndTime = 0x4662
286 };
287 
291 enum ChaptersIds { EditionEntry = 0x45b9 };
292 
297  EditionUID = 0x45bc,
301  ChapterAtom = 0xb6
302 };
303 
308  ChapterUID = 0x73c4,
317  ChapterTrack = 0x8f,
319  ChapProcess = 0x6944
320 };
321 
326 
330 enum ChapterDisplayIds { ChapString = 0x85, ChapLanguage = 0x437c, ChapLanguageIETF = 0x437D, ChapCountry = 0x437e };
331 
336 
341 
346  Timecode = 0xe7,
347  SilentTracks = 0x5854,
348  Position = 0xa7,
349  PrevSize = 0xab,
350  SimpleBlock = 0xa3,
351  BlockGroup = 0xa0,
352  EncryptedBlock = 0xaf
353 };
354 
359 
364  Block = 0xa1,
365  BlockVirtual = 0xa2,
366  BlockAdditions = 0x75a1,
371  CodecState = 0xa4,
372  DiscardPadding = 0x75a2,
373  Slices = 0x8e,
375 };
376 
380 enum BlockAdditionsIds { BlockMore = 0xa6 };
381 
385 enum BlockMoreIds { BlockAddID = 0xee, BlockAdditional = 0x45 };
386 
390 enum SlicesIds { TimeSlice = 0xe8 };
391 
395 enum TimeSliceIds { LaceNumber = 0xcc, FrameNumber = 0xcd, BlockAdditionID = 0xcb, Delay = 0xce, SliceDuration = 0xcf };
396 
401 
402 } // namespace MatroskaIds
403 
404 namespace MatroskaTrackType {
405 
406 enum KnownValues { Video = 0x1, Audio = 0x2, Complex = 0x3, Logo = 0x10, Subtitle = 0x11, Buttons = 0x12, Control = 0x20 };
407 }
408 
409 enum class MatroskaElementLevel : std::uint8_t {
410  TopLevel = 0x0,
411  Level1,
412  Level2,
413  Level3,
414  Level4,
415  Level5,
416  Level6,
417  Global = 0xFE,
418  Unknown = 0xFF,
419 };
420 
422 {
423  return static_cast<std::uint8_t>(lhs) < static_cast<std::uint8_t>(MatroskaElementLevel::Global)
424  && static_cast<std::uint8_t>(rhs) < static_cast<std::uint8_t>(MatroskaElementLevel::Global)
425  && static_cast<std::uint8_t>(lhs) > static_cast<std::uint8_t>(rhs);
426 }
427 
428 constexpr bool operator>(std::uint8_t lhs, MatroskaElementLevel rhs)
429 {
430  return lhs < static_cast<std::uint8_t>(MatroskaElementLevel::Global)
431  && static_cast<std::uint8_t>(rhs) < static_cast<std::uint8_t>(MatroskaElementLevel::Global)
432  && static_cast<std::uint8_t>(lhs) > static_cast<std::uint8_t>(rhs);
433 }
434 
436 {
437  return static_cast<std::uint8_t>(lhs) < static_cast<std::uint8_t>(MatroskaElementLevel::Global)
438  && static_cast<std::uint8_t>(rhs) < static_cast<std::uint8_t>(MatroskaElementLevel::Global)
439  && static_cast<std::uint8_t>(lhs) < static_cast<std::uint8_t>(rhs);
440 }
441 
443 {
444  return lhs == rhs || lhs > rhs;
445 }
446 
448 {
449  return lhs == rhs || lhs < rhs;
450 }
451 
452 TAG_PARSER_EXPORT std::string_view matroskaIdName(std::uint32_t matroskaId);
453 TAG_PARSER_EXPORT MatroskaElementLevel matroskaIdLevel(std::uint32_t matroskaId);
454 
455 } // namespace TagParser
456 
457 #endif // TAG_PARSER_MATROSKAIDS_H
The Tag class is used to store, read and write tag information.
Definition: tag.h:108
#define TAG_PARSER_EXPORT
Marks the symbol to be exported by the tagparser library.
ChaptersIds
Encapsulates all ID values in the Chapters master.
Definition: matroskaid.h:291
SeekIds
Encapsulates all ID values in the Seek master.
Definition: matroskaid.h:38
SeekHeadIds
Encapsulates all ID values in the SeekHead master.
Definition: matroskaid.h:31
TrackOperationIds
Encapsulates all ID values in the TrackOperation master.
Definition: matroskaid.h:152
CuesIds
Encapsulates all ID values in the Cues master.
Definition: matroskaid.h:244
TrackCombinePlanesIds
Encapsulates all ID values in the TrackCombinePlanes master.
Definition: matroskaid.h:157
ChapProcessIds
Encapsulates all ID values in the ChapProcess master.
Definition: matroskaid.h:335
ChapterAtomIds
Encapsulates all ID values in the ChapterAtom master.
Definition: matroskaid.h:307
CuePointIds
Encapsulates all ID values in the CuePoint master.
Definition: matroskaid.h:249
SilentTracksIds
Encapsulates all ID values in the SilentTracks master.
Definition: matroskaid.h:358
TopLevelIds
Encapsulates all top level ID values.
Definition: matroskaid.h:16
TimeSliceIds
Encapsulates all ID values in the TimeSlice master.
Definition: matroskaid.h:395
ChapterTranslateIds
Encapsulates all ID values in the ChapterTranslate master.
Definition: matroskaid.h:63
TrackPlaneIds
Encapsulates all ID values in the TrackPlane master.
Definition: matroskaid.h:162
SlicesIds
Encapsulates all ID values in the Slices master.
Definition: matroskaid.h:390
SimpleTagIds
Encapsulates all ID values in the SimpleTag master.
Definition: matroskaid.h:220
TrackEntryIds
Encapsulates all ID values in the TrackEntry master.
Definition: matroskaid.h:75
AttachedFileIds
Encapsulates all ID values in the AttachedFile master.
Definition: matroskaid.h:277
BlockMoreIds
Encapsulates all ID values in the BlockMore master.
Definition: matroskaid.h:385
EditionEntryIds
Encapsulates all ID values in the EditionEntry master.
Definition: matroskaid.h:296
ReferenceFrameIds
Encapsulates all ID values in the ReferenceFrame master.
Definition: matroskaid.h:400
CueReferenceIds
Encapsulates all ID values in the CueReference master.
Definition: matroskaid.h:267
TracksIds
Encapsulates all ID values in the Tracks master.
Definition: matroskaid.h:68
BlockAdditionsIds
Encapsulates all ID values in the BlockAdditions master.
Definition: matroskaid.h:380
TrackAudioIds
Encapsulates all ID values in the TrackAudio master.
Definition: matroskaid.h:147
TrackVideoIds
Encapsulates all ID values in the TrackVideo master.
Definition: matroskaid.h:124
TargetsIds
Encapsulates all ID values in the Targets master.
Definition: matroskaid.h:232
ContentEncodingsIds
Encapsulates all ID values in the ContentEncodings master.
Definition: matroskaid.h:172
SegmentInfoIds
Encapsulates all ID values in the SegmentInfo master.
Definition: matroskaid.h:43
TrackTranslateIds
Encapsulates all ID values in the TrackTranslate master.
Definition: matroskaid.h:119
ContentCompressionIds
Encapsulates all ID values in the ContentCompression master.
Definition: matroskaid.h:188
ChapProcessCommandIds
Encapsulates all ID values in the ChapProcessCommand master.
Definition: matroskaid.h:340
TrackJoinBlocksIds
Encapsulates all ID values in the TrackJoinBlocks master.
Definition: matroskaid.h:167
TagsIds
Encapsulates all ID values in the Tags master.
Definition: matroskaid.h:205
CueTrackPositionsIds
Encapsulates all ID values in the CueTrackPositions master.
Definition: matroskaid.h:254
ClusterIds
Encapsulates all ID values in the Cluster master.
Definition: matroskaid.h:345
BlockGroupIds
Encapsulates all ID values in the BlockGroup master.
Definition: matroskaid.h:363
AttachmentsIds
Encapsulates all ID values in the Attachments master.
Definition: matroskaid.h:272
ContentEncryptionIds
Encapsulates all ID values in the ContentEncryption master.
Definition: matroskaid.h:193
ChapterTrackIds
Encapsulates all ID values in the ChapterTrack master.
Definition: matroskaid.h:325
ContentEncodingIds
Encapsulates all ID values in the ContentEncoding master.
Definition: matroskaid.h:177
TagIds
Encapsulates all ID values in the Tag master.
Definition: matroskaid.h:212
ChapterDisplayIds
Encapsulates all ID values in the ChapterDisplay master.
Definition: matroskaid.h:330
Contains all classes and functions of the TagInfo library.
Definition: aaccodebook.h:10
TAG_PARSER_EXPORT MatroskaElementLevel matroskaIdLevel(std::uint32_t matroskaId)
Returns the level at which elements with the specified matroskaId are supposed to occur in a Matroska...
Definition: matroskaid.cpp:529
MatroskaElementLevel
Definition: matroskaid.h:409
TAG_PARSER_EXPORT std::string_view matroskaIdName(std::uint32_t matroskaId)
Returns a string for the specified matroskaId if known; otherwise returns an empty string.
Definition: matroskaid.cpp:22
constexpr bool operator>=(MatroskaElementLevel lhs, MatroskaElementLevel rhs)
Definition: matroskaid.h:442
constexpr bool operator<(MatroskaElementLevel lhs, MatroskaElementLevel rhs)
Definition: matroskaid.h:435
constexpr bool operator<=(MatroskaElementLevel lhs, MatroskaElementLevel rhs)
Definition: matroskaid.h:447
constexpr bool operator>(MatroskaElementLevel lhs, MatroskaElementLevel rhs)
Definition: matroskaid.h:421
TrackType
The TrackType enum specifies the underlying file type of a track and the concrete class of the track ...
Definition: abstracttrack.h:31