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