comparison libmpdvdkit2/nav_types.h @ 15874:483e955893b8

update libdvdread to v0.9.4
author aurel
date Thu, 30 Jun 2005 22:48:26 +0000
parents 25df9508f9a8
children 0783dd397f74
comparison
equal deleted inserted replaced
15873:276da0bb6207 15874:483e955893b8
1 #ifndef NAV_TYPES_H_INCLUDED 1 #ifndef NAV_TYPES_H_INCLUDED
2 #define NAV_TYPES_H_INCLUDED 2 #define NAV_TYPES_H_INCLUDED
3 3
4 /* 4 /*
5 * Copyright (C) 2000, 2001 Håkan Hjort <d95hjort@dtek.chalmers.se> 5 * Copyright (C) 2000, 2001, 2002 Håkan Hjort <d95hjort@dtek.chalmers.se>
6 * 6 *
7 * Modified for use with MPlayer, changes contained in libdvdread_changes.diff. 7 * Modified for use with MPlayer, changes contained in libdvdread_changes.diff.
8 * detailed CVS changelog at http://www.mplayerhq.hu/cgi-bin/cvsweb.cgi/main/ 8 * detailed CVS changelog at http://www.mplayerhq.hu/cgi-bin/cvsweb.cgi/main/
9 * $Id$ 9 * $Id$
10 * 10 *
32 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 32 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
33 * USA 33 * USA
34 */ 34 */
35 35
36 #include <inttypes.h> 36 #include <inttypes.h>
37 #include "ifo_types.h" // only dvd_time_t, vm_cmd_t and user_ops_t 37 #include "ifo_types.h" /* only dvd_time_t, vm_cmd_t and user_ops_t */
38 38
39 39
40 #undef ATTRIBUTE_PACKED 40 #undef ATTRIBUTE_PACKED
41 #undef PRAGMA_PACK_BEGIN 41 #undef PRAGMA_PACK_BEGIN
42 #undef PRAGMA_PACK_END 42 #undef PRAGMA_PACK_END
72 72
73 /** 73 /**
74 * PCI General Information 74 * PCI General Information
75 */ 75 */
76 typedef struct { 76 typedef struct {
77 uint32_t nv_pck_lbn; 77 uint32_t nv_pck_lbn; /**< sector address of this nav pack */
78 uint16_t vobu_cat; 78 uint16_t vobu_cat; /**< 'category' of vobu */
79 uint16_t zero1; 79 uint16_t zero1; /**< reserved */
80 user_ops_t vobu_uop_ctl; 80 user_ops_t vobu_uop_ctl; /**< UOP of vobu */
81 uint32_t vobu_s_ptm; 81 uint32_t vobu_s_ptm; /**< start presentation time of vobu */
82 uint32_t vobu_e_ptm; 82 uint32_t vobu_e_ptm; /**< end presentation time of vobu */
83 uint32_t vobu_se_e_ptm; 83 uint32_t vobu_se_e_ptm; /**< end ptm of sequence end in vobu */
84 dvd_time_t e_eltm; 84 dvd_time_t e_eltm; /**< Cell elapsed time */
85 char vobu_isrc[32]; 85 char vobu_isrc[32];
86 } ATTRIBUTE_PACKED pci_gi_t; 86 } ATTRIBUTE_PACKED pci_gi_t;
87 87
88 /** 88 /**
89 * Non Seamless Angle Information 89 * Non Seamless Angle Information
90 */ 90 */
91 typedef struct { 91 typedef struct {
92 uint32_t nsml_agl_dsta[9]; 92 uint32_t nsml_agl_dsta[9]; /**< address of destination vobu in AGL_C#n */
93 } ATTRIBUTE_PACKED nsml_agli_t; 93 } ATTRIBUTE_PACKED nsml_agli_t;
94 94
95 /** 95 /**
96 * Highlight General Information 96 * Highlight General Information
97 */ 97 *
98 typedef struct { 98 * For btngrX_dsp_ty the bits have the following meaning:
99 uint16_t hli_ss; ///< only low 2 bits 99 * 000b: normal 4/3 only buttons
100 uint32_t hli_s_ptm; 100 * XX1b: wide (16/9) buttons
101 uint32_t hli_e_ptm; 101 * X1Xb: letterbox buttons
102 uint32_t btn_se_e_ptm; 102 * 1XXb: pan&scan buttons
103 */
104 typedef struct {
105 uint16_t hli_ss; /**< status, only low 2 bits 0: no buttons, 1: different 2: equal 3: eual except for button cmds */
106 uint32_t hli_s_ptm; /**< start ptm of hli */
107 uint32_t hli_e_ptm; /**< end ptm of hli */
108 uint32_t btn_se_e_ptm; /**< end ptm of button select */
103 #ifdef WORDS_BIGENDIAN 109 #ifdef WORDS_BIGENDIAN
104 unsigned int zero1 : 2; 110 unsigned int zero1 : 2; /**< reserved */
105 unsigned int btngr_ns : 2; 111 unsigned int btngr_ns : 2; /**< number of button groups 1, 2 or 3 with 36/18/12 buttons */
106 unsigned int zero2 : 1; 112 unsigned int zero2 : 1; /**< reserved */
107 unsigned int btngr1_dsp_ty : 3; 113 unsigned int btngr1_dsp_ty : 3; /**< display type of subpic stream for button group 1 */
108 unsigned int zero3 : 1; 114 unsigned int zero3 : 1; /**< reserved */
109 unsigned int btngr2_dsp_ty : 3; 115 unsigned int btngr2_dsp_ty : 3; /**< display type of subpic stream for button group 2 */
110 unsigned int zero4 : 1; 116 unsigned int zero4 : 1; /**< reserved */
111 unsigned int btngr3_dsp_ty : 3; 117 unsigned int btngr3_dsp_ty : 3; /**< display type of subpic stream for button group 3 */
112 #else 118 #else
113 unsigned int btngr1_dsp_ty : 3; 119 unsigned int btngr1_dsp_ty : 3;
114 unsigned int zero2 : 1; 120 unsigned int zero2 : 1;
115 unsigned int btngr_ns : 2; 121 unsigned int btngr_ns : 2;
116 unsigned int zero1 : 2; 122 unsigned int zero1 : 2;
117 unsigned int btngr3_dsp_ty : 3; 123 unsigned int btngr3_dsp_ty : 3;
118 unsigned int zero4 : 1; 124 unsigned int zero4 : 1;
119 unsigned int btngr2_dsp_ty : 3; 125 unsigned int btngr2_dsp_ty : 3;
120 unsigned int zero3 : 1; 126 unsigned int zero3 : 1;
121 #endif 127 #endif
122 uint8_t btn_ofn; 128 uint8_t btn_ofn; /**< button offset number range 0-255 */
123 uint8_t btn_ns; ///< only low 6 bits 129 uint8_t btn_ns; /**< number of valid buttons <= 36/18/12 (low 6 bits) */
124 uint8_t nsl_btn_ns; ///< only low 6 bits 130 uint8_t nsl_btn_ns; /**< number of buttons selectable by U_BTNNi (low 6 bits) nsl_btn_ns <= btn_ns */
125 uint8_t zero5; 131 uint8_t zero5; /**< reserved */
126 uint8_t fosl_btnn; ///< only low 6 bits 132 uint8_t fosl_btnn; /**< forcedly selected button (low 6 bits) */
127 uint8_t foac_btnn; ///< only low 6 bits 133 uint8_t foac_btnn; /**< forcedly activated button (low 6 bits) */
128 } ATTRIBUTE_PACKED hl_gi_t; 134 } ATTRIBUTE_PACKED hl_gi_t;
129 135
130 136
131 /** 137 /**
132 * Button Color Information Table 138 * Button Color Information Table
133 */ 139 * Each entry beeing a 32bit word that contains the color indexs and alpha
134 typedef struct { 140 * values to use. They are all represented by 4 bit number and stored
135 uint32_t btn_coli[3][2]; 141 * like this [Ci3, Ci2, Ci1, Ci0, A3, A2, A1, A0]. The actual palette
142 * that the indexes reference is in the PGC.
143 * @TODO split the uint32_t into a struct
144 */
145 typedef struct {
146 uint32_t btn_coli[3][2]; /**< [button color number-1][select:0/action:1] */
136 } ATTRIBUTE_PACKED btn_colit_t; 147 } ATTRIBUTE_PACKED btn_colit_t;
137 148
138 /** 149 /**
139 * Button Information 150 * Button Information
151 *
152 * NOTE: I've had to change the structure from the disk layout to get
153 * the packing to work with Sun's Forte C compiler.
154 * The 4 and 7 bytes are 'rotated' was: ABC DEF GHIJ is: ABCG DEFH IJ
140 */ 155 */
141 typedef struct { 156 typedef struct {
142 #ifdef WORDS_BIGENDIAN 157 #ifdef WORDS_BIGENDIAN
143 unsigned int btn_coln : 2; 158 unsigned int btn_coln : 2; /**< button color number */
144 unsigned int x_start : 10; 159 unsigned int x_start : 10; /**< x start offset within the overlay */
145 unsigned int zero1 : 2; 160 unsigned int zero1 : 2; /**< reserved */
146 unsigned int x_end : 10; 161 unsigned int x_end : 10; /**< x end offset within the overlay */
147 unsigned int auto_action_mode : 2; 162
148 unsigned int y_start : 10; 163 unsigned int zero3 : 2; /**< reserved */
149 unsigned int zero2 : 2; 164 unsigned int up : 6; /**< button index when pressing up */
150 unsigned int y_end : 10; 165
151 166 unsigned int auto_action_mode : 2; /**< 0: no, 1: activated if selected */
152 unsigned int zero3 : 2; 167 unsigned int y_start : 10; /**< y start offset within the overlay */
153 unsigned int up : 6; 168 unsigned int zero2 : 2; /**< reserved */
154 unsigned int zero4 : 2; 169 unsigned int y_end : 10; /**< y end offset within the overlay */
155 unsigned int down : 6; 170
156 unsigned int zero5 : 2; 171 unsigned int zero4 : 2; /**< reserved */
157 unsigned int left : 6; 172 unsigned int down : 6; /**< button index when pressing down */
158 unsigned int zero6 : 2; 173 unsigned int zero5 : 2; /**< reserved */
159 unsigned int right : 6; 174 unsigned int left : 6; /**< button index when pressing left */
175 unsigned int zero6 : 2; /**< reserved */
176 unsigned int right : 6; /**< button index when pressing right */
160 #else 177 #else
161 unsigned int x_end : 10; 178 unsigned int x_end : 10;
162 unsigned int zero1 : 2; 179 unsigned int zero1 : 2;
163 unsigned int x_start : 10; 180 unsigned int x_start : 10;
164 unsigned int btn_coln : 2; 181 unsigned int btn_coln : 2;
182
183 unsigned int up : 6;
184 unsigned int zero3 : 2;
185
165 unsigned int y_end : 10; 186 unsigned int y_end : 10;
166 unsigned int zero2 : 2; 187 unsigned int zero2 : 2;
167 unsigned int y_start : 10; 188 unsigned int y_start : 10;
168 unsigned int auto_action_mode : 2; 189 unsigned int auto_action_mode : 2;
169 190
170 unsigned int up : 6;
171 unsigned int zero3 : 2;
172 unsigned int down : 6; 191 unsigned int down : 6;
173 unsigned int zero4 : 2; 192 unsigned int zero4 : 2;
174 unsigned int left : 6; 193 unsigned int left : 6;
175 unsigned int zero5 : 2; 194 unsigned int zero5 : 2;
176 unsigned int right : 6; 195 unsigned int right : 6;
204 /** 223 /**
205 * DSI General Information 224 * DSI General Information
206 */ 225 */
207 typedef struct { 226 typedef struct {
208 uint32_t nv_pck_scr; 227 uint32_t nv_pck_scr;
209 uint32_t nv_pck_lbn; 228 uint32_t nv_pck_lbn; /**< sector address of this nav pack */
210 uint32_t vobu_ea; 229 uint32_t vobu_ea; /**< end address of this VOBU */
211 uint32_t vobu_1stref_ea; 230 uint32_t vobu_1stref_ea; /**< end address of the 1st reference image */
212 uint32_t vobu_2ndref_ea; 231 uint32_t vobu_2ndref_ea; /**< end address of the 2nd reference image */
213 uint32_t vobu_3rdref_ea; 232 uint32_t vobu_3rdref_ea; /**< end address of the 3rd reference image */
214 uint16_t vobu_vob_idn; 233 uint16_t vobu_vob_idn; /**< VOB Id number that this VOBU is part of */
215 uint8_t zero1; 234 uint8_t zero1; /**< reserved */
216 uint8_t vobu_c_idn; 235 uint8_t vobu_c_idn; /**< Cell Id number that this VOBU is part of */
217 dvd_time_t c_eltm; 236 dvd_time_t c_eltm; /**< Cell elapsed time */
218 } ATTRIBUTE_PACKED dsi_gi_t; 237 } ATTRIBUTE_PACKED dsi_gi_t;
219 238
220 /** 239 /**
221 * Seamless Playback Information 240 * Seamless Playback Information
222 */ 241 */
223 typedef struct { 242 typedef struct {
224 uint16_t category; ///< category of seamless VOBU 243 uint16_t category; /**< 'category' of seamless VOBU */
225 uint32_t ilvu_ea; ///< end address of interleaved Unit (sectors) 244 uint32_t ilvu_ea; /**< end address of interleaved Unit */
226 uint32_t ilvu_sa; ///< start address of next interleaved unit (sectors) 245 uint32_t ilvu_sa; /**< start address of next interleaved unit */
227 uint16_t size; ///< size of next interleaved unit (sectors) 246 uint16_t size; /**< size of next interleaved unit */
228 uint32_t vob_v_s_s_ptm; ///< video start ptm in vob 247 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 248 uint32_t vob_v_e_e_ptm; /**< video end ptm in vob */
230 struct { 249 struct {
231 uint32_t stp_ptm1; 250 uint32_t stp_ptm1;
232 uint32_t stp_ptm2; 251 uint32_t stp_ptm2;
233 uint32_t gap_len1; 252 uint32_t gap_len1;
234 uint32_t gap_len2; 253 uint32_t gap_len2;
237 256
238 /** 257 /**
239 * Seamless Angle Infromation for one angle 258 * Seamless Angle Infromation for one angle
240 */ 259 */
241 typedef struct { 260 typedef struct {
242 uint32_t address; ///< Sector offset to next ILVU, high bit is before/after 261 uint32_t address; /**< offset to next ILVU, high bit is before/after */
243 uint16_t size; ///< Byte size of the ILVU poited to by address. 262 uint16_t size; /**< byte size of the ILVU pointed to by address */
244 } ATTRIBUTE_PACKED sml_agl_data_t; 263 } ATTRIBUTE_PACKED sml_agl_data_t;
245 264
246 /** 265 /**
247 * Seamless Angle Infromation 266 * Seamless Angle Infromation
248 */ 267 */
252 271
253 /** 272 /**
254 * VOBU Search Information 273 * VOBU Search Information
255 */ 274 */
256 typedef struct { 275 typedef struct {
257 uint32_t next_video; ///< Next vobu that contains video 276 uint32_t next_video; /**< Next vobu that contains video */
258 uint32_t fwda[19]; ///< Forwards, time 277 uint32_t fwda[19]; /**< Forwards, time */
259 uint32_t next_vobu; 278 uint32_t next_vobu;
260 uint32_t prev_vobu; 279 uint32_t prev_vobu;
261 uint32_t bwda[19]; ///< Backwards, time 280 uint32_t bwda[19]; /**< Backwards, time */
262 uint32_t prev_video; 281 uint32_t prev_video;
263 } ATTRIBUTE_PACKED vobu_sri_t; 282 } ATTRIBUTE_PACKED vobu_sri_t;
264 283
265 #define SRI_END_OF_CELL 0x3fffffff 284 #define SRI_END_OF_CELL 0x3fffffff
266 285
267 /** 286 /**
268 * Synchronous Information 287 * Synchronous Information
269 */ 288 */
270 typedef struct { 289 typedef struct {
271 uint16_t a_synca[8]; ///< Sector offset to first audio packet for this VOBU 290 uint16_t a_synca[8]; /**< offset to first audio packet for this VOBU */
272 uint32_t sp_synca[32]; ///< Sector offset to first subpicture packet 291 uint32_t sp_synca[32]; /**< offset to first subpicture packet */
273 } ATTRIBUTE_PACKED synci_t; 292 } ATTRIBUTE_PACKED synci_t;
274 293
275 /** 294 /**
276 * DSI packet 295 * DSI packet
277 */ 296 */