📄 ifoprinter.cc
字号:
//// Copyright (c) 2003 by Istv醤 V醨adi//// This file is part of dxr3Player, a DVD player written specifically // for the DXR3 (aka Hollywood+) decoder card.// This program is free software; you can redistribute it and/or modify// it under the terms of the GNU General Public License as published by// the Free Software Foundation; either version 2 of the License, or// (at your option) any later version.//// This program is distributed in the hope that it will be useful,// but WITHOUT ANY WARRANTY; without even the implied warranty of// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the// GNU General Public License for more details.//// You should have received a copy of the GNU General Public License// along with this program; if not, write to the Free Software// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA//------------------------------------------------------------------------------#include "IFOPrinter.h"#include "dvd/vm/InstructionSet.h"#include <cstdio>#include <libmpdvdkit/ifo_print.h>extern "C" {void ifo_print_VMGI_MAT(vmgi_mat_t *vmgi_mat);void ifo_print_PGC(pgc_t *pgc);void ifo_print_TT_SRPT(tt_srpt_t *tt_srpt);void ifo_print_PGCI_UT(pgci_ut_t *pgci_ut);void ifo_print_PTL_MAIT(ptl_mait_t *ptl_mait);void ifo_print_VTS_ATRT(vts_atrt_t *vts_atrt);void ifo_print_C_ADT(c_adt_t *c_adt);void ifo_print_VOBU_ADMAP(vobu_admap_t *vobu_admap);void ifo_print_VTSI_MAT(vtsi_mat_t *vtsi_mat);void ifo_print_VTS_PTT_SRPT(vts_ptt_srpt_t *vts_ptt_srpt);void ifo_print_PGCIT(pgcit_t *pgcit, int pgc_type);void ifo_print_PGCI_UT(pgci_ut_t *pgci_ut);}//------------------------------------------------------------------------------using ifodump::IFOPrinter;using dvd::vm::Instruction;using dvd::vm::InstructionSet;//------------------------------------------------------------------------------void IFOPrinter::printCommands(const pgci_ut_t* pgci_ut, const char* caption){ if (pgci_ut==0) return; printf("%s\n", caption); char subCaption[64]; for(size_t i = 0; i<pgci_ut->nr_of_lus; ++i) { pgci_lu_t* lu = pgci_ut->lu + i; uint16_t lang_code = lu->lang_code; snprintf(subCaption, sizeof(subCaption), "\nPGCs for language %c%c:", (char)((lang_code>>8)&0xff), (char)((lang_code>>0)&0xff)); printCommands(lu->pgcit, subCaption); }}//------------------------------------------------------------------------------void IFOPrinter::printCommands(const pgcit_t* pgcit, const char* caption){ if (pgcit==0) return; printf("%s\n", caption); char subCaption[32]; for(size_t i = 0; i<pgcit->nr_of_pgci_srp; ++i) { snprintf(subCaption, sizeof(subCaption), "\nPGC %u:", i+1); printCommands(pgcit->pgci_srp[i].pgc, subCaption); }}//------------------------------------------------------------------------------void IFOPrinter::printCommands(const pgc_t* pgc, const char* caption){ if (pgc==0) return; printf("%s\n", caption); pgc_command_tbl_t* commandTable = pgc->command_tbl; if (commandTable==0) { printf("No commands in PGC!\n"); } else { printf("Pre-commands:\n"); printCommands(commandTable->pre_cmds, commandTable->nr_of_pre); printf("Cell-commands:\n"); printCommands(commandTable->cell_cmds, commandTable->nr_of_cell); printf("Post-commands:\n"); printCommands(commandTable->post_cmds, commandTable->nr_of_post); }}//------------------------------------------------------------------------------void IFOPrinter::printCommands(const vm_cmd_t* cmds, size_t numCommands){ if (cmds==0 || numCommands==0) return; InstructionSet commands(reinterpret_cast<const Instruction*>(cmds), numCommands); commands.print(stdout);}//------------------------------------------------------------------------------void IFOPrinter::print(const ifo_handle_t* ifohandle){ // Stolen from ifo_print.c if(ifohandle->vmgi_mat) { printf("VMG top level\n-------------\n"); ifo_print_VMGI_MAT(ifohandle->vmgi_mat); printf("\nFirst Play PGC\n--------------\n"); ifo_print_PGC(ifohandle->first_play_pgc); printf("\nTitle Track search pointer table\n"); printf( "------------------------------------------------\n"); ifo_print_TT_SRPT(ifohandle->tt_srpt); printf("\nMenu PGCI Unit table\n"); printf( "--------------------\n"); if(ifohandle->pgci_ut) { ifo_print_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) { ifo_print_PTL_MAIT(ifohandle->ptl_mait); } else { printf("No Parental Management Information present\n"); } printf("\nVideo Title Set Attribute Table\n"); printf( "-------------------------------\n"); ifo_print_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) { ifo_print_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) { ifo_print_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"); ifo_print_VTSI_MAT(ifohandle->vtsi_mat); printf("\nPart of Title Track search pointer table\n"); printf( "----------------------------------------------\n"); ifo_print_VTS_PTT_SRPT(ifohandle->vts_ptt_srpt); printf("\nPGCI Unit table\n"); printf( "--------------------\n"); ifo_print_PGCIT(ifohandle->vts_pgcit, 0); printf("\nMenu PGCI Unit table\n"); printf( "--------------------\n"); if(ifohandle->pgci_ut) { ifo_print_PGCI_UT(ifohandle->pgci_ut); } else { printf("No Menu PGCI Unit table present\n"); } printf("\nMenu Cell Adress table\n"); printf( "-----------------\n"); if(ifohandle->menu_c_adt) { ifo_print_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) { ifo_print_VOBU_ADMAP(ifohandle->menu_vobu_admap); } else { printf("No Menu VOBU address map present\n"); } printf("\nCell Adress table\n"); printf( "-----------------\n"); ifo_print_C_ADT(ifohandle->vts_c_adt); printf("\nVideo Title Set VOBU address map\n"); printf( "-----------------\n"); ifo_print_VOBU_ADMAP(ifohandle->vts_vobu_admap); } printf("--------------------------------------------------\n"); printf("PGC commands:\n"); printf("--------------------------------------------------\n"); printCommands(ifohandle->first_play_pgc, "First-play PGC:"); printCommands(ifohandle->pgci_ut, "\n\nMenu PGCs:"); printCommands(ifohandle->vts_pgcit, "\n\nTitle PGCs:");}//------------------------------------------------------------------------------
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -