]> git.sesse.net Git - vlc/blob - src/input/dvd_css.h
-CSS support kludged for current DVD input.
[vlc] / src / input / dvd_css.h
1 /*****************************************************************************
2  * dvd_css.h: Structures for DVD authentification and unscrambling
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 #if defined( HAVE_SYS_DVDIO_H ) || defined( LINUX_DVD )
23 #define KEY_SIZE 5
24
25 typedef u8 DVD_key_t[KEY_SIZE];
26
27 typedef struct disc_s
28 {
29     u8              pi_challenge[2*KEY_SIZE];
30     u8              pi_key1[KEY_SIZE];
31     u8              pi_key2[KEY_SIZE];
32     u8              pi_key_check[KEY_SIZE];
33     u8              i_varient;
34 } disc_t;
35
36 typedef struct title_key_s
37 {
38     u32             i;          /* This signification of this parameter
39                                    depends on the function it is called from :
40                                     *from DVDInit    -> i == i_lba
41                                     *from CSSGetKeys -> i == i_occ */
42     DVD_key_t       key;
43 } title_key_t;
44
45 typedef struct css_s
46 {
47     int             i_fd;
48     boolean_t       b_error;
49     int             i_agid;
50     disc_t          disc;
51     u8              pi_disc_key[2048];
52     int             i_title_nb;
53     title_key_t*    p_title_key;
54 } css_t;
55
56 /*****************************************************************************
57  * Prototypes in dvd_css.c
58  *****************************************************************************/
59 struct css_s    CSSInit     ( int );
60 int             CSSGetKeys  ( struct css_s* );
61 int             CSSDescrambleSector( DVD_key_t , u8* );
62 #endif