]> git.sesse.net Git - vlc/blob - plugins/dvd/input_dvd.h
-Fixed bugs in title/chapter handling once more, especially for size
[vlc] / plugins / dvd / input_dvd.h
1 /*****************************************************************************
2  * input_dvd.h: thread structure of the DVD plugin
3  *****************************************************************************
4  * Copyright (C) 1999-2001 VideoLAN
5  *
6  * Author: Stéphane Borel <stef@via.ecp.fr>
7  *
8  * This program is free software; you can redistribute it and/or modify
9  * it under the terms of the GNU General Public License as published by
10  * the Free Software Foundation; either version 2 of the License, or
11  * (at your option) any later version.
12  *
13  * This program is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16  * GNU General Public License for more details.
17  *
18  * You should have received a copy of the GNU General Public License
19  * along with this program; if not, write to the Free Software
20  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111, USA.
21  *****************************************************************************/
22
23 /*****************************************************************************
24  * Preamble
25  *****************************************************************************/
26 /* Logical block size for DVD-VIDEO */
27 #define DVD_LB_SIZE 2048
28
29 /*****************************************************************************
30  * thread_dvd_data_t: extension of input_thread_t for DVD specificity.
31  *****************************************************************************/
32 typedef struct thread_dvd_data_s
33 {
34     int                     i_fd;               // File descriptor of device
35     boolean_t               b_encrypted;        // CSS encryption
36
37     int                     i_block_once;       // Nb of block read once by 
38                                                 // readv
39
40     /* Navigation information */
41     int                     i_title;
42     int                     i_vts_title;
43
44     int                     i_chapter_nb;
45     int                     i_chapter;
46
47     int                     i_cell;         /* cell index in adress map */
48     int                     i_prg_cell;     /* cell index in program map */
49
50     int                     i_sector;
51     int                     i_end_sector;   /* last sector of current cell */
52
53     off_t                   i_title_start;
54     off_t                   i_start;
55     off_t                   i_size;
56
57     /* Scrambling Information */
58     struct css_s *          p_css;
59
60     /* Structure that contains all information of the DVD */
61     struct ifo_s            ifo;
62
63 } thread_dvd_data_t;
64
65 /*****************************************************************************
66  * Prototypes in dvd_ifo.c
67  *****************************************************************************/
68 struct ifo_s    IfoInit     ( int );
69 int             IfoReadVTS  ( struct ifo_s * );
70 void            IfoRead     ( struct ifo_s * );
71 void            IfoEnd      ( ifo_t * );
72
73 /*****************************************************************************
74  * Prototypes in dvd_css.c
75  *****************************************************************************/
76 int             CSSTest             ( int );
77 struct css_s *  CSSInit             ( int );
78 void            CSSEnd              ( struct css_s * );
79 int             CSSGetKey           ( struct css_s * );
80 int             CSSDescrambleSector ( u8 * , u8 * );
81