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