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