📄 iforeader.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 "config.h"#include "IFOReader.h"#include <cstdlib>#include <byteswap.h>//------------------------------------------------------------------------------using ifodump::IFOReader;//------------------------------------------------------------------------------// Hidden methods (for GCC <3.0)//------------------------------------------------------------------------------inline void IFOReader::read(uint8_t& x){ FileReader::read(x);}inline void IFOReader::read(uint16_t& x){ FileReader::read(x);}inline void IFOReader::read(uint32_t& x){ FileReader::read(x);}inline void IFOReader::read(uint64_t& x){ FileReader::read(x);}inline void IFOReader::read(void* buffer, size_t length){ FileReader::read(buffer, length);}inline void IFOReader::read(vm_cmd_t& cmd){ Reader<IFOReader>::read(cmd);}inline void IFOReader::read(user_ops_t& userOperations){ Reader<IFOReader>::read(userOperations);}//------------------------------------------------------------------------------//------------------------------------------------------------------------------void IFOReader::read(dvd_time_t& t){ t.hour = read8(); t.minute = read8(); t.second = read8(); t.frame_u = read8();}//------------------------------------------------------------------------------void IFOReader::read(video_attr_t& attr){ read(&attr, sizeof(video_attr_t));}//------------------------------------------------------------------------------void IFOReader::read(audio_attr_t& attr){ read(&attr, 2); attr.lang_code = read16(); attr.lang_extension = read8(); attr.code_extension = read8(); attr.unknown3 = read8(); read(&attr.app_info, 1);}//------------------------------------------------------------------------------void IFOReader::read(subp_attr_t& attr){ attr.type = read8(); attr.zero1 = read8(); attr.lang_code = read16(); attr.lang_extension = read8(); attr.zero2 = read8();}//------------------------------------------------------------------------------void IFOReader::read(pgc_command_tbl_t& commandTable){ commandTable.zero_1 = read16(); vm_cmd_t* cmds; commandTable.nr_of_pre = readArray(cmds); commandTable.pre_cmds = cmds; commandTable.nr_of_post = readArray(cmds); commandTable.post_cmds = cmds; commandTable.nr_of_cell = readArray(cmds); commandTable.cell_cmds = cmds;}//------------------------------------------------------------------------------void IFOReader::read(cell_playback_t& cellPlayback){ read(&cellPlayback, 2); cellPlayback.still_time = read8(); cellPlayback.cell_cmd_nr = read8(); read(cellPlayback.playback_time); cellPlayback.first_sector = read32(); cellPlayback.first_ilvu_end_sector = read32(); cellPlayback.last_vobu_start_sector = read32(); cellPlayback.last_sector = read32();}//------------------------------------------------------------------------------void IFOReader::read(cell_position_t& cellPosition){ cellPosition.vob_id_nr = read16(); cellPosition.zero_1 = read8(); cellPosition.cell_nr = read8();}//------------------------------------------------------------------------------void IFOReader::read(pgc_t& pgc){ pgc.zero_1 = read16(); read(pgc.playback_time); read(pgc.prohibited_ops); readFixedArray(sizeof(pgc.audio_control), pgc.audio_control); readFixedArray(sizeof(pgc.subp_control), pgc.subp_control); pgc.next_pgc_nr = read16(); pgc.prev_pgc_nr = read16(); pgc.goup_pgc_nr = read16(); pgc.still_time = read8(); pgc.pg_playback_mode = read8(); readFixedArray(sizeof(pgc.palette), pgc.palette); pgc.command_tbl_offset = read16(); pgc.program_map_offset = read16(); pgc.cell_playback_offset = read16(); pgc.cell_position_offset = read16(); pgc_command_tbl_t* command_tbl; readPointer(command_tbl); pgc.command_tbl = command_tbl; pgc_program_map_t* program_map; pgc.nr_of_programs = readArray(program_map); pgc.program_map = program_map; cell_playback_t* cell_playback; pgc.nr_of_cells = readArray(cell_playback); pgc.cell_playback = cell_playback; cell_position_t* cell_position; readArray(cell_position); pgc.cell_position = cell_position;}//------------------------------------------------------------------------------void IFOReader::read(pgci_srp_t& pgciSRP){ pgciSRP.entry_id = read8(); read((&pgciSRP.entry_id)+1, 1); pgciSRP.ptl_id_mask = read16(); pgciSRP.pgc_start_byte = read32(); pgc_t* pgc; readPointer(pgc); pgciSRP.pgc = pgc;}//------------------------------------------------------------------------------void IFOReader::read(pgcit_t& pgci){ pgci.zero_1 = read16(); pgci.last_byte = read32(); pgci_srp_t* pgci_srp; pgci.nr_of_pgci_srp = readArray(pgci_srp); pgci.pgci_srp = pgci_srp;}//------------------------------------------------------------------------------void IFOReader::read(pgci_lu_t& pgciLanguageUnit){ pgciLanguageUnit.lang_code = read16(); pgciLanguageUnit.lang_extension = read8(); pgciLanguageUnit.exists = read8(); pgciLanguageUnit.lang_start_byte = read32(); pgcit_t* pgcit; readPointer(pgcit); pgciLanguageUnit.pgcit = pgcit;}//------------------------------------------------------------------------------void IFOReader::read(pgci_ut_t& pgciUnitTable){ pgciUnitTable.zero_1 = read16(); pgciUnitTable.last_byte = read32(); pgci_lu_t* lu; pgciUnitTable.nr_of_lus = readArray(lu); pgciUnitTable.lu = lu;}//------------------------------------------------------------------------------void IFOReader::read(cell_adr_t& cellAddress){ cellAddress.vob_id = read16(); cellAddress.cell_id = read8(); cellAddress.zero_1 = read8(); cellAddress.start_sector = read32(); cellAddress.last_sector = read32();}//------------------------------------------------------------------------------void IFOReader::read(c_adt_t& cellAddressTable){ cellAddressTable.nr_of_vobs = read16(); cellAddressTable.zero_1 = read16(); cell_adr_t* cell_adr_table; cellAddressTable.last_byte = readLastArray(cell_adr_table); cellAddressTable.cell_adr_table = cell_adr_table;}//------------------------------------------------------------------------------void IFOReader::read(vobu_admap_t& vobuAddressMap){ uint32_t* vobu_start_sectors; vobuAddressMap.last_byte = readLastArray(vobu_start_sectors); vobuAddressMap.vobu_start_sectors = vobu_start_sectors;}//------------------------------------------------------------------------------void IFOReader::read(vmgi_mat_t& vmgiMat){ read(vmgiMat.vmg_identifier, sizeof(vmgiMat.vmg_identifier)); vmgiMat.vmg_last_sector = read32(); read(vmgiMat.zero_1, sizeof(vmgiMat.zero_1)); vmgiMat.vmgi_last_sector = read32(); vmgiMat.zero_2 = read8(); vmgiMat.specification_version = read8(); vmgiMat.vmg_category = read32(); vmgiMat.vmg_nr_of_volumes = read16(); vmgiMat.vmg_this_volume_nr = read16(); vmgiMat.disc_side = read8(); read(vmgiMat.zero_3, sizeof(vmgiMat.zero_3)); vmgiMat.vmg_nr_of_title_sets = read16(); read(vmgiMat.provider_identifier, sizeof(vmgiMat.provider_identifier)); vmgiMat.vmg_pos_code = read64(); read(vmgiMat.zero_4, sizeof(vmgiMat.zero_4)); vmgiMat.vmgi_last_byte = read32(); vmgiMat.first_play_pgc = read32(); read(vmgiMat.zero_5, sizeof(vmgiMat.zero_5)); vmgiMat.vmgm_vobs = read32(); vmgiMat.tt_srpt = read32();
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -