4 #ifndef DVD_VIDEO_LB_LEN
5 #define DVD_VIDEO_LB_LEN 2048
8 #define OFFSET_IFO 0x0000
9 #define OFFSET_VTS 0x0000
10 #define OFFSET_LEN 0x00C0
11 #define IFO_OFFSET_TAT 0x00C0
12 #define OFFSET_VTSI_MAT 0x0080
13 #define IFO_OFFSET_VIDEO 0x0100
14 #define IFO_OFFSET_AUDIO 0x0200
15 #define IFO_OFFSET_SUBPIC 0x0250
18 // for debug and error output
25 #if BYTE_ORDER == BIG_ENDIAN
26 u_char compression
: 2;
29 u_char perm_displ
: 2;
33 u_char source_res
: 2;
34 u_char letterboxed
: 1;
37 u_char perm_displ
: 2;
40 u_char compression
: 2;
43 u_char letterboxed
: 1;
44 u_char source_res
: 2;
55 #if MPEG3_LITTLE_ENDIAN
56 u_char num_channels
: 3; // number of channels (n+1)
57 u_char sample_freq
: 2; // sampling frequency
58 u_char quantization
: 2; // quantization
59 u_char appl_mode2
: 1; // audio application mode
61 u_char appl_mode1
: 1; //
62 u_char type
: 2; // audio type (language included?)
63 u_char multichannel_extension
: 1;
64 u_char coding_mode
: 2;
66 u_char appl_mode2
: 1;
67 u_char quantization
: 2;
68 u_char sample_freq
: 2;
69 u_char num_channels
: 3;
71 u_char coding_mode
: 2;
72 u_char multichannel_extension
: 1;
74 u_char appl_mode1
: 1;
76 u_short lang_code
: 16; // <char> description
77 u_int foo
: 8; // 0x00000000 ?
79 u_int bar
: 8; // 0x00000000 ?
82 #define IFO_AUDIO_LEN 7
89 u_short prefix
: 16; // 0x0100 ?
90 u_short lang_code
: 16; // <char> description
91 u_char foo
: 8; // dont know
92 u_char caption
: 8; // 0x00 ?
97 * Time Map Table header entry
102 u_char tu
: 16; // time unit (in seconds)
103 u_int
: 16; // don't know
108 u_int
: 24; // don't know
109 u_char tu
: 8; // time unit (in seconds)
112 //#define IFO_TMT_HDR_LEN 4
113 #define IFOQ_TMT_HDR_LEN 1
121 u_short vob_id
: 16; // Video Object Identifier
122 u_char cell_id
: 8; // Cell Identifier
123 u_char
: 8; // don't know
124 u_int start
: 32; // Cell start
125 u_int end
: 32; // Cell end
130 u_short vob_id
: 16; // Video Object Identifier
131 u_short cell_id
: 16; // Cell Identifier
132 } ifo_pgc_cell_pos_t
;
135 * Part of Title AND Title set Cell Address
139 u_short pgc
; // Program Chain (PTT)
140 u_short pg
; // Program (PTT)
141 u_long start
; // Start of VOBU (VTS? CADDR)
142 u_long end
; // End of VOBU (VTS? CADDR)
146 u_int num
; // Number of Chapters
147 ifo_ptt_data_t
*data
; // Data
151 u_int num
; // Number of Titles
152 ifo_ptt_sub_t
*title
; // Titles
156 u_char chain_info
: 8; // 0x5e 0xde(2 angles, no overlay), 0x5f 0x9f 0x9f 0xdf(4 angles overlay), 0x2 0xa 0x8(1 angle)
157 u_char foo
: 8; // parent control ??
158 u_char still_time
: 8;
162 u_int vobu_start
: 32; // 1st vobu start
164 u_int vobu_last_start
: 32;
165 u_int vobu_last_end
: 32;
166 } ifo_pgci_cell_addr_t
;
168 #define PGCI_CELL_ADDR_LEN 24
170 #define ID_NUM_MENU_VOBS 0
171 #define ID_NUM_TITLE_VOBS 1
176 #define ID_TITLE_PGCI 2
177 #define ID_MENU_PGCI 3
179 #define ID_MENU_CELL_ADDR 5
180 #define ID_MENU_VOBU_ADDR_MAP 6
181 #define ID_TITLE_CELL_ADDR 7
182 #define ID_TITLE_VOBU_ADDR_MAP 8
186 * Information Table - for internal use only
195 int fd
; // file descriptor
196 __off64_t pos
; // offset of ifo file on device
204 #define IFO_HDR_LEN 8
205 #define IFOQ_HDR_LEN 2
208 u_short num
: 16; // number of entries
209 u_short
: 16; // don't known (reserved?)
210 u_int len
: 32; // length of table
214 u_short
: 16; // don't known (reserved?)
215 u_short num
: 16; // number of entries
216 u_int len
: 32; // length of table
224 ifo_t
*ifoOpen (int fd
, __off64_t pos
);
225 int ifoClose (ifo_t
*ifo
);
227 u_int
ifoGetVOBStart (ifo_t
*ifo
);
228 int ifoGetNumberOfTitles (ifo_t
*ifo
);
229 int ifoGetNumberOfParts (ifo_t
*ifo
);
231 int ifoGetVMGPTT (ifo_hdr_t
*hdr
, char **ptr
);
232 int ifoGetPGCI (ifo_hdr_t
*hdr
, int title
, char **ptr
);
233 int ifoGetCLUT (char *pgc
, char **ptr
);
234 u_int
ifoGetCellPlayInfo (u_char
*pgc
, u_char
**ptr
);
235 u_int
ifoGetCellPos (u_char
*pgc
, u_char
**ptr
);
236 int ifoGetProgramMap (char *pgc
, char **ptr
);
237 int ifoGetCellAddr (char *cell_addr
, char **ptr
);
238 int ifoGetCellAddrNum (char *hdr
);
240 int ifoGetAudio (char *hdr
, char **ptr
);
241 int ifoGetSPU (char *hdr
, char **ptr
);
243 ifo_ptt_t
*ifo_get_ptt (ifo_t
*ifo
);
244 int ifo_get_num_title_pgci (ifo_t
*ifo
);
245 u_char
*ifo_get_ptr_title_pgci (ifo_t
*ifo
, int index
);
247 char *ifoDecodeLang (u_short descr
);
249 int ifoIsVTS (ifo_t
*ifo
);
250 int ifoIsVMG (ifo_t
*ifo
);
252 void ifoPrintVideo (u_char
*ptr
);
254 void ifoPrintCellPlayInfo (u_char
*ptr
, u_int num
);
255 void ifoPrintCellInfo (u_char
*ptr
, u_int num
);
256 void ifoPrintCellPos (u_char
*ptr
, u_int num
);
257 void ifoPrintCLUT (u_char
*ptr
);
258 void ifoPrintProgramMap (u_char
*ptr
, u_int num
);
261 void ifoPrintAudio (ifo_audio_t
*ptr
, u_int num
);
262 void ifoPrintSPU (ifo_spu_t
*ptr
, u_int num
);
263 void ifoPrintTMT (ifo_t
*ifo
);
265 void ifoPrintVMOP (u_char
*opcode
);
267 void ifoPrint_ptt (ifo_ptt_t
*ptt
);
268 void ifoPrint_vts_vobu_addr_map (ifo_t
*ifo
);
269 void ifoPrint_vtsm_vobu_addr_map (ifo_t
*ifo
);
270 void ifoPrint_vts_cell_addr (ifo_t
*ifo
);
271 void ifoPrint_vtsm_cell_addr (ifo_t
*ifo
);
272 void ifoPrint_title_pgci (ifo_t
*ifo
);
273 void ifoPrint_pgc_cmd (u_char
*pgc_ptr
);
274 void ifoPrintTSP (u_char
*toast
);
275 void ifoPrint_pgc (u_char
*ptr
);