~ubuntu-branches/ubuntu/saucy/libdvdread/saucy

« back to all changes in this revision

Viewing changes to src/nav_types.h

  • Committer: Package Import Robot
  • Author(s): Bryce Harrington
  • Date: 2011-11-28 17:12:51 UTC
  • mfrom: (1.1.4) (3.2.10 sid)
  • Revision ID: package-import@ubuntu.com-20111128171251-fxbi0nd6rrz3lsfb
Tags: 4.2.0-1ubuntu1
* Merge from debian testing.  Remaining changes:
  - Re-add missing install-css.sh. Update the script with patch by Gene Cumm
    for dynamic version calculation.
  - debian/control: add Suggests for install-css.sh on wget, debhelper, etc.
  - debian/rules: install install-css.sh, leave perms executable.
  - 100-quell-vts-tmapt-warning.patch - Don't recommend sending bug
    reports when VTS_TMAPT is missing
  - 102-reorder-linkage.patch - Fix link order for shared library loading.
* Drop 101-fix-msb-unicode.patch; fixed upstream.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
#ifndef NAV_TYPES_H_INCLUDED
2
 
#define NAV_TYPES_H_INCLUDED
3
 
 
4
 
/*
5
 
 * Copyright (C) 2000, 2001, 2002 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>
33
 
#include "ifo_types.h" /* only dvd_time_t, vm_cmd_t and user_ops_t */
34
 
 
35
 
/* The length including the substream id byte. */
36
 
#define PCI_BYTES 0x3d4
37
 
#define DSI_BYTES 0x3fa
38
 
 
39
 
#define PS2_PCI_SUBSTREAM_ID 0x00
40
 
#define PS2_DSI_SUBSTREAM_ID 0x01
41
 
 
42
 
/* Remove this */
43
 
#define DSI_START_BYTE 1031
44
 
 
45
 
/**
46
 
 * PCI General Information
47
 
 */
48
 
typedef struct {
49
 
  uint32_t nv_pck_lbn;      /**< sector address of this nav pack */
50
 
  uint16_t vobu_cat;        /**< 'category' of vobu */
51
 
  uint16_t zero1;           /**< reserved */
52
 
  user_ops_t vobu_uop_ctl;  /**< UOP of vobu */
53
 
  uint32_t vobu_s_ptm;      /**< start presentation time of vobu */
54
 
  uint32_t vobu_e_ptm;      /**< end presentation time of vobu */
55
 
  uint32_t vobu_se_e_ptm;   /**< end ptm of sequence end in vobu */
56
 
  dvd_time_t e_eltm;        /**< Cell elapsed time */
57
 
  char vobu_isrc[32];
58
 
} ATTRIBUTE_PACKED pci_gi_t;
59
 
 
60
 
/**
61
 
 * Non Seamless Angle Information
62
 
 */
63
 
typedef struct {
64
 
  uint32_t nsml_agl_dsta[9];  /**< address of destination vobu in AGL_C#n */
65
 
} ATTRIBUTE_PACKED nsml_agli_t;
66
 
 
67
 
/**
68
 
 * Highlight General Information
69
 
 *
70
 
 * For btngrX_dsp_ty the bits have the following meaning:
71
 
 * 000b: normal 4/3 only buttons
72
 
 * XX1b: wide (16/9) buttons
73
 
 * X1Xb: letterbox buttons
74
 
 * 1XXb: pan&scan buttons
75
 
 */
76
 
typedef struct {
77
 
  uint16_t hli_ss; /**< status, only low 2 bits 0: no buttons, 1: different 2: equal 3: eual except for button cmds */
78
 
  uint32_t hli_s_ptm;              /**< start ptm of hli */
79
 
  uint32_t hli_e_ptm;              /**< end ptm of hli */
80
 
  uint32_t btn_se_e_ptm;           /**< end ptm of button select */
81
 
  unsigned int zero1 : 2;          /**< reserved */
82
 
  unsigned int btngr_ns : 2;       /**< number of button groups 1, 2 or 3 with 36/18/12 buttons */
83
 
  unsigned int zero2 : 1;          /**< reserved */
84
 
  unsigned int btngr1_dsp_ty : 3;  /**< display type of subpic stream for button group 1 */
85
 
  unsigned int zero3 : 1;          /**< reserved */
86
 
  unsigned int btngr2_dsp_ty : 3;  /**< display type of subpic stream for button group 2 */
87
 
  unsigned int zero4 : 1;          /**< reserved */
88
 
  unsigned int btngr3_dsp_ty : 3;  /**< display type of subpic stream for button group 3 */
89
 
  uint8_t btn_ofn;     /**< button offset number range 0-255 */
90
 
  uint8_t btn_ns;      /**< number of valid buttons  <= 36/18/12 (low 6 bits) */
91
 
  uint8_t nsl_btn_ns;  /**< number of buttons selectable by U_BTNNi (low 6 bits)   nsl_btn_ns <= btn_ns */
92
 
  uint8_t zero5;       /**< reserved */
93
 
  uint8_t fosl_btnn;   /**< forcedly selected button  (low 6 bits) */
94
 
  uint8_t foac_btnn;   /**< forcedly activated button (low 6 bits) */
95
 
} ATTRIBUTE_PACKED hl_gi_t;
96
 
 
97
 
 
98
 
/**
99
 
 * Button Color Information Table
100
 
 * Each entry beeing a 32bit word that contains the color indexs and alpha
101
 
 * values to use.  They are all represented by 4 bit number and stored
102
 
 * like this [Ci3, Ci2, Ci1, Ci0, A3, A2, A1, A0].   The actual palette
103
 
 * that the indexes reference is in the PGC.
104
 
 * @TODO split the uint32_t into a struct
105
 
 */
106
 
typedef struct {
107
 
  uint32_t btn_coli[3][2];  /**< [button color number-1][select:0/action:1] */
108
 
} ATTRIBUTE_PACKED btn_colit_t;
109
 
 
110
 
/**
111
 
 * Button Information
112
 
 *
113
 
 * NOTE: I've had to change the structure from the disk layout to get
114
 
 * the packing to work with Sun's Forte C compiler.
115
 
 * The 4 and 7 bytes are 'rotated' was: ABC DEF GHIJ  is: ABCG DEFH IJ
116
 
 */
117
 
typedef struct {
118
 
  unsigned int btn_coln         : 2;  /**< button color number */
119
 
  unsigned int x_start          : 10; /**< x start offset within the overlay */
120
 
  unsigned int zero1            : 2;  /**< reserved */
121
 
  unsigned int x_end            : 10; /**< x end offset within the overlay */
122
 
 
123
 
  unsigned int auto_action_mode : 2;  /**< 0: no, 1: activated if selected */
124
 
  unsigned int y_start          : 10; /**< y start offset within the overlay */
125
 
  unsigned int zero2            : 2;  /**< reserved */
126
 
  unsigned int y_end            : 10; /**< y end offset within the overlay */
127
 
 
128
 
  unsigned int zero3            : 2;  /**< reserved */
129
 
  unsigned int up               : 6;  /**< button index when pressing up */
130
 
  unsigned int zero4            : 2;  /**< reserved */
131
 
  unsigned int down             : 6;  /**< button index when pressing down */
132
 
  unsigned int zero5            : 2;  /**< reserved */
133
 
  unsigned int left             : 6;  /**< button index when pressing left */
134
 
  unsigned int zero6            : 2;  /**< reserved */
135
 
  unsigned int right            : 6;  /**< button index when pressing right */
136
 
  vm_cmd_t cmd;
137
 
} ATTRIBUTE_PACKED btni_t;
138
 
 
139
 
/**
140
 
 * Highlight Information
141
 
 */
142
 
typedef struct {
143
 
  hl_gi_t     hl_gi;
144
 
  btn_colit_t btn_colit;
145
 
  btni_t      btnit[36];
146
 
} ATTRIBUTE_PACKED hli_t;
147
 
 
148
 
/**
149
 
 * PCI packet
150
 
 */
151
 
typedef struct {
152
 
  pci_gi_t    pci_gi;
153
 
  nsml_agli_t nsml_agli;
154
 
  hli_t       hli;
155
 
  uint8_t     zero1[189];
156
 
} ATTRIBUTE_PACKED pci_t;
157
 
 
158
 
 
159
 
 
160
 
 
161
 
/**
162
 
 * DSI General Information
163
 
 */
164
 
typedef struct {
165
 
  uint32_t nv_pck_scr;
166
 
  uint32_t nv_pck_lbn;      /**< sector address of this nav pack */
167
 
  uint32_t vobu_ea;         /**< end address of this VOBU */
168
 
  uint32_t vobu_1stref_ea;  /**< end address of the 1st reference image */
169
 
  uint32_t vobu_2ndref_ea;  /**< end address of the 2nd reference image */
170
 
  uint32_t vobu_3rdref_ea;  /**< end address of the 3rd reference image */
171
 
  uint16_t vobu_vob_idn;    /**< VOB Id number that this VOBU is part of */
172
 
  uint8_t  zero1;           /**< reserved */
173
 
  uint8_t  vobu_c_idn;      /**< Cell Id number that this VOBU is part of */
174
 
  dvd_time_t c_eltm;        /**< Cell elapsed time */
175
 
} ATTRIBUTE_PACKED dsi_gi_t;
176
 
 
177
 
/**
178
 
 * Seamless Playback Information
179
 
 */
180
 
typedef struct {
181
 
  uint16_t category;       /**< 'category' of seamless VOBU */
182
 
  uint32_t ilvu_ea;        /**< end address of interleaved Unit */
183
 
  uint32_t ilvu_sa;        /**< start address of next interleaved unit */
184
 
  uint16_t size;           /**< size of next interleaved unit */
185
 
  uint32_t vob_v_s_s_ptm;  /**< video start ptm in vob */
186
 
  uint32_t vob_v_e_e_ptm;  /**< video end ptm in vob */
187
 
  struct {
188
 
    uint32_t stp_ptm1;
189
 
    uint32_t stp_ptm2;
190
 
    uint32_t gap_len1;
191
 
    uint32_t gap_len2;
192
 
  } vob_a[8];
193
 
} ATTRIBUTE_PACKED sml_pbi_t;
194
 
 
195
 
/**
196
 
 * Seamless Angle Infromation for one angle
197
 
 */
198
 
typedef struct {
199
 
    uint32_t address; /**< offset to next ILVU, high bit is before/after */
200
 
    uint16_t size;    /**< byte size of the ILVU pointed to by address */
201
 
} ATTRIBUTE_PACKED sml_agl_data_t;
202
 
 
203
 
/**
204
 
 * Seamless Angle Infromation
205
 
 */
206
 
typedef struct {
207
 
  sml_agl_data_t data[9];
208
 
} ATTRIBUTE_PACKED sml_agli_t;
209
 
 
210
 
/**
211
 
 * VOBU Search Information
212
 
 */
213
 
typedef struct {
214
 
  uint32_t next_video; /**< Next vobu that contains video */
215
 
  uint32_t fwda[19];   /**< Forwards, time */
216
 
  uint32_t next_vobu;
217
 
  uint32_t prev_vobu;
218
 
  uint32_t bwda[19];   /**< Backwards, time */
219
 
  uint32_t prev_video;
220
 
} ATTRIBUTE_PACKED vobu_sri_t;
221
 
 
222
 
#define SRI_END_OF_CELL 0x3fffffff
223
 
 
224
 
/**
225
 
 * Synchronous Information
226
 
 */
227
 
typedef struct {
228
 
  uint16_t a_synca[8];   /**< offset to first audio packet for this VOBU */
229
 
  uint32_t sp_synca[32]; /**< offset to first subpicture packet */
230
 
} ATTRIBUTE_PACKED synci_t;
231
 
 
232
 
/**
233
 
 * DSI packet
234
 
 */
235
 
typedef struct {
236
 
  dsi_gi_t   dsi_gi;
237
 
  sml_pbi_t  sml_pbi;
238
 
  sml_agli_t sml_agli;
239
 
  vobu_sri_t vobu_sri;
240
 
  synci_t    synci;
241
 
  uint8_t    zero1[471];
242
 
} ATTRIBUTE_PACKED dsi_t;
243
 
 
244
 
 
245
 
#if PRAGMA_PACK
246
 
#pragma pack()
247
 
#endif
248
 
 
249
 
#endif /* NAV_TYPES_H_INCLUDED */