⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 ifo_print.c

📁 有关mpeg2的deocde代码
💻 C
📖 第 1 页 / 共 3 页
字号:
      }    }    for(i = 0; i < 32; i++) {    if(pgc->subp_control[i] & 0x80000000) { /* The 'is present' bit */      printf("Subpicture stream %2i control: %08x\n", 	     i, pgc->subp_control[i]);    }  }    printf("Next PGC number: %i\n", pgc->next_pgc_nr);  printf("Prev PGC number: %i\n", pgc->prev_pgc_nr);  printf("GoUp PGC number: %i\n", pgc->goup_pgc_nr);  if(pgc->nr_of_programs != 0) {    printf("Still time: %i seconds (255=inf)\n", pgc->still_time);    if(pgc->pg_playback_mode == 0)      printf("PG Playback mode: Sequential\n");    else if(!(pgc->pg_playback_mode & 0x80))      printf("PG Playback mode: Random %i\n", pgc->pg_playback_mode);    else      printf("PG Playback mode: Shuffle %i\n", pgc->pg_playback_mode & 0x7f );  }    if(pgc->nr_of_programs != 0) {    for(i = 0; i < 16; i++) {      printf("Color %2i: %08x\n", i, pgc->palette[i]);    }  }    /* Memmory offsets to div. tables. */  ifoPrint_PGC_COMMAND_TBL(pgc->command_tbl);  ifoPrint_PGC_PROGRAM_MAP(pgc->program_map, pgc->nr_of_programs);  ifoPrint_CELL_PLAYBACK(pgc->cell_playback, pgc->nr_of_cells);  ifoPrint_CELL_POSITION(pgc->cell_position, pgc->nr_of_cells);}void ifoPrint_TT_SRPT(tt_srpt_t *tt_srpt) {  int i;    printf("Number of TitleTrack search pointers: %i\n",	 tt_srpt->nr_of_srpts);  for(i=0;i<tt_srpt->nr_of_srpts;i++) {    printf("Title Track index %i\n", i + 1);    printf("\tTitle set number (VTS): %i", 	   tt_srpt->title[i].title_set_nr);    printf("\tVTS_TTN: %i\n", tt_srpt->title[i].vts_ttn);    printf("\tNumber of PTTs: %i\n", tt_srpt->title[i].nr_of_ptts);    printf("\tNumber of angles: %i\n", 	   tt_srpt->title[i].nr_of_angles);    printf("\tTitle playback type: %s%s%s%s%s%s%s\n",	   tt_srpt->title[i].pb_ty.multi_or_random_pgc_title ? 	   " One Random PGC Title or Multi PGC Title" : 	   " One Sequential PGC Title",	   tt_srpt->title[i].pb_ty.jlc_exists_in_cell_cmd ?	   "" : ", No Link/Jump/Call exists in Cell command",	   tt_srpt->title[i].pb_ty.jlc_exists_in_prepost_cmd ?	   "" : ", No Link/Jump/Call exists in Pre- and/or Post-command",	   tt_srpt->title[i].pb_ty.jlc_exists_in_button_cmd ?	   "" : ", No Link/Jump/Call exists in Button command",	   tt_srpt->title[i].pb_ty.jlc_exists_in_tt_dom ?	   "" : ", No Link/Jump/Call exists in TT_DOM",	   tt_srpt->title[i].pb_ty.chapter_search_or_play ?	   ", UOP1 (TT_Play and PTT_Search) prohibited" : "",	   tt_srpt->title[i].pb_ty.title_or_time_play ?	   ", UOP0 (Time_Play and Time_Search) prohibited" : ""	   );        printf("\tParental ID field: %04x\n",	   tt_srpt->title[i].parental_id);    printf("\tTitle set starting sector %08x\n", 	   tt_srpt->title[i].title_set_sector);  }}void ifoPrint_VTS_PTT_SRPT(vts_ptt_srpt_t *vts_ptt_srpt) {  int i, j;  printf(" nr_of_srpts %i last byte %i\n", 	 vts_ptt_srpt->nr_of_srpts, 	 vts_ptt_srpt->last_byte);  for(i=0;i<vts_ptt_srpt->nr_of_srpts;i++) {    printf("\nVTS_PTT number %d has a offset %d relative to VTS_PTT_SRPT\n", 				i + 1, vts_ptt_srpt->ttu_offset[i]);    for(j=0;j<vts_ptt_srpt->title[i].nr_of_ptts;j++) {      printf("VTS_PTT_SRPT - Title %3i part %3i: PGC: %3i PG: %3i\n",	     i + 1, j + 1, 	     vts_ptt_srpt->title[i].ptt[j].pgcn,	     vts_ptt_srpt->title[i].ptt[j].pgn );    }  }}void ifoPrint_PTL_MAIT(ptl_mait_t *ptl_mait) {  int i, level, vts;    printf("Number of Countries: %i\n", ptl_mait->nr_of_countries);  printf("Number of VTSs: %i\n", ptl_mait->nr_of_vtss);  printf("Last byte: %i\n", ptl_mait->last_byte);    for(i = 0; i < ptl_mait->nr_of_countries; i++) {        printf("Start byte: %i\n", ptl_mait->countries[i].pf_ptl_mai_start_byte);    printf("Parental Masks for country: %c%c\n",	   ptl_mait->countries[i].country_code >> 8,	   ptl_mait->countries[i].country_code & 0xff);        for(vts = 0; vts <= ptl_mait->nr_of_vtss; vts++) {      if( vts == 0 ) {	printf("VMG    ");       } else {	printf("VTS %2d ", vts);      }      for(level = 0; level < 8; level++) {	printf("%d: %04x  ", level,	       ptl_mait->countries[i].pf_ptl_mai[vts][level] );      }      printf("\n");    }  }}void ifoPrint_VTS_TMAPT(vts_tmapt_t *vts_tmapt) {  unsigned int timeunit;  int i, j;    printf("Number of VTS_TMAPS: %i\n", vts_tmapt->nr_of_tmaps);  printf("Last byte: %i\n", vts_tmapt->last_byte);  for(i = 0; i < vts_tmapt->nr_of_tmaps; i++) {    printf("TMAP %i\n", i + 1);    printf("  offset %d relative to VTS_TMAPTI\n", vts_tmapt->tmap_offset[i]);    printf("  Time unit (seconds): %i\n", vts_tmapt->tmap[i].tmu);    printf("  Number of entries: %i\n", vts_tmapt->tmap[i].nr_of_entries);    timeunit = vts_tmapt->tmap[i].tmu;    for(j = 0; j < vts_tmapt->tmap[i].nr_of_entries; j++) {      unsigned int ac_time = timeunit * (j + 1);      printf("Time: %2i:%02i:%02i  VOBU Sector: 0x%08x %s\n", 	     ac_time / (60 * 60), (ac_time / 60) % 60, ac_time % 60,	     vts_tmapt->tmap[i].map_ent[j] & 0x7fffffff,	     (vts_tmapt->tmap[i].map_ent[j] >> 31) ? "discontinuity" : "");    }  }}void ifoPrint_C_ADT(c_adt_t *c_adt) {  int i, entries;    printf("Number of VOBs in this VOBS: %i\n", c_adt->nr_of_vobs);  //entries = c_adt->nr_of_vobs;  entries = (c_adt->last_byte + 1 - C_ADT_SIZE)/sizeof(c_adt_t);    for(i = 0; i < entries; i++) {    printf("VOB ID: %3i, Cell ID: %3i   ", 	   c_adt->cell_adr_table[i].vob_id, c_adt->cell_adr_table[i].cell_id);    printf("Sector (first): 0x%08x   (last): 0x%08x\n",	   c_adt->cell_adr_table[i].start_sector, 	   c_adt->cell_adr_table[i].last_sector);  }}void ifoPrint_VOBU_ADMAP(vobu_admap_t *vobu_admap) {  int i, entries;    entries = (vobu_admap->last_byte + 1 - VOBU_ADMAP_SIZE)/4;  for(i = 0; i < entries; i++) {    printf("VOBU %5i  First sector: 0x%08x\n", i + 1,	   vobu_admap->vobu_start_sectors[i]);  }}void ifoPrint_PGCIT(pgcit_t *pgcit) {  int i;    for(i = 0; i < pgcit->nr_of_pgci_srp; i++) {    printf("\nProgram (PGC): %3i\t", i + 1);    printf("PGC Category: Entry id 0x%02x, ", pgcit->pgci_srp[i].entry_id);    printf("Parental ID mask 0x%04x\n", pgcit->pgci_srp[i].ptl_id_mask);    ifoPrint_PGC(pgcit->pgci_srp[i].pgc);  }}void ifoPrint_PGCI_UT(pgci_ut_t *pgci_ut) {  int i;    printf("Number of Menu Language Units (PGCI_LU): %3i\n", pgci_ut->nr_of_lus);  for(i = 0; i < pgci_ut->nr_of_lus; i++) {    printf("\nMenu Language Code: %c%c (%c)\n",	   pgci_ut->lu[i].lang_code >> 8,	   pgci_ut->lu[i].lang_code & 0xff,	   pgci_ut->lu[i].lang_extension ? pgci_ut->lu[i].lang_extension :' ');    printf("Menu Existence: %02x\n", pgci_ut->lu[i].exists);    ifoPrint_PGCIT(pgci_ut->lu[i].pgcit);  }}static void ifoPrint_VTS_ATTRIBUTES(vts_attributes_t *vts_attributes) {  int i;    printf("VTS_CAT Application type: %08x\n", vts_attributes->vts_cat);   printf("Video attributes of VTSM_VOBS: ");  ifoPrint_video_attributes(&vts_attributes->vtsm_vobs_attr);  printf("\n");  printf("Number of Audio streams: %i\n", 	 vts_attributes->nr_of_vtsm_audio_streams);  if(vts_attributes->nr_of_vtsm_audio_streams > 0) {    printf("\tstream %i attributes: ", 1);    ifoPrint_audio_attributes(&vts_attributes->vtsm_audio_attr);    printf("\n");  }  printf("Number of Subpicture streams: %i\n", 	 vts_attributes->nr_of_vtsm_subp_streams);  if(vts_attributes->nr_of_vtsm_subp_streams > 0) {    printf("\tstream %2i attributes: ", 1);    ifoPrint_subp_attributes(&vts_attributes->vtsm_subp_attr);    printf("\n");  }     printf("Video attributes of VTSTT_VOBS: ");  ifoPrint_video_attributes(&vts_attributes->vtstt_vobs_video_attr);  printf("\n");  printf("Number of Audio streams: %i\n", 	 vts_attributes->nr_of_vtstt_audio_streams);  for(i = 0; i < vts_attributes->nr_of_vtstt_audio_streams; i++) {    printf("\tstream %i attributes: ", i);    ifoPrint_audio_attributes(&vts_attributes->vtstt_audio_attr[i]);    printf("\n");  }    printf("Number of Subpicture streams: %i\n", 	 vts_attributes->nr_of_vtstt_subp_streams);  for(i = 0; i < vts_attributes->nr_of_vtstt_subp_streams; i++) {    printf("\tstream %2i attributes: ", i);        ifoPrint_subp_attributes(&vts_attributes->vtstt_subp_attr[i]);    printf("\n");  }}void ifoPrint_VTS_ATRT(vts_atrt_t *vts_atrt) {  int i;    printf("Number of Video Title Sets: %3i\n", vts_atrt->nr_of_vtss);  for(i = 0; i < vts_atrt->nr_of_vtss; i++) {    printf("\nVideo Title Set %i\n", i + 1);    printf("  offset %d relative to VMG_VTS_ATRT\n", 	   vts_atrt->vts_atrt_offsets[i]);    ifoPrint_VTS_ATTRIBUTES(&vts_atrt->vts[i]);  }}void ifoPrint(dvd_reader_t *dvd, int title) {  ifo_handle_t *ifohandle;  ifohandle = ifoOpen(dvd, title);  if(!ifohandle) {    fprintf(stderr, "Can't open info file for title %d\n", title);    return;  }      if(ifohandle->vmgi_mat) {    printf("VMG top level\n-------------\n");    ifoPrint_VMGI_MAT(ifohandle->vmgi_mat);    printf("\nFirst Play PGC\n--------------\n");    ifoPrint_PGC(ifohandle->first_play_pgc);    printf("\nTitle Track search pointer table\n");    printf(  "------------------------------------------------\n");    ifoPrint_TT_SRPT(ifohandle->tt_srpt);    printf("\nMenu PGCI Unit table\n");    printf(  "--------------------\n");    if(ifohandle->pgci_ut) {      ifoPrint_PGCI_UT(ifohandle->pgci_ut);    } else {      printf("No PGCI Unit table present\n");    }    printf("\nParental Manegment Information table\n");    printf(  "------------------------------------\n");    if(ifohandle->ptl_mait) {      ifoPrint_PTL_MAIT(ifohandle->ptl_mait);    } else {      printf("No Parental Management Information present\n");    }    printf("\nVideo Title Set Attribute Table\n");    printf(  "-------------------------------\n");    ifoPrint_VTS_ATRT(ifohandle->vts_atrt);        printf("\nText Data Manager Information\n");    printf(  "-----------------------------\n");    if(ifohandle->txtdt_mgi) {      //ifoPrint_TXTDT_MGI(&(vmgi->txtdt_mgi));    } else {      printf("No Text Data Manager Information present\n");    }    printf("\nMenu Cell Adress table\n");    printf(  "-----------------\n");    if(ifohandle->menu_c_adt) {      ifoPrint_C_ADT(ifohandle->menu_c_adt);    } else {      printf("No Menu Cell Adress table present\n");    }    printf("\nVideo Manager Menu VOBU address map\n");    printf(  "-----------------\n");    if(ifohandle->menu_vobu_admap) {      ifoPrint_VOBU_ADMAP(ifohandle->menu_vobu_admap);    } else {      printf("No Menu VOBU address map present\n");       }  }  if(ifohandle->vtsi_mat) {    printf("VTS top level\n-------------\n");    ifoPrint_VTSI_MAT(ifohandle->vtsi_mat);    printf("\nPart of Title Track search pointer table\n");    printf(  "----------------------------------------------\n");    ifoPrint_VTS_PTT_SRPT(ifohandle->vts_ptt_srpt);    printf("\nPGCI Unit table\n");    printf(  "--------------------\n");    ifoPrint_PGCIT(ifohandle->vts_pgcit);    printf("\nMenu PGCI Unit table\n");    printf(  "--------------------\n");    if(ifohandle->pgci_ut) {      ifoPrint_PGCI_UT(ifohandle->pgci_ut);    } else {      printf("No Menu PGCI Unit table present\n");    }        printf("\nTime Search table\n");    printf(  "-----------------\n");    if(ifohandle->vts_tmapt) {      ifoPrint_VTS_TMAPT(ifohandle->vts_tmapt);    } else {      printf("No Time Search table present\n");    }    printf("\nMenu Cell Adress table\n");    printf(  "-----------------\n");    if(ifohandle->menu_c_adt) {      ifoPrint_C_ADT(ifohandle->menu_c_adt);    } else {      printf("No Cell Adress table present\n");    }    printf("\nVideo Title Set Menu VOBU address map\n");    printf(  "-----------------\n");    if(ifohandle->menu_vobu_admap) {      ifoPrint_VOBU_ADMAP(ifohandle->menu_vobu_admap);    } else {      printf("No Menu VOBU address map present\n");    }    printf("\nCell Adress table\n");    printf(  "-----------------\n");    ifoPrint_C_ADT(ifohandle->vts_c_adt);    printf("\nVideo Title Set VOBU address map\n");    printf(  "-----------------\n");    ifoPrint_VOBU_ADMAP(ifohandle->vts_vobu_admap);  }   ifoClose(ifohandle);}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -