Mercurial > libdvdread4.hg
annotate ifo_types.h @ 21:4aa618ae094f src
Use consistent license headers everywhere: Fix FSF address and boilerplate.
author | diego |
---|---|
date | Sun, 14 Sep 2008 15:42:49 +0000 |
parents | fce16251755c |
children | 447c5319a522 |
rev | line source |
---|---|
3 | 1 #ifndef IFO_TYPES_H_INCLUDED |
2 #define IFO_TYPES_H_INCLUDED | |
3 | |
4 /* | |
5 * Copyright (C) 2000, 2001 Björn Englund <d4bjorn@dtek.chalmers.se>, | |
6 * Håkan Hjort <d95hjort@dtek.chalmers.se> | |
7 * | |
21
4aa618ae094f
Use consistent license headers everywhere: Fix FSF address and boilerplate.
diego
parents:
20
diff
changeset
|
8 * This file is part of libdvdread. |
4aa618ae094f
Use consistent license headers everywhere: Fix FSF address and boilerplate.
diego
parents:
20
diff
changeset
|
9 * |
4aa618ae094f
Use consistent license headers everywhere: Fix FSF address and boilerplate.
diego
parents:
20
diff
changeset
|
10 * libdvdread is free software; you can redistribute it and/or modify |
3 | 11 * it under the terms of the GNU General Public License as published by |
12 * the Free Software Foundation; either version 2 of the License, or | |
13 * (at your option) any later version. | |
14 * | |
21
4aa618ae094f
Use consistent license headers everywhere: Fix FSF address and boilerplate.
diego
parents:
20
diff
changeset
|
15 * libdvdread is distributed in the hope that it will be useful, |
3 | 16 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
18 * GNU General Public License for more details. | |
19 * | |
21
4aa618ae094f
Use consistent license headers everywhere: Fix FSF address and boilerplate.
diego
parents:
20
diff
changeset
|
20 * You should have received a copy of the GNU General Public License along |
4aa618ae094f
Use consistent license headers everywhere: Fix FSF address and boilerplate.
diego
parents:
20
diff
changeset
|
21 * with libdvdread; if not, write to the Free Software Foundation, Inc., |
4aa618ae094f
Use consistent license headers everywhere: Fix FSF address and boilerplate.
diego
parents:
20
diff
changeset
|
22 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. |
3 | 23 */ |
24 | |
25 #include <inttypes.h> | |
26 #include "dvd_reader.h" | |
27 | |
28 | |
29 #undef ATTRIBUTE_PACKED | |
20 | 30 #undef PRAGMA_PACK_BEGIN |
3 | 31 #undef PRAGMA_PACK_END |
32 | |
33 #if defined(__GNUC__) | |
34 #if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 95) | |
35 #define ATTRIBUTE_PACKED __attribute__ ((packed)) | |
36 #define PRAGMA_PACK 0 | |
37 #endif | |
38 #endif | |
39 | |
40 #if !defined(ATTRIBUTE_PACKED) | |
41 #define ATTRIBUTE_PACKED | |
42 #define PRAGMA_PACK 1 | |
43 #endif | |
44 | |
45 #if PRAGMA_PACK | |
46 #pragma pack(1) | |
47 #endif | |
48 | |
49 | |
50 /** | |
51 * Common | |
52 * | |
53 * The following structures are used in both the VMGI and VTSI. | |
54 */ | |
55 | |
56 | |
57 /** | |
58 * DVD Time Information. | |
59 */ | |
60 typedef struct { | |
61 uint8_t hour; | |
62 uint8_t minute; | |
63 uint8_t second; | |
64 uint8_t frame_u; /* The two high bits are the frame rate. */ | |
65 } ATTRIBUTE_PACKED dvd_time_t; | |
66 | |
67 /** | |
68 * Type to store per-command data. | |
69 */ | |
70 typedef struct { | |
71 uint8_t bytes[8]; | |
72 } ATTRIBUTE_PACKED vm_cmd_t; | |
73 #define COMMAND_DATA_SIZE 8U | |
74 | |
75 | |
76 /** | |
77 * Video Attributes. | |
78 */ | |
79 typedef struct { | |
80 unsigned char mpeg_version : 2; | |
81 unsigned char video_format : 2; | |
82 unsigned char display_aspect_ratio : 2; | |
83 unsigned char permitted_df : 2; | |
20 | 84 |
3 | 85 unsigned char line21_cc_1 : 1; |
86 unsigned char line21_cc_2 : 1; | |
87 unsigned char unknown1 : 1; | |
88 unsigned char bit_rate : 1; | |
20 | 89 |
3 | 90 unsigned char picture_size : 2; |
91 unsigned char letterboxed : 1; | |
92 unsigned char film_mode : 1; | |
93 } ATTRIBUTE_PACKED video_attr_t; | |
94 | |
95 /** | |
96 * Audio Attributes. | |
97 */ | |
98 typedef struct { | |
99 unsigned char audio_format : 3; | |
100 unsigned char multichannel_extension : 1; | |
101 unsigned char lang_type : 2; | |
102 unsigned char application_mode : 2; | |
20 | 103 |
3 | 104 unsigned char quantization : 2; |
105 unsigned char sample_frequency : 2; | |
106 unsigned char unknown1 : 1; | |
107 unsigned char channels : 3; | |
108 uint16_t lang_code; | |
109 uint8_t lang_extension; | |
110 uint8_t code_extension; | |
111 uint8_t unknown3; | |
112 union { | |
113 struct ATTRIBUTE_PACKED { | |
114 unsigned char unknown4 : 1; | |
115 unsigned char channel_assignment : 3; | |
116 unsigned char version : 2; | |
117 unsigned char mc_intro : 1; /* probably 0: true, 1:false */ | |
118 unsigned char mode : 1; /* Karaoke mode 0: solo 1: duet */ | |
119 } karaoke; | |
120 struct ATTRIBUTE_PACKED { | |
121 unsigned char unknown5 : 4; | |
122 unsigned char dolby_encoded : 1; /* suitable for surround decoding */ | |
123 unsigned char unknown6 : 3; | |
124 } surround; | |
125 } app_info; | |
126 } ATTRIBUTE_PACKED audio_attr_t; | |
127 | |
128 | |
129 /** | |
130 * MultiChannel Extension | |
131 */ | |
132 typedef struct { | |
133 unsigned int zero1 : 7; | |
134 unsigned int ach0_gme : 1; | |
135 | |
136 unsigned int zero2 : 7; | |
137 unsigned int ach1_gme : 1; | |
138 | |
139 unsigned int zero3 : 4; | |
140 unsigned int ach2_gv1e : 1; | |
141 unsigned int ach2_gv2e : 1; | |
142 unsigned int ach2_gm1e : 1; | |
143 unsigned int ach2_gm2e : 1; | |
144 | |
145 unsigned int zero4 : 4; | |
146 unsigned int ach3_gv1e : 1; | |
147 unsigned int ach3_gv2e : 1; | |
148 unsigned int ach3_gmAe : 1; | |
149 unsigned int ach3_se2e : 1; | |
150 | |
151 unsigned int zero5 : 4; | |
152 unsigned int ach4_gv1e : 1; | |
153 unsigned int ach4_gv2e : 1; | |
154 unsigned int ach4_gmBe : 1; | |
155 unsigned int ach4_seBe : 1; | |
156 uint8_t zero6[19]; | |
157 } ATTRIBUTE_PACKED multichannel_ext_t; | |
158 | |
159 | |
160 /** | |
161 * Subpicture Attributes. | |
162 */ | |
163 typedef struct { | |
164 /* | |
165 * type: 0 not specified | |
166 * 1 language | |
167 * 2 other | |
168 * coding mode: 0 run length | |
169 * 1 extended | |
170 * 2 other | |
171 * language: indicates language if type == 1 | |
172 * lang extension: if type == 1 contains the lang extension | |
173 */ | |
174 unsigned char code_mode : 3; | |
175 unsigned char zero1 : 3; | |
176 unsigned char type : 2; | |
177 uint8_t zero2; | |
178 uint16_t lang_code; | |
179 uint8_t lang_extension; | |
180 uint8_t code_extension; | |
181 } ATTRIBUTE_PACKED subp_attr_t; | |
182 | |
183 | |
184 | |
185 /** | |
186 * PGC Command Table. | |
20 | 187 */ |
3 | 188 typedef struct { |
189 uint16_t nr_of_pre; | |
190 uint16_t nr_of_post; | |
191 uint16_t nr_of_cell; | |
192 uint16_t zero_1; | |
193 vm_cmd_t *pre_cmds; | |
194 vm_cmd_t *post_cmds; | |
195 vm_cmd_t *cell_cmds; | |
196 } ATTRIBUTE_PACKED pgc_command_tbl_t; | |
197 #define PGC_COMMAND_TBL_SIZE 8U | |
198 | |
199 /** | |
200 * PGC Program Map | |
201 */ | |
20 | 202 typedef uint8_t pgc_program_map_t; |
3 | 203 |
204 /** | |
205 * Cell Playback Information. | |
206 */ | |
207 typedef struct { | |
208 unsigned int block_mode : 2; | |
209 unsigned int block_type : 2; | |
210 unsigned int seamless_play : 1; | |
211 unsigned int interleaved : 1; | |
212 unsigned int stc_discontinuity: 1; | |
213 unsigned int seamless_angle : 1; | |
214 unsigned int playback_mode : 1; /**< When set, enter StillMode after each VOBU */ | |
215 unsigned int restricted : 1; /**< ?? drop out of fastforward? */ | |
216 unsigned int unknown2 : 6; | |
217 uint8_t still_time; | |
218 uint8_t cell_cmd_nr; | |
219 dvd_time_t playback_time; | |
220 uint32_t first_sector; | |
221 uint32_t first_ilvu_end_sector; | |
222 uint32_t last_vobu_start_sector; | |
223 uint32_t last_sector; | |
224 } ATTRIBUTE_PACKED cell_playback_t; | |
225 | |
226 #define BLOCK_TYPE_NONE 0x0 | |
227 #define BLOCK_TYPE_ANGLE_BLOCK 0x1 | |
228 | |
229 #define BLOCK_MODE_NOT_IN_BLOCK 0x0 | |
230 #define BLOCK_MODE_FIRST_CELL 0x1 | |
231 #define BLOCK_MODE_IN_BLOCK 0x2 | |
232 #define BLOCK_MODE_LAST_CELL 0x3 | |
233 | |
234 /** | |
235 * Cell Position Information. | |
236 */ | |
237 typedef struct { | |
238 uint16_t vob_id_nr; | |
239 uint8_t zero_1; | |
240 uint8_t cell_nr; | |
241 } ATTRIBUTE_PACKED cell_position_t; | |
242 | |
243 /** | |
244 * User Operations. | |
245 */ | |
246 typedef struct { | |
247 unsigned int zero : 7; /* 25-31 */ | |
248 unsigned int video_pres_mode_change : 1; /* 24 */ | |
20 | 249 |
3 | 250 unsigned int karaoke_audio_pres_mode_change : 1; /* 23 */ |
251 unsigned int angle_change : 1; | |
252 unsigned int subpic_stream_change : 1; | |
253 unsigned int audio_stream_change : 1; | |
254 unsigned int pause_on : 1; | |
255 unsigned int still_off : 1; | |
256 unsigned int button_select_or_activate : 1; | |
257 unsigned int resume : 1; /* 16 */ | |
20 | 258 |
3 | 259 unsigned int chapter_menu_call : 1; /* 15 */ |
260 unsigned int angle_menu_call : 1; | |
261 unsigned int audio_menu_call : 1; | |
262 unsigned int subpic_menu_call : 1; | |
263 unsigned int root_menu_call : 1; | |
264 unsigned int title_menu_call : 1; | |
265 unsigned int backward_scan : 1; | |
266 unsigned int forward_scan : 1; /* 8 */ | |
20 | 267 |
3 | 268 unsigned int next_pg_search : 1; /* 7 */ |
269 unsigned int prev_or_top_pg_search : 1; | |
270 unsigned int time_or_chapter_search : 1; | |
271 unsigned int go_up : 1; | |
272 unsigned int stop : 1; | |
273 unsigned int title_play : 1; | |
274 unsigned int chapter_search_or_play : 1; | |
275 unsigned int title_or_time_play : 1; /* 0 */ | |
276 } ATTRIBUTE_PACKED user_ops_t; | |
277 | |
278 /** | |
279 * Program Chain Information. | |
280 */ | |
281 typedef struct { | |
282 uint16_t zero_1; | |
283 uint8_t nr_of_programs; | |
284 uint8_t nr_of_cells; | |
285 dvd_time_t playback_time; | |
286 user_ops_t prohibited_ops; | |
287 uint16_t audio_control[8]; /* New type? */ | |
288 uint32_t subp_control[32]; /* New type? */ | |
289 uint16_t next_pgc_nr; | |
290 uint16_t prev_pgc_nr; | |
291 uint16_t goup_pgc_nr; | |
292 uint8_t still_time; | |
293 uint8_t pg_playback_mode; | |
294 uint32_t palette[16]; /* New type struct {zero_1, Y, Cr, Cb} ? */ | |
295 uint16_t command_tbl_offset; | |
296 uint16_t program_map_offset; | |
297 uint16_t cell_playback_offset; | |
298 uint16_t cell_position_offset; | |
299 pgc_command_tbl_t *command_tbl; | |
300 pgc_program_map_t *program_map; | |
301 cell_playback_t *cell_playback; | |
302 cell_position_t *cell_position; | |
303 } ATTRIBUTE_PACKED pgc_t; | |
304 #define PGC_SIZE 236U | |
305 | |
306 /** | |
307 * Program Chain Information Search Pointer. | |
308 */ | |
309 typedef struct { | |
310 uint8_t entry_id; | |
311 unsigned int block_mode : 2; | |
312 unsigned int block_type : 2; | |
313 unsigned int unknown1 : 4; | |
314 uint16_t ptl_id_mask; | |
315 uint32_t pgc_start_byte; | |
316 pgc_t *pgc; | |
317 } ATTRIBUTE_PACKED pgci_srp_t; | |
318 #define PGCI_SRP_SIZE 8U | |
319 | |
320 /** | |
321 * Program Chain Information Table. | |
322 */ | |
323 typedef struct { | |
324 uint16_t nr_of_pgci_srp; | |
325 uint16_t zero_1; | |
326 uint32_t last_byte; | |
327 pgci_srp_t *pgci_srp; | |
328 } ATTRIBUTE_PACKED pgcit_t; | |
329 #define PGCIT_SIZE 8U | |
330 | |
331 /** | |
332 * Menu PGCI Language Unit. | |
333 */ | |
334 typedef struct { | |
335 uint16_t lang_code; | |
336 uint8_t lang_extension; | |
337 uint8_t exists; | |
338 uint32_t lang_start_byte; | |
339 pgcit_t *pgcit; | |
340 } ATTRIBUTE_PACKED pgci_lu_t; | |
341 #define PGCI_LU_SIZE 8U | |
342 | |
343 /** | |
344 * Menu PGCI Unit Table. | |
345 */ | |
346 typedef struct { | |
347 uint16_t nr_of_lus; | |
348 uint16_t zero_1; | |
349 uint32_t last_byte; | |
350 pgci_lu_t *lu; | |
351 } ATTRIBUTE_PACKED pgci_ut_t; | |
352 #define PGCI_UT_SIZE 8U | |
353 | |
354 /** | |
355 * Cell Address Information. | |
356 */ | |
357 typedef struct { | |
358 uint16_t vob_id; | |
359 uint8_t cell_id; | |
360 uint8_t zero_1; | |
361 uint32_t start_sector; | |
362 uint32_t last_sector; | |
363 } ATTRIBUTE_PACKED cell_adr_t; | |
364 | |
365 /** | |
366 * Cell Address Table. | |
367 */ | |
368 typedef struct { | |
369 uint16_t nr_of_vobs; /* VOBs */ | |
370 uint16_t zero_1; | |
371 uint32_t last_byte; | |
372 cell_adr_t *cell_adr_table; /* No explicit size given. */ | |
373 } ATTRIBUTE_PACKED c_adt_t; | |
374 #define C_ADT_SIZE 8U | |
375 | |
376 /** | |
377 * VOBU Address Map. | |
378 */ | |
379 typedef struct { | |
380 uint32_t last_byte; | |
381 uint32_t *vobu_start_sectors; | |
382 } ATTRIBUTE_PACKED vobu_admap_t; | |
383 #define VOBU_ADMAP_SIZE 4U | |
384 | |
385 | |
386 | |
387 | |
388 /** | |
389 * VMGI | |
390 * | |
391 * The following structures relate to the Video Manager. | |
392 */ | |
393 | |
394 /** | |
395 * Video Manager Information Management Table. | |
396 */ | |
397 typedef struct { | |
398 char vmg_identifier[12]; | |
399 uint32_t vmg_last_sector; | |
400 uint8_t zero_1[12]; | |
401 uint32_t vmgi_last_sector; | |
402 uint8_t zero_2; | |
403 uint8_t specification_version; | |
404 uint32_t vmg_category; | |
405 uint16_t vmg_nr_of_volumes; | |
406 uint16_t vmg_this_volume_nr; | |
407 uint8_t disc_side; | |
408 uint8_t zero_3[19]; | |
409 uint16_t vmg_nr_of_title_sets; /* Number of VTSs. */ | |
410 char provider_identifier[32]; | |
411 uint64_t vmg_pos_code; | |
412 uint8_t zero_4[24]; | |
413 uint32_t vmgi_last_byte; | |
414 uint32_t first_play_pgc; | |
415 uint8_t zero_5[56]; | |
416 uint32_t vmgm_vobs; /* sector */ | |
417 uint32_t tt_srpt; /* sector */ | |
418 uint32_t vmgm_pgci_ut; /* sector */ | |
419 uint32_t ptl_mait; /* sector */ | |
420 uint32_t vts_atrt; /* sector */ | |
421 uint32_t txtdt_mgi; /* sector */ | |
422 uint32_t vmgm_c_adt; /* sector */ | |
423 uint32_t vmgm_vobu_admap; /* sector */ | |
424 uint8_t zero_6[32]; | |
20 | 425 |
3 | 426 video_attr_t vmgm_video_attr; |
427 uint8_t zero_7; | |
428 uint8_t nr_of_vmgm_audio_streams; /* should be 0 or 1 */ | |
429 audio_attr_t vmgm_audio_attr; | |
430 audio_attr_t zero_8[7]; | |
431 uint8_t zero_9[17]; | |
432 uint8_t nr_of_vmgm_subp_streams; /* should be 0 or 1 */ | |
433 subp_attr_t vmgm_subp_attr; | |
434 subp_attr_t zero_10[27]; /* XXX: how much 'padding' here? */ | |
435 } ATTRIBUTE_PACKED vmgi_mat_t; | |
436 | |
437 typedef struct { | |
438 unsigned int zero_1 : 1; | |
439 unsigned int multi_or_random_pgc_title : 1; /* 0: one sequential pgc title */ | |
440 unsigned int jlc_exists_in_cell_cmd : 1; | |
441 unsigned int jlc_exists_in_prepost_cmd : 1; | |
442 unsigned int jlc_exists_in_button_cmd : 1; | |
443 unsigned int jlc_exists_in_tt_dom : 1; | |
444 unsigned int chapter_search_or_play : 1; /* UOP 1 */ | |
445 unsigned int title_or_time_play : 1; /* UOP 0 */ | |
446 } ATTRIBUTE_PACKED playback_type_t; | |
447 | |
448 /** | |
449 * Title Information. | |
450 */ | |
451 typedef struct { | |
452 playback_type_t pb_ty; | |
453 uint8_t nr_of_angles; | |
454 uint16_t nr_of_ptts; | |
455 uint16_t parental_id; | |
456 uint8_t title_set_nr; | |
457 uint8_t vts_ttn; | |
458 uint32_t title_set_sector; | |
459 } ATTRIBUTE_PACKED title_info_t; | |
460 | |
461 /** | |
462 * PartOfTitle Search Pointer Table. | |
463 */ | |
464 typedef struct { | |
465 uint16_t nr_of_srpts; | |
466 uint16_t zero_1; | |
467 uint32_t last_byte; | |
468 title_info_t *title; | |
469 } ATTRIBUTE_PACKED tt_srpt_t; | |
470 #define TT_SRPT_SIZE 8U | |
471 | |
472 | |
473 /** | |
474 * Parental Management Information Unit Table. | |
475 * Level 1 (US: G), ..., 7 (US: NC-17), 8 | |
476 */ | |
477 typedef uint16_t pf_level_t[8]; | |
478 | |
479 /** | |
480 * Parental Management Information Unit Table. | |
481 */ | |
482 typedef struct { | |
483 uint16_t country_code; | |
484 uint16_t zero_1; | |
485 uint16_t pf_ptl_mai_start_byte; | |
486 uint16_t zero_2; | |
487 pf_level_t *pf_ptl_mai; /* table of (nr_of_vtss + 1), video_ts is first */ | |
488 } ATTRIBUTE_PACKED ptl_mait_country_t; | |
489 #define PTL_MAIT_COUNTRY_SIZE 8U | |
490 | |
491 /** | |
492 * Parental Management Information Table. | |
493 */ | |
494 typedef struct { | |
495 uint16_t nr_of_countries; | |
496 uint16_t nr_of_vtss; | |
497 uint32_t last_byte; | |
498 ptl_mait_country_t *countries; | |
499 } ATTRIBUTE_PACKED ptl_mait_t; | |
500 #define PTL_MAIT_SIZE 8U | |
501 | |
502 /** | |
503 * Video Title Set Attributes. | |
504 */ | |
505 typedef struct { | |
506 uint32_t last_byte; | |
507 uint32_t vts_cat; | |
20 | 508 |
3 | 509 video_attr_t vtsm_vobs_attr; |
510 uint8_t zero_1; | |
511 uint8_t nr_of_vtsm_audio_streams; /* should be 0 or 1 */ | |
512 audio_attr_t vtsm_audio_attr; | |
20 | 513 audio_attr_t zero_2[7]; |
3 | 514 uint8_t zero_3[16]; |
515 uint8_t zero_4; | |
516 uint8_t nr_of_vtsm_subp_streams; /* should be 0 or 1 */ | |
517 subp_attr_t vtsm_subp_attr; | |
518 subp_attr_t zero_5[27]; | |
20 | 519 |
3 | 520 uint8_t zero_6[2]; |
20 | 521 |
3 | 522 video_attr_t vtstt_vobs_video_attr; |
523 uint8_t zero_7; | |
524 uint8_t nr_of_vtstt_audio_streams; | |
525 audio_attr_t vtstt_audio_attr[8]; | |
526 uint8_t zero_8[16]; | |
527 uint8_t zero_9; | |
528 uint8_t nr_of_vtstt_subp_streams; | |
529 subp_attr_t vtstt_subp_attr[32]; | |
530 } ATTRIBUTE_PACKED vts_attributes_t; | |
531 #define VTS_ATTRIBUTES_SIZE 542U | |
532 #define VTS_ATTRIBUTES_MIN_SIZE 356U | |
533 | |
534 /** | |
535 * Video Title Set Attribute Table. | |
536 */ | |
537 typedef struct { | |
538 uint16_t nr_of_vtss; | |
539 uint16_t zero_1; | |
540 uint32_t last_byte; | |
541 vts_attributes_t *vts; | |
542 uint32_t *vts_atrt_offsets; /* offsets table for each vts_attributes */ | |
543 } ATTRIBUTE_PACKED vts_atrt_t; | |
544 #define VTS_ATRT_SIZE 8U | |
545 | |
546 /** | |
547 * Text Data. (Incomplete) | |
548 */ | |
549 typedef struct { | |
550 uint32_t last_byte; /* offsets are relative here */ | |
551 uint16_t offsets[100]; /* == nr_of_srpts + 1 (first is disc title) */ | |
20 | 552 #if 0 |
3 | 553 uint16_t unknown; /* 0x48 ?? 0x48 words (16bit) info following */ |
554 uint16_t zero_1; | |
20 | 555 |
3 | 556 uint8_t type_of_info; /* ?? 01 == disc, 02 == Title, 04 == Title part */ |
557 uint8_t unknown1; | |
558 uint8_t unknown2; | |
559 uint8_t unknown3; | |
560 uint8_t unknown4; /* ?? allways 0x30 language?, text format? */ | |
561 uint8_t unknown5; | |
562 uint16_t offset; /* from first */ | |
20 | 563 |
3 | 564 char text[12]; /* ended by 0x09 */ |
565 #endif | |
566 } ATTRIBUTE_PACKED txtdt_t; | |
567 | |
568 /** | |
569 * Text Data Language Unit. (Incomplete) | |
20 | 570 */ |
3 | 571 typedef struct { |
572 uint16_t lang_code; | |
573 uint16_t unknown; /* 0x0001, title 1? disc 1? side 1? */ | |
574 uint32_t txtdt_start_byte; /* prt, rel start of vmg_txtdt_mgi */ | |
575 txtdt_t *txtdt; | |
576 } ATTRIBUTE_PACKED txtdt_lu_t; | |
577 #define TXTDT_LU_SIZE 8U | |
578 | |
579 /** | |
580 * Text Data Manager Information. (Incomplete) | |
581 */ | |
582 typedef struct { | |
583 char disc_name[14]; /* how many bytes?? */ | |
584 uint16_t nr_of_language_units; /* 32bit?? */ | |
585 uint32_t last_byte; | |
586 txtdt_lu_t *lu; | |
587 } ATTRIBUTE_PACKED txtdt_mgi_t; | |
588 #define TXTDT_MGI_SIZE 20U | |
589 | |
590 | |
591 /** | |
592 * VTS | |
593 * | |
594 * Structures relating to the Video Title Set (VTS). | |
595 */ | |
596 | |
597 /** | |
598 * Video Title Set Information Management Table. | |
599 */ | |
600 typedef struct { | |
601 char vts_identifier[12]; | |
602 uint32_t vts_last_sector; | |
603 uint8_t zero_1[12]; | |
604 uint32_t vtsi_last_sector; | |
605 uint8_t zero_2; | |
606 uint8_t specification_version; | |
607 uint32_t vts_category; | |
608 uint16_t zero_3; | |
609 uint16_t zero_4; | |
610 uint8_t zero_5; | |
611 uint8_t zero_6[19]; | |
612 uint16_t zero_7; | |
613 uint8_t zero_8[32]; | |
614 uint64_t zero_9; | |
615 uint8_t zero_10[24]; | |
616 uint32_t vtsi_last_byte; | |
617 uint32_t zero_11; | |
618 uint8_t zero_12[56]; | |
619 uint32_t vtsm_vobs; /* sector */ | |
620 uint32_t vtstt_vobs; /* sector */ | |
621 uint32_t vts_ptt_srpt; /* sector */ | |
622 uint32_t vts_pgcit; /* sector */ | |
623 uint32_t vtsm_pgci_ut; /* sector */ | |
624 uint32_t vts_tmapt; /* sector */ | |
625 uint32_t vtsm_c_adt; /* sector */ | |
626 uint32_t vtsm_vobu_admap; /* sector */ | |
627 uint32_t vts_c_adt; /* sector */ | |
628 uint32_t vts_vobu_admap; /* sector */ | |
629 uint8_t zero_13[24]; | |
20 | 630 |
3 | 631 video_attr_t vtsm_video_attr; |
632 uint8_t zero_14; | |
633 uint8_t nr_of_vtsm_audio_streams; /* should be 0 or 1 */ | |
634 audio_attr_t vtsm_audio_attr; | |
635 audio_attr_t zero_15[7]; | |
636 uint8_t zero_16[17]; | |
637 uint8_t nr_of_vtsm_subp_streams; /* should be 0 or 1 */ | |
638 subp_attr_t vtsm_subp_attr; | |
639 subp_attr_t zero_17[27]; | |
640 uint8_t zero_18[2]; | |
20 | 641 |
3 | 642 video_attr_t vts_video_attr; |
643 uint8_t zero_19; | |
644 uint8_t nr_of_vts_audio_streams; | |
645 audio_attr_t vts_audio_attr[8]; | |
646 uint8_t zero_20[17]; | |
647 uint8_t nr_of_vts_subp_streams; | |
648 subp_attr_t vts_subp_attr[32]; | |
649 uint16_t zero_21; | |
650 multichannel_ext_t vts_mu_audio_attr[8]; | |
651 /* XXX: how much 'padding' here, if any? */ | |
652 } ATTRIBUTE_PACKED vtsi_mat_t; | |
653 | |
654 /** | |
655 * PartOfTitle Unit Information. | |
656 */ | |
657 typedef struct { | |
658 uint16_t pgcn; | |
659 uint16_t pgn; | |
660 } ATTRIBUTE_PACKED ptt_info_t; | |
661 | |
662 /** | |
663 * PartOfTitle Information. | |
664 */ | |
665 typedef struct { | |
666 uint16_t nr_of_ptts; | |
667 ptt_info_t *ptt; | |
668 } ATTRIBUTE_PACKED ttu_t; | |
669 | |
670 /** | |
671 * PartOfTitle Search Pointer Table. | |
672 */ | |
673 typedef struct { | |
674 uint16_t nr_of_srpts; | |
675 uint16_t zero_1; | |
676 uint32_t last_byte; | |
677 ttu_t *title; | |
678 uint32_t *ttu_offset; /* offset table for each ttu */ | |
679 } ATTRIBUTE_PACKED vts_ptt_srpt_t; | |
680 #define VTS_PTT_SRPT_SIZE 8U | |
681 | |
682 | |
683 /** | |
684 * Time Map Entry. | |
685 */ | |
686 /* Should this be bit field at all or just the uint32_t? */ | |
687 typedef uint32_t map_ent_t; | |
688 | |
689 /** | |
690 * Time Map. | |
691 */ | |
692 typedef struct { | |
693 uint8_t tmu; /* Time unit, in seconds */ | |
694 uint8_t zero_1; | |
695 uint16_t nr_of_entries; | |
696 map_ent_t *map_ent; | |
697 } ATTRIBUTE_PACKED vts_tmap_t; | |
698 #define VTS_TMAP_SIZE 4U | |
699 | |
700 /** | |
701 * Time Map Table. | |
702 */ | |
703 typedef struct { | |
704 uint16_t nr_of_tmaps; | |
705 uint16_t zero_1; | |
706 uint32_t last_byte; | |
707 vts_tmap_t *tmap; | |
708 uint32_t *tmap_offset; /* offset table for each tmap */ | |
709 } ATTRIBUTE_PACKED vts_tmapt_t; | |
710 #define VTS_TMAPT_SIZE 8U | |
711 | |
712 | |
713 #if PRAGMA_PACK | |
714 #pragma pack() | |
715 #endif | |
716 | |
717 | |
718 /** | |
719 * The following structure defines an IFO file. The structure is divided into | |
720 * two parts, the VMGI, or Video Manager Information, which is read from the | |
721 * VIDEO_TS.[IFO,BUP] file, and the VTSI, or Video Title Set Information, which | |
722 * is read in from the VTS_XX_0.[IFO,BUP] files. | |
723 */ | |
724 typedef struct { | |
725 dvd_file_t *file; | |
20 | 726 |
3 | 727 /* VMGI */ |
728 vmgi_mat_t *vmgi_mat; | |
729 tt_srpt_t *tt_srpt; | |
20 | 730 pgc_t *first_play_pgc; |
3 | 731 ptl_mait_t *ptl_mait; |
732 vts_atrt_t *vts_atrt; | |
733 txtdt_mgi_t *txtdt_mgi; | |
20 | 734 |
3 | 735 /* Common */ |
736 pgci_ut_t *pgci_ut; | |
737 c_adt_t *menu_c_adt; | |
738 vobu_admap_t *menu_vobu_admap; | |
20 | 739 |
3 | 740 /* VTSI */ |
741 vtsi_mat_t *vtsi_mat; | |
742 vts_ptt_srpt_t *vts_ptt_srpt; | |
743 pgcit_t *vts_pgcit; | |
744 vts_tmapt_t *vts_tmapt; | |
745 c_adt_t *vts_c_adt; | |
746 vobu_admap_t *vts_vobu_admap; | |
747 } ifo_handle_t; | |
748 | |
749 #endif /* IFO_TYPES_H_INCLUDED */ |