Mercurial > libdvdread4.hg
comparison ifo_print.c @ 20:fce16251755c src
Remove all trailing whitespace,
patch by Erik Hovland *erik$hovland dot org%
author | rathann |
---|---|
date | Sat, 06 Sep 2008 21:55:51 +0000 |
parents | 4e610984cc3f |
children | 4aa618ae094f |
comparison
equal
deleted
inserted
replaced
19:7f7e87bd7536 | 20:fce16251755c |
---|---|
1 /* | 1 /* |
2 * This program is free software; you can redistribute it and/or modify | 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 | 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 | 4 * the Free Software Foundation; either version 2 of the License, or |
5 * (at your option) any later version. | 5 * (at your option) any later version. |
6 * | 6 * |
34 const char *rate; | 34 const char *rate; |
35 assert((dtime->hour>>4) < 0xa && (dtime->hour&0xf) < 0xa); | 35 assert((dtime->hour>>4) < 0xa && (dtime->hour&0xf) < 0xa); |
36 assert((dtime->minute>>4) < 0x7 && (dtime->minute&0xf) < 0xa); | 36 assert((dtime->minute>>4) < 0x7 && (dtime->minute&0xf) < 0xa); |
37 assert((dtime->second>>4) < 0x7 && (dtime->second&0xf) < 0xa); | 37 assert((dtime->second>>4) < 0x7 && (dtime->second&0xf) < 0xa); |
38 assert((dtime->frame_u&0xf) < 0xa); | 38 assert((dtime->frame_u&0xf) < 0xa); |
39 | 39 |
40 printf("%02x:%02x:%02x.%02x", | 40 printf("%02x:%02x:%02x.%02x", |
41 dtime->hour, | 41 dtime->hour, |
42 dtime->minute, | 42 dtime->minute, |
43 dtime->second, | 43 dtime->second, |
44 dtime->frame_u & 0x3f); | 44 dtime->frame_u & 0x3f); |
45 switch((dtime->frame_u & 0xc0) >> 6) { | 45 switch((dtime->frame_u & 0xc0) >> 6) { |
48 break; | 48 break; |
49 case 3: | 49 case 3: |
50 rate = "29.97"; | 50 rate = "29.97"; |
51 break; | 51 break; |
52 default: | 52 default: |
53 if(dtime->hour == 0 && dtime->minute == 0 | 53 if(dtime->hour == 0 && dtime->minute == 0 |
54 && dtime->second == 0 && dtime->frame_u == 0) | 54 && dtime->second == 0 && dtime->frame_u == 0) |
55 rate = "no"; | 55 rate = "no"; |
56 else | 56 else |
57 rate = "(please send a bug report)"; | 57 rate = "(please send a bug report)"; |
58 break; | 58 break; |
59 } | 59 } |
60 printf(" @ %s fps", rate); | 60 printf(" @ %s fps", rate); |
61 } | 61 } |
62 | 62 |
63 void dvdread_print_time(dvd_time_t *dtime) { | 63 void dvdread_print_time(dvd_time_t *dtime) { |
64 ifo_print_time(5, dtime); | 64 ifo_print_time(5, dtime); |
79 #endif | 79 #endif |
80 printf("\n"); | 80 printf("\n"); |
81 } | 81 } |
82 | 82 |
83 static void ifo_print_video_attributes(int level, video_attr_t *attr) { | 83 static void ifo_print_video_attributes(int level, video_attr_t *attr) { |
84 | 84 |
85 /* The following test is shorter but not correct ISO C, | 85 /* The following test is shorter but not correct ISO C, |
86 memcmp(attr,my_friendly_zeros, sizeof(video_attr_t)) */ | 86 memcmp(attr,my_friendly_zeros, sizeof(video_attr_t)) */ |
87 if(attr->mpeg_version == 0 | 87 if(attr->mpeg_version == 0 |
88 && attr->video_format == 0 | 88 && attr->video_format == 0 |
89 && attr->display_aspect_ratio == 0 | 89 && attr->display_aspect_ratio == 0 |
90 && attr->permitted_df == 0 | 90 && attr->permitted_df == 0 |
91 && attr->unknown1 == 0 | 91 && attr->unknown1 == 0 |
92 && attr->line21_cc_1 == 0 | 92 && attr->line21_cc_1 == 0 |
93 && attr->line21_cc_2 == 0 | 93 && attr->line21_cc_2 == 0 |
94 && attr->video_format == 0 | 94 && attr->video_format == 0 |
95 && attr->letterboxed == 0 | 95 && attr->letterboxed == 0 |
96 && attr->film_mode == 0) { | 96 && attr->film_mode == 0) { |
97 printf("-- Unspecified --"); | 97 printf("-- Unspecified --"); |
98 return; | 98 return; |
99 } | 99 } |
100 | 100 |
101 switch(attr->mpeg_version) { | 101 switch(attr->mpeg_version) { |
102 case 0: | 102 case 0: |
103 printf("mpeg1, "); | 103 printf("mpeg1, "); |
104 break; | 104 break; |
105 case 1: | 105 case 1: |
106 printf("mpeg2, "); | 106 printf("mpeg2, "); |
107 break; | 107 break; |
108 default: | 108 default: |
109 printf("(please send a bug report), "); | 109 printf("(please send a bug report), "); |
110 } | 110 } |
111 | 111 |
112 switch(attr->video_format) { | 112 switch(attr->video_format) { |
113 case 0: | 113 case 0: |
114 printf("ntsc, "); | 114 printf("ntsc, "); |
115 break; | 115 break; |
116 case 1: | 116 case 1: |
117 printf("pal, "); | 117 printf("pal, "); |
118 break; | 118 break; |
119 default: | 119 default: |
120 printf("(please send a bug report), "); | 120 printf("(please send a bug report), "); |
121 } | 121 } |
122 | 122 |
123 switch(attr->display_aspect_ratio) { | 123 switch(attr->display_aspect_ratio) { |
124 case 0: | 124 case 0: |
125 printf("4:3, "); | 125 printf("4:3, "); |
126 break; | 126 break; |
127 case 3: | 127 case 3: |
128 printf("16:9, "); | 128 printf("16:9, "); |
129 break; | 129 break; |
130 default: | 130 default: |
131 printf("(please send a bug report), "); | 131 printf("(please send a bug report), "); |
132 } | 132 } |
133 | 133 |
134 // Wide is allways allowed..!!! | 134 // Wide is allways allowed..!!! |
135 switch(attr->permitted_df) { | 135 switch(attr->permitted_df) { |
136 case 0: | 136 case 0: |
137 printf("pan&scan+letterboxed, "); | 137 printf("pan&scan+letterboxed, "); |
138 break; | 138 break; |
146 printf("not specified, "); | 146 printf("not specified, "); |
147 break; | 147 break; |
148 default: | 148 default: |
149 printf("(please send a bug report), "); | 149 printf("(please send a bug report), "); |
150 } | 150 } |
151 | 151 |
152 printf("U%x, ", attr->unknown1); | 152 printf("U%x, ", attr->unknown1); |
153 assert(!attr->unknown1); | 153 assert(!attr->unknown1); |
154 | 154 |
155 if(attr->line21_cc_1 || attr->line21_cc_2) { | 155 if(attr->line21_cc_1 || attr->line21_cc_2) { |
156 printf("NTSC CC "); | 156 printf("NTSC CC "); |
157 if(attr->line21_cc_1) | 157 if(attr->line21_cc_1) |
158 printf("1, "); | 158 printf("1, "); |
159 if(attr->line21_cc_2) | 159 if(attr->line21_cc_2) |
160 printf("2, "); | 160 printf("2, "); |
161 } | 161 } |
162 | 162 |
163 { | 163 { |
164 int height = 480; | 164 int height = 480; |
165 if(attr->video_format != 0) | 165 if(attr->video_format != 0) |
166 height = 576; | 166 height = 576; |
167 switch(attr->picture_size) { | 167 switch(attr->picture_size) { |
168 case 0: | 168 case 0: |
169 printf("720x%d, ", height); | 169 printf("720x%d, ", height); |
170 break; | 170 break; |
174 case 2: | 174 case 2: |
175 printf("352x%d, ", height); | 175 printf("352x%d, ", height); |
176 break; | 176 break; |
177 case 3: | 177 case 3: |
178 printf("352x%d, ", height/2); | 178 printf("352x%d, ", height/2); |
179 break; | 179 break; |
180 default: | 180 default: |
181 printf("(please send a bug report), "); | 181 printf("(please send a bug report), "); |
182 } | 182 } |
183 } | 183 } |
184 | 184 |
185 if(attr->letterboxed) { | 185 if(attr->letterboxed) { |
186 printf("source letterboxed, "); | 186 printf("source letterboxed, "); |
187 } | 187 } |
188 | 188 |
189 if(attr->film_mode) { | 189 if(attr->film_mode) { |
190 printf("film. "); | 190 printf("film. "); |
191 } else { | 191 } else { |
192 printf("video. "); //camera | 192 printf("video. "); //camera |
193 } | 193 } |
194 } | 194 } |
195 | 195 |
196 static void ifo_print_audio_attributes(int level, audio_attr_t *attr) { | 196 static void ifo_print_audio_attributes(int level, audio_attr_t *attr) { |
197 | 197 |
198 if(attr->audio_format == 0 | 198 if(attr->audio_format == 0 |
199 && attr->multichannel_extension == 0 | 199 && attr->multichannel_extension == 0 |
200 && attr->lang_type == 0 | 200 && attr->lang_type == 0 |
201 && attr->application_mode == 0 | 201 && attr->application_mode == 0 |
202 && attr->quantization == 0 | 202 && attr->quantization == 0 |
206 && attr->unknown1 == 0 | 206 && attr->unknown1 == 0 |
207 && attr->unknown3 == 0) { | 207 && attr->unknown3 == 0) { |
208 printf("-- Unspecified --"); | 208 printf("-- Unspecified --"); |
209 return; | 209 return; |
210 } | 210 } |
211 | 211 |
212 switch(attr->audio_format) { | 212 switch(attr->audio_format) { |
213 case 0: | 213 case 0: |
214 printf("ac3 "); | 214 printf("ac3 "); |
215 if(attr->quantization != 3) | 215 if(attr->quantization != 3) |
216 printf("(please send a bug report) ac3 quant/drc not 3 (%d)", attr->quantization); | 216 printf("(please send a bug report) ac3 quant/drc not 3 (%d)", attr->quantization); |
228 break; | 228 break; |
229 case 1: | 229 case 1: |
230 printf("drc "); | 230 printf("drc "); |
231 break; | 231 break; |
232 default: | 232 default: |
233 printf("(please send a bug report) mpeg reserved quant/drc (%d)", attr->quantization); | 233 printf("(please send a bug report) mpeg reserved quant/drc (%d)", attr->quantization); |
234 } | 234 } |
235 break; | 235 break; |
236 case 4: | 236 case 4: |
237 printf("lpcm "); | 237 printf("lpcm "); |
238 switch(attr->quantization) { | 238 switch(attr->quantization) { |
259 printf("(please send a bug report) dts quant/drc not 3 (%d)", attr->quantization); | 259 printf("(please send a bug report) dts quant/drc not 3 (%d)", attr->quantization); |
260 break; | 260 break; |
261 default: | 261 default: |
262 printf("(please send a bug report) "); | 262 printf("(please send a bug report) "); |
263 } | 263 } |
264 | 264 |
265 if(attr->multichannel_extension) | 265 if(attr->multichannel_extension) |
266 printf("multichannel_extension "); | 266 printf("multichannel_extension "); |
267 | 267 |
268 switch(attr->lang_type) { | 268 switch(attr->lang_type) { |
269 case 0: | 269 case 0: |
270 // not specified | 270 // not specified |
271 assert(attr->lang_code == 0 || attr->lang_code == 0xffff); | 271 assert(attr->lang_code == 0 || attr->lang_code == 0xffff); |
272 break; | 272 break; |
288 printf("surround sound mode "); | 288 printf("surround sound mode "); |
289 break; | 289 break; |
290 default: | 290 default: |
291 printf("(please send a bug report) "); | 291 printf("(please send a bug report) "); |
292 } | 292 } |
293 | 293 |
294 switch(attr->quantization) { | 294 switch(attr->quantization) { |
295 case 0: | 295 case 0: |
296 printf("16bit "); | 296 printf("16bit "); |
297 break; | 297 break; |
298 case 1: | 298 case 1: |
305 printf("drc "); | 305 printf("drc "); |
306 break; | 306 break; |
307 default: | 307 default: |
308 printf("(please send a bug report) "); | 308 printf("(please send a bug report) "); |
309 } | 309 } |
310 | 310 |
311 switch(attr->sample_frequency) { | 311 switch(attr->sample_frequency) { |
312 case 0: | 312 case 0: |
313 printf("48kHz "); | 313 printf("48kHz "); |
314 break; | 314 break; |
315 case 1: | 315 case 1: |
316 printf("??kHz "); | 316 printf("??kHz "); |
317 break; | 317 break; |
318 default: | 318 default: |
319 printf("sample_frequency %i (please send a bug report) ", | 319 printf("sample_frequency %i (please send a bug report) ", |
320 attr->sample_frequency); | 320 attr->sample_frequency); |
321 } | 321 } |
322 | 322 |
323 printf("%dCh ", attr->channels + 1); | 323 printf("%dCh ", attr->channels + 1); |
324 | 324 |
325 switch(attr->lang_extension) { | 325 switch(attr->lang_extension) { |
326 case 0: | 326 case 0: |
327 printf("Not specified "); | 327 printf("Not specified "); |
328 break; | 328 break; |
329 case 1: // Normal audio | 329 case 1: // Normal audio |
336 printf("Director's comments 1 "); | 336 printf("Director's comments 1 "); |
337 break; | 337 break; |
338 case 4: // Directors 2 | 338 case 4: // Directors 2 |
339 printf("Director's comments 2 "); | 339 printf("Director's comments 2 "); |
340 break; | 340 break; |
341 //case 4: // Music score ? | 341 //case 4: // Music score ? |
342 default: | 342 default: |
343 printf("(please send a bug report) "); | 343 printf("(please send a bug report) "); |
344 } | 344 } |
345 | 345 |
346 printf("%d ", attr->unknown1); | 346 printf("%d ", attr->unknown1); |
347 printf("%d ", attr->unknown3); | 347 printf("%d ", attr->unknown3); |
348 } | 348 } |
349 | 349 |
350 static void ifo_print_subp_attributes(int level, subp_attr_t *attr) { | 350 static void ifo_print_subp_attributes(int level, subp_attr_t *attr) { |
351 | 351 |
352 if(attr->type == 0 | 352 if(attr->type == 0 |
353 && attr->lang_code == 0 | 353 && attr->lang_code == 0 |
354 && attr->zero1 == 0 | 354 && attr->zero1 == 0 |
355 && attr->zero2 == 0 | 355 && attr->zero2 == 0 |
356 && attr->lang_extension== 0) { | 356 && attr->lang_extension== 0) { |
357 printf("-- Unspecified --"); | 357 printf("-- Unspecified --"); |
358 return; | 358 return; |
359 } | 359 } |
360 | 360 |
361 printf("type %02x ", attr->type); | 361 printf("type %02x ", attr->type); |
362 | 362 |
363 if(isalpha((int)(attr->lang_code >> 8)) | 363 if(isalpha((int)(attr->lang_code >> 8)) |
364 && isalpha((int)(attr->lang_code & 0xff))) { | 364 && isalpha((int)(attr->lang_code & 0xff))) { |
365 printf("%c%c ", attr->lang_code >> 8, attr->lang_code & 0xff); | 365 printf("%c%c ", attr->lang_code >> 8, attr->lang_code & 0xff); |
366 } else { | 366 } else { |
367 printf("%02x%02x ", 0xff & (unsigned)(attr->lang_code >> 8), | 367 printf("%02x%02x ", 0xff & (unsigned)(attr->lang_code >> 8), |
368 0xff & (unsigned)(attr->lang_code & 0xff)); | 368 0xff & (unsigned)(attr->lang_code & 0xff)); |
369 } | 369 } |
370 | 370 |
371 printf("%d ", attr->zero1); | 371 printf("%d ", attr->zero1); |
372 printf("%d ", attr->zero2); | 372 printf("%d ", attr->zero2); |
373 | 373 |
374 switch(attr->lang_extension) { | 374 switch(attr->lang_extension) { |
375 case 0: | 375 case 0: |
379 printf("Caption with normal size character "); | 379 printf("Caption with normal size character "); |
380 break; | 380 break; |
381 case 2: | 381 case 2: |
382 printf("Caption with bigger size character "); | 382 printf("Caption with bigger size character "); |
383 break; | 383 break; |
384 case 3: | 384 case 3: |
385 printf("Caption for children "); | 385 printf("Caption for children "); |
386 break; | 386 break; |
387 case 4: | 387 case 4: |
388 printf("reserved "); | 388 printf("reserved "); |
389 break; | 389 break; |
428 | 428 |
429 | 429 |
430 static void ifo_print_USER_OPS(user_ops_t *user_ops) { | 430 static void ifo_print_USER_OPS(user_ops_t *user_ops) { |
431 uint32_t uops; | 431 uint32_t uops; |
432 unsigned char *ptr = (unsigned char *)user_ops; | 432 unsigned char *ptr = (unsigned char *)user_ops; |
433 | 433 |
434 uops = (*ptr++ << 24); | 434 uops = (*ptr++ << 24); |
435 uops |= (*ptr++ << 16); | 435 uops |= (*ptr++ << 16); |
436 uops |= (*ptr++ << 8); | 436 uops |= (*ptr++ << 8); |
437 uops |= (*ptr++); | 437 uops |= (*ptr++); |
438 | 438 |
439 if(uops == 0) { | 439 if(uops == 0) { |
440 printf("None\n"); | 440 printf("None\n"); |
441 } else if(uops == 0x01ffffff) { | 441 } else if(uops == 0x01ffffff) { |
442 printf("All\n"); | 442 printf("All\n"); |
443 } else { | 443 } else { |
495 } | 495 } |
496 } | 496 } |
497 | 497 |
498 | 498 |
499 void ifo_print_VMGI_MAT(vmgi_mat_t *vmgi_mat) { | 499 void ifo_print_VMGI_MAT(vmgi_mat_t *vmgi_mat) { |
500 | 500 |
501 printf("VMG Identifier: %.12s\n", vmgi_mat->vmg_identifier); | 501 printf("VMG Identifier: %.12s\n", vmgi_mat->vmg_identifier); |
502 printf("Last Sector of VMG: %08x\n", vmgi_mat->vmg_last_sector); | 502 printf("Last Sector of VMG: %08x\n", vmgi_mat->vmg_last_sector); |
503 printf("Last Sector of VMGI: %08x\n", vmgi_mat->vmgi_last_sector); | 503 printf("Last Sector of VMGI: %08x\n", vmgi_mat->vmgi_last_sector); |
504 printf("Specification version number: %01x.%01x\n", | 504 printf("Specification version number: %01x.%01x\n", |
505 vmgi_mat->specification_version >> 4, | 505 vmgi_mat->specification_version >> 4, |
506 vmgi_mat->specification_version & 0xf); | 506 vmgi_mat->specification_version & 0xf); |
507 /* Byte 2 of 'VMG Category' (00xx0000) is the Region Code */ | 507 /* Byte 2 of 'VMG Category' (00xx0000) is the Region Code */ |
508 printf("VMG Category: %08x (Region Code=%02x)\n", vmgi_mat->vmg_category, ((vmgi_mat->vmg_category >> 16) & 0xff) ^0xff); | 508 printf("VMG Category: %08x (Region Code=%02x)\n", vmgi_mat->vmg_category, ((vmgi_mat->vmg_category >> 16) & 0xff) ^0xff); |
509 printf("VMG Number of Volumes: %i\n", vmgi_mat->vmg_nr_of_volumes); | 509 printf("VMG Number of Volumes: %i\n", vmgi_mat->vmg_nr_of_volumes); |
510 printf("VMG This Volume: %i\n", vmgi_mat->vmg_this_volume_nr); | 510 printf("VMG This Volume: %i\n", vmgi_mat->vmg_this_volume_nr); |
512 printf("VMG Number of Title Sets %i\n", vmgi_mat->vmg_nr_of_title_sets); | 512 printf("VMG Number of Title Sets %i\n", vmgi_mat->vmg_nr_of_title_sets); |
513 printf("Provider ID: %.32s\n", vmgi_mat->provider_identifier); | 513 printf("Provider ID: %.32s\n", vmgi_mat->provider_identifier); |
514 printf("VMG POS Code: %08x", (uint32_t)(vmgi_mat->vmg_pos_code >> 32)); | 514 printf("VMG POS Code: %08x", (uint32_t)(vmgi_mat->vmg_pos_code >> 32)); |
515 printf("%08x\n", (uint32_t)vmgi_mat->vmg_pos_code); | 515 printf("%08x\n", (uint32_t)vmgi_mat->vmg_pos_code); |
516 printf("End byte of VMGI_MAT: %08x\n", vmgi_mat->vmgi_last_byte); | 516 printf("End byte of VMGI_MAT: %08x\n", vmgi_mat->vmgi_last_byte); |
517 printf("Start byte of First Play PGC (FP PGC): %08x\n", | 517 printf("Start byte of First Play PGC (FP PGC): %08x\n", |
518 vmgi_mat->first_play_pgc); | 518 vmgi_mat->first_play_pgc); |
519 printf("Start sector of VMGM_VOBS: %08x\n", vmgi_mat->vmgm_vobs); | 519 printf("Start sector of VMGM_VOBS: %08x\n", vmgi_mat->vmgm_vobs); |
520 printf("Start sector of TT_SRPT: %08x\n", vmgi_mat->tt_srpt); | 520 printf("Start sector of TT_SRPT: %08x\n", vmgi_mat->tt_srpt); |
521 printf("Start sector of VMGM_PGCI_UT: %08x\n", vmgi_mat->vmgm_pgci_ut); | 521 printf("Start sector of VMGM_PGCI_UT: %08x\n", vmgi_mat->vmgm_pgci_ut); |
522 printf("Start sector of PTL_MAIT: %08x\n", vmgi_mat->ptl_mait); | 522 printf("Start sector of PTL_MAIT: %08x\n", vmgi_mat->ptl_mait); |
523 printf("Start sector of VTS_ATRT: %08x\n", vmgi_mat->vts_atrt); | 523 printf("Start sector of VTS_ATRT: %08x\n", vmgi_mat->vts_atrt); |
524 printf("Start sector of TXTDT_MG: %08x\n", vmgi_mat->txtdt_mgi); | 524 printf("Start sector of TXTDT_MG: %08x\n", vmgi_mat->txtdt_mgi); |
525 printf("Start sector of VMGM_C_ADT: %08x\n", vmgi_mat->vmgm_c_adt); | 525 printf("Start sector of VMGM_C_ADT: %08x\n", vmgi_mat->vmgm_c_adt); |
526 printf("Start sector of VMGM_VOBU_ADMAP: %08x\n", | 526 printf("Start sector of VMGM_VOBU_ADMAP: %08x\n", |
527 vmgi_mat->vmgm_vobu_admap); | 527 vmgi_mat->vmgm_vobu_admap); |
528 printf("Video attributes of VMGM_VOBS: "); | 528 printf("Video attributes of VMGM_VOBS: "); |
529 ifo_print_video_attributes(5, &vmgi_mat->vmgm_video_attr); | 529 ifo_print_video_attributes(5, &vmgi_mat->vmgm_video_attr); |
530 printf("\n"); | 530 printf("\n"); |
531 printf("VMGM Number of Audio attributes: %i\n", | 531 printf("VMGM Number of Audio attributes: %i\n", |
532 vmgi_mat->nr_of_vmgm_audio_streams); | 532 vmgi_mat->nr_of_vmgm_audio_streams); |
533 if(vmgi_mat->nr_of_vmgm_audio_streams > 0) { | 533 if(vmgi_mat->nr_of_vmgm_audio_streams > 0) { |
534 printf("\tstream %i status: ", 1); | 534 printf("\tstream %i status: ", 1); |
535 ifo_print_audio_attributes(5, &vmgi_mat->vmgm_audio_attr); | 535 ifo_print_audio_attributes(5, &vmgi_mat->vmgm_audio_attr); |
536 printf("\n"); | 536 printf("\n"); |
537 } | 537 } |
538 printf("VMGM Number of Sub-picture attributes: %i\n", | 538 printf("VMGM Number of Sub-picture attributes: %i\n", |
539 vmgi_mat->nr_of_vmgm_subp_streams); | 539 vmgi_mat->nr_of_vmgm_subp_streams); |
540 if(vmgi_mat->nr_of_vmgm_subp_streams > 0) { | 540 if(vmgi_mat->nr_of_vmgm_subp_streams > 0) { |
541 printf("\tstream %2i status: ", 1); | 541 printf("\tstream %2i status: ", 1); |
542 ifo_print_subp_attributes(5, &vmgi_mat->vmgm_subp_attr); | 542 ifo_print_subp_attributes(5, &vmgi_mat->vmgm_subp_attr); |
543 printf("\n"); | 543 printf("\n"); |
549 int i; | 549 int i; |
550 | 550 |
551 printf("VTS Identifier: %.12s\n", vtsi_mat->vts_identifier); | 551 printf("VTS Identifier: %.12s\n", vtsi_mat->vts_identifier); |
552 printf("Last Sector of VTS: %08x\n", vtsi_mat->vts_last_sector); | 552 printf("Last Sector of VTS: %08x\n", vtsi_mat->vts_last_sector); |
553 printf("Last Sector of VTSI: %08x\n", vtsi_mat->vtsi_last_sector); | 553 printf("Last Sector of VTSI: %08x\n", vtsi_mat->vtsi_last_sector); |
554 printf("Specification version number: %01x.%01x\n", | 554 printf("Specification version number: %01x.%01x\n", |
555 vtsi_mat->specification_version>>4, | 555 vtsi_mat->specification_version>>4, |
556 vtsi_mat->specification_version&0xf); | 556 vtsi_mat->specification_version&0xf); |
557 printf("VTS Category: %08x\n", vtsi_mat->vts_category); | 557 printf("VTS Category: %08x\n", vtsi_mat->vts_category); |
558 printf("End byte of VTSI_MAT: %08x\n", vtsi_mat->vtsi_last_byte); | 558 printf("End byte of VTSI_MAT: %08x\n", vtsi_mat->vtsi_last_byte); |
559 printf("Start sector of VTSM_VOBS: %08x\n", vtsi_mat->vtsm_vobs); | 559 printf("Start sector of VTSM_VOBS: %08x\n", vtsi_mat->vtsm_vobs); |
560 printf("Start sector of VTSTT_VOBS: %08x\n", vtsi_mat->vtstt_vobs); | 560 printf("Start sector of VTSTT_VOBS: %08x\n", vtsi_mat->vtstt_vobs); |
568 printf("Start sector of VTS_VOBU_ADMAP: %08x\n", vtsi_mat->vts_vobu_admap); | 568 printf("Start sector of VTS_VOBU_ADMAP: %08x\n", vtsi_mat->vts_vobu_admap); |
569 | 569 |
570 printf("Video attributes of VTSM_VOBS: "); | 570 printf("Video attributes of VTSM_VOBS: "); |
571 ifo_print_video_attributes(5, &vtsi_mat->vtsm_video_attr); | 571 ifo_print_video_attributes(5, &vtsi_mat->vtsm_video_attr); |
572 printf("\n"); | 572 printf("\n"); |
573 | 573 |
574 printf("VTSM Number of Audio attributes: %i\n", | 574 printf("VTSM Number of Audio attributes: %i\n", |
575 vtsi_mat->nr_of_vtsm_audio_streams); | 575 vtsi_mat->nr_of_vtsm_audio_streams); |
576 if(vtsi_mat->nr_of_vtsm_audio_streams > 0) { | 576 if(vtsi_mat->nr_of_vtsm_audio_streams > 0) { |
577 printf("\tstream %i status: ", 1); | 577 printf("\tstream %i status: ", 1); |
578 ifo_print_audio_attributes(5, &vtsi_mat->vtsm_audio_attr); | 578 ifo_print_audio_attributes(5, &vtsi_mat->vtsm_audio_attr); |
579 printf("\n"); | 579 printf("\n"); |
580 } | 580 } |
581 | 581 |
582 printf("VTSM Number of Sub-picture attributes: %i\n", | 582 printf("VTSM Number of Sub-picture attributes: %i\n", |
583 vtsi_mat->nr_of_vtsm_subp_streams); | 583 vtsi_mat->nr_of_vtsm_subp_streams); |
584 if(vtsi_mat->nr_of_vtsm_subp_streams > 0) { | 584 if(vtsi_mat->nr_of_vtsm_subp_streams > 0) { |
585 printf("\tstream %2i status: ", 1); | 585 printf("\tstream %2i status: ", 1); |
586 ifo_print_subp_attributes(5, &vtsi_mat->vtsm_subp_attr); | 586 ifo_print_subp_attributes(5, &vtsi_mat->vtsm_subp_attr); |
587 printf("\n"); | 587 printf("\n"); |
588 } | 588 } |
589 | 589 |
590 printf("Video attributes of VTS_VOBS: "); | 590 printf("Video attributes of VTS_VOBS: "); |
591 ifo_print_video_attributes(5, &vtsi_mat->vts_video_attr); | 591 ifo_print_video_attributes(5, &vtsi_mat->vts_video_attr); |
592 printf("\n"); | 592 printf("\n"); |
593 | 593 |
594 printf("VTS Number of Audio attributes: %i\n", | 594 printf("VTS Number of Audio attributes: %i\n", |
595 vtsi_mat->nr_of_vts_audio_streams); | 595 vtsi_mat->nr_of_vts_audio_streams); |
596 for(i = 0; i < vtsi_mat->nr_of_vts_audio_streams; i++) { | 596 for(i = 0; i < vtsi_mat->nr_of_vts_audio_streams; i++) { |
597 printf("\tstream %i status: ", i); | 597 printf("\tstream %i status: ", i); |
598 ifo_print_audio_attributes(5, &vtsi_mat->vts_audio_attr[i]); | 598 ifo_print_audio_attributes(5, &vtsi_mat->vts_audio_attr[i]); |
599 printf("\n"); | 599 printf("\n"); |
600 } | 600 } |
601 | 601 |
602 printf("VTS Number of Subpicture attributes: %i\n", | 602 printf("VTS Number of Subpicture attributes: %i\n", |
603 vtsi_mat->nr_of_vts_subp_streams); | 603 vtsi_mat->nr_of_vts_subp_streams); |
604 for(i = 0; i < vtsi_mat->nr_of_vts_subp_streams; i++) { | 604 for(i = 0; i < vtsi_mat->nr_of_vts_subp_streams; i++) { |
605 printf("\tstream %2i status: ", i); | 605 printf("\tstream %2i status: ", i); |
606 ifo_print_subp_attributes(5, &vtsi_mat->vts_subp_attr[i]); | 606 ifo_print_subp_attributes(5, &vtsi_mat->vts_subp_attr[i]); |
607 printf("\n"); | 607 printf("\n"); |
609 } | 609 } |
610 | 610 |
611 | 611 |
612 static void ifo_print_PGC_COMMAND_TBL(pgc_command_tbl_t *cmd_tbl) { | 612 static void ifo_print_PGC_COMMAND_TBL(pgc_command_tbl_t *cmd_tbl) { |
613 int i; | 613 int i; |
614 | 614 |
615 if(cmd_tbl == NULL) { | 615 if(cmd_tbl == NULL) { |
616 printf("No Command table present\n"); | 616 printf("No Command table present\n"); |
617 return; | 617 return; |
618 } | 618 } |
619 | 619 |
620 printf("Number of Pre commands: %i\n", cmd_tbl->nr_of_pre); | 620 printf("Number of Pre commands: %i\n", cmd_tbl->nr_of_pre); |
621 for(i = 0; i < cmd_tbl->nr_of_pre; i++) { | 621 for(i = 0; i < cmd_tbl->nr_of_pre; i++) { |
622 ifo_print_cmd(i, &cmd_tbl->pre_cmds[i]); | 622 ifo_print_cmd(i, &cmd_tbl->pre_cmds[i]); |
623 } | 623 } |
624 | 624 |
634 } | 634 } |
635 | 635 |
636 | 636 |
637 static void ifo_print_PGC_PROGRAM_MAP(pgc_program_map_t *program_map, int nr) { | 637 static void ifo_print_PGC_PROGRAM_MAP(pgc_program_map_t *program_map, int nr) { |
638 int i; | 638 int i; |
639 | 639 |
640 if(program_map == NULL) { | 640 if(program_map == NULL) { |
641 printf("No Program map present\n"); | 641 printf("No Program map present\n"); |
642 return; | 642 return; |
643 } | 643 } |
644 | 644 |
645 for(i = 0; i < nr; i++) { | 645 for(i = 0; i < nr; i++) { |
646 printf("Program %3i Entry Cell: %3i\n", i + 1, program_map[i]); | 646 printf("Program %3i Entry Cell: %3i\n", i + 1, program_map[i]); |
647 } | 647 } |
648 } | 648 } |
649 | 649 |
650 | 650 |
651 static void ifo_print_CELL_PLAYBACK(cell_playback_t *cell_playback, int nr) { | 651 static void ifo_print_CELL_PLAYBACK(cell_playback_t *cell_playback, int nr) { |
652 int i; | 652 int i; |
653 | 653 |
654 if(cell_playback == NULL) { | 654 if(cell_playback == NULL) { |
655 printf("No Cell Playback info present\n"); | 655 printf("No Cell Playback info present\n"); |
656 return; | 656 return; |
657 } | 657 } |
658 | 658 |
659 for(i=0;i<nr;i++) { | 659 for(i=0;i<nr;i++) { |
660 printf("Cell: %3i ", i + 1); | 660 printf("Cell: %3i ", i + 1); |
661 | 661 |
662 dvdread_print_time(&cell_playback[i].playback_time); | 662 dvdread_print_time(&cell_playback[i].playback_time); |
663 printf("\t"); | 663 printf("\t"); |
674 s = ""; break; | 674 s = ""; break; |
675 case 3: | 675 case 3: |
676 s = "last"; break; | 676 s = "last"; break; |
677 } | 677 } |
678 printf("%s cell in the block ", s); | 678 printf("%s cell in the block ", s); |
679 | 679 |
680 switch(cell_playback[i].block_type) { | 680 switch(cell_playback[i].block_type) { |
681 case 0: | 681 case 0: |
682 printf("not part of the block "); | 682 printf("not part of the block "); |
683 break; | 683 break; |
684 case 1: | 684 case 1: |
706 printf("Unknown 0x%x ", cell_playback[i].unknown2); | 706 printf("Unknown 0x%x ", cell_playback[i].unknown2); |
707 if(cell_playback[i].still_time) | 707 if(cell_playback[i].still_time) |
708 printf("still time %d ", cell_playback[i].still_time); | 708 printf("still time %d ", cell_playback[i].still_time); |
709 if(cell_playback[i].cell_cmd_nr) | 709 if(cell_playback[i].cell_cmd_nr) |
710 printf("cell command %d", cell_playback[i].cell_cmd_nr); | 710 printf("cell command %d", cell_playback[i].cell_cmd_nr); |
711 | 711 |
712 printf("\n\tStart sector: %08x\tFirst ILVU end sector: %08x\n", | 712 printf("\n\tStart sector: %08x\tFirst ILVU end sector: %08x\n", |
713 cell_playback[i].first_sector, | 713 cell_playback[i].first_sector, |
714 cell_playback[i].first_ilvu_end_sector); | 714 cell_playback[i].first_ilvu_end_sector); |
715 printf("\tEnd sector: %08x\tLast VOBU start sector: %08x\n", | 715 printf("\tEnd sector: %08x\tLast VOBU start sector: %08x\n", |
716 cell_playback[i].last_sector, | 716 cell_playback[i].last_sector, |
717 cell_playback[i].last_vobu_start_sector); | 717 cell_playback[i].last_vobu_start_sector); |
718 } | 718 } |
719 } | 719 } |
720 | 720 |
721 static void ifo_print_CELL_POSITION(cell_position_t *cell_position, int nr) { | 721 static void ifo_print_CELL_POSITION(cell_position_t *cell_position, int nr) { |
722 int i; | 722 int i; |
723 | 723 |
724 if(cell_position == NULL) { | 724 if(cell_position == NULL) { |
725 printf("No Cell Position info present\n"); | 725 printf("No Cell Position info present\n"); |
726 return; | 726 return; |
727 } | 727 } |
728 | 728 |
729 for(i=0;i<nr;i++) { | 729 for(i=0;i<nr;i++) { |
730 printf("Cell: %3i has VOB ID: %3i, Cell ID: %3i\n", i + 1, | 730 printf("Cell: %3i has VOB ID: %3i, Cell ID: %3i\n", i + 1, |
731 cell_position[i].vob_id_nr, cell_position[i].cell_nr); | 731 cell_position[i].vob_id_nr, cell_position[i].cell_nr); |
732 } | 732 } |
733 } | 733 } |
734 | 734 |
735 | 735 |
736 void ifo_print_PGC(pgc_t *pgc) { | 736 void ifo_print_PGC(pgc_t *pgc) { |
737 int i; | 737 int i; |
738 | 738 |
739 if (!pgc) { | 739 if (!pgc) { |
740 printf("None\n"); | 740 printf("None\n"); |
741 return; | 741 return; |
742 } | 742 } |
743 printf("Number of Programs: %i\n", pgc->nr_of_programs); | 743 printf("Number of Programs: %i\n", pgc->nr_of_programs); |
747 dvdread_print_time(&pgc->playback_time); printf("\n"); | 747 dvdread_print_time(&pgc->playback_time); printf("\n"); |
748 | 748 |
749 /* If no programs/no time then does this mean anything? */ | 749 /* If no programs/no time then does this mean anything? */ |
750 printf("Prohibited user operations: "); | 750 printf("Prohibited user operations: "); |
751 ifo_print_USER_OPS(&pgc->prohibited_ops); | 751 ifo_print_USER_OPS(&pgc->prohibited_ops); |
752 | 752 |
753 for(i = 0; i < 8; i++) { | 753 for(i = 0; i < 8; i++) { |
754 if(pgc->audio_control[i] & 0x8000) { /* The 'is present' bit */ | 754 if(pgc->audio_control[i] & 0x8000) { /* The 'is present' bit */ |
755 printf("Audio stream %i control: %04x\n", | 755 printf("Audio stream %i control: %04x\n", |
756 i, pgc->audio_control[i]); | 756 i, pgc->audio_control[i]); |
757 } | 757 } |
758 } | 758 } |
759 | 759 |
760 for(i = 0; i < 32; i++) { | 760 for(i = 0; i < 32; i++) { |
761 if(pgc->subp_control[i] & 0x80000000) { /* The 'is present' bit */ | 761 if(pgc->subp_control[i] & 0x80000000) { /* The 'is present' bit */ |
762 printf("Subpicture stream %2i control: %08x: 4:3=%d, Wide=%d, Letterbox=%d, Pan-Scan=%d\n", | 762 printf("Subpicture stream %2i control: %08x: 4:3=%d, Wide=%d, Letterbox=%d, Pan-Scan=%d\n", |
763 i, pgc->subp_control[i], | 763 i, pgc->subp_control[i], |
764 (pgc->subp_control[i] >>24) & 0x1f, | 764 (pgc->subp_control[i] >>24) & 0x1f, |
765 (pgc->subp_control[i] >>16) & 0x1f, | 765 (pgc->subp_control[i] >>16) & 0x1f, |
766 (pgc->subp_control[i] >>8) & 0x1f, | 766 (pgc->subp_control[i] >>8) & 0x1f, |
767 (pgc->subp_control[i] ) & 0x1f); | 767 (pgc->subp_control[i] ) & 0x1f); |
768 } | 768 } |
769 } | 769 } |
770 | 770 |
771 printf("Next PGC number: %i\n", pgc->next_pgc_nr); | 771 printf("Next PGC number: %i\n", pgc->next_pgc_nr); |
772 printf("Prev PGC number: %i\n", pgc->prev_pgc_nr); | 772 printf("Prev PGC number: %i\n", pgc->prev_pgc_nr); |
773 printf("GoUp PGC number: %i\n", pgc->goup_pgc_nr); | 773 printf("GoUp PGC number: %i\n", pgc->goup_pgc_nr); |
774 if(pgc->nr_of_programs != 0) { | 774 if(pgc->nr_of_programs != 0) { |
775 printf("Still time: %i seconds (255=inf)\n", pgc->still_time); | 775 printf("Still time: %i seconds (255=inf)\n", pgc->still_time); |
776 printf("PG Playback mode %02x\n", pgc->pg_playback_mode); | 776 printf("PG Playback mode %02x\n", pgc->pg_playback_mode); |
777 } | 777 } |
778 | 778 |
779 if(pgc->nr_of_programs != 0) { | 779 if(pgc->nr_of_programs != 0) { |
780 for(i = 0; i < 16; i++) { | 780 for(i = 0; i < 16; i++) { |
781 printf("Color %2i: %08x\n", i, pgc->palette[i]); | 781 printf("Color %2i: %08x\n", i, pgc->palette[i]); |
782 } | 782 } |
783 } | 783 } |
784 | 784 |
785 /* Memmory offsets to div. tables. */ | 785 /* Memmory offsets to div. tables. */ |
786 ifo_print_PGC_COMMAND_TBL(pgc->command_tbl); | 786 ifo_print_PGC_COMMAND_TBL(pgc->command_tbl); |
787 ifo_print_PGC_PROGRAM_MAP(pgc->program_map, pgc->nr_of_programs); | 787 ifo_print_PGC_PROGRAM_MAP(pgc->program_map, pgc->nr_of_programs); |
788 ifo_print_CELL_PLAYBACK(pgc->cell_playback, pgc->nr_of_cells); | 788 ifo_print_CELL_PLAYBACK(pgc->cell_playback, pgc->nr_of_cells); |
789 ifo_print_CELL_POSITION(pgc->cell_position, pgc->nr_of_cells); | 789 ifo_print_CELL_POSITION(pgc->cell_position, pgc->nr_of_cells); |
790 } | 790 } |
791 | 791 |
792 | 792 |
793 void ifo_print_TT_SRPT(tt_srpt_t *tt_srpt) { | 793 void ifo_print_TT_SRPT(tt_srpt_t *tt_srpt) { |
794 int i; | 794 int i; |
795 | 795 |
796 printf("Number of TitleTrack search pointers: %i\n", | 796 printf("Number of TitleTrack search pointers: %i\n", |
797 tt_srpt->nr_of_srpts); | 797 tt_srpt->nr_of_srpts); |
798 for(i=0;i<tt_srpt->nr_of_srpts;i++) { | 798 for(i=0;i<tt_srpt->nr_of_srpts;i++) { |
799 printf("Title Track index %i\n", i + 1); | 799 printf("Title Track index %i\n", i + 1); |
800 printf("\tTitle set number (VTS): %i", | 800 printf("\tTitle set number (VTS): %i", |
801 tt_srpt->title[i].title_set_nr); | 801 tt_srpt->title[i].title_set_nr); |
802 printf("\tVTS_TTN: %i\n", tt_srpt->title[i].vts_ttn); | 802 printf("\tVTS_TTN: %i\n", tt_srpt->title[i].vts_ttn); |
803 printf("\tNumber of PTTs: %i\n", tt_srpt->title[i].nr_of_ptts); | 803 printf("\tNumber of PTTs: %i\n", tt_srpt->title[i].nr_of_ptts); |
804 printf("\tNumber of angles: %i\n", | 804 printf("\tNumber of angles: %i\n", |
805 tt_srpt->title[i].nr_of_angles); | 805 tt_srpt->title[i].nr_of_angles); |
806 | 806 |
807 printf("\tTitle playback type: (%02x)\n", | 807 printf("\tTitle playback type: (%02x)\n", |
808 *(uint8_t *)&(tt_srpt->title[i].pb_ty)); | 808 *(uint8_t *)&(tt_srpt->title[i].pb_ty)); |
809 printf("\t\t%s\n", | 809 printf("\t\t%s\n", |
810 tt_srpt->title[i].pb_ty.multi_or_random_pgc_title ? "Random or Shuffle" : "Sequencial"); | 810 tt_srpt->title[i].pb_ty.multi_or_random_pgc_title ? "Random or Shuffle" : "Sequencial"); |
811 if (tt_srpt->title[i].pb_ty.jlc_exists_in_cell_cmd) printf("\t\tJump/Link/Call exists in cell cmd\n"); | 811 if (tt_srpt->title[i].pb_ty.jlc_exists_in_cell_cmd) printf("\t\tJump/Link/Call exists in cell cmd\n"); |
812 if (tt_srpt->title[i].pb_ty.jlc_exists_in_prepost_cmd) printf("\t\tJump/Link/Call exists in pre/post cmd\n"); | 812 if (tt_srpt->title[i].pb_ty.jlc_exists_in_prepost_cmd) printf("\t\tJump/Link/Call exists in pre/post cmd\n"); |
813 if (tt_srpt->title[i].pb_ty.jlc_exists_in_button_cmd) printf("\t\tJump/Link/Call exists in button cmd\n"); | 813 if (tt_srpt->title[i].pb_ty.jlc_exists_in_button_cmd) printf("\t\tJump/Link/Call exists in button cmd\n"); |
814 if (tt_srpt->title[i].pb_ty.jlc_exists_in_tt_dom) printf("\t\tJump/Link/Call exists in tt_dom cmd\n"); | 814 if (tt_srpt->title[i].pb_ty.jlc_exists_in_tt_dom) printf("\t\tJump/Link/Call exists in tt_dom cmd\n"); |
815 printf("\t\tTitle or time play:%d\n", tt_srpt->title[i].pb_ty.title_or_time_play); | 815 printf("\t\tTitle or time play:%d\n", tt_srpt->title[i].pb_ty.title_or_time_play); |
816 printf("\t\tChapter search or play:%d\n", tt_srpt->title[i].pb_ty.chapter_search_or_play); | 816 printf("\t\tChapter search or play:%d\n", tt_srpt->title[i].pb_ty.chapter_search_or_play); |
817 | 817 |
818 printf("\tParental ID field: %04x\n", | 818 printf("\tParental ID field: %04x\n", |
819 tt_srpt->title[i].parental_id); | 819 tt_srpt->title[i].parental_id); |
820 printf("\tTitle set starting sector %08x\n", | 820 printf("\tTitle set starting sector %08x\n", |
821 tt_srpt->title[i].title_set_sector); | 821 tt_srpt->title[i].title_set_sector); |
822 } | 822 } |
823 } | 823 } |
824 | 824 |
825 | 825 |
826 void ifo_print_VTS_PTT_SRPT(vts_ptt_srpt_t *vts_ptt_srpt) { | 826 void ifo_print_VTS_PTT_SRPT(vts_ptt_srpt_t *vts_ptt_srpt) { |
827 int i, j; | 827 int i, j; |
828 printf(" nr_of_srpts %i last byte %i\n", | 828 printf(" nr_of_srpts %i last byte %i\n", |
829 vts_ptt_srpt->nr_of_srpts, | 829 vts_ptt_srpt->nr_of_srpts, |
830 vts_ptt_srpt->last_byte); | 830 vts_ptt_srpt->last_byte); |
831 for(i=0;i<vts_ptt_srpt->nr_of_srpts;i++) { | 831 for(i=0;i<vts_ptt_srpt->nr_of_srpts;i++) { |
832 for(j=0;j<vts_ptt_srpt->title[i].nr_of_ptts;j++) { | 832 for(j=0;j<vts_ptt_srpt->title[i].nr_of_ptts;j++) { |
833 printf("VTS_PTT_SRPT - Title %3i part %3i: PGC: %3i PG: %3i\n", | 833 printf("VTS_PTT_SRPT - Title %3i part %3i: PGC: %3i PG: %3i\n", |
834 i + 1, j + 1, | 834 i + 1, j + 1, |
835 vts_ptt_srpt->title[i].ptt[j].pgcn, | 835 vts_ptt_srpt->title[i].ptt[j].pgcn, |
836 vts_ptt_srpt->title[i].ptt[j].pgn ); | 836 vts_ptt_srpt->title[i].ptt[j].pgn ); |
837 } | 837 } |
838 } | 838 } |
839 } | 839 } |
844 printf("%02x ", *ptr++); | 844 printf("%02x ", *ptr++); |
845 } | 845 } |
846 | 846 |
847 void ifo_print_PTL_MAIT(ptl_mait_t *ptl_mait) { | 847 void ifo_print_PTL_MAIT(ptl_mait_t *ptl_mait) { |
848 int i, j; | 848 int i, j; |
849 | 849 |
850 printf("Number of Countries: %i\n", ptl_mait->nr_of_countries); | 850 printf("Number of Countries: %i\n", ptl_mait->nr_of_countries); |
851 printf("Number of VTSs: %i\n", ptl_mait->nr_of_vtss); | 851 printf("Number of VTSs: %i\n", ptl_mait->nr_of_vtss); |
852 //printf("Last byte: %i\n", ptl_mait->last_byte); | 852 //printf("Last byte: %i\n", ptl_mait->last_byte); |
853 | 853 |
854 for(i = 0; i < ptl_mait->nr_of_countries; i++) { | 854 for(i = 0; i < ptl_mait->nr_of_countries; i++) { |
855 printf("Country code: %c%c\n", | 855 printf("Country code: %c%c\n", |
856 ptl_mait->countries[i].country_code >> 8, | 856 ptl_mait->countries[i].country_code >> 8, |
857 ptl_mait->countries[i].country_code & 0xff); | 857 ptl_mait->countries[i].country_code & 0xff); |
858 /* | 858 /* |
859 printf("Start byte: %04x %i\n", | 859 printf("Start byte: %04x %i\n", |
860 ptl_mait->countries[i].pf_ptl_mai_start_byte, | 860 ptl_mait->countries[i].pf_ptl_mai_start_byte, |
861 ptl_mait->countries[i].pf_ptl_mai_start_byte); | 861 ptl_mait->countries[i].pf_ptl_mai_start_byte); |
862 */ | 862 */ |
863 /* This seems to be pointing at a array with 8 2byte fields per VTS | 863 /* This seems to be pointing at a array with 8 2byte fields per VTS |
864 ? and one extra for the menu? always an odd number of VTSs on | 864 ? and one extra for the menu? always an odd number of VTSs on |
865 all the dics I tested so it might be padding to even also. | 865 all the dics I tested so it might be padding to even also. |
866 If it is for the menu it probably the first entry. */ | 866 If it is for the menu it probably the first entry. */ |
867 for(j=0;j<8;j++) { | 867 for(j=0;j<8;j++) { |
868 hexdump( (uint8_t *)ptl_mait->countries - PTL_MAIT_COUNTRY_SIZE | 868 hexdump( (uint8_t *)ptl_mait->countries - PTL_MAIT_COUNTRY_SIZE |
869 + ptl_mait->countries[i].pf_ptl_mai_start_byte | 869 + ptl_mait->countries[i].pf_ptl_mai_start_byte |
870 + j*(ptl_mait->nr_of_vtss+1)*2, (ptl_mait->nr_of_vtss+1)*2); | 870 + j*(ptl_mait->nr_of_vtss+1)*2, (ptl_mait->nr_of_vtss+1)*2); |
871 printf("\n"); | 871 printf("\n"); |
872 } | 872 } |
873 } | 873 } |
896 } | 896 } |
897 } | 897 } |
898 | 898 |
899 void ifo_print_C_ADT(c_adt_t *c_adt) { | 899 void ifo_print_C_ADT(c_adt_t *c_adt) { |
900 int i, entries; | 900 int i, entries; |
901 | 901 |
902 printf("Number of VOBs in this VOBS: %i\n", c_adt->nr_of_vobs); | 902 printf("Number of VOBs in this VOBS: %i\n", c_adt->nr_of_vobs); |
903 //entries = c_adt->nr_of_vobs; | 903 //entries = c_adt->nr_of_vobs; |
904 entries = (c_adt->last_byte + 1 - C_ADT_SIZE)/sizeof(c_adt_t); | 904 entries = (c_adt->last_byte + 1 - C_ADT_SIZE)/sizeof(c_adt_t); |
905 | 905 |
906 for(i = 0; i < entries; i++) { | 906 for(i = 0; i < entries; i++) { |
907 printf("VOB ID: %3i, Cell ID: %3i ", | 907 printf("VOB ID: %3i, Cell ID: %3i ", |
908 c_adt->cell_adr_table[i].vob_id, c_adt->cell_adr_table[i].cell_id); | 908 c_adt->cell_adr_table[i].vob_id, c_adt->cell_adr_table[i].cell_id); |
909 printf("Sector (first): 0x%08x (last): 0x%08x\n", | 909 printf("Sector (first): 0x%08x (last): 0x%08x\n", |
910 c_adt->cell_adr_table[i].start_sector, | 910 c_adt->cell_adr_table[i].start_sector, |
911 c_adt->cell_adr_table[i].last_sector); | 911 c_adt->cell_adr_table[i].last_sector); |
912 } | 912 } |
913 } | 913 } |
914 | 914 |
915 | 915 |
916 void ifo_print_VOBU_ADMAP(vobu_admap_t *vobu_admap) { | 916 void ifo_print_VOBU_ADMAP(vobu_admap_t *vobu_admap) { |
917 int i, entries; | 917 int i, entries; |
918 | 918 |
919 entries = (vobu_admap->last_byte + 1 - VOBU_ADMAP_SIZE)/4; | 919 entries = (vobu_admap->last_byte + 1 - VOBU_ADMAP_SIZE)/4; |
920 for(i = 0; i < entries; i++) { | 920 for(i = 0; i < entries; i++) { |
921 printf("VOBU %5i First sector: 0x%08x\n", i + 1, | 921 printf("VOBU %5i First sector: 0x%08x\n", i + 1, |
922 vobu_admap->vobu_start_sectors[i]); | 922 vobu_admap->vobu_start_sectors[i]); |
923 } | 923 } |
953 } | 953 } |
954 | 954 |
955 /* pgc_type=1 for menu, 0 for title. */ | 955 /* pgc_type=1 for menu, 0 for title. */ |
956 void ifo_print_PGCIT(pgcit_t *pgcit, int pgc_type) { | 956 void ifo_print_PGCIT(pgcit_t *pgcit, int pgc_type) { |
957 int i; | 957 int i; |
958 | 958 |
959 printf("\nNumber of Program Chains: %3i\n", pgcit->nr_of_pgci_srp); | 959 printf("\nNumber of Program Chains: %3i\n", pgcit->nr_of_pgci_srp); |
960 for(i = 0; i < pgcit->nr_of_pgci_srp; i++) { | 960 for(i = 0; i < pgcit->nr_of_pgci_srp; i++) { |
961 printf("\nProgram (PGC): %3i\n", i + 1); | 961 printf("\nProgram (PGC): %3i\n", i + 1); |
962 if (pgc_type) { | 962 if (pgc_type) { |
963 printf("PGC Category: Entry PGC %d, Menu Type=0x%02x:%s (Entry id 0x%02x), ", | 963 printf("PGC Category: Entry PGC %d, Menu Type=0x%02x:%s (Entry id 0x%02x), ", |
977 } | 977 } |
978 | 978 |
979 | 979 |
980 void ifo_print_PGCI_UT(pgci_ut_t *pgci_ut) { | 980 void ifo_print_PGCI_UT(pgci_ut_t *pgci_ut) { |
981 int i, menu; | 981 int i, menu; |
982 | 982 |
983 printf("Number of Menu Language Units (PGCI_LU): %3i\n", pgci_ut->nr_of_lus); | 983 printf("Number of Menu Language Units (PGCI_LU): %3i\n", pgci_ut->nr_of_lus); |
984 for(i = 0; i < pgci_ut->nr_of_lus; i++) { | 984 for(i = 0; i < pgci_ut->nr_of_lus; i++) { |
985 printf("\nMenu Language Unit %d\n", i+1); | 985 printf("\nMenu Language Unit %d\n", i+1); |
986 printf("\nMenu Language Code: %c%c\n", | 986 printf("\nMenu Language Code: %c%c\n", |
987 pgci_ut->lu[i].lang_code >> 8, | 987 pgci_ut->lu[i].lang_code >> 8, |
988 pgci_ut->lu[i].lang_code & 0xff); | 988 pgci_ut->lu[i].lang_code & 0xff); |
989 | 989 |
990 menu = pgci_ut->lu[i].exists; | 990 menu = pgci_ut->lu[i].exists; |
991 printf("Menu Existence: %02x: ", menu); | 991 printf("Menu Existence: %02x: ", menu); |
992 if (menu == 0) { | 992 if (menu == 0) { |
993 printf("No menus "); | 993 printf("No menus "); |
994 } | 994 } |
1022 } | 1022 } |
1023 | 1023 |
1024 | 1024 |
1025 static void ifo_print_VTS_ATTRIBUTES(vts_attributes_t *vts_attributes) { | 1025 static void ifo_print_VTS_ATTRIBUTES(vts_attributes_t *vts_attributes) { |
1026 int i; | 1026 int i; |
1027 | 1027 |
1028 printf("VTS_CAT Application type: %08x\n", vts_attributes->vts_cat); | 1028 printf("VTS_CAT Application type: %08x\n", vts_attributes->vts_cat); |
1029 | 1029 |
1030 printf("Video attributes of VTSM_VOBS: "); | 1030 printf("Video attributes of VTSM_VOBS: "); |
1031 ifo_print_video_attributes(5, &vts_attributes->vtsm_vobs_attr); | 1031 ifo_print_video_attributes(5, &vts_attributes->vtsm_vobs_attr); |
1032 printf("\n"); | 1032 printf("\n"); |
1033 printf("Number of Audio streams: %i\n", | 1033 printf("Number of Audio streams: %i\n", |
1034 vts_attributes->nr_of_vtsm_audio_streams); | 1034 vts_attributes->nr_of_vtsm_audio_streams); |
1035 if(vts_attributes->nr_of_vtsm_audio_streams > 0) { | 1035 if(vts_attributes->nr_of_vtsm_audio_streams > 0) { |
1036 printf("\tstream %i attributes: ", 1); | 1036 printf("\tstream %i attributes: ", 1); |
1037 ifo_print_audio_attributes(5, &vts_attributes->vtsm_audio_attr); | 1037 ifo_print_audio_attributes(5, &vts_attributes->vtsm_audio_attr); |
1038 printf("\n"); | 1038 printf("\n"); |
1039 } | 1039 } |
1040 printf("Number of Subpicture streams: %i\n", | 1040 printf("Number of Subpicture streams: %i\n", |
1041 vts_attributes->nr_of_vtsm_subp_streams); | 1041 vts_attributes->nr_of_vtsm_subp_streams); |
1042 if(vts_attributes->nr_of_vtsm_subp_streams > 0) { | 1042 if(vts_attributes->nr_of_vtsm_subp_streams > 0) { |
1043 printf("\tstream %2i attributes: ", 1); | 1043 printf("\tstream %2i attributes: ", 1); |
1044 ifo_print_subp_attributes(5, &vts_attributes->vtsm_subp_attr); | 1044 ifo_print_subp_attributes(5, &vts_attributes->vtsm_subp_attr); |
1045 printf("\n"); | 1045 printf("\n"); |
1046 } | 1046 } |
1047 | 1047 |
1048 printf("Video attributes of VTSTT_VOBS: "); | 1048 printf("Video attributes of VTSTT_VOBS: "); |
1049 ifo_print_video_attributes(5, &vts_attributes->vtstt_vobs_video_attr); | 1049 ifo_print_video_attributes(5, &vts_attributes->vtstt_vobs_video_attr); |
1050 printf("\n"); | 1050 printf("\n"); |
1051 printf("Number of Audio streams: %i\n", | 1051 printf("Number of Audio streams: %i\n", |
1052 vts_attributes->nr_of_vtstt_audio_streams); | 1052 vts_attributes->nr_of_vtstt_audio_streams); |
1053 for(i = 0; i < vts_attributes->nr_of_vtstt_audio_streams; i++) { | 1053 for(i = 0; i < vts_attributes->nr_of_vtstt_audio_streams; i++) { |
1054 printf("\tstream %i attributes: ", i); | 1054 printf("\tstream %i attributes: ", i); |
1055 ifo_print_audio_attributes(5, &vts_attributes->vtstt_audio_attr[i]); | 1055 ifo_print_audio_attributes(5, &vts_attributes->vtstt_audio_attr[i]); |
1056 printf("\n"); | 1056 printf("\n"); |
1057 } | 1057 } |
1058 | 1058 |
1059 printf("Number of Subpicture streams: %i\n", | 1059 printf("Number of Subpicture streams: %i\n", |
1060 vts_attributes->nr_of_vtstt_subp_streams); | 1060 vts_attributes->nr_of_vtstt_subp_streams); |
1061 for(i = 0; i < vts_attributes->nr_of_vtstt_subp_streams; i++) { | 1061 for(i = 0; i < vts_attributes->nr_of_vtstt_subp_streams; i++) { |
1062 printf("\tstream %2i attributes: ", i); | 1062 printf("\tstream %2i attributes: ", i); |
1063 ifo_print_subp_attributes(5, &vts_attributes->vtstt_subp_attr[i]); | 1063 ifo_print_subp_attributes(5, &vts_attributes->vtstt_subp_attr[i]); |
1064 printf("\n"); | 1064 printf("\n"); |
1065 } | 1065 } |
1066 } | 1066 } |
1067 | 1067 |
1068 | 1068 |
1069 void ifo_print_VTS_ATRT(vts_atrt_t *vts_atrt) { | 1069 void ifo_print_VTS_ATRT(vts_atrt_t *vts_atrt) { |
1070 int i; | 1070 int i; |
1071 | 1071 |
1072 printf("Number of Video Title Sets: %3i\n", vts_atrt->nr_of_vtss); | 1072 printf("Number of Video Title Sets: %3i\n", vts_atrt->nr_of_vtss); |
1073 for(i = 0; i < vts_atrt->nr_of_vtss; i++) { | 1073 for(i = 0; i < vts_atrt->nr_of_vtss; i++) { |
1074 printf("\nVideo Title Set %i\n", i + 1); | 1074 printf("\nVideo Title Set %i\n", i + 1); |
1075 ifo_print_VTS_ATTRIBUTES(&vts_atrt->vts[i]); | 1075 ifo_print_VTS_ATTRIBUTES(&vts_atrt->vts[i]); |
1076 } | 1076 } |
1083 ifohandle = ifoOpen(dvd, title); | 1083 ifohandle = ifoOpen(dvd, title); |
1084 if(!ifohandle) { | 1084 if(!ifohandle) { |
1085 fprintf(stderr, "Can't open info file for title %d\n", title); | 1085 fprintf(stderr, "Can't open info file for title %d\n", title); |
1086 return; | 1086 return; |
1087 } | 1087 } |
1088 | 1088 |
1089 | 1089 |
1090 if(ifohandle->vmgi_mat) { | 1090 if(ifohandle->vmgi_mat) { |
1091 | 1091 |
1092 printf("VMG top level\n-------------\n"); | 1092 printf("VMG top level\n-------------\n"); |
1093 ifo_print_VMGI_MAT(ifohandle->vmgi_mat); | 1093 ifo_print_VMGI_MAT(ifohandle->vmgi_mat); |
1094 | 1094 |
1119 } | 1119 } |
1120 | 1120 |
1121 printf("\nVideo Title Set Attribute Table\n"); | 1121 printf("\nVideo Title Set Attribute Table\n"); |
1122 printf( "-------------------------------\n"); | 1122 printf( "-------------------------------\n"); |
1123 ifo_print_VTS_ATRT(ifohandle->vts_atrt); | 1123 ifo_print_VTS_ATRT(ifohandle->vts_atrt); |
1124 | 1124 |
1125 printf("\nText Data Manager Information\n"); | 1125 printf("\nText Data Manager Information\n"); |
1126 printf( "-----------------------------\n"); | 1126 printf( "-----------------------------\n"); |
1127 if(ifohandle->txtdt_mgi) { | 1127 if(ifohandle->txtdt_mgi) { |
1128 //ifo_print_TXTDT_MGI(&(vmgi->txtdt_mgi)); | 1128 //ifo_print_TXTDT_MGI(&(vmgi->txtdt_mgi)); |
1129 } else { | 1129 } else { |
1141 printf("\nVideo Manager Menu VOBU address map\n"); | 1141 printf("\nVideo Manager Menu VOBU address map\n"); |
1142 printf( "-----------------\n"); | 1142 printf( "-----------------\n"); |
1143 if(ifohandle->menu_vobu_admap) { | 1143 if(ifohandle->menu_vobu_admap) { |
1144 ifo_print_VOBU_ADMAP(ifohandle->menu_vobu_admap); | 1144 ifo_print_VOBU_ADMAP(ifohandle->menu_vobu_admap); |
1145 } else { | 1145 } else { |
1146 printf("No Menu VOBU address map present\n"); | 1146 printf("No Menu VOBU address map present\n"); |
1147 } | 1147 } |
1148 } | 1148 } |
1149 | 1149 |
1150 | 1150 |
1151 if(ifohandle->vtsi_mat) { | 1151 if(ifohandle->vtsi_mat) { |
1198 ifo_print_C_ADT(ifohandle->vts_c_adt); | 1198 ifo_print_C_ADT(ifohandle->vts_c_adt); |
1199 | 1199 |
1200 printf("\nVideo Title Set VOBU address map\n"); | 1200 printf("\nVideo Title Set VOBU address map\n"); |
1201 printf( "-----------------\n"); | 1201 printf( "-----------------\n"); |
1202 ifo_print_VOBU_ADMAP(ifohandle->vts_vobu_admap); | 1202 ifo_print_VOBU_ADMAP(ifohandle->vts_vobu_admap); |
1203 } | 1203 } |
1204 | 1204 |
1205 ifoClose(ifohandle); | 1205 ifoClose(ifohandle); |
1206 } | 1206 } |
1207 | 1207 |
1208 /* | 1208 /* |