input_dvd.h 2.76 KB
Newer Older
Sam Hocevar's avatar
 
Sam Hocevar committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25
/*****************************************************************************
 * input_dvd.h: thread structure of the DVD plugin
 *****************************************************************************
 * Copyright (C) 1999-2001 VideoLAN
 *
 * Author: Stéphane Borel <stef@via.ecp.fr>
 *
 * 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.
 *****************************************************************************/

/*****************************************************************************
 * Preamble
 *****************************************************************************/
26
/* Logical block size for DVD-VIDEO */
Sam Hocevar's avatar
 
Sam Hocevar committed
27 28 29
#define DVD_LB_SIZE 2048

/*****************************************************************************
30
 * thread_dvd_data_t: extension of input_thread_t for DVD specificity.
Sam Hocevar's avatar
 
Sam Hocevar committed
31 32 33 34 35 36
 *****************************************************************************/
typedef struct thread_dvd_data_s
{
    int                     i_fd;               // File descriptor of device
    boolean_t               b_encrypted;        // CSS encryption
    int                     i_read_once;        // NB of bytes read by DVDRead
37 38 39 40 41

    int                     i_start_byte;
    int                     i_start_cell;
    int                     i_end_cell;

Sam Hocevar's avatar
 
Sam Hocevar committed
42 43
    /* Scrambling Information */
    struct css_s            css;
44

Sam Hocevar's avatar
 
Sam Hocevar committed
45 46
    /* Structure that contains all information of the DVD */
    struct ifo_s            ifo;
47

Sam Hocevar's avatar
 
Sam Hocevar committed
48 49 50 51 52 53
} thread_dvd_data_t;

/*****************************************************************************
 * Prototypes in dvd_ifo.c
 *****************************************************************************/
struct ifo_s    IfoInit( int );
Stéphane Borel's avatar
 
Stéphane Borel committed
54
int             IfoReadVTS( struct ifo_s * );
Sam Hocevar's avatar
 
Sam Hocevar committed
55 56 57 58 59 60 61 62
void            IfoRead( struct ifo_s * );
void            IfoEnd( ifo_t * );

/*****************************************************************************
 * Prototypes in dvd_css.c
 *****************************************************************************/
int             CSSTest     ( int );
struct css_s    CSSInit     ( int );
Stéphane Borel's avatar
 
Stéphane Borel committed
63
int             CSSGetKey   ( struct css_s * );
Sam Hocevar's avatar
 
Sam Hocevar committed
64 65
int             CSSDescrambleSector( u8 * , u8 * );