7029
|
1 #ifndef NAV_TYPES_H_INCLUDED
|
|
2 #define NAV_TYPES_H_INCLUDED
|
|
3
|
|
4 /*
|
|
5 * Copyright (C) 2000, 2001 Håkan Hjort <d95hjort@dtek.chalmers.se>
|
|
6 *
|
|
7 * The data structures in this file should represent the layout of the
|
|
8 * pci and dsi packets as they are stored in the stream. Information
|
|
9 * found by reading the source to VOBDUMP is the base for the structure
|
|
10 * and names of these data types.
|
|
11 *
|
|
12 * VOBDUMP: a program for examining DVD .VOB files.
|
|
13 * Copyright 1998, 1999 Eric Smith <eric@brouhaha.com>
|
|
14 *
|
|
15 * VOBDUMP is free software; you can redistribute it and/or modify it
|
|
16 * under the terms of the GNU General Public License version 2 as
|
|
17 * published by the Free Software Foundation. Note that I am not
|
|
18 * granting permission to redistribute or modify VOBDUMP under the terms
|
|
19 * of any later version of the General Public License.
|
|
20 *
|
|
21 * This program is distributed in the hope that it will be useful (or at
|
|
22 * least amusing), but WITHOUT ANY WARRANTY; without even the implied
|
|
23 * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See
|
|
24 * the GNU General Public License for more details.
|
|
25 *
|
|
26 * You should have received a copy of the GNU General Public License
|
|
27 * along with this program; if not, write to the Free Software
|
|
28 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
|
|
29 * USA
|
|
30 */
|
|
31
|
|
32 #include <inttypes.h>
|
7033
|
33 #include "ifo_types.h" // only dvd_time_t, vm_cmd_t and user_ops_t
|
7029
|
34
|
|
35
|
|
36 #undef ATTRIBUTE_PACKED
|
|
37 #undef PRAGMA_PACK_BEGIN
|
|
38 #undef PRAGMA_PACK_END
|
|
39
|
|
40 #if defined(__GNUC__)
|
|
41 #if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 95)
|
|
42 #define ATTRIBUTE_PACKED __attribute__ ((packed))
|
|
43 #define PRAGMA_PACK 0
|
|
44 #endif
|
|
45 #endif
|
|
46
|
|
47 #if !defined(ATTRIBUTE_PACKED)
|
|
48 #define ATTRIBUTE_PACKED
|
|
49 #define PRAGMA_PACK 1
|
|
50 #endif
|
|
51
|
|
52
|
|
53 /* The length including the substream id byte. */
|
|
54 #define PCI_BYTES 0x3d4
|
|
55 #define DSI_BYTES 0x3fa
|
|
56
|
|
57 #define PS2_PCI_SUBSTREAM_ID 0x00
|
|
58 #define PS2_DSI_SUBSTREAM_ID 0x01
|
|
59
|
|
60 /* Remove this */
|
|
61 #define DSI_START_BYTE 1031
|
|
62
|
|
63
|
|
64 #if PRAGMA_PACK
|
|
65 #pragma pack(1)
|
|
66 #endif
|
|
67
|
|
68
|
|
69 /**
|
|
70 * PCI General Information
|
|
71 */
|
|
72 typedef struct {
|
|
73 uint32_t nv_pck_lbn;
|
|
74 uint16_t vobu_cat;
|
|
75 uint16_t zero1;
|
|
76 user_ops_t vobu_uop_ctl;
|
|
77 uint32_t vobu_s_ptm;
|
|
78 uint32_t vobu_e_ptm;
|
|
79 uint32_t vobu_se_e_ptm;
|
|
80 dvd_time_t e_eltm;
|
|
81 char vobu_isrc[32];
|
|
82 } ATTRIBUTE_PACKED pci_gi_t;
|
|
83
|
|
84 /**
|
|
85 * Non Seamless Angle Information
|
|
86 */
|
|
87 typedef struct {
|
|
88 uint32_t nsml_agl_dsta[9];
|
|
89 } ATTRIBUTE_PACKED nsml_agli_t;
|
|
90
|
|
91 /**
|
|
92 * Highlight General Information
|
|
93 */
|
|
94 typedef struct {
|
|
95 uint16_t hli_ss; ///< only low 2 bits
|
|
96 uint32_t hli_s_ptm;
|
|
97 uint32_t hli_e_ptm;
|
|
98 uint32_t btn_se_e_ptm;
|
|
99 #ifdef WORDS_BIGENDIAN
|
|
100 unsigned int zero1 : 2;
|
|
101 unsigned int btngr_ns : 2;
|
|
102 unsigned int zero2 : 1;
|
|
103 unsigned int btngr1_dsp_ty : 3;
|
|
104 unsigned int zero3 : 1;
|
|
105 unsigned int btngr2_dsp_ty : 3;
|
|
106 unsigned int zero4 : 1;
|
|
107 unsigned int btngr3_dsp_ty : 3;
|
|
108 #else
|
|
109 unsigned int btngr1_dsp_ty : 3;
|
|
110 unsigned int zero2 : 1;
|
|
111 unsigned int btngr_ns : 2;
|
|
112 unsigned int zero1 : 2;
|
|
113 unsigned int btngr3_dsp_ty : 3;
|
|
114 unsigned int zero4 : 1;
|
|
115 unsigned int btngr2_dsp_ty : 3;
|
|
116 unsigned int zero3 : 1;
|
|
117 #endif
|
|
118 uint8_t btn_ofn;
|
|
119 uint8_t btn_ns; ///< only low 6 bits
|
|
120 uint8_t nsl_btn_ns; ///< only low 6 bits
|
|
121 uint8_t zero5;
|
|
122 uint8_t fosl_btnn; ///< only low 6 bits
|
|
123 uint8_t foac_btnn; ///< only low 6 bits
|
|
124 } ATTRIBUTE_PACKED hl_gi_t;
|
|
125
|
|
126
|
|
127 /**
|
|
128 * Button Color Information Table
|
|
129 */
|
|
130 typedef struct {
|
|
131 uint32_t btn_coli[3][2];
|
|
132 } ATTRIBUTE_PACKED btn_colit_t;
|
|
133
|
|
134 /**
|
|
135 * Button Information
|
|
136 */
|
|
137 typedef struct {
|
|
138 #ifdef WORDS_BIGENDIAN
|
|
139 unsigned int btn_coln : 2;
|
|
140 unsigned int x_start : 10;
|
|
141 unsigned int zero1 : 2;
|
|
142 unsigned int x_end : 10;
|
|
143 unsigned int auto_action_mode : 2;
|
|
144 unsigned int y_start : 10;
|
|
145 unsigned int zero2 : 2;
|
|
146 unsigned int y_end : 10;
|
|
147
|
|
148 unsigned int zero3 : 2;
|
|
149 unsigned int up : 6;
|
|
150 unsigned int zero4 : 2;
|
|
151 unsigned int down : 6;
|
|
152 unsigned int zero5 : 2;
|
|
153 unsigned int left : 6;
|
|
154 unsigned int zero6 : 2;
|
|
155 unsigned int right : 6;
|
|
156 #else
|
|
157 unsigned int x_end : 10;
|
|
158 unsigned int zero1 : 2;
|
|
159 unsigned int x_start : 10;
|
|
160 unsigned int btn_coln : 2;
|
|
161 unsigned int y_end : 10;
|
|
162 unsigned int zero2 : 2;
|
|
163 unsigned int y_start : 10;
|
|
164 unsigned int auto_action_mode : 2;
|
|
165
|
|
166 unsigned int up : 6;
|
|
167 unsigned int zero3 : 2;
|
|
168 unsigned int down : 6;
|
|
169 unsigned int zero4 : 2;
|
|
170 unsigned int left : 6;
|
|
171 unsigned int zero5 : 2;
|
|
172 unsigned int right : 6;
|
|
173 unsigned int zero6 : 2;
|
|
174 #endif
|
|
175 vm_cmd_t cmd;
|
|
176 } ATTRIBUTE_PACKED btni_t;
|
|
177
|
|
178 /**
|
|
179 * Highlight Information
|
|
180 */
|
|
181 typedef struct {
|
|
182 hl_gi_t hl_gi;
|
|
183 btn_colit_t btn_colit;
|
|
184 btni_t btnit[36];
|
|
185 } ATTRIBUTE_PACKED hli_t;
|
|
186
|
|
187 /**
|
|
188 * PCI packet
|
|
189 */
|
|
190 typedef struct {
|
|
191 pci_gi_t pci_gi;
|
|
192 nsml_agli_t nsml_agli;
|
|
193 hli_t hli;
|
|
194 uint8_t zero1[189];
|
|
195 } ATTRIBUTE_PACKED pci_t;
|
|
196
|
|
197
|
|
198
|
|
199
|
|
200 /**
|
|
201 * DSI General Information
|
|
202 */
|
|
203 typedef struct {
|
|
204 uint32_t nv_pck_scr;
|
|
205 uint32_t nv_pck_lbn;
|
|
206 uint32_t vobu_ea;
|
|
207 uint32_t vobu_1stref_ea;
|
|
208 uint32_t vobu_2ndref_ea;
|
|
209 uint32_t vobu_3rdref_ea;
|
|
210 uint16_t vobu_vob_idn;
|
|
211 uint8_t zero1;
|
|
212 uint8_t vobu_c_idn;
|
|
213 dvd_time_t c_eltm;
|
|
214 } ATTRIBUTE_PACKED dsi_gi_t;
|
|
215
|
|
216 /**
|
|
217 * Seamless Playback Information
|
|
218 */
|
|
219 typedef struct {
|
|
220 uint16_t category; ///< category of seamless VOBU
|
|
221 uint32_t ilvu_ea; ///< end address of interleaved Unit (sectors)
|
|
222 uint32_t ilvu_sa; ///< start address of next interleaved unit (sectors)
|
|
223 uint16_t size; ///< size of next interleaved unit (sectors)
|
|
224 uint32_t vob_v_s_s_ptm; ///< video start ptm in vob
|
|
225 uint32_t vob_v_e_e_ptm; ///< video end ptm in vob
|
|
226 struct {
|
|
227 uint32_t stp_ptm1;
|
|
228 uint32_t stp_ptm2;
|
|
229 uint32_t gap_len1;
|
|
230 uint32_t gap_len2;
|
|
231 } vob_a[8];
|
|
232 } ATTRIBUTE_PACKED sml_pbi_t;
|
|
233
|
|
234 /**
|
|
235 * Seamless Angle Infromation for one angle
|
|
236 */
|
|
237 typedef struct {
|
|
238 uint32_t address; ///< Sector offset to next ILVU, high bit is before/after
|
|
239 uint16_t size; ///< Byte size of the ILVU poited to by address.
|
|
240 } ATTRIBUTE_PACKED sml_agl_data_t;
|
|
241
|
|
242 /**
|
|
243 * Seamless Angle Infromation
|
|
244 */
|
|
245 typedef struct {
|
|
246 sml_agl_data_t data[9];
|
|
247 } ATTRIBUTE_PACKED sml_agli_t;
|
|
248
|
|
249 /**
|
|
250 * VOBU Search Information
|
|
251 */
|
|
252 typedef struct {
|
|
253 uint32_t next_video; ///< Next vobu that contains video
|
|
254 uint32_t fwda[19]; ///< Forwards, time
|
|
255 uint32_t next_vobu;
|
|
256 uint32_t prev_vobu;
|
|
257 uint32_t bwda[19]; ///< Backwards, time
|
|
258 uint32_t prev_video;
|
|
259 } ATTRIBUTE_PACKED vobu_sri_t;
|
|
260
|
|
261 #define SRI_END_OF_CELL 0x3fffffff
|
|
262
|
|
263 /**
|
|
264 * Synchronous Information
|
|
265 */
|
|
266 typedef struct {
|
|
267 uint16_t a_synca[8]; ///< Sector offset to first audio packet for this VOBU
|
|
268 uint32_t sp_synca[32]; ///< Sector offset to first subpicture packet
|
|
269 } ATTRIBUTE_PACKED synci_t;
|
|
270
|
|
271 /**
|
|
272 * DSI packet
|
|
273 */
|
|
274 typedef struct {
|
|
275 dsi_gi_t dsi_gi;
|
|
276 sml_pbi_t sml_pbi;
|
|
277 sml_agli_t sml_agli;
|
|
278 vobu_sri_t vobu_sri;
|
|
279 synci_t synci;
|
|
280 uint8_t zero1[471];
|
|
281 } ATTRIBUTE_PACKED dsi_t;
|
|
282
|
|
283
|
|
284 #if PRAGMA_PACK
|
|
285 #pragma pack()
|
|
286 #endif
|
|
287
|
|
288 #endif /* NAV_TYPES_H_INCLUDED */
|