00001 #ifndef NAV_TYPES_H_INCLUDED 00002 #define NAV_TYPES_H_INCLUDED 00003 00004 /* 00005 * Copyright (C) 2000, 2001, 2002 Håkan Hjort <d95hjort@dtek.chalmers.se> 00006 * 00007 * The data structures in this file should represent the layout of the 00008 * pci and dsi packets as they are stored in the stream. Information 00009 * found by reading the source to VOBDUMP is the base for the structure 00010 * and names of these data types. 00011 * 00012 * VOBDUMP: a program for examining DVD .VOB files. 00013 * Copyright 1998, 1999 Eric Smith <eric@brouhaha.com> 00014 * 00015 * VOBDUMP is free software; you can redistribute it and/or modify it 00016 * under the terms of the GNU General Public License version 2 as 00017 * published by the Free Software Foundation. Note that I am not 00018 * granting permission to redistribute or modify VOBDUMP under the terms 00019 * of any later version of the General Public License. 00020 * 00021 * This program is distributed in the hope that it will be useful (or at 00022 * least amusing), but WITHOUT ANY WARRANTY; without even the implied 00023 * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See 00024 * the GNU General Public License for more details. 00025 * 00026 * You should have received a copy of the GNU General Public License 00027 * along with this program; if not, write to the Free Software 00028 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 00029 * USA 00030 */ 00031 00032 #include <inttypes.h> 00033 #include "ifo_types.h" /* only dvd_time_t, vm_cmd_t and user_ops_t */ 00034 00035 00036 #undef ATTRIBUTE_PACKED 00037 #undef PRAGMA_PACK_BEGIN 00038 #undef PRAGMA_PACK_END 00039 00040 #if defined(__GNUC__) 00041 #if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 95) 00042 #define ATTRIBUTE_PACKED __attribute__ ((packed)) 00043 #define PRAGMA_PACK 0 00044 #endif 00045 #endif 00046 00047 #if !defined(ATTRIBUTE_PACKED) 00048 #define ATTRIBUTE_PACKED 00049 #define PRAGMA_PACK 1 00050 #endif 00051 00052 00053 /* The length including the substream id byte. */ 00054 #define PCI_BYTES 0x3d4 00055 #define DSI_BYTES 0x3fa 00056 00057 #define PS2_PCI_SUBSTREAM_ID 0x00 00058 #define PS2_DSI_SUBSTREAM_ID 0x01 00059 00060 /* Remove this */ 00061 #define DSI_START_BYTE 1031 00062 00063 00064 #if PRAGMA_PACK 00065 #pragma pack(1) 00066 #endif 00067 00068 00072 typedef struct { 00073 uint32_t nv_pck_lbn; 00074 uint16_t vobu_cat; 00075 uint16_t zero1; 00076 user_ops_t vobu_uop_ctl; 00077 uint32_t vobu_s_ptm; 00078 uint32_t vobu_e_ptm; 00079 uint32_t vobu_se_e_ptm; 00080 dvd_time_t e_eltm; 00081 char vobu_isrc[32]; 00082 } ATTRIBUTE_PACKED pci_gi_t; 00083 00087 typedef struct { 00088 uint32_t nsml_agl_dsta[9]; 00089 } ATTRIBUTE_PACKED nsml_agli_t; 00090 00100 typedef struct { 00101 uint16_t hli_ss; 00102 uint32_t hli_s_ptm; 00103 uint32_t hli_e_ptm; 00104 uint32_t btn_se_e_ptm; 00105 unsigned int zero1 : 2; 00106 unsigned int btngr_ns : 2; 00107 unsigned int zero2 : 1; 00108 unsigned int btngr1_dsp_ty : 3; 00109 unsigned int zero3 : 1; 00110 unsigned int btngr2_dsp_ty : 3; 00111 unsigned int zero4 : 1; 00112 unsigned int btngr3_dsp_ty : 3; 00113 uint8_t btn_ofn; 00114 uint8_t btn_ns; 00115 uint8_t nsl_btn_ns; 00116 uint8_t zero5; 00117 uint8_t fosl_btnn; 00118 uint8_t foac_btnn; 00119 } ATTRIBUTE_PACKED hl_gi_t; 00120 00121 00130 typedef struct { 00131 uint32_t btn_coli[3][2]; 00132 } ATTRIBUTE_PACKED btn_colit_t; 00133 00141 typedef struct { 00142 unsigned int btn_coln : 2; 00143 unsigned int x_start : 10; 00144 unsigned int zero1 : 2; 00145 unsigned int x_end : 10; 00147 unsigned int auto_action_mode : 2; 00148 unsigned int y_start : 10; 00149 unsigned int zero2 : 2; 00150 unsigned int y_end : 10; 00152 unsigned int zero3 : 2; 00153 unsigned int up : 6; 00154 unsigned int zero4 : 2; 00155 unsigned int down : 6; 00156 unsigned int zero5 : 2; 00157 unsigned int left : 6; 00158 unsigned int zero6 : 2; 00159 unsigned int right : 6; 00160 vm_cmd_t cmd; 00161 } ATTRIBUTE_PACKED btni_t; 00162 00166 typedef struct { 00167 hl_gi_t hl_gi; 00168 btn_colit_t btn_colit; 00169 btni_t btnit[36]; 00170 } ATTRIBUTE_PACKED hli_t; 00171 00175 typedef struct { 00176 pci_gi_t pci_gi; 00177 nsml_agli_t nsml_agli; 00178 hli_t hli; 00179 uint8_t zero1[189]; 00180 } ATTRIBUTE_PACKED pci_t; 00181 00182 00183 00184 00188 typedef struct { 00189 uint32_t nv_pck_scr; 00190 uint32_t nv_pck_lbn; 00191 uint32_t vobu_ea; 00192 uint32_t vobu_1stref_ea; 00193 uint32_t vobu_2ndref_ea; 00194 uint32_t vobu_3rdref_ea; 00195 uint16_t vobu_vob_idn; 00196 uint8_t zero1; 00197 uint8_t vobu_c_idn; 00198 dvd_time_t c_eltm; 00199 } ATTRIBUTE_PACKED dsi_gi_t; 00200 00204 typedef struct { 00205 uint16_t category; 00206 uint32_t ilvu_ea; 00207 uint32_t ilvu_sa; 00208 uint16_t size; 00209 uint32_t vob_v_s_s_ptm; 00210 uint32_t vob_v_e_e_ptm; 00211 struct { 00212 uint32_t stp_ptm1; 00213 uint32_t stp_ptm2; 00214 uint32_t gap_len1; 00215 uint32_t gap_len2; 00216 } vob_a[8]; 00217 } ATTRIBUTE_PACKED sml_pbi_t; 00218 00222 typedef struct { 00223 uint32_t address; 00224 uint16_t size; 00225 } ATTRIBUTE_PACKED sml_agl_data_t; 00226 00230 typedef struct { 00231 sml_agl_data_t data[9]; 00232 } ATTRIBUTE_PACKED sml_agli_t; 00233 00237 typedef struct { 00238 uint32_t next_video; 00239 uint32_t fwda[19]; 00240 uint32_t next_vobu; 00241 uint32_t prev_vobu; 00242 uint32_t bwda[19]; 00243 uint32_t prev_video; 00244 } ATTRIBUTE_PACKED vobu_sri_t; 00245 00246 #define SRI_END_OF_CELL 0x3fffffff 00247 00251 typedef struct { 00252 uint16_t a_synca[8]; 00253 uint32_t sp_synca[32]; 00254 } ATTRIBUTE_PACKED synci_t; 00255 00259 typedef struct { 00260 dsi_gi_t dsi_gi; 00261 sml_pbi_t sml_pbi; 00262 sml_agli_t sml_agli; 00263 vobu_sri_t vobu_sri; 00264 synci_t synci; 00265 uint8_t zero1[471]; 00266 } ATTRIBUTE_PACKED dsi_t; 00267 00268 00269 #if PRAGMA_PACK 00270 #pragma pack() 00271 #endif 00272 00273 #endif /* NAV_TYPES_H_INCLUDED */
1.5.5