Mercurial > libdvdread4.hg
annotate ifo_print.c @ 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 | 3552a3d11604 |
rev | line source |
---|---|
20 | 1 /* |
21
4aa618ae094f
Use consistent license headers everywhere: Fix FSF address and boilerplate.
diego
parents:
20
diff
changeset
|
2 * This file is part of libdvdread. |
4aa618ae094f
Use consistent license headers everywhere: Fix FSF address and boilerplate.
diego
parents:
20
diff
changeset
|
3 * |
4aa618ae094f
Use consistent license headers everywhere: Fix FSF address and boilerplate.
diego
parents:
20
diff
changeset
|
4 * libdvdread is free software; you can redistribute it and/or modify |
3 | 5 * it under the terms of the GNU General Public License as published by |
6 * the Free Software Foundation; either version 2 of the License, or | |
7 * (at your option) any later version. | |
8 * | |
21
4aa618ae094f
Use consistent license headers everywhere: Fix FSF address and boilerplate.
diego
parents:
20
diff
changeset
|
9 * libdvdread is distributed in the hope that it will be useful, |
3 | 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
12 * GNU General Public License for more details. | |
13 * | |
21
4aa618ae094f
Use consistent license headers everywhere: Fix FSF address and boilerplate.
diego
parents:
20
diff
changeset
|
14 * 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
|
15 * 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
|
16 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. |
3 | 17 * |
18 * $Id$ | |
19 * | |
20 */ | |
21 | |
22 #include <stdio.h> | |
23 #include <stdlib.h> | |
24 #include <unistd.h> | |
25 #include <inttypes.h> | |
26 #include <string.h> | |
27 #include <ctype.h> | |
28 #include <assert.h> | |
29 | |
30 #include "ifo_types.h" | |
31 #include "ifo_read.h" | |
32 #include "ifo_print.h" | |
33 | |
34 /* Put this in some other file / package? It's used in nav_print too. */ | |
35 static void ifo_print_time(int level, dvd_time_t *dtime) { | |
36 const char *rate; | |
37 assert((dtime->hour>>4) < 0xa && (dtime->hour&0xf) < 0xa); | |
38 assert((dtime->minute>>4) < 0x7 && (dtime->minute&0xf) < 0xa); | |
39 assert((dtime->second>>4) < 0x7 && (dtime->second&0xf) < 0xa); | |
40 assert((dtime->frame_u&0xf) < 0xa); | |
20 | 41 |
42 printf("%02x:%02x:%02x.%02x", | |
3 | 43 dtime->hour, |
44 dtime->minute, | |
45 dtime->second, | |
46 dtime->frame_u & 0x3f); | |
47 switch((dtime->frame_u & 0xc0) >> 6) { | |
48 case 1: | |
49 rate = "25.00"; | |
50 break; | |
51 case 3: | |
52 rate = "29.97"; | |
53 break; | |
54 default: | |
20 | 55 if(dtime->hour == 0 && dtime->minute == 0 |
3 | 56 && dtime->second == 0 && dtime->frame_u == 0) |
57 rate = "no"; | |
58 else | |
59 rate = "(please send a bug report)"; | |
60 break; | |
20 | 61 } |
3 | 62 printf(" @ %s fps", rate); |
63 } | |
64 | |
13
4e610984cc3f
added dvdread_print_time() and removed the file-static print_time() in nav_print.c; based on a patch by Erik Hovland org
nicodvb
parents:
4
diff
changeset
|
65 void dvdread_print_time(dvd_time_t *dtime) { |
4e610984cc3f
added dvdread_print_time() and removed the file-static print_time() in nav_print.c; based on a patch by Erik Hovland org
nicodvb
parents:
4
diff
changeset
|
66 ifo_print_time(5, dtime); |
4e610984cc3f
added dvdread_print_time() and removed the file-static print_time() in nav_print.c; based on a patch by Erik Hovland org
nicodvb
parents:
4
diff
changeset
|
67 } |
4e610984cc3f
added dvdread_print_time() and removed the file-static print_time() in nav_print.c; based on a patch by Erik Hovland org
nicodvb
parents:
4
diff
changeset
|
68 |
3 | 69 /* Put this in some other file / package? It's used in nav_print too. |
70 Possibly also by the vm / navigator. */ | |
71 static void ifo_print_cmd(int row, vm_cmd_t *command) { | |
72 int i; | |
73 | |
74 printf("(%03d) ", row + 1); | |
75 for(i=0;i<8;i++) | |
76 printf("%02x ", command->bytes[i]); | |
77 printf("| "); | |
78 #if 0 | |
79 //disabled call of dvdnav function | |
80 vm_print_mnemonic(command); | |
81 #endif | |
82 printf("\n"); | |
83 } | |
84 | |
85 static void ifo_print_video_attributes(int level, video_attr_t *attr) { | |
20 | 86 |
3 | 87 /* The following test is shorter but not correct ISO C, |
88 memcmp(attr,my_friendly_zeros, sizeof(video_attr_t)) */ | |
20 | 89 if(attr->mpeg_version == 0 |
90 && attr->video_format == 0 | |
91 && attr->display_aspect_ratio == 0 | |
92 && attr->permitted_df == 0 | |
93 && attr->unknown1 == 0 | |
94 && attr->line21_cc_1 == 0 | |
95 && attr->line21_cc_2 == 0 | |
96 && attr->video_format == 0 | |
97 && attr->letterboxed == 0 | |
3 | 98 && attr->film_mode == 0) { |
99 printf("-- Unspecified --"); | |
100 return; | |
101 } | |
20 | 102 |
3 | 103 switch(attr->mpeg_version) { |
104 case 0: | |
105 printf("mpeg1, "); | |
106 break; | |
107 case 1: | |
108 printf("mpeg2, "); | |
109 break; | |
110 default: | |
111 printf("(please send a bug report), "); | |
112 } | |
20 | 113 |
3 | 114 switch(attr->video_format) { |
115 case 0: | |
116 printf("ntsc, "); | |
117 break; | |
118 case 1: | |
119 printf("pal, "); | |
120 break; | |
121 default: | |
122 printf("(please send a bug report), "); | |
123 } | |
20 | 124 |
3 | 125 switch(attr->display_aspect_ratio) { |
126 case 0: | |
127 printf("4:3, "); | |
128 break; | |
129 case 3: | |
130 printf("16:9, "); | |
131 break; | |
132 default: | |
133 printf("(please send a bug report), "); | |
134 } | |
20 | 135 |
3 | 136 // Wide is allways allowed..!!! |
137 switch(attr->permitted_df) { | |
138 case 0: | |
139 printf("pan&scan+letterboxed, "); | |
140 break; | |
141 case 1: | |
142 printf("only pan&scan, "); //?? | |
143 break; | |
144 case 2: | |
145 printf("only letterboxed, "); | |
146 break; | |
147 case 3: | |
148 printf("not specified, "); | |
149 break; | |
150 default: | |
151 printf("(please send a bug report), "); | |
152 } | |
20 | 153 |
3 | 154 printf("U%x, ", attr->unknown1); |
155 assert(!attr->unknown1); | |
20 | 156 |
3 | 157 if(attr->line21_cc_1 || attr->line21_cc_2) { |
158 printf("NTSC CC "); | |
159 if(attr->line21_cc_1) | |
160 printf("1, "); | |
161 if(attr->line21_cc_2) | |
162 printf("2, "); | |
163 } | |
20 | 164 |
3 | 165 { |
166 int height = 480; | |
20 | 167 if(attr->video_format != 0) |
3 | 168 height = 576; |
169 switch(attr->picture_size) { | |
170 case 0: | |
171 printf("720x%d, ", height); | |
172 break; | |
173 case 1: | |
174 printf("704x%d, ", height); | |
175 break; | |
176 case 2: | |
177 printf("352x%d, ", height); | |
178 break; | |
179 case 3: | |
180 printf("352x%d, ", height/2); | |
20 | 181 break; |
3 | 182 default: |
183 printf("(please send a bug report), "); | |
184 } | |
185 } | |
186 | |
187 if(attr->letterboxed) { | |
188 printf("source letterboxed, "); | |
189 } | |
20 | 190 |
3 | 191 if(attr->film_mode) { |
192 printf("film. "); | |
193 } else { | |
194 printf("video. "); //camera | |
195 } | |
196 } | |
197 | |
198 static void ifo_print_audio_attributes(int level, audio_attr_t *attr) { | |
20 | 199 |
3 | 200 if(attr->audio_format == 0 |
201 && attr->multichannel_extension == 0 | |
202 && attr->lang_type == 0 | |
203 && attr->application_mode == 0 | |
204 && attr->quantization == 0 | |
205 && attr->sample_frequency == 0 | |
206 && attr->channels == 0 | |
207 && attr->lang_extension == 0 | |
208 && attr->unknown1 == 0 | |
209 && attr->unknown3 == 0) { | |
210 printf("-- Unspecified --"); | |
211 return; | |
212 } | |
20 | 213 |
3 | 214 switch(attr->audio_format) { |
215 case 0: | |
216 printf("ac3 "); | |
217 if(attr->quantization != 3) | |
218 printf("(please send a bug report) ac3 quant/drc not 3 (%d)", attr->quantization); | |
219 break; | |
220 case 1: | |
221 printf("(please send a bug report) "); | |
222 break; | |
223 case 2: | |
224 printf("mpeg1 "); | |
225 case 3: | |
226 printf("mpeg2ext "); | |
227 switch(attr->quantization) { | |
228 case 0: | |
229 printf("no drc "); | |
230 break; | |
231 case 1: | |
232 printf("drc "); | |
233 break; | |
234 default: | |
20 | 235 printf("(please send a bug report) mpeg reserved quant/drc (%d)", attr->quantization); |
3 | 236 } |
237 break; | |
238 case 4: | |
239 printf("lpcm "); | |
240 switch(attr->quantization) { | |
241 case 0: | |
242 printf("16bit "); | |
243 break; | |
244 case 1: | |
245 printf("20bit "); | |
246 break; | |
247 case 2: | |
248 printf("24bit "); | |
249 break; | |
250 case 3: | |
251 printf("(please send a bug report) lpcm reserved quant/drc (%d)", attr->quantization); | |
252 break; | |
253 } | |
254 break; | |
255 case 5: | |
256 printf("(please send a bug report) "); | |
257 break; | |
258 case 6: | |
259 printf("dts "); | |
260 if(attr->quantization != 3) | |
261 printf("(please send a bug report) dts quant/drc not 3 (%d)", attr->quantization); | |
262 break; | |
263 default: | |
264 printf("(please send a bug report) "); | |
265 } | |
20 | 266 |
3 | 267 if(attr->multichannel_extension) |
268 printf("multichannel_extension "); | |
20 | 269 |
3 | 270 switch(attr->lang_type) { |
271 case 0: | |
272 // not specified | |
273 assert(attr->lang_code == 0 || attr->lang_code == 0xffff); | |
274 break; | |
275 case 1: | |
276 printf("%c%c ", attr->lang_code>>8, attr->lang_code & 0xff); | |
277 break; | |
278 default: | |
279 printf("(please send a bug report) "); | |
280 } | |
281 | |
282 switch(attr->application_mode) { | |
283 case 0: | |
284 // not specified | |
285 break; | |
286 case 1: | |
287 printf("karaoke mode "); | |
288 break; | |
289 case 2: | |
290 printf("surround sound mode "); | |
291 break; | |
292 default: | |
293 printf("(please send a bug report) "); | |
294 } | |
20 | 295 |
3 | 296 switch(attr->quantization) { |
297 case 0: | |
298 printf("16bit "); | |
299 break; | |
300 case 1: | |
301 printf("20bit "); | |
302 break; | |
303 case 2: | |
304 printf("24bit "); | |
305 break; | |
306 case 3: | |
307 printf("drc "); | |
308 break; | |
309 default: | |
310 printf("(please send a bug report) "); | |
311 } | |
20 | 312 |
3 | 313 switch(attr->sample_frequency) { |
314 case 0: | |
315 printf("48kHz "); | |
316 break; | |
317 case 1: | |
318 printf("??kHz "); | |
319 break; | |
320 default: | |
20 | 321 printf("sample_frequency %i (please send a bug report) ", |
3 | 322 attr->sample_frequency); |
323 } | |
20 | 324 |
3 | 325 printf("%dCh ", attr->channels + 1); |
20 | 326 |
3 | 327 switch(attr->lang_extension) { |
328 case 0: | |
329 printf("Not specified "); | |
330 break; | |
331 case 1: // Normal audio | |
332 printf("Normal Caption "); | |
333 break; | |
334 case 2: // visually imparied | |
335 printf("Audio for visually impaired "); | |
336 break; | |
337 case 3: // Directors 1 | |
338 printf("Director's comments 1 "); | |
339 break; | |
340 case 4: // Directors 2 | |
341 printf("Director's comments 2 "); | |
342 break; | |
20 | 343 //case 4: // Music score ? |
3 | 344 default: |
345 printf("(please send a bug report) "); | |
346 } | |
20 | 347 |
3 | 348 printf("%d ", attr->unknown1); |
349 printf("%d ", attr->unknown3); | |
350 } | |
351 | |
352 static void ifo_print_subp_attributes(int level, subp_attr_t *attr) { | |
20 | 353 |
3 | 354 if(attr->type == 0 |
355 && attr->lang_code == 0 | |
356 && attr->zero1 == 0 | |
357 && attr->zero2 == 0 | |
358 && attr->lang_extension== 0) { | |
359 printf("-- Unspecified --"); | |
360 return; | |
361 } | |
20 | 362 |
3 | 363 printf("type %02x ", attr->type); |
20 | 364 |
3 | 365 if(isalpha((int)(attr->lang_code >> 8)) |
366 && isalpha((int)(attr->lang_code & 0xff))) { | |
367 printf("%c%c ", attr->lang_code >> 8, attr->lang_code & 0xff); | |
368 } else { | |
20 | 369 printf("%02x%02x ", 0xff & (unsigned)(attr->lang_code >> 8), |
3 | 370 0xff & (unsigned)(attr->lang_code & 0xff)); |
371 } | |
20 | 372 |
3 | 373 printf("%d ", attr->zero1); |
374 printf("%d ", attr->zero2); | |
375 | |
376 switch(attr->lang_extension) { | |
377 case 0: | |
378 printf("Not specified "); | |
379 break; | |
380 case 1: | |
381 printf("Caption with normal size character "); | |
382 break; | |
383 case 2: | |
384 printf("Caption with bigger size character "); | |
385 break; | |
20 | 386 case 3: |
3 | 387 printf("Caption for children "); |
388 break; | |
389 case 4: | |
390 printf("reserved "); | |
391 break; | |
392 case 5: | |
393 printf("Closed Caption with normal size character "); | |
394 break; | |
395 case 6: | |
396 printf("Closed Caption with bigger size character "); | |
397 break; | |
398 case 7: | |
399 printf("Closed Caption for children "); | |
400 break; | |
401 case 8: | |
402 printf("reserved "); | |
403 break; | |
404 case 9: | |
405 printf("Forced Caption"); | |
406 break; | |
407 case 10: | |
408 printf("reserved "); | |
409 break; | |
410 case 11: | |
411 printf("reserved "); | |
412 break; | |
413 case 12: | |
414 printf("reserved "); | |
415 break; | |
416 case 13: | |
417 printf("Director's comments with normal size character "); | |
418 break; | |
419 case 14: | |
420 printf("Director's comments with bigger size character "); | |
421 break; | |
422 case 15: | |
423 printf("Director's comments for children "); | |
424 break; | |
425 default: | |
426 printf("(please send a bug report) "); | |
427 } | |
428 | |
429 } | |
430 | |
431 | |
432 static void ifo_print_USER_OPS(user_ops_t *user_ops) { | |
433 uint32_t uops; | |
434 unsigned char *ptr = (unsigned char *)user_ops; | |
20 | 435 |
3 | 436 uops = (*ptr++ << 24); |
437 uops |= (*ptr++ << 16); | |
438 uops |= (*ptr++ << 8); | |
439 uops |= (*ptr++); | |
20 | 440 |
3 | 441 if(uops == 0) { |
442 printf("None\n"); | |
443 } else if(uops == 0x01ffffff) { | |
444 printf("All\n"); | |
445 } else { | |
446 if(user_ops->title_or_time_play) | |
447 printf("Title or Time Play, "); | |
448 if(user_ops->chapter_search_or_play) | |
449 printf("Chapter Search or Play, "); | |
450 if(user_ops->title_play) | |
451 printf("Title Play, "); | |
452 if(user_ops->stop) | |
453 printf("Stop, "); | |
454 if(user_ops->go_up) | |
455 printf("Go Up, "); | |
456 if(user_ops->time_or_chapter_search) | |
457 printf("Time or Chapter Search, "); | |
458 if(user_ops->prev_or_top_pg_search) | |
459 printf("Prev or Top PG Search, "); | |
460 if(user_ops->next_pg_search) | |
461 printf("Next PG Search, "); | |
462 if(user_ops->forward_scan) | |
463 printf("Forward Scan, "); | |
464 if(user_ops->backward_scan) | |
465 printf("Backward Scan, "); | |
466 if(user_ops->title_menu_call) | |
467 printf("Title Menu Call, "); | |
468 if(user_ops->root_menu_call) | |
469 printf("Root Menu Call, "); | |
470 if(user_ops->subpic_menu_call) | |
471 printf("SubPic Menu Call, "); | |
472 if(user_ops->audio_menu_call) | |
473 printf("Audio Menu Call, "); | |
474 if(user_ops->angle_menu_call) | |
475 printf("Angle Menu Call, "); | |
476 if(user_ops->chapter_menu_call) | |
477 printf("Chapter Menu Call, "); | |
478 if(user_ops->resume) | |
479 printf("Resume, "); | |
480 if(user_ops->button_select_or_activate) | |
481 printf("Button Select or Activate, "); | |
482 if(user_ops->still_off) | |
483 printf("Still Off, "); | |
484 if(user_ops->pause_on) | |
485 printf("Pause On, "); | |
486 if(user_ops->audio_stream_change) | |
487 printf("Audio Stream Change, "); | |
488 if(user_ops->subpic_stream_change) | |
489 printf("SubPic Stream Change, "); | |
490 if(user_ops->angle_change) | |
491 printf("Angle Change, "); | |
492 if(user_ops->karaoke_audio_pres_mode_change) | |
493 printf("Karaoke Audio Pres Mode Change, "); | |
494 if(user_ops->video_pres_mode_change) | |
495 printf("Video Pres Mode Change, "); | |
496 printf("\n"); | |
497 } | |
498 } | |
499 | |
500 | |
501 void ifo_print_VMGI_MAT(vmgi_mat_t *vmgi_mat) { | |
20 | 502 |
3 | 503 printf("VMG Identifier: %.12s\n", vmgi_mat->vmg_identifier); |
504 printf("Last Sector of VMG: %08x\n", vmgi_mat->vmg_last_sector); | |
505 printf("Last Sector of VMGI: %08x\n", vmgi_mat->vmgi_last_sector); | |
20 | 506 printf("Specification version number: %01x.%01x\n", |
507 vmgi_mat->specification_version >> 4, | |
3 | 508 vmgi_mat->specification_version & 0xf); |
509 /* Byte 2 of 'VMG Category' (00xx0000) is the Region Code */ | |
510 printf("VMG Category: %08x (Region Code=%02x)\n", vmgi_mat->vmg_category, ((vmgi_mat->vmg_category >> 16) & 0xff) ^0xff); | |
511 printf("VMG Number of Volumes: %i\n", vmgi_mat->vmg_nr_of_volumes); | |
512 printf("VMG This Volume: %i\n", vmgi_mat->vmg_this_volume_nr); | |
513 printf("Disc side %i\n", vmgi_mat->disc_side); | |
514 printf("VMG Number of Title Sets %i\n", vmgi_mat->vmg_nr_of_title_sets); | |
515 printf("Provider ID: %.32s\n", vmgi_mat->provider_identifier); | |
516 printf("VMG POS Code: %08x", (uint32_t)(vmgi_mat->vmg_pos_code >> 32)); | |
517 printf("%08x\n", (uint32_t)vmgi_mat->vmg_pos_code); | |
518 printf("End byte of VMGI_MAT: %08x\n", vmgi_mat->vmgi_last_byte); | |
20 | 519 printf("Start byte of First Play PGC (FP PGC): %08x\n", |
3 | 520 vmgi_mat->first_play_pgc); |
521 printf("Start sector of VMGM_VOBS: %08x\n", vmgi_mat->vmgm_vobs); | |
522 printf("Start sector of TT_SRPT: %08x\n", vmgi_mat->tt_srpt); | |
523 printf("Start sector of VMGM_PGCI_UT: %08x\n", vmgi_mat->vmgm_pgci_ut); | |
524 printf("Start sector of PTL_MAIT: %08x\n", vmgi_mat->ptl_mait); | |
525 printf("Start sector of VTS_ATRT: %08x\n", vmgi_mat->vts_atrt); | |
526 printf("Start sector of TXTDT_MG: %08x\n", vmgi_mat->txtdt_mgi); | |
527 printf("Start sector of VMGM_C_ADT: %08x\n", vmgi_mat->vmgm_c_adt); | |
20 | 528 printf("Start sector of VMGM_VOBU_ADMAP: %08x\n", |
3 | 529 vmgi_mat->vmgm_vobu_admap); |
530 printf("Video attributes of VMGM_VOBS: "); | |
531 ifo_print_video_attributes(5, &vmgi_mat->vmgm_video_attr); | |
532 printf("\n"); | |
20 | 533 printf("VMGM Number of Audio attributes: %i\n", |
3 | 534 vmgi_mat->nr_of_vmgm_audio_streams); |
535 if(vmgi_mat->nr_of_vmgm_audio_streams > 0) { | |
536 printf("\tstream %i status: ", 1); | |
537 ifo_print_audio_attributes(5, &vmgi_mat->vmgm_audio_attr); | |
538 printf("\n"); | |
539 } | |
20 | 540 printf("VMGM Number of Sub-picture attributes: %i\n", |
3 | 541 vmgi_mat->nr_of_vmgm_subp_streams); |
542 if(vmgi_mat->nr_of_vmgm_subp_streams > 0) { | |
543 printf("\tstream %2i status: ", 1); | |
544 ifo_print_subp_attributes(5, &vmgi_mat->vmgm_subp_attr); | |
545 printf("\n"); | |
546 } | |
547 } | |
548 | |
549 | |
550 void ifo_print_VTSI_MAT(vtsi_mat_t *vtsi_mat) { | |
551 int i; | |
552 | |
553 printf("VTS Identifier: %.12s\n", vtsi_mat->vts_identifier); | |
554 printf("Last Sector of VTS: %08x\n", vtsi_mat->vts_last_sector); | |
555 printf("Last Sector of VTSI: %08x\n", vtsi_mat->vtsi_last_sector); | |
20 | 556 printf("Specification version number: %01x.%01x\n", |
557 vtsi_mat->specification_version>>4, | |
3 | 558 vtsi_mat->specification_version&0xf); |
559 printf("VTS Category: %08x\n", vtsi_mat->vts_category); | |
560 printf("End byte of VTSI_MAT: %08x\n", vtsi_mat->vtsi_last_byte); | |
561 printf("Start sector of VTSM_VOBS: %08x\n", vtsi_mat->vtsm_vobs); | |
562 printf("Start sector of VTSTT_VOBS: %08x\n", vtsi_mat->vtstt_vobs); | |
563 printf("Start sector of VTS_PTT_SRPT: %08x\n", vtsi_mat->vts_ptt_srpt); | |
564 printf("Start sector of VTS_PGCIT: %08x\n", vtsi_mat->vts_pgcit); | |
565 printf("Start sector of VTSM_PGCI_UT: %08x\n", vtsi_mat->vtsm_pgci_ut); | |
566 printf("Start sector of VTS_TMAPT: %08x\n", vtsi_mat->vts_tmapt); | |
567 printf("Start sector of VTSM_C_ADT: %08x\n", vtsi_mat->vtsm_c_adt); | |
568 printf("Start sector of VTSM_VOBU_ADMAP: %08x\n",vtsi_mat->vtsm_vobu_admap); | |
569 printf("Start sector of VTS_C_ADT: %08x\n", vtsi_mat->vts_c_adt); | |
570 printf("Start sector of VTS_VOBU_ADMAP: %08x\n", vtsi_mat->vts_vobu_admap); | |
571 | |
572 printf("Video attributes of VTSM_VOBS: "); | |
573 ifo_print_video_attributes(5, &vtsi_mat->vtsm_video_attr); | |
574 printf("\n"); | |
20 | 575 |
576 printf("VTSM Number of Audio attributes: %i\n", | |
3 | 577 vtsi_mat->nr_of_vtsm_audio_streams); |
578 if(vtsi_mat->nr_of_vtsm_audio_streams > 0) { | |
579 printf("\tstream %i status: ", 1); | |
580 ifo_print_audio_attributes(5, &vtsi_mat->vtsm_audio_attr); | |
581 printf("\n"); | |
582 } | |
20 | 583 |
584 printf("VTSM Number of Sub-picture attributes: %i\n", | |
3 | 585 vtsi_mat->nr_of_vtsm_subp_streams); |
586 if(vtsi_mat->nr_of_vtsm_subp_streams > 0) { | |
587 printf("\tstream %2i status: ", 1); | |
588 ifo_print_subp_attributes(5, &vtsi_mat->vtsm_subp_attr); | |
589 printf("\n"); | |
590 } | |
20 | 591 |
3 | 592 printf("Video attributes of VTS_VOBS: "); |
593 ifo_print_video_attributes(5, &vtsi_mat->vts_video_attr); | |
594 printf("\n"); | |
20 | 595 |
596 printf("VTS Number of Audio attributes: %i\n", | |
3 | 597 vtsi_mat->nr_of_vts_audio_streams); |
598 for(i = 0; i < vtsi_mat->nr_of_vts_audio_streams; i++) { | |
599 printf("\tstream %i status: ", i); | |
600 ifo_print_audio_attributes(5, &vtsi_mat->vts_audio_attr[i]); | |
601 printf("\n"); | |
602 } | |
20 | 603 |
604 printf("VTS Number of Subpicture attributes: %i\n", | |
3 | 605 vtsi_mat->nr_of_vts_subp_streams); |
606 for(i = 0; i < vtsi_mat->nr_of_vts_subp_streams; i++) { | |
607 printf("\tstream %2i status: ", i); | |
608 ifo_print_subp_attributes(5, &vtsi_mat->vts_subp_attr[i]); | |
609 printf("\n"); | |
610 } | |
611 } | |
612 | |
613 | |
614 static void ifo_print_PGC_COMMAND_TBL(pgc_command_tbl_t *cmd_tbl) { | |
615 int i; | |
20 | 616 |
3 | 617 if(cmd_tbl == NULL) { |
618 printf("No Command table present\n"); | |
619 return; | |
620 } | |
20 | 621 |
3 | 622 printf("Number of Pre commands: %i\n", cmd_tbl->nr_of_pre); |
623 for(i = 0; i < cmd_tbl->nr_of_pre; i++) { | |
624 ifo_print_cmd(i, &cmd_tbl->pre_cmds[i]); | |
625 } | |
626 | |
627 printf("Number of Post commands: %i\n", cmd_tbl->nr_of_post); | |
628 for(i = 0; i < cmd_tbl->nr_of_post; i++) { | |
629 ifo_print_cmd(i, &cmd_tbl->post_cmds[i]); | |
630 } | |
631 | |
632 printf("Number of Cell commands: %i\n", cmd_tbl->nr_of_cell); | |
633 for(i = 0; i < cmd_tbl->nr_of_cell; i++) { | |
634 ifo_print_cmd(i, &cmd_tbl->cell_cmds[i]); | |
635 } | |
636 } | |
637 | |
638 | |
639 static void ifo_print_PGC_PROGRAM_MAP(pgc_program_map_t *program_map, int nr) { | |
640 int i; | |
20 | 641 |
3 | 642 if(program_map == NULL) { |
643 printf("No Program map present\n"); | |
644 return; | |
645 } | |
20 | 646 |
3 | 647 for(i = 0; i < nr; i++) { |
648 printf("Program %3i Entry Cell: %3i\n", i + 1, program_map[i]); | |
649 } | |
650 } | |
651 | |
652 | |
653 static void ifo_print_CELL_PLAYBACK(cell_playback_t *cell_playback, int nr) { | |
654 int i; | |
20 | 655 |
3 | 656 if(cell_playback == NULL) { |
657 printf("No Cell Playback info present\n"); | |
658 return; | |
659 } | |
20 | 660 |
3 | 661 for(i=0;i<nr;i++) { |
662 printf("Cell: %3i ", i + 1); | |
663 | |
13
4e610984cc3f
added dvdread_print_time() and removed the file-static print_time() in nav_print.c; based on a patch by Erik Hovland org
nicodvb
parents:
4
diff
changeset
|
664 dvdread_print_time(&cell_playback[i].playback_time); |
3 | 665 printf("\t"); |
666 | |
667 if(cell_playback[i].block_mode || cell_playback[i].block_type) { | |
668 const char *s; | |
669 switch(cell_playback[i].block_mode) { | |
670 case 0: | |
671 s = "not a"; break; | |
672 case 1: | |
673 s = "the first"; break; | |
674 case 2: | |
675 default: | |
676 s = ""; break; | |
677 case 3: | |
678 s = "last"; break; | |
679 } | |
680 printf("%s cell in the block ", s); | |
20 | 681 |
3 | 682 switch(cell_playback[i].block_type) { |
683 case 0: | |
684 printf("not part of the block "); | |
685 break; | |
686 case 1: | |
687 printf("angle block "); | |
688 break; | |
689 case 2: | |
690 case 3: | |
691 printf("(send bug repport) "); | |
692 break; | |
693 } | |
694 } | |
695 if(cell_playback[i].seamless_play) | |
696 printf("presented seamlessly "); | |
697 if(cell_playback[i].interleaved) | |
698 printf("cell is interleaved "); | |
699 if(cell_playback[i].stc_discontinuity) | |
700 printf("STC_discontinuty "); | |
701 if(cell_playback[i].seamless_angle) | |
702 printf("only seamless angle "); | |
703 if(cell_playback[i].playback_mode) | |
704 printf("only still VOBUs "); | |
705 if(cell_playback[i].restricted) | |
706 printf("restricted cell "); | |
707 if(cell_playback[i].unknown2) | |
708 printf("Unknown 0x%x ", cell_playback[i].unknown2); | |
709 if(cell_playback[i].still_time) | |
710 printf("still time %d ", cell_playback[i].still_time); | |
711 if(cell_playback[i].cell_cmd_nr) | |
712 printf("cell command %d", cell_playback[i].cell_cmd_nr); | |
20 | 713 |
714 printf("\n\tStart sector: %08x\tFirst ILVU end sector: %08x\n", | |
715 cell_playback[i].first_sector, | |
3 | 716 cell_playback[i].first_ilvu_end_sector); |
20 | 717 printf("\tEnd sector: %08x\tLast VOBU start sector: %08x\n", |
718 cell_playback[i].last_sector, | |
3 | 719 cell_playback[i].last_vobu_start_sector); |
720 } | |
721 } | |
722 | |
723 static void ifo_print_CELL_POSITION(cell_position_t *cell_position, int nr) { | |
724 int i; | |
20 | 725 |
3 | 726 if(cell_position == NULL) { |
727 printf("No Cell Position info present\n"); | |
728 return; | |
729 } | |
20 | 730 |
3 | 731 for(i=0;i<nr;i++) { |
20 | 732 printf("Cell: %3i has VOB ID: %3i, Cell ID: %3i\n", i + 1, |
3 | 733 cell_position[i].vob_id_nr, cell_position[i].cell_nr); |
734 } | |
735 } | |
736 | |
737 | |
738 void ifo_print_PGC(pgc_t *pgc) { | |
739 int i; | |
20 | 740 |
3 | 741 if (!pgc) { |
742 printf("None\n"); | |
743 return; | |
744 } | |
745 printf("Number of Programs: %i\n", pgc->nr_of_programs); | |
746 printf("Number of Cells: %i\n", pgc->nr_of_cells); | |
747 /* Check that time is 0:0:0:0 also if nr_of_programs==0 */ | |
748 printf("Playback time: "); | |
13
4e610984cc3f
added dvdread_print_time() and removed the file-static print_time() in nav_print.c; based on a patch by Erik Hovland org
nicodvb
parents:
4
diff
changeset
|
749 dvdread_print_time(&pgc->playback_time); printf("\n"); |
3 | 750 |
751 /* If no programs/no time then does this mean anything? */ | |
752 printf("Prohibited user operations: "); | |
753 ifo_print_USER_OPS(&pgc->prohibited_ops); | |
20 | 754 |
3 | 755 for(i = 0; i < 8; i++) { |
756 if(pgc->audio_control[i] & 0x8000) { /* The 'is present' bit */ | |
20 | 757 printf("Audio stream %i control: %04x\n", |
3 | 758 i, pgc->audio_control[i]); |
759 } | |
760 } | |
20 | 761 |
3 | 762 for(i = 0; i < 32; i++) { |
763 if(pgc->subp_control[i] & 0x80000000) { /* The 'is present' bit */ | |
20 | 764 printf("Subpicture stream %2i control: %08x: 4:3=%d, Wide=%d, Letterbox=%d, Pan-Scan=%d\n", |
3 | 765 i, pgc->subp_control[i], |
766 (pgc->subp_control[i] >>24) & 0x1f, | |
767 (pgc->subp_control[i] >>16) & 0x1f, | |
768 (pgc->subp_control[i] >>8) & 0x1f, | |
769 (pgc->subp_control[i] ) & 0x1f); | |
770 } | |
771 } | |
20 | 772 |
3 | 773 printf("Next PGC number: %i\n", pgc->next_pgc_nr); |
774 printf("Prev PGC number: %i\n", pgc->prev_pgc_nr); | |
775 printf("GoUp PGC number: %i\n", pgc->goup_pgc_nr); | |
776 if(pgc->nr_of_programs != 0) { | |
777 printf("Still time: %i seconds (255=inf)\n", pgc->still_time); | |
778 printf("PG Playback mode %02x\n", pgc->pg_playback_mode); | |
779 } | |
20 | 780 |
3 | 781 if(pgc->nr_of_programs != 0) { |
782 for(i = 0; i < 16; i++) { | |
783 printf("Color %2i: %08x\n", i, pgc->palette[i]); | |
784 } | |
785 } | |
20 | 786 |
3 | 787 /* Memmory offsets to div. tables. */ |
788 ifo_print_PGC_COMMAND_TBL(pgc->command_tbl); | |
789 ifo_print_PGC_PROGRAM_MAP(pgc->program_map, pgc->nr_of_programs); | |
790 ifo_print_CELL_PLAYBACK(pgc->cell_playback, pgc->nr_of_cells); | |
791 ifo_print_CELL_POSITION(pgc->cell_position, pgc->nr_of_cells); | |
792 } | |
793 | |
794 | |
795 void ifo_print_TT_SRPT(tt_srpt_t *tt_srpt) { | |
796 int i; | |
20 | 797 |
3 | 798 printf("Number of TitleTrack search pointers: %i\n", |
799 tt_srpt->nr_of_srpts); | |
800 for(i=0;i<tt_srpt->nr_of_srpts;i++) { | |
801 printf("Title Track index %i\n", i + 1); | |
20 | 802 printf("\tTitle set number (VTS): %i", |
3 | 803 tt_srpt->title[i].title_set_nr); |
804 printf("\tVTS_TTN: %i\n", tt_srpt->title[i].vts_ttn); | |
805 printf("\tNumber of PTTs: %i\n", tt_srpt->title[i].nr_of_ptts); | |
20 | 806 printf("\tNumber of angles: %i\n", |
3 | 807 tt_srpt->title[i].nr_of_angles); |
808 | |
20 | 809 printf("\tTitle playback type: (%02x)\n", |
3 | 810 *(uint8_t *)&(tt_srpt->title[i].pb_ty)); |
811 printf("\t\t%s\n", | |
812 tt_srpt->title[i].pb_ty.multi_or_random_pgc_title ? "Random or Shuffle" : "Sequencial"); | |
20 | 813 if (tt_srpt->title[i].pb_ty.jlc_exists_in_cell_cmd) printf("\t\tJump/Link/Call exists in cell cmd\n"); |
3 | 814 if (tt_srpt->title[i].pb_ty.jlc_exists_in_prepost_cmd) printf("\t\tJump/Link/Call exists in pre/post cmd\n"); |
815 if (tt_srpt->title[i].pb_ty.jlc_exists_in_button_cmd) printf("\t\tJump/Link/Call exists in button cmd\n"); | |
816 if (tt_srpt->title[i].pb_ty.jlc_exists_in_tt_dom) printf("\t\tJump/Link/Call exists in tt_dom cmd\n"); | |
817 printf("\t\tTitle or time play:%d\n", tt_srpt->title[i].pb_ty.title_or_time_play); | |
818 printf("\t\tChapter search or play:%d\n", tt_srpt->title[i].pb_ty.chapter_search_or_play); | |
819 | |
820 printf("\tParental ID field: %04x\n", | |
821 tt_srpt->title[i].parental_id); | |
20 | 822 printf("\tTitle set starting sector %08x\n", |
3 | 823 tt_srpt->title[i].title_set_sector); |
824 } | |
825 } | |
826 | |
827 | |
828 void ifo_print_VTS_PTT_SRPT(vts_ptt_srpt_t *vts_ptt_srpt) { | |
829 int i, j; | |
20 | 830 printf(" nr_of_srpts %i last byte %i\n", |
831 vts_ptt_srpt->nr_of_srpts, | |
3 | 832 vts_ptt_srpt->last_byte); |
833 for(i=0;i<vts_ptt_srpt->nr_of_srpts;i++) { | |
834 for(j=0;j<vts_ptt_srpt->title[i].nr_of_ptts;j++) { | |
835 printf("VTS_PTT_SRPT - Title %3i part %3i: PGC: %3i PG: %3i\n", | |
20 | 836 i + 1, j + 1, |
3 | 837 vts_ptt_srpt->title[i].ptt[j].pgcn, |
838 vts_ptt_srpt->title[i].ptt[j].pgn ); | |
839 } | |
840 } | |
841 } | |
842 | |
843 | |
844 static void hexdump(uint8_t *ptr, int len) { | |
845 while(len--) | |
846 printf("%02x ", *ptr++); | |
847 } | |
848 | |
849 void ifo_print_PTL_MAIT(ptl_mait_t *ptl_mait) { | |
850 int i, j; | |
20 | 851 |
3 | 852 printf("Number of Countries: %i\n", ptl_mait->nr_of_countries); |
853 printf("Number of VTSs: %i\n", ptl_mait->nr_of_vtss); | |
854 //printf("Last byte: %i\n", ptl_mait->last_byte); | |
20 | 855 |
3 | 856 for(i = 0; i < ptl_mait->nr_of_countries; i++) { |
20 | 857 printf("Country code: %c%c\n", |
3 | 858 ptl_mait->countries[i].country_code >> 8, |
859 ptl_mait->countries[i].country_code & 0xff); | |
860 /* | |
20 | 861 printf("Start byte: %04x %i\n", |
862 ptl_mait->countries[i].pf_ptl_mai_start_byte, | |
3 | 863 ptl_mait->countries[i].pf_ptl_mai_start_byte); |
864 */ | |
865 /* This seems to be pointing at a array with 8 2byte fields per VTS | |
866 ? and one extra for the menu? always an odd number of VTSs on | |
867 all the dics I tested so it might be padding to even also. | |
868 If it is for the menu it probably the first entry. */ | |
869 for(j=0;j<8;j++) { | |
20 | 870 hexdump( (uint8_t *)ptl_mait->countries - PTL_MAIT_COUNTRY_SIZE |
3 | 871 + ptl_mait->countries[i].pf_ptl_mai_start_byte |
872 + j*(ptl_mait->nr_of_vtss+1)*2, (ptl_mait->nr_of_vtss+1)*2); | |
873 printf("\n"); | |
874 } | |
875 } | |
876 } | |
877 | |
878 void ifo_print_VTS_TMAPT(vts_tmapt_t *vts_tmapt) { | |
879 unsigned int timeunit; | |
880 int i, j; | |
881 | |
882 printf("Number of VTS_TMAPS: %i\n", vts_tmapt->nr_of_tmaps); | |
883 printf("Last byte: %i\n", vts_tmapt->last_byte); | |
884 | |
885 for(i = 0; i < vts_tmapt->nr_of_tmaps; i++) { | |
886 printf("TMAP %i (number matches title PGC number.)\n", i + 1); | |
887 printf(" offset %d relative to VTS_TMAPTI\n", vts_tmapt->tmap_offset[i]); | |
888 printf(" Time unit (seconds): %i\n", vts_tmapt->tmap[i].tmu); | |
889 printf(" Number of entries: %i\n", vts_tmapt->tmap[i].nr_of_entries); | |
890 timeunit = vts_tmapt->tmap[i].tmu; | |
891 for(j = 0; j < vts_tmapt->tmap[i].nr_of_entries; j++) { | |
892 unsigned int ac_time = timeunit * (j + 1); | |
893 printf("Time: %2i:%02i:%02i VOBU Sector: 0x%08x %s\n", | |
894 ac_time / (60 * 60), (ac_time / 60) % 60, ac_time % 60, | |
895 vts_tmapt->tmap[i].map_ent[j] & 0x7fffffff, | |
896 (vts_tmapt->tmap[i].map_ent[j] >> 31) ? "discontinuity" : ""); | |
897 } | |
898 } | |
899 } | |
900 | |
901 void ifo_print_C_ADT(c_adt_t *c_adt) { | |
902 int i, entries; | |
20 | 903 |
3 | 904 printf("Number of VOBs in this VOBS: %i\n", c_adt->nr_of_vobs); |
905 //entries = c_adt->nr_of_vobs; | |
906 entries = (c_adt->last_byte + 1 - C_ADT_SIZE)/sizeof(c_adt_t); | |
20 | 907 |
3 | 908 for(i = 0; i < entries; i++) { |
20 | 909 printf("VOB ID: %3i, Cell ID: %3i ", |
3 | 910 c_adt->cell_adr_table[i].vob_id, c_adt->cell_adr_table[i].cell_id); |
911 printf("Sector (first): 0x%08x (last): 0x%08x\n", | |
20 | 912 c_adt->cell_adr_table[i].start_sector, |
3 | 913 c_adt->cell_adr_table[i].last_sector); |
914 } | |
915 } | |
916 | |
917 | |
918 void ifo_print_VOBU_ADMAP(vobu_admap_t *vobu_admap) { | |
919 int i, entries; | |
20 | 920 |
3 | 921 entries = (vobu_admap->last_byte + 1 - VOBU_ADMAP_SIZE)/4; |
922 for(i = 0; i < entries; i++) { | |
923 printf("VOBU %5i First sector: 0x%08x\n", i + 1, | |
924 vobu_admap->vobu_start_sectors[i]); | |
925 } | |
926 } | |
927 | |
928 const char *ifo_print_menu_name(int type) { | |
929 const char *menu_name; | |
930 menu_name=""; | |
931 switch (type) { | |
932 case 2: | |
933 menu_name="Title"; | |
934 break; | |
935 case 3: | |
936 menu_name = "Root"; | |
937 break; | |
938 case 4: | |
939 menu_name = "Sub-Picture"; | |
940 break; | |
941 case 5: | |
942 menu_name = "Audio"; | |
943 break; | |
944 case 6: | |
945 menu_name = "Angle"; | |
946 break; | |
947 case 7: | |
948 menu_name = "PTT (Chapter)"; | |
949 break; | |
950 default: | |
951 menu_name = "Unknown"; | |
952 break; | |
953 } | |
954 return &menu_name[0]; | |
955 } | |
956 | |
957 /* pgc_type=1 for menu, 0 for title. */ | |
958 void ifo_print_PGCIT(pgcit_t *pgcit, int pgc_type) { | |
959 int i; | |
20 | 960 |
3 | 961 printf("\nNumber of Program Chains: %3i\n", pgcit->nr_of_pgci_srp); |
962 for(i = 0; i < pgcit->nr_of_pgci_srp; i++) { | |
963 printf("\nProgram (PGC): %3i\n", i + 1); | |
964 if (pgc_type) { | |
965 printf("PGC Category: Entry PGC %d, Menu Type=0x%02x:%s (Entry id 0x%02x), ", | |
966 pgcit->pgci_srp[i].entry_id >> 7, | |
967 pgcit->pgci_srp[i].entry_id & 0xf, | |
968 ifo_print_menu_name(pgcit->pgci_srp[i].entry_id & 0xf), | |
969 pgcit->pgci_srp[i].entry_id); | |
970 } else { | |
971 printf("PGC Category: %s VTS_TTN:0x%02x (Entry id 0x%02x), ", | |
972 pgcit->pgci_srp[i].entry_id >> 7 ? "At Start of" : "During", | |
973 pgcit->pgci_srp[i].entry_id & 0xf, | |
974 pgcit->pgci_srp[i].entry_id); | |
975 } | |
976 printf("Parental ID mask 0x%04x\n", pgcit->pgci_srp[i].ptl_id_mask); | |
977 ifo_print_PGC(pgcit->pgci_srp[i].pgc); | |
978 } | |
979 } | |
980 | |
981 | |
982 void ifo_print_PGCI_UT(pgci_ut_t *pgci_ut) { | |
983 int i, menu; | |
20 | 984 |
3 | 985 printf("Number of Menu Language Units (PGCI_LU): %3i\n", pgci_ut->nr_of_lus); |
986 for(i = 0; i < pgci_ut->nr_of_lus; i++) { | |
987 printf("\nMenu Language Unit %d\n", i+1); | |
988 printf("\nMenu Language Code: %c%c\n", | |
989 pgci_ut->lu[i].lang_code >> 8, | |
990 pgci_ut->lu[i].lang_code & 0xff); | |
20 | 991 |
3 | 992 menu = pgci_ut->lu[i].exists; |
993 printf("Menu Existence: %02x: ", menu); | |
994 if (menu == 0) { | |
995 printf("No menus "); | |
996 } | |
997 if (menu & 0x80) { | |
998 printf("Root "); | |
999 menu^=0x80; | |
1000 } | |
1001 if (menu & 0x40) { | |
1002 printf("Sub-Picture "); | |
1003 menu^=0x40; | |
1004 } | |
1005 if (menu & 0x20) { | |
1006 printf("Audio "); | |
1007 menu^=0x20; | |
1008 } | |
1009 if (menu & 0x10) { | |
1010 printf("Angle "); | |
1011 menu^=0x10; | |
1012 } | |
1013 if (menu & 0x08) { | |
1014 printf("PTT "); | |
1015 menu^=0x08; | |
1016 } | |
1017 if (menu > 0) { | |
1018 printf("Unknown extra menus "); | |
1019 menu^=0x08; | |
1020 } | |
1021 printf("\n"); | |
1022 ifo_print_PGCIT(pgci_ut->lu[i].pgcit, 1); | |
1023 } | |
1024 } | |
1025 | |
1026 | |
1027 static void ifo_print_VTS_ATTRIBUTES(vts_attributes_t *vts_attributes) { | |
1028 int i; | |
20 | 1029 |
3 | 1030 printf("VTS_CAT Application type: %08x\n", vts_attributes->vts_cat); |
20 | 1031 |
3 | 1032 printf("Video attributes of VTSM_VOBS: "); |
1033 ifo_print_video_attributes(5, &vts_attributes->vtsm_vobs_attr); | |
1034 printf("\n"); | |
20 | 1035 printf("Number of Audio streams: %i\n", |
3 | 1036 vts_attributes->nr_of_vtsm_audio_streams); |
1037 if(vts_attributes->nr_of_vtsm_audio_streams > 0) { | |
1038 printf("\tstream %i attributes: ", 1); | |
1039 ifo_print_audio_attributes(5, &vts_attributes->vtsm_audio_attr); | |
1040 printf("\n"); | |
1041 } | |
20 | 1042 printf("Number of Subpicture streams: %i\n", |
3 | 1043 vts_attributes->nr_of_vtsm_subp_streams); |
1044 if(vts_attributes->nr_of_vtsm_subp_streams > 0) { | |
1045 printf("\tstream %2i attributes: ", 1); | |
1046 ifo_print_subp_attributes(5, &vts_attributes->vtsm_subp_attr); | |
1047 printf("\n"); | |
1048 } | |
20 | 1049 |
3 | 1050 printf("Video attributes of VTSTT_VOBS: "); |
1051 ifo_print_video_attributes(5, &vts_attributes->vtstt_vobs_video_attr); | |
1052 printf("\n"); | |
20 | 1053 printf("Number of Audio streams: %i\n", |
3 | 1054 vts_attributes->nr_of_vtstt_audio_streams); |
1055 for(i = 0; i < vts_attributes->nr_of_vtstt_audio_streams; i++) { | |
1056 printf("\tstream %i attributes: ", i); | |
1057 ifo_print_audio_attributes(5, &vts_attributes->vtstt_audio_attr[i]); | |
1058 printf("\n"); | |
1059 } | |
20 | 1060 |
1061 printf("Number of Subpicture streams: %i\n", | |
3 | 1062 vts_attributes->nr_of_vtstt_subp_streams); |
1063 for(i = 0; i < vts_attributes->nr_of_vtstt_subp_streams; i++) { | |
20 | 1064 printf("\tstream %2i attributes: ", i); |
3 | 1065 ifo_print_subp_attributes(5, &vts_attributes->vtstt_subp_attr[i]); |
1066 printf("\n"); | |
1067 } | |
1068 } | |
1069 | |
1070 | |
1071 void ifo_print_VTS_ATRT(vts_atrt_t *vts_atrt) { | |
1072 int i; | |
20 | 1073 |
3 | 1074 printf("Number of Video Title Sets: %3i\n", vts_atrt->nr_of_vtss); |
1075 for(i = 0; i < vts_atrt->nr_of_vtss; i++) { | |
1076 printf("\nVideo Title Set %i\n", i + 1); | |
1077 ifo_print_VTS_ATTRIBUTES(&vts_atrt->vts[i]); | |
1078 } | |
1079 } | |
1080 | |
1081 | |
1082 void ifo_print(dvd_reader_t *dvd, int title) { | |
1083 ifo_handle_t *ifohandle; | |
1084 printf("Local ifo_print\n"); | |
1085 ifohandle = ifoOpen(dvd, title); | |
1086 if(!ifohandle) { | |
1087 fprintf(stderr, "Can't open info file for title %d\n", title); | |
1088 return; | |
1089 } | |
20 | 1090 |
1091 | |
3 | 1092 if(ifohandle->vmgi_mat) { |
1093 | |
1094 printf("VMG top level\n-------------\n"); | |
1095 ifo_print_VMGI_MAT(ifohandle->vmgi_mat); | |
1096 | |
1097 printf("\nFirst Play PGC\n--------------\n"); | |
1098 if(ifohandle->first_play_pgc) | |
1099 ifo_print_PGC(ifohandle->first_play_pgc); | |
1100 else | |
1101 printf("No First Play PGC present\n"); | |
1102 | |
1103 printf("\nTitle Track search pointer table\n"); | |
1104 printf( "------------------------------------------------\n"); | |
1105 ifo_print_TT_SRPT(ifohandle->tt_srpt); | |
1106 | |
1107 printf("\nMenu PGCI Unit table\n"); | |
1108 printf( "--------------------\n"); | |
1109 if(ifohandle->pgci_ut) { | |
1110 ifo_print_PGCI_UT(ifohandle->pgci_ut); | |
1111 } else { | |
1112 printf("No PGCI Unit table present\n"); | |
1113 } | |
1114 | |
1115 printf("\nParental Manegment Information table\n"); | |
1116 printf( "------------------------------------\n"); | |
1117 if(ifohandle->ptl_mait) { | |
1118 ifo_print_PTL_MAIT(ifohandle->ptl_mait); | |
1119 } else { | |
1120 printf("No Parental Management Information present\n"); | |
1121 } | |
1122 | |
1123 printf("\nVideo Title Set Attribute Table\n"); | |
1124 printf( "-------------------------------\n"); | |
1125 ifo_print_VTS_ATRT(ifohandle->vts_atrt); | |
20 | 1126 |
3 | 1127 printf("\nText Data Manager Information\n"); |
1128 printf( "-----------------------------\n"); | |
1129 if(ifohandle->txtdt_mgi) { | |
1130 //ifo_print_TXTDT_MGI(&(vmgi->txtdt_mgi)); | |
1131 } else { | |
1132 printf("No Text Data Manager Information present\n"); | |
1133 } | |
1134 | |
1135 printf("\nMenu Cell Adress table\n"); | |
1136 printf( "-----------------\n"); | |
1137 if(ifohandle->menu_c_adt) { | |
1138 ifo_print_C_ADT(ifohandle->menu_c_adt); | |
1139 } else { | |
1140 printf("No Menu Cell Adress table present\n"); | |
1141 } | |
1142 | |
1143 printf("\nVideo Manager Menu VOBU address map\n"); | |
1144 printf( "-----------------\n"); | |
1145 if(ifohandle->menu_vobu_admap) { | |
1146 ifo_print_VOBU_ADMAP(ifohandle->menu_vobu_admap); | |
1147 } else { | |
20 | 1148 printf("No Menu VOBU address map present\n"); |
3 | 1149 } |
1150 } | |
1151 | |
1152 | |
1153 if(ifohandle->vtsi_mat) { | |
1154 | |
1155 printf("VTS top level\n-------------\n"); | |
1156 ifo_print_VTSI_MAT(ifohandle->vtsi_mat); | |
1157 | |
1158 printf("\nPart of Title Track search pointer table\n"); | |
1159 printf( "----------------------------------------------\n"); | |
1160 ifo_print_VTS_PTT_SRPT(ifohandle->vts_ptt_srpt); | |
1161 | |
1162 printf("\nPGCI Unit table\n"); | |
1163 printf( "--------------------\n"); | |
1164 ifo_print_PGCIT(ifohandle->vts_pgcit, 0); | |
1165 | |
1166 printf("\nMenu PGCI Unit table\n"); | |
1167 printf( "--------------------\n"); | |
1168 if(ifohandle->pgci_ut) { | |
1169 ifo_print_PGCI_UT(ifohandle->pgci_ut); | |
1170 } else { | |
1171 printf("No Menu PGCI Unit table present\n"); | |
1172 } | |
1173 | |
1174 printf("\nVTS Time Map table\n"); | |
1175 printf( "-----------------\n"); | |
1176 if(ifohandle->vts_tmapt) { | |
1177 ifo_print_VTS_TMAPT(ifohandle->vts_tmapt); | |
1178 } else { | |
1179 printf("No VTS Time Map table present\n"); | |
1180 } | |
1181 | |
1182 printf("\nMenu Cell Adress table\n"); | |
1183 printf( "-----------------\n"); | |
1184 if(ifohandle->menu_c_adt) { | |
1185 ifo_print_C_ADT(ifohandle->menu_c_adt); | |
1186 } else { | |
1187 printf("No Cell Adress table present\n"); | |
1188 } | |
1189 | |
1190 printf("\nVideo Title Set Menu VOBU address map\n"); | |
1191 printf( "-----------------\n"); | |
1192 if(ifohandle->menu_vobu_admap) { | |
1193 ifo_print_VOBU_ADMAP(ifohandle->menu_vobu_admap); | |
1194 } else { | |
1195 printf("No Menu VOBU address map present\n"); | |
1196 } | |
1197 | |
1198 printf("\nCell Adress table\n"); | |
1199 printf( "-----------------\n"); | |
1200 ifo_print_C_ADT(ifohandle->vts_c_adt); | |
1201 | |
1202 printf("\nVideo Title Set VOBU address map\n"); | |
1203 printf( "-----------------\n"); | |
1204 ifo_print_VOBU_ADMAP(ifohandle->vts_vobu_admap); | |
20 | 1205 } |
3 | 1206 |
1207 ifoClose(ifohandle); | |
1208 } | |
1209 | |
1210 /* | |
1211 * $Log$ | |
1212 * Revision 1.3 2004/10/22 11:36:19 jcdutton | |
1213 * Stop seg fault when using ifo_dump. | |
1214 * | |
1215 * Revision 1.2 2004/09/27 12:24:01 jcdutton | |
1216 * Add extra info to printout when using ifo_dump. | |
1217 * | |
1218 * Revision 1.1 2004/01/11 21:43:13 mroi | |
1219 * big build system changes | |
1220 * * cleaned up all Makefiles and added a Makefile.common | |
1221 * * added relchk script | |
1222 * * moved libdvdread files to a dvdread subdir | |
1223 * * moved DVD VM to a vm subdir | |
1224 * * removed unused code in read_cache.c | |
1225 * | |
1226 * Revision 1.4 2004/01/01 15:13:13 jcdutton | |
1227 * Put ifo_print.c and .h back in. | |
1228 * | |
1229 * Revision 1.7 2003/04/28 15:17:17 jcdutton | |
1230 * Update ifodump to work with new libdvdnav cvs, instead of needing libdvdread. | |
1231 * | |
1232 * Revision 1.6 2003/04/05 22:49:04 jcdutton | |
1233 * Update with more info from the latest libdvdread. | |
1234 * | |
1235 * Revision 1.5 2003/04/05 13:03:49 jcdutton | |
1236 * Small updates. | |
1237 * | |
1238 * Revision 1.4 2003/04/01 08:01:03 jcdutton | |
1239 * Add VTS Time map display. Requires libdvdread 0.9.4. The same version that comes with xine. | |
1240 * | |
1241 * Revision 1.3 2003/03/14 15:49:18 mroi | |
1242 * adjust to new libdvdread version | |
1243 * | |
1244 * Revision 1.2 2002/08/30 05:12:33 jcdutton | |
1245 * Minor update now that I know what PGC Entry IDs are for. | |
1246 * | |
1247 * Revision 1.1.1.1 2002/08/28 09:48:35 jcdutton | |
1248 * Initial import into CVS. | |
1249 * | |
1250 * | |
1251 * | |
1252 */ | |
1253 |