nav_types.h
1 /*
2  * Copyright (C) 2000, 2001, 2002 HÃ¥kan Hjort <d95hjort@dtek.chalmers.se>
3  *
4  * The data structures in this file should represent the layout of the
5  * pci and dsi packets as they are stored in the stream. Information
6  * found by reading the source to VOBDUMP is the base for the structure
7  * and names of these data types.
8  *
9  * VOBDUMP: a program for examining DVD .VOB files.
10  * Copyright 1998, 1999 Eric Smith <eric@brouhaha.com>
11  *
12  * VOBDUMP is free software; you can redistribute it and/or modify it
13  * under the terms of the GNU General Public License version 2 as
14  * published by the Free Software Foundation. Note that I am not
15  * granting permission to redistribute or modify VOBDUMP under the terms
16  * of any later version of the General Public License.
17  *
18  * This program is distributed in the hope that it will be useful (or at
19  * least amusing), but WITHOUT ANY WARRANTY; without even the implied
20  * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See
21  * the GNU General Public License for more details.
22  *
23  * You should have received a copy of the GNU General Public License
24  * along with this program; if not, write to the Free Software Foundation,
25  * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
26  */
27 
28 #ifndef LIBDVDREAD_NAV_TYPES_H
29 #define LIBDVDREAD_NAV_TYPES_H
30 
31 #include <inttypes.h>
32 #include "ifo_types.h" /* only dvd_time_t, vm_cmd_t and user_ops_t */
33 
34 /* The length including the substream id byte. */
35 #define PCI_BYTES 0x3d4
36 #define DSI_BYTES 0x3fa
37 
38 #define PS2_PCI_SUBSTREAM_ID 0x00
39 #define PS2_DSI_SUBSTREAM_ID 0x01
40 
41 /* Remove this */
42 #define DSI_START_BYTE 1031
43 
47 typedef struct {
48  uint32_t nv_pck_lbn;
49  uint16_t vobu_cat;
50  uint16_t zero1;
51  user_ops_t vobu_uop_ctl;
52  uint32_t vobu_s_ptm;
53  uint32_t vobu_e_ptm;
54  uint32_t vobu_se_e_ptm;
55  dvd_time_t e_eltm;
56  char vobu_isrc[32];
57 } ATTRIBUTE_PACKED pci_gi_t;
58 
62 typedef struct {
63  uint32_t nsml_agl_dsta[9];
64 } ATTRIBUTE_PACKED nsml_agli_t;
65 
75 typedef struct {
76  uint16_t hli_ss;
77  uint32_t hli_s_ptm;
78  uint32_t hli_e_ptm;
79  uint32_t btn_se_e_ptm;
80  unsigned int zero1 : 2;
81  unsigned int btngr_ns : 2;
82  unsigned int zero2 : 1;
83  unsigned int btngr1_dsp_ty : 3;
84  unsigned int zero3 : 1;
85  unsigned int btngr2_dsp_ty : 3;
86  unsigned int zero4 : 1;
87  unsigned int btngr3_dsp_ty : 3;
88  uint8_t btn_ofn;
89  uint8_t btn_ns;
90  uint8_t nsl_btn_ns;
91  uint8_t zero5;
92  uint8_t fosl_btnn;
93  uint8_t foac_btnn;
94 } ATTRIBUTE_PACKED hl_gi_t;
95 
96 
105 typedef struct {
106  uint32_t btn_coli[3][2];
107 } ATTRIBUTE_PACKED btn_colit_t;
108 
116 typedef struct {
117  unsigned int btn_coln : 2;
118  unsigned int x_start : 10;
119  unsigned int zero1 : 2;
120  unsigned int x_end : 10;
122  unsigned int auto_action_mode : 2;
123  unsigned int y_start : 10;
124  unsigned int zero2 : 2;
125  unsigned int y_end : 10;
127  unsigned int zero3 : 2;
128  unsigned int up : 6;
129  unsigned int zero4 : 2;
130  unsigned int down : 6;
131  unsigned int zero5 : 2;
132  unsigned int left : 6;
133  unsigned int zero6 : 2;
134  unsigned int right : 6;
135  vm_cmd_t cmd;
136 } ATTRIBUTE_PACKED btni_t;
137 
141 typedef struct {
142  hl_gi_t hl_gi;
143  btn_colit_t btn_colit;
144  btni_t btnit[36];
145 } ATTRIBUTE_PACKED hli_t;
146 
150 typedef struct {
151  pci_gi_t pci_gi;
152  nsml_agli_t nsml_agli;
153  hli_t hli;
154  uint8_t zero1[189];
155 } ATTRIBUTE_PACKED pci_t;
156 
157 
158 
159 
163 typedef struct {
164  uint32_t nv_pck_scr;
165  uint32_t nv_pck_lbn;
166  uint32_t vobu_ea;
167  uint32_t vobu_1stref_ea;
168  uint32_t vobu_2ndref_ea;
169  uint32_t vobu_3rdref_ea;
170  uint16_t vobu_vob_idn;
171  uint8_t zero1;
172  uint8_t vobu_c_idn;
173  dvd_time_t c_eltm;
174 } ATTRIBUTE_PACKED dsi_gi_t;
175 
179 typedef struct {
180  uint16_t category;
181  uint32_t ilvu_ea;
182  uint32_t ilvu_sa;
183  uint16_t size;
184  uint32_t vob_v_s_s_ptm;
185  uint32_t vob_v_e_e_ptm;
186  struct {
187  uint32_t stp_ptm1;
188  uint32_t stp_ptm2;
189  uint32_t gap_len1;
190  uint32_t gap_len2;
191  } vob_a[8];
192 } ATTRIBUTE_PACKED sml_pbi_t;
193 
197 typedef struct {
198  uint32_t address;
199  uint16_t size;
200 } ATTRIBUTE_PACKED sml_agl_data_t;
201 
205 typedef struct {
206  sml_agl_data_t data[9];
207 } ATTRIBUTE_PACKED sml_agli_t;
208 
212 typedef struct {
213  uint32_t next_video;
214  uint32_t fwda[19];
215  uint32_t next_vobu;
216  uint32_t prev_vobu;
217  uint32_t bwda[19];
218  uint32_t prev_video;
219 } ATTRIBUTE_PACKED vobu_sri_t;
220 
221 #define SRI_END_OF_CELL 0x3fffffff
222 
226 typedef struct {
227  uint16_t a_synca[8];
228  uint32_t sp_synca[32];
229 } ATTRIBUTE_PACKED synci_t;
230 
234 typedef struct {
235  dsi_gi_t dsi_gi;
236  sml_pbi_t sml_pbi;
237  sml_agli_t sml_agli;
238  vobu_sri_t vobu_sri;
239  synci_t synci;
240  uint8_t zero1[471];
241 } ATTRIBUTE_PACKED dsi_t;
242 
243 
244 #if PRAGMA_PACK
245 #pragma pack()
246 #endif
247 
248 #endif /* LIBDVDREAD_NAV_TYPES_H */
uint32_t ilvu_ea
Definition: nav_types.h:181
uint32_t vobu_ea
Definition: nav_types.h:166
uint16_t category
Definition: nav_types.h:180
uint16_t vobu_cat
Definition: nav_types.h:49
uint32_t nv_pck_lbn
Definition: nav_types.h:48
uint32_t next_video
Definition: nav_types.h:213
uint8_t fosl_btnn
Definition: nav_types.h:92
dvd_time_t c_eltm
Definition: nav_types.h:173
uint32_t hli_s_ptm
Definition: nav_types.h:77
uint32_t vobu_se_e_ptm
Definition: nav_types.h:54
uint32_t hli_e_ptm
Definition: nav_types.h:78
dvd_time_t e_eltm
Definition: nav_types.h:55
uint16_t hli_ss
Definition: nav_types.h:76
uint8_t foac_btnn
Definition: nav_types.h:93
uint32_t btn_se_e_ptm
Definition: nav_types.h:79
uint32_t vob_v_e_e_ptm
Definition: nav_types.h:185
uint32_t vob_v_s_s_ptm
Definition: nav_types.h:184
uint32_t address
Definition: nav_types.h:198
uint16_t zero1
Definition: nav_types.h:50
uint16_t size
Definition: nav_types.h:183
uint32_t vobu_2ndref_ea
Definition: nav_types.h:168
uint8_t zero5
Definition: nav_types.h:91
uint32_t vobu_s_ptm
Definition: nav_types.h:52
uint8_t btn_ns
Definition: nav_types.h:89
user_ops_t vobu_uop_ctl
Definition: nav_types.h:51
uint32_t vobu_3rdref_ea
Definition: nav_types.h:169
uint32_t vobu_e_ptm
Definition: nav_types.h:53
uint8_t nsl_btn_ns
Definition: nav_types.h:90
uint32_t ilvu_sa
Definition: nav_types.h:182
uint8_t btn_ofn
Definition: nav_types.h:88
uint16_t vobu_vob_idn
Definition: nav_types.h:170
uint32_t vobu_1stref_ea
Definition: nav_types.h:167
uint8_t vobu_c_idn
Definition: nav_types.h:172
Definition: ifo_types.h:60