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