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