summaryrefslogtreecommitdiffstats
path: root/libmpdemux/ebml_types.h
blob: 9dde5814ba3f4bff13302758ac857b3bcd85fbf1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
// Generated by TOOLS/matroska.py, do not edit manually

#define EBML_ID_EBML                             0x1a45dfa3
#define EBML_ID_EBMLVERSION                      0x4286
#define EBML_ID_EBMLREADVERSION                  0x42f7
#define EBML_ID_EBMLMAXIDLENGTH                  0x42f2
#define EBML_ID_EBMLMAXSIZELENGTH                0x42f3
#define EBML_ID_DOCTYPE                          0x4282
#define EBML_ID_DOCTYPEVERSION                   0x4287
#define EBML_ID_DOCTYPEREADVERSION               0x4285
#define EBML_ID_CRC32                            0xbf
#define EBML_ID_VOID                             0xec
#define MATROSKA_ID_SEGMENT                      0x18538067
#define MATROSKA_ID_SEEKHEAD                     0x114d9b74
#define MATROSKA_ID_SEEK                         0x4dbb
#define MATROSKA_ID_SEEKID                       0x53ab
#define MATROSKA_ID_SEEKPOSITION                 0x53ac
#define MATROSKA_ID_INFO                         0x1549a966
#define MATROSKA_ID_SEGMENTUID                   0x73a4
#define MATROSKA_ID_PREVUID                      0x3cb923
#define MATROSKA_ID_NEXTUID                      0x3eb923
#define MATROSKA_ID_TIMECODESCALE                0x2ad7b1
#define MATROSKA_ID_DATEUTC                      0x4461
#define MATROSKA_ID_TITLE                        0x7ba9
#define MATROSKA_ID_MUXINGAPP                    0x4d80
#define MATROSKA_ID_WRITINGAPP                   0x5741
#define MATROSKA_ID_DURATION                     0x4489
#define MATROSKA_ID_CLUSTER                      0x1f43b675
#define MATROSKA_ID_TIMECODE                     0xe7
#define MATROSKA_ID_BLOCKGROUP                   0xa0
#define MATROSKA_ID_BLOCK                        0xa1
#define MATROSKA_ID_BLOCKDURATION                0x9b
#define MATROSKA_ID_REFERENCEBLOCK               0xfb
#define MATROSKA_ID_SIMPLEBLOCK                  0xa3
#define MATROSKA_ID_TRACKS                       0x1654ae6b
#define MATROSKA_ID_TRACKENTRY                   0xae
#define MATROSKA_ID_TRACKNUMBER                  0xd7
#define MATROSKA_ID_TRACKUID                     0x73c5
#define MATROSKA_ID_TRACKTYPE                    0x83
#define MATROSKA_ID_FLAGENABLED                  0xb9
#define MATROSKA_ID_FLAGDEFAULT                  0x88
#define MATROSKA_ID_FLAGFORCED                   0x55aa
#define MATROSKA_ID_FLAGLACING                   0x9c
#define MATROSKA_ID_MINCACHE                     0x6de7
#define MATROSKA_ID_DEFAULTDURATION              0x23e383
#define MATROSKA_ID_TRACKTIMECODESCALE           0x23314f
#define MATROSKA_ID_MAXBLOCKADDITIONID           0x55ee
#define MATROSKA_ID_NAME                         0x536e
#define MATROSKA_ID_LANGUAGE                     0x22b59c
#define MATROSKA_ID_CODECID                      0x86
#define MATROSKA_ID_CODECPRIVATE                 0x63a2
#define MATROSKA_ID_CODECDECODEALL               0xaa
#define MATROSKA_ID_VIDEO                        0xe0
#define MATROSKA_ID_FLAGINTERLACED               0x9a
#define MATROSKA_ID_PIXELWIDTH                   0xb0
#define MATROSKA_ID_PIXELHEIGHT                  0xba
#define MATROSKA_ID_DISPLAYWIDTH                 0x54b0
#define MATROSKA_ID_DISPLAYHEIGHT                0x54ba
#define MATROSKA_ID_FRAMERATE                    0x2383e3
#define MATROSKA_ID_AUDIO                        0xe1
#define MATROSKA_ID_SAMPLINGFREQUENCY            0xb5
#define MATROSKA_ID_CHANNELS                     0x9f
#define MATROSKA_ID_BITDEPTH                     0x6264
#define MATROSKA_ID_CONTENTENCODINGS             0x6d80
#define MATROSKA_ID_CONTENTENCODING              0x6240
#define MATROSKA_ID_CONTENTENCODINGORDER         0x5031
#define MATROSKA_ID_CONTENTENCODINGSCOPE         0x5032
#define MATROSKA_ID_CONTENTENCODINGTYPE          0x5033
#define MATROSKA_ID_CONTENTCOMPRESSION           0x5034
#define MATROSKA_ID_CONTENTCOMPALGO              0x4254
#define MATROSKA_ID_CONTENTCOMPSETTINGS          0x4255
#define MATROSKA_ID_CUES                         0x1c53bb6b
#define MATROSKA_ID_CUEPOINT                     0xbb
#define MATROSKA_ID_CUETIME                      0xb3
#define MATROSKA_ID_CUETRACKPOSITIONS            0xb7
#define MATROSKA_ID_CUETRACK                     0xf7
#define MATROSKA_ID_CUECLUSTERPOSITION           0xf1
#define MATROSKA_ID_ATTACHMENTS                  0x1941a469
#define MATROSKA_ID_ATTACHEDFILE                 0x61a7
#define MATROSKA_ID_FILENAME                     0x466e
#define MATROSKA_ID_FILEMIMETYPE                 0x4660
#define MATROSKA_ID_FILEDATA                     0x465c
#define MATROSKA_ID_FILEUID                      0x46ae
#define MATROSKA_ID_CHAPTERS                     0x1043a770
#define MATROSKA_ID_EDITIONENTRY                 0x45b9
#define MATROSKA_ID_EDITIONUID                   0x45bc
#define MATROSKA_ID_EDITIONFLAGHIDDEN            0x45bd
#define MATROSKA_ID_EDITIONFLAGDEFAULT           0x45db
#define MATROSKA_ID_EDITIONFLAGORDERED           0x45dd
#define MATROSKA_ID_CHAPTERATOM                  0xb6
#define MATROSKA_ID_CHAPTERUID                   0x73c4
#define MATROSKA_ID_CHAPTERTIMESTART             0x91
#define MATROSKA_ID_CHAPTERTIMEEND               0x92
#define MATROSKA_ID_CHAPTERFLAGHIDDEN            0x98
#define MATROSKA_ID_CHAPTERFLAGENABLED           0x4598
#define MATROSKA_ID_CHAPTERSEGMENTUID            0x6e67
#define MATROSKA_ID_CHAPTERSEGMENTEDITIONUID     0x6ebc
#define MATROSKA_ID_CHAPTERDISPLAY               0x80
#define MATROSKA_ID_CHAPSTRING                   0x85
#define MATROSKA_ID_CHAPLANGUAGE                 0x437c
#define MATROSKA_ID_TAGS                         0x1254c367
#define MATROSKA_ID_TAG                          0x7373
#define MATROSKA_ID_TARGETS                      0x63c0
#define MATROSKA_ID_TARGETTYPEVALUE              0x68ca
#define MATROSKA_ID_TARGETTRACKUID               0x63c5
#define MATROSKA_ID_TARGETEDITIONUID             0x63c9
#define MATROSKA_ID_TARGETCHAPTERUID             0x63c4
#define MATROSKA_ID_TARGETATTACHMENTUID          0x63c6
#define MATROSKA_ID_SIMPLETAG                    0x67c8
#define MATROSKA_ID_TAGNAME                      0x45a3
#define MATROSKA_ID_TAGLANGUAGE                  0x447a
#define MATROSKA_ID_TAGSTRING                    0x4487


struct ebml_simple_tag {
    struct bstr   tag_name;
    struct bstr   tag_language;
    struct bstr   tag_string;

    int  n_tag_name;
    int  n_tag_language;
    int  n_tag_string;
};

struct ebml_targets {
    uint64_t   target_type_value;
    uint64_t   target_track_uid;
    uint64_t   target_edition_uid;
    uint64_t   target_chapter_uid;
    uint64_t   target_attachment_uid;

    int  n_target_type_value;
    int  n_target_track_uid;
    int  n_target_edition_uid;
    int  n_target_chapter_uid;
    int  n_target_attachment_uid;
};

struct ebml_tag {
    struct ebml_targets      targets;
    struct ebml_simple_tag  *simple_tag;

    int  n_targets;
    int  n_simple_tag;
};

struct ebml_tags {
    struct ebml_tag  *tag;

    int  n_tag;
};

struct ebml_chapter_display {
    struct bstr   chap_string;
    struct bstr  *chap_language;

    int  n_chap_string;
    int  n_chap_language;
};

struct ebml_chapter_atom {
    uint64_t                      chapter_uid;
    uint64_t                      chapter_time_start;
    uint64_t                      chapter_time_end;
    uint64_t                      chapter_flag_hidden;
    uint64_t                      chapter_flag_enabled;
    struct bstr                   chapter_segment_uid;
    uint64_t                      chapter_segment_edition_uid;
    struct ebml_chapter_display  *chapter_display;

    int  n_chapter_uid;
    int  n_chapter_time_start;
    int  n_chapter_time_end;
    int  n_chapter_flag_hidden;
    int  n_chapter_flag_enabled;
    int  n_chapter_segment_uid;
    int  n_chapter_segment_edition_uid;
    int  n_chapter_display;
};

struct ebml_edition_entry {
    uint64_t                   edition_uid;
    uint64_t                   edition_flag_hidden;
    uint64_t                   edition_flag_default;
    uint64_t                   edition_flag_ordered;
    struct ebml_chapter_atom  *chapter_atom;

    int  n_edition_uid;
    int  n_edition_flag_hidden;
    int  n_edition_flag_default;
    int  n_edition_flag_ordered;
    int  n_chapter_atom;
};

struct ebml_chapters {
    struct ebml_edition_entry  *edition_entry;

    int  n_edition_entry;
};

struct ebml_attached_file {
    struct bstr   file_name;
    struct bstr   file_mime_type;
    struct bstr   file_data;
    uint64_t      file_uid;

    int  n_file_name;
    int  n_file_mime_type;
    int  n_file_data;
    int  n_file_uid;
};

struct ebml_attachments {
    struct ebml_attached_file  *attached_file;

    int  n_attached_file;
};

struct ebml_cue_track_positions {
    uint64_t   cue_track;
    uint64_t   cue_cluster_position;

    int  n_cue_track;
    int  n_cue_cluster_position;
};

struct ebml_cue_point {
    uint64_t                          cue_time;
    struct ebml_cue_track_positions  *cue_track_positions;

    int  n_cue_time;
    int  n_cue_track_positions;
};

struct ebml_cues {
    struct ebml_cue_point  *cue_point;

    int  n_cue_point;
};

struct ebml_content_compression {
    uint64_t      content_comp_algo;
    struct bstr   content_comp_settings;

    int  n_content_comp_algo;
    int  n_content_comp_settings;
};

struct ebml_content_encoding {
    uint64_t                          content_encoding_order;
    uint64_t                          content_encoding_scope;
    uint64_t                          content_encoding_type;
    struct ebml_content_compression   content_compression;

    int  n_content_encoding_order;
    int  n_content_encoding_scope;
    int  n_content_encoding_type;
    int  n_content_compression;
};

struct ebml_content_encodings {
    struct ebml_content_encoding  *content_encoding;

    int  n_content_encoding;
};

struct ebml_audio {
    double     sampling_frequency;
    uint64_t   channels;
    uint64_t   bit_depth;

    int  n_sampling_frequency;
    int  n_channels;
    int  n_bit_depth;
};

struct ebml_video {
    uint64_t   flag_interlaced;
    uint64_t   pixel_width;
    uint64_t   pixel_height;
    uint64_t   display_width;
    uint64_t   display_height;
    double     frame_rate;

    int  n_flag_interlaced;
    int  n_pixel_width;
    int  n_pixel_height;
    int  n_display_width;
    int  n_display_height;
    int  n_frame_rate;
};

struct ebml_track_entry {
    uint64_t                        track_number;
    uint64_t                        track_uid;
    uint64_t                        track_type;
    uint64_t                        flag_enabled;
    uint64_t                        flag_default;
    uint64_t                        flag_forced;
    uint64_t                        flag_lacing;
    uint64_t                        min_cache;
    uint64_t                        default_duration;
    double                          track_timecode_scale;
    uint64_t                        max_block_addition_id;
    struct bstr                     name;
    struct bstr                     language;
    struct bstr                     codec_id;
    struct bstr                     codec_private;
    uint64_t                        codec_decode_all;
    struct ebml_video               video;
    struct ebml_audio               audio;
    struct ebml_content_encodings   content_encodings;

    int  n_track_number;
    int  n_track_uid;
    int  n_track_type;
    int  n_flag_enabled;
    int  n_flag_default;
    int  n_flag_forced;
    int  n_flag_lacing;
    int  n_min_cache;
    int  n_default_duration;
    int  n_track_timecode_scale;
    int  n_max_block_addition_id;
    int  n_name;
    int  n_language;
    int  n_codec_id;
    int  n_codec_private;
    int  n_codec_decode_all;
    int  n_video;
    int  n_audio;
    int  n_content_encodings;
};

struct ebml_tracks {
    struct ebml_track_entry  *track_entry;

    int  n_track_entry;
};

struct ebml_block_group {
    struct bstr   block;
    uint64_t      block_duration;
    int64_t      *reference_block;

    int  n_block;
    int  n_block_duration;
    int  n_reference_block;
};

struct ebml_cluster {
    uint64_t                  timecode;
    struct ebml_block_group  *block_group;
    struct bstr              *simple_block;

    int  n_timecode;
    int  n_block_group;
    int  n_simple_block;
};

struct ebml_info {
    struct bstr   segment_uid;
    struct bstr   prev_uid;
    struct bstr   next_uid;
    uint64_t      timecode_scale;
    int64_t       date_utc;
    struct bstr   title;
    struct bstr   muxing_app;
    struct bstr   writing_app;
    double        duration;

    int  n_segment_uid;
    int  n_prev_uid;
    int  n_next_uid;
    int  n_timecode_scale;
    int  n_date_utc;
    int  n_title;
    int  n_muxing_app;
    int  n_writing_app;
    int  n_duration;
};

struct ebml_seek {
    uint32_t   seek_id;
    uint64_t   seek_position;

    int  n_seek_id;
    int  n_seek_position;
};

struct ebml_seek_head {
    struct ebml_seek  *seek;

    int  n_seek;
};

struct ebml_segment {
    struct ebml_seek_head    *seek_head;
    struct ebml_info         *info;
    struct ebml_cluster      *cluster;
    struct ebml_tracks       *tracks;
    struct ebml_cues          cues;
    struct ebml_attachments   attachments;
    struct ebml_chapters      chapters;
    struct ebml_tags         *tags;

    int  n_seek_head;
    int  n_info;
    int  n_cluster;
    int  n_tracks;
    int  n_cues;
    int  n_attachments;
    int  n_chapters;
    int  n_tags;
};

struct ebml_ebml {
    uint64_t      ebml_version;
    uint64_t      ebml_read_version;
    uint64_t      ebml_max_id_length;
    uint64_t      ebml_max_size_length;
    struct bstr   doc_type;
    uint64_t      doc_type_version;
    uint64_t      doc_type_read_version;

    int  n_ebml_version;
    int  n_ebml_read_version;
    int  n_ebml_max_id_length;
    int  n_ebml_max_size_length;
    int  n_doc_type;
    int  n_doc_type_version;
    int  n_doc_type_read_version;
};
extern const struct ebml_elem_desc ebml_ebml_desc;
extern const struct ebml_elem_desc ebml_segment_desc;
extern const struct ebml_elem_desc ebml_seek_head_desc;
extern const struct ebml_elem_desc ebml_seek_desc;
extern const struct ebml_elem_desc ebml_info_desc;
extern const struct ebml_elem_desc ebml_cluster_desc;
extern const struct ebml_elem_desc ebml_block_group_desc;
extern const struct ebml_elem_desc ebml_tracks_desc;
extern const struct ebml_elem_desc ebml_track_entry_desc;
extern const struct ebml_elem_desc ebml_video_desc;
extern const struct ebml_elem_desc ebml_audio_desc;
extern const struct ebml_elem_desc ebml_content_encodings_desc;
extern const struct ebml_elem_desc ebml_content_encoding_desc;
extern const struct ebml_elem_desc ebml_content_compression_desc;
extern const struct ebml_elem_desc ebml_cues_desc;
extern const struct ebml_elem_desc ebml_cue_point_desc;
extern const struct ebml_elem_desc ebml_cue_track_positions_desc;
extern const struct ebml_elem_desc ebml_attachments_desc;
extern const struct ebml_elem_desc ebml_attached_file_desc;
extern const struct ebml_elem_desc ebml_chapters_desc;
extern const struct ebml_elem_desc ebml_edition_entry_desc;
extern const struct ebml_elem_desc ebml_chapter_atom_desc;
extern const struct ebml_elem_desc ebml_chapter_display_desc;
extern const struct ebml_elem_desc ebml_tags_desc;
extern const struct ebml_elem_desc ebml_tag_desc;
extern const struct ebml_elem_desc ebml_targets_desc;
extern const struct ebml_elem_desc ebml_simple_tag_desc;

#define MAX_EBML_SUBELEMENTS 19