dvd_ifo.h 19.2 KB
Newer Older
Stéphane Borel's avatar
Stéphane Borel committed
1
/*****************************************************************************
2
 * dvd_ifo.h: Structures for ifo parsing
Stéphane Borel's avatar
Stéphane Borel committed
3 4
 *****************************************************************************
 * Copyright (C) 1999-2001 VideoLAN
Sam Hocevar's avatar
 
Sam Hocevar committed
5
 * $Id: dvd_ifo.h,v 1.10 2001/04/04 02:49:18 sam Exp $
Stéphane Borel's avatar
Stéphane Borel committed
6 7 8
 *
 * Author: Stphane Borel <stef@via.ecp.fr>
 *
9 10 11 12 13
 * based on:
 *  - libifo by Thomas Mirlacher <dent@cosy.sbg.ac.at>
 *  - IFO structure documentation by Thomas Mirlacher, Bjrn Englund,
 *  Hkan Hjort
 * 
Stéphane Borel's avatar
Stéphane Borel committed
14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111, USA.
 *****************************************************************************/

/*****************************************************************************
 * Common structures for Video Management and Video Title sets
 *****************************************************************************/

/*
 * Program Chain structures
 */
36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76
typedef struct ifo_video_s
{
    u8      i_compression         ;// 2;
    u8      i_system              ;// 2;
    u8      i_ratio               ;// 2;
    u8      i_perm_displ          ;// 2;

    u8      i_line21_1            ;// 1;
    u8      i_line21_2            ;// 1;
    u8      i_source_res          ;// 2;
    u8      i_letterboxed         ;// 1;
    u8      i_mode                ;// 1;
} ifo_video_t;

/* Audio type information */
typedef struct ifo_audio_s
{
    u8      i_coding_mode         ;// 3;
    u8      i_multichannel_extension  ;// 1;
    u8      i_type                ;// 2;
    u8      i_appl_mode           ;// 2;

    u8      i_quantization        ;// 2;
    u8      i_sample_freq         ;// 2;
//    u8                            ;// 1;
    u8      i_num_channels        ;// 3;
    u16     i_lang_code           ;// 16;   // <char> description
    u8      i_foo                 ;// 8;    // 0x00000000 ?
    u8      i_caption             ;// 8;
    u8      i_bar                 ;// 8;    // 0x00000000 ?
} ifo_audio_t;

typedef struct ifo_spu_t
{
    u16     i_prefix              ;// 16;   // 0x0100 ?
    u16     i_lang_code           ;// 16;   // <char> description
    u8      i_foo                 ;// 8;    // dont know
    u8      i_caption             ;// 8;    // 0x00 ?
} ifo_spu_t;


Stéphane Borel's avatar
Stéphane Borel committed
77

78
/* Ifo vitual machine Commands */
79
typedef struct command_desc_s
80 81 82 83 84 85 86
{
    u8              i_type      :3;
    u8              i_direct    :1;
    u8              i_cmd       :4;
    u8              i_dir_cmp   :1;
    u8              i_cmp       :3;
    u8              i_sub_cmd   :4;
87 88
    union
    {
Sam Hocevar's avatar
 
Sam Hocevar committed
89 90
        u8          pi_8[6];
        u16         pi_16[3];
91
    } data;
92
} command_desc_t;
93

Stéphane Borel's avatar
Stéphane Borel committed
94 95
/* Program Chain Command Table
  - start at i_pgc_com_tab_sbyte */
96
typedef struct command_s
Stéphane Borel's avatar
Stéphane Borel committed
97
{
98 99 100
    u16             i_pre_command_nb;               // 2 bytes
    u16             i_post_command_nb;              // 2 bytes
    u16             i_cell_command_nb;              // 2 bytes
Stéphane Borel's avatar
Stéphane Borel committed
101
//    char[2]         ???
102 103 104 105
    command_desc_t* p_pre_command;                  // i_pre_com_nb * 8 bytes
    command_desc_t* p_post_command;                 // i_post_com_nb * 8 bytes
    command_desc_t* p_cell_command;                 // i_cell_com_nb * 8 bytes
} command_t;
Stéphane Borel's avatar
Stéphane Borel committed
106 107 108

/* Program Chain Map Table
 * - start at "i_pgc_prg_map_sbyte" */
109
typedef struct chapter_map_s
Stéphane Borel's avatar
Stéphane Borel committed
110
{
111 112
    u8*             pi_start_cell;              // i_prg_nb * 1 byte 
} chapter_map_t;
Stéphane Borel's avatar
Stéphane Borel committed
113 114 115 116

/* Cell Playback Information Table
 * we have a pointer to such a structure for each cell  
 * - first start at "i_cell_play_inf_sbyte" */
117
typedef struct cell_play_s
Stéphane Borel's avatar
Stéphane Borel committed
118 119
{
    /* This information concerns the currently selected cell */
120
    u16             i_category;                      // 2 bytes
Stéphane Borel's avatar
Stéphane Borel committed
121
    u8              i_still_time;               // 1 byte; in seconds; ff=inf
122
    u8              i_command_nb;                   // 1 byte; 0 = no com
Stéphane Borel's avatar
Stéphane Borel committed
123
    u32             i_play_time;                // 4 bytes
124
    u32             i_start_sector;             // 4 bytes
Stéphane Borel's avatar
Stéphane Borel committed
125
    u32             i_first_ilvu_vobu_esector;  // 4 bytes; ???
126 127 128
    u32             i_last_vobu_start_sector;            // 4 bytes
    u32             i_end_sector;                  // 4 bytes
} cell_play_t;
Stéphane Borel's avatar
Stéphane Borel committed
129 130 131 132

/* Cell Position Information Table
 * we have a pointer to such a structure for each cell 
 * - first start at "i_cell_pos_inf_sbyte" */
133
typedef struct cell_pos_s
Stéphane Borel's avatar
Stéphane Borel committed
134 135 136 137 138
{
    /* This information concerns the currently selected cell */
    u16             i_vob_id;                   // 2 bytes
//    char            ???
    u8              i_cell_id;                  // 1 byte
139
} cell_pos_t;
Stéphane Borel's avatar
Stéphane Borel committed
140 141 142 143

/* Main structure for Program Chain
 * - start at i_fp_pgc_sbyte
 * - or at i_vmgm_pgci_sbyte in vmgm_pgci_srp_t */
144
typedef struct title_s
Stéphane Borel's avatar
Stéphane Borel committed
145 146 147
{
    /* Global features of program chain */
//    char[2]         ???
148
    u8              i_chapter_nb;                   // 1 byte
Stéphane Borel's avatar
Stéphane Borel committed
149 150 151 152 153
    u8              i_cell_nb;                  // 1 byte
    u32             i_play_time;                // 4 bytes
    u32             i_prohibited_user_op;       // 4 bytes
    u16             pi_audio_status[8];         // 8*2 bytes
    u32             pi_subpic_status[32];       // 32*4 bytes
154 155 156
    u16             i_next_title_num;              // 2 bytes
    u16             i_prev_title_num;              // 2 bytes
    u16             i_go_up_title_num;              // 2 bytes
Stéphane Borel's avatar
Stéphane Borel committed
157 158 159 160 161 162
    u8              i_still_time;               // 1 byte ; in seconds
    u8              i_play_mode;                // 1 byte
    /* In video_ts.ifo, the 3 significant bytes of each color are
     * preceded by 1 unsignificant byte */
    u32             pi_yuv_color[16];           // 16*3 bytes
    /* Here come the start bytes of the following structures */
163 164 165 166
    u16             i_command_start_byte;            // 2 bytes
    u16             i_chapter_map_start_byte;            // 2 bytes
    u16             i_cell_play_start_byte;      // 2 bytes
    u16             i_cell_pos_start_byte;       // 2 bytes
Stéphane Borel's avatar
Stéphane Borel committed
167
    /* Predefined structures */
168 169 170 171 172
    command_t       command;
    chapter_map_t   chapter_map;
    cell_play_t*    p_cell_play;           // i_cell_nb * 24 bytes
    cell_pos_t*     p_cell_pos;             // i_cell_nb * 4 bytes
} title_t;
Stéphane Borel's avatar
Stéphane Borel committed
173 174 175 176 177 178

/*
 * Menu PGCI Unit Table
 */

/* Menu PGCI Language unit Descriptor */
179
typedef struct unit_s
Stéphane Borel's avatar
Stéphane Borel committed
180
{
Stéphane Borel's avatar
Stéphane Borel committed
181
    char            ps_lang_code[2];            // 2 bytes (ISO-xx)
Stéphane Borel's avatar
Stéphane Borel committed
182 183
//    char            ???
    u8              i_existence_mask;           // 1 byte
184 185
    u32             i_unit_inf_start_byte;                 // 4 bytes
} unit_t;
Stéphane Borel's avatar
Stéphane Borel committed
186

187
typedef struct unit_title_s
Stéphane Borel's avatar
Stéphane Borel committed
188
{
189 190 191 192 193 194
    u8              i_category_mask;             // 1 byte
    u8              i_category;                  // 1 byte
    u16             i_parental_mask;                 // 2 bytes
    u32             i_title_start_byte;               // 4 bytes
    title_t         title;
} unit_title_t;
Stéphane Borel's avatar
Stéphane Borel committed
195 196 197

/* Menu PGCI Language Unit Table 
 * - start at i_lu_sbyte */
198
typedef struct unit_inf_s
Stéphane Borel's avatar
Stéphane Borel committed
199
{
200
    u16             i_title_nb;                   // 2 bytes
Stéphane Borel's avatar
Stéphane Borel committed
201
//    char[2]         ???
202 203 204
    u32             i_end_byte;                 // 4 bytes
    unit_title_t *  p_title;                      // i_srp_nb * 8 bytes
} unit_inf_t;
Stéphane Borel's avatar
Stéphane Borel committed
205 206 207

/* Main Struct for Menu PGCI
 * - start at i_*_pgci_ut_ssector */
208
typedef struct title_unit_s
Stéphane Borel's avatar
Stéphane Borel committed
209
{
210
    u16             i_unit_nb;                    // 2 bytes; ???
Stéphane Borel's avatar
Stéphane Borel committed
211
//    char[2]         ???
212 213 214 215
    u32             i_end_byte;                    // 4 bytes
    unit_t*         p_unit;                       // i_lu_nb * 8 bytes
    unit_inf_t*     p_unit_inf;                 // i_lu_nb * 8 bytes
} title_unit_t;
Stéphane Borel's avatar
Stéphane Borel committed
216 217 218 219

/*
 * Cell Adress Table Information
 */
220
typedef struct cell_map_s
Stéphane Borel's avatar
Stéphane Borel committed
221 222 223 224
{
    u16             i_vob_id;                   // 2 bytes
    u8              i_cell_id;                  // 1 byte
//    char            ???
225 226 227
    u32             i_start_sector;                  // 4 bytes
    u32             i_end_sector;                  // 4 bytes
} cell_map_t;
Stéphane Borel's avatar
Stéphane Borel committed
228

229
typedef struct cell_inf_s
Stéphane Borel's avatar
Stéphane Borel committed
230 231 232
{
    u16             i_vob_nb;                   // 2 bytes
//    char[2]         ???
233
    u32             i_end_byte;                    // 4 bytes
234 235
    u16             i_cell_nb;                  // not in ifo; computed
                                                // with e_byte
236 237
    cell_map_t*     p_cell_map;
} cell_inf_t;
Stéphane Borel's avatar
Stéphane Borel committed
238 239 240 241 242


/*
 * VOBU Adress Map Table
 */
243
typedef struct vobu_map_s
Stéphane Borel's avatar
Stéphane Borel committed
244
{
245 246 247
    u32             i_end_byte;                    // 4 bytes
    u32*            pi_vobu_start_sector;            // (nb of vobu) * 4 bytes
} vobu_map_t;
Stéphane Borel's avatar
Stéphane Borel committed
248 249 250 251 252 253 254 255

/*****************************************************************************
 * Structures for Video Management (cf video_ts.ifo)
 *****************************************************************************/

/* 
 * Video Manager Information Management Table
 */ 
256
typedef struct manager_inf_s
Stéphane Borel's avatar
Stéphane Borel committed
257 258
{
    char            psz_id[13];                 // 12 bytes (DVDVIDEO-VMG)
259
    u32             i_vmg_end_sector;                  // 4 bytes
Stéphane Borel's avatar
Stéphane Borel committed
260
//    char[12]        ???
261
    u32             i_vmg_inf_end_sector;                // 4 bytes
Stéphane Borel's avatar
Stéphane Borel committed
262 263 264
//    char            ???
    u8              i_spec_ver;                 // 1 byte
    u32             i_cat;                      // 4 bytes
265 266
    u16             i_volume_nb;                   // 2 bytes
    u16             i_volume;                      // 2 bytes
Stéphane Borel's avatar
Stéphane Borel committed
267 268
    u8              i_disc_side;                // 1 bytes
//    char[20]        ???
269
    u16             i_title_set_nb;                   // 2 bytes
Stéphane Borel's avatar
Stéphane Borel committed
270
    char            ps_provider_id[32];         // 32 bytes
Stéphane Borel's avatar
Stéphane Borel committed
271 272
    u64             i_pos_code;                 // 8 bytes
//    char[24]        ???
273 274
    u32             i_vmg_inf_end_byte;              // 4 bytes
    u32             i_first_play_title_start_byte;             // 4 bytes
Stéphane Borel's avatar
Stéphane Borel committed
275
//    char[56]        ???
276 277 278 279 280 281 282 283
    u32             i_vob_start_sector;             // 4 bytes
    u32             i_title_inf_start_sector;         // 4 bytes
    u32             i_title_unit_start_sector;          // 4 bytes
    u32             i_parental_inf_start_sector;         // 4 bytes
    u32             i_vts_inf_start_sector;         // 4 bytes
    u32             i_text_data_start_sector;         // 4 bytes
    u32             i_cell_inf_start_sector;            // 4 bytes
    u32             i_vobu_map_start_sector;       // 4 bytes
Stéphane Borel's avatar
Stéphane Borel committed
284
//    char[2]         ???
285
    ifo_video_t     video_attr;                 // 2 bytes
Stéphane Borel's avatar
Stéphane Borel committed
286 287
//    char            ???
    u8              i_audio_nb;                 // 1 byte
288
    ifo_audio_t     p_audio_attr[8];            // i_vmgm_audio_nb * 8 bytes
Stéphane Borel's avatar
Stéphane Borel committed
289
//    char[16]        ???
290 291 292
    u8              i_spu_nb;                // 1 byte
    ifo_spu_t       p_spu_attr[32];          // i_subpic_nb * 6 bytes
} manager_inf_t;
Stéphane Borel's avatar
Stéphane Borel committed
293 294 295 296 297 298 299 300


/* 
 * Part Of Title Search Pointer Table Information
 */

/* Title sets structure
 * we have a pointer to this structure for each tts */
301
typedef struct title_attr_s
Stéphane Borel's avatar
Stéphane Borel committed
302 303 304
{
    u8              i_play_type;                // 1 byte
    u8              i_angle_nb;                 // 1 byte
305
    u16             i_chapter_nb;                  // 2 bytes; Chapters/PGs
Stéphane Borel's avatar
Stéphane Borel committed
306
    u16             i_parental_id;              // 2 bytes
307 308 309 310
    u8              i_title_set_num;            // 1 byte (VTS#)
    u8              i_title_num;                 // 1 byte ???
    u32             i_start_sector;              // 4 bytes
} title_attr_t;
Stéphane Borel's avatar
Stéphane Borel committed
311 312 313

/* Main struct for tts
 * - start at "i_vmg_ptt_srpt_ssector" */
314
typedef struct title_inf_s
Stéphane Borel's avatar
Stéphane Borel committed
315
{
316
    u16             i_title_nb;                   // 2 bytes
Stéphane Borel's avatar
Stéphane Borel committed
317
//    char[2]         ???
318 319 320
    u32             i_end_byte;                    // 4 bytes
    title_attr_t *  p_attr;                     // i_ttu_nb * 12 bytes
} title_inf_t;
Stéphane Borel's avatar
Stéphane Borel committed
321 322 323 324

/*
 * Parental Management Information Table
 */
325
typedef struct parental_desc_s
Stéphane Borel's avatar
Stéphane Borel committed
326
{
Stéphane Borel's avatar
Stéphane Borel committed
327
    char            ps_country_code[2];         // 2 bytes
Stéphane Borel's avatar
Stéphane Borel committed
328
//    char[2]         ???
329
    u16             i_parental_mask_start_byte;            // 2 bytes
Stéphane Borel's avatar
Stéphane Borel committed
330
//    char[2]         ???
331
} parental_desc_t;
Stéphane Borel's avatar
Stéphane Borel committed
332

333
typedef struct parental_mask_s
Stéphane Borel's avatar
Stéphane Borel committed
334
{
335 336
    u16*            ppi_mask[8];            // (i_vts_nb +1) * 8 * 2 bytes
} parental_mask_t;
Stéphane Borel's avatar
Stéphane Borel committed
337 338 339

/* Main struct for parental management
 * - start at i_vmg_ptl_mait_ssector */
340
typedef struct parental_inf_s
Stéphane Borel's avatar
Stéphane Borel committed
341 342 343
{
    u16             i_country_nb;               // 2 bytes
    u16             i_vts_nb;                   // 2 bytes
344 345 346 347
    u32             i_end_byte;                    // 4 bytes
    parental_desc_t* p_parental_desc;             // i_country_nb * 8 bytes
    parental_mask_t* p_parental_mask;        // i_country_nb * sizeof(vmg_ptl_mask_t)
} parental_inf_t;
Stéphane Borel's avatar
Stéphane Borel committed
348 349 350 351 352 353 354

/*
 * Video Title Set Attribute Table
 */

/* Attribute structure : one for each vts
 * - start at pi_atrt_sbyte */
355
typedef struct vts_attr_s
Stéphane Borel's avatar
Stéphane Borel committed
356
{
357
    u32             i_end_byte;                    // 4 bytes
Stéphane Borel's avatar
Stéphane Borel committed
358
    u32             i_cat_app_type;             // 4 bytes
359
    ifo_video_t     vts_menu_video_attr;          // 2 bytes
Stéphane Borel's avatar
Stéphane Borel committed
360
//    char            ???
361 362
    u8              i_vts_menu_audio_nb;            // 1 byte
    ifo_audio_t     p_vts_menu_audio_attr[8];       // 8 * 8 bytes
Stéphane Borel's avatar
Stéphane Borel committed
363
//    char[17]        ???
364 365
    u8              i_vts_menu_spu_nb;           // 1 byte
    ifo_spu_t       p_vts_menu_spu_attr[28];     // i_vtsm_subpic_nb * 6 bytes
366
//    char[2]         ???
367
    ifo_video_t     vts_title_video_attr;         // 2 bytes
Stéphane Borel's avatar
Stéphane Borel committed
368
//    char            ???
369 370
    u8              i_vts_title_audio_nb;           // 1 byte
    ifo_audio_t     p_vts_title_audio_attr[8];      // 8 * 8 bytes
371
//    char[17]        ???
372 373 374
    u8              i_vts_title_spu_nb;          // 1 byte
    ifo_spu_t       p_vts_title_spu_attr[28];    // i_vtstt_subpic_nb * 6 bytes
} vts_attr_t;
Stéphane Borel's avatar
Stéphane Borel committed
375 376 377

/* Main struct for vts attributes
 * - start at i_vmg_vts_atrt_ssector */
378
typedef struct vts_inf_s
Stéphane Borel's avatar
Stéphane Borel committed
379 380 381
{
    u16             i_vts_nb;                   // 2 bytes
//    char[2]         ???
382 383 384 385
    u32             i_end_byte;                    // 4 bytes
    u32*            pi_vts_attr_start_byte;          // i_vts_nb * 4 bytes
    vts_attr_t*     p_vts_attr;
} vts_inf_t;
Stéphane Borel's avatar
Stéphane Borel committed
386 387 388 389 390 391

/* 
 * Global Structure for Video Manager
 */
typedef struct vmg_s 
{
392 393 394 395 396 397 398 399
    manager_inf_t       manager_inf;
    title_t             title;
    title_inf_t         title_inf;
    title_unit_t        title_unit;
    parental_inf_t      parental_inf;
    vts_inf_t           vts_inf;
    cell_inf_t          cell_inf;
    vobu_map_t          vobu_map;
Stéphane Borel's avatar
Stéphane Borel committed
400 401 402 403 404 405 406 407 408
} vmg_t;

/*****************************************************************************
 * Structures for Video Title Sets (cf vts_*.ifo)
 ****************************************************************************/

/* 
 * Video Title Sets Information Management Table
 */ 
409
typedef struct vts_manager_s
Stéphane Borel's avatar
Stéphane Borel committed
410 411
{
    char            psz_id[13];                 // 12 bytes (DVDVIDEO-VTS)
412
    u32             i_end_sector;                  // 4 bytes
Stéphane Borel's avatar
Stéphane Borel committed
413
//    char[12]        ???
414
    u32             i_inf_end_sector;                // 4 bytes
Stéphane Borel's avatar
Stéphane Borel committed
415 416 417 418
//    char            ???
    u8              i_spec_ver;                 // 1 byte
    u32             i_cat;                      // 4 bytes
//    char[90]        ???
419
    u32             i_inf_end_byte;                // 4 bytes
Stéphane Borel's avatar
Stéphane Borel committed
420
//    char[60]        ???
421 422 423 424 425 426 427 428 429 430
    u32             i_menu_vob_start_sector;           // 4 bytes
    u32             i_title_vob_start_sector;          // 4 bytes
    u32             i_title_inf_start_sector;         // 4 bytes
    u32             i_title_unit_start_sector;            // 4 bytes
    u32             i_menu_unit_start_sector;        // 4 bytes
    u32             i_time_inf_start_sector;          // 4 bytes
    u32             i_menu_cell_inf_start_sector;          // 4 bytes
    u32             i_menu_vobu_map_start_sector;     // 4 bytes
    u32             i_cell_inf_start_sector;            // 4 bytes
    u32             i_vobu_map_start_sector;       // 4 bytes
Stéphane Borel's avatar
Stéphane Borel committed
431
//    char[24]        ???
432
    ifo_video_t     menu_video_attr;               // 2 bytes
Stéphane Borel's avatar
Stéphane Borel committed
433
//    char            ???
434 435
    u8              i_menu_audio_nb;               // 1 byte
    ifo_audio_t     p_menu_audio_attr[8];          // i_vmgm_audio_nb * 8 bytes
Stéphane Borel's avatar
Stéphane Borel committed
436
//    char[16]        ???
437 438
    u8              i_menu_spu_nb;              // 1 byte
    ifo_spu_t       p_menu_spu_attr[32];        // i_subpic_nb * 6 bytes
Stéphane Borel's avatar
Stéphane Borel committed
439 440
                                                // !!! only 28 subpics ???
//    char[2]         ???
441
    ifo_video_t     video_attr;                 // 2 bytes
Stéphane Borel's avatar
Stéphane Borel committed
442 443
//    char            ???
    u8              i_audio_nb;                 // 1 byte
444
    ifo_audio_t     p_audio_attr[8];            // i_vmgm_audio_nb * 8 bytes
Stéphane Borel's avatar
Stéphane Borel committed
445
//    char[16]        ???
446 447 448
    u8              i_spu_nb;                // 1 byte
    ifo_spu_t       p_spu_attr[32];          // i_subpic_nb * 6 bytes
} vts_manager_t;
Stéphane Borel's avatar
Stéphane Borel committed
449 450 451 452 453 454 455

/* 
 * Part Of Title Search Pointer Table Information
 */

/* Title sets structure
 * we have a pointer to this structure for each tts */
456
typedef struct title_start_s
Stéphane Borel's avatar
Stéphane Borel committed
457
{
458 459 460
    u16             i_program_chain_num;                   // 2 bytes; Chapters/PGs
    u16             i_program_num;                   // 2 bytes
} title_start_t;
Stéphane Borel's avatar
Stéphane Borel committed
461 462 463

/* Main struct for tts
 * - start at "i_vts_ptt_srpt_ssector" */
464
typedef struct vts_title_s
Stéphane Borel's avatar
Stéphane Borel committed
465
{
466
    u16             i_title_nb;                   // 2 bytes
Stéphane Borel's avatar
Stéphane Borel committed
467
//    char[2]         ???
468 469 470 471
    u32             i_end_byte;                    // 4 bytes
    u32*            pi_start_byte;
    title_start_t * p_title_start;                      // i_ttu_nb * 4 bytes
} vts_title_t;
Stéphane Borel's avatar
Stéphane Borel committed
472 473 474 475 476 477

/*
 * Time Map table information
 */

/* Time Map structure */
478
typedef struct time_map_s
Stéphane Borel's avatar
Stéphane Borel committed
479 480 481 482 483
{
    u8              i_time_unit;                // 1 byte
//    char            ???
    u16             i_entry_nb;                 // 2 bytes
    u32*            pi_sector;                  // i_entry_nb * 4 bytes
484
} time_map_t;
Stéphane Borel's avatar
Stéphane Borel committed
485 486 487

/* Main structure for tmap_ti
 * - start at "i_tmap_ti_ssector" */
488
typedef struct time_inf_s
Stéphane Borel's avatar
Stéphane Borel committed
489 490 491
{
    u16             i_nb;                       // 2 bytes
//    char[2]         ???
492 493 494 495
    u32             i_end_byte;                    // 4 bytes
    u32*            pi_start_byte;                   // i_tmap_nb * 4 bytes
    time_map_t*     p_time_map;
} time_inf_t;
Stéphane Borel's avatar
Stéphane Borel committed
496 497 498 499 500 501

/*
 * Video Title Set 
 */
typedef struct vts_s
{
502
    boolean_t       b_initialized;
503
    off_t           i_pos;
504 505 506 507 508 509 510 511 512
    vts_manager_t   manager_inf;
    vts_title_t     title_inf;
    title_unit_t    menu_unit;
    unit_inf_t      title_unit;
    time_inf_t      time_inf;
    cell_inf_t      menu_cell_inf;
    vobu_map_t      menu_vobu_map;
    cell_inf_t      cell_inf;
    vobu_map_t      vobu_map;
Stéphane Borel's avatar
Stéphane Borel committed
513 514 515 516 517 518 519
} vts_t;

/*
 *  Global Ifo Structure
 */
typedef struct ifo_s
{
520 521 522 523 524 525 526
    int             i_fd;           /* File descriptor for the device */
    off_t           i_off;          /* Offset to video_ts.ifo on the device */
    off_t           i_pos;          /* Position of stream pointer */
    boolean_t       b_error;        /* Error Management */
    vmg_t           vmg;            /* Structure described in video_ts */
    int             i_title;        /* Current title number */
    vts_t           vts;            /* Vts ifo for current title set */
Stéphane Borel's avatar
Stéphane Borel committed
527 528
} ifo_t;