annotate libmpdvdkit2/libdvdcss.h @ 20549:056891fcc677

uCIFS is gone, URL update.
author diego
date Tue, 31 Oct 2006 16:46:45 +0000
parents f59726d0761e
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
7027
c9a4dfaa9868 importing libdvdcss 1.2.2 files
arpi
parents:
diff changeset
1 /*****************************************************************************
9333
f0f0f176d298 sync with libdvdcss 1.2.5 (including u8->uint8_t and whitespace cosmetics...)
arpi
parents: 8637
diff changeset
2 * libdvdcss.h: private DVD reading library data
7027
c9a4dfaa9868 importing libdvdcss 1.2.2 files
arpi
parents:
diff changeset
3 *****************************************************************************
c9a4dfaa9868 importing libdvdcss 1.2.2 files
arpi
parents:
diff changeset
4 * Copyright (C) 1998-2001 VideoLAN
c9a4dfaa9868 importing libdvdcss 1.2.2 files
arpi
parents:
diff changeset
5 * $Id$
c9a4dfaa9868 importing libdvdcss 1.2.2 files
arpi
parents:
diff changeset
6 *
c9a4dfaa9868 importing libdvdcss 1.2.2 files
arpi
parents:
diff changeset
7 * Authors: Stéphane Borel <stef@via.ecp.fr>
c9a4dfaa9868 importing libdvdcss 1.2.2 files
arpi
parents:
diff changeset
8 * Samuel Hocevar <sam@zoy.org>
c9a4dfaa9868 importing libdvdcss 1.2.2 files
arpi
parents:
diff changeset
9 *
c9a4dfaa9868 importing libdvdcss 1.2.2 files
arpi
parents:
diff changeset
10 * This program is free software; you can redistribute it and/or modify
c9a4dfaa9868 importing libdvdcss 1.2.2 files
arpi
parents:
diff changeset
11 * it under the terms of the GNU General Public License as published by
c9a4dfaa9868 importing libdvdcss 1.2.2 files
arpi
parents:
diff changeset
12 * the Free Software Foundation; either version 2 of the License, or
c9a4dfaa9868 importing libdvdcss 1.2.2 files
arpi
parents:
diff changeset
13 * (at your option) any later version.
9333
f0f0f176d298 sync with libdvdcss 1.2.5 (including u8->uint8_t and whitespace cosmetics...)
arpi
parents: 8637
diff changeset
14 *
7027
c9a4dfaa9868 importing libdvdcss 1.2.2 files
arpi
parents:
diff changeset
15 * This program is distributed in the hope that it will be useful,
c9a4dfaa9868 importing libdvdcss 1.2.2 files
arpi
parents:
diff changeset
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
c9a4dfaa9868 importing libdvdcss 1.2.2 files
arpi
parents:
diff changeset
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
c9a4dfaa9868 importing libdvdcss 1.2.2 files
arpi
parents:
diff changeset
18 * GNU General Public License for more details.
c9a4dfaa9868 importing libdvdcss 1.2.2 files
arpi
parents:
diff changeset
19 *
c9a4dfaa9868 importing libdvdcss 1.2.2 files
arpi
parents:
diff changeset
20 * You should have received a copy of the GNU General Public License
c9a4dfaa9868 importing libdvdcss 1.2.2 files
arpi
parents:
diff changeset
21 * along with this program; if not, write to the Free Software
c9a4dfaa9868 importing libdvdcss 1.2.2 files
arpi
parents:
diff changeset
22 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111, USA.
c9a4dfaa9868 importing libdvdcss 1.2.2 files
arpi
parents:
diff changeset
23 *****************************************************************************/
c9a4dfaa9868 importing libdvdcss 1.2.2 files
arpi
parents:
diff changeset
24
8637
0211de3039eb update libdvdcss in libmpdvdkit to latest version (1.2.4)
arpi
parents: 7032
diff changeset
25 struct iovec;
0211de3039eb update libdvdcss in libmpdvdkit to latest version (1.2.4)
arpi
parents: 7032
diff changeset
26
7027
c9a4dfaa9868 importing libdvdcss 1.2.2 files
arpi
parents:
diff changeset
27 /*****************************************************************************
c9a4dfaa9868 importing libdvdcss 1.2.2 files
arpi
parents:
diff changeset
28 * The libdvdcss structure
c9a4dfaa9868 importing libdvdcss 1.2.2 files
arpi
parents:
diff changeset
29 *****************************************************************************/
c9a4dfaa9868 importing libdvdcss 1.2.2 files
arpi
parents:
diff changeset
30 struct dvdcss_s
c9a4dfaa9868 importing libdvdcss 1.2.2 files
arpi
parents:
diff changeset
31 {
c9a4dfaa9868 importing libdvdcss 1.2.2 files
arpi
parents:
diff changeset
32 /* File descriptor */
c9a4dfaa9868 importing libdvdcss 1.2.2 files
arpi
parents:
diff changeset
33 char * psz_device;
c9a4dfaa9868 importing libdvdcss 1.2.2 files
arpi
parents:
diff changeset
34 int i_fd;
8637
0211de3039eb update libdvdcss in libmpdvdkit to latest version (1.2.4)
arpi
parents: 7032
diff changeset
35 int i_read_fd;
9333
f0f0f176d298 sync with libdvdcss 1.2.5 (including u8->uint8_t and whitespace cosmetics...)
arpi
parents: 8637
diff changeset
36 int i_pos;
7027
c9a4dfaa9868 importing libdvdcss 1.2.2 files
arpi
parents:
diff changeset
37
8637
0211de3039eb update libdvdcss in libmpdvdkit to latest version (1.2.4)
arpi
parents: 7032
diff changeset
38 /* File handling */
0211de3039eb update libdvdcss in libmpdvdkit to latest version (1.2.4)
arpi
parents: 7032
diff changeset
39 int ( * pf_seek ) ( dvdcss_t, int );
0211de3039eb update libdvdcss in libmpdvdkit to latest version (1.2.4)
arpi
parents: 7032
diff changeset
40 int ( * pf_read ) ( dvdcss_t, void *, int );
0211de3039eb update libdvdcss in libmpdvdkit to latest version (1.2.4)
arpi
parents: 7032
diff changeset
41 int ( * pf_readv ) ( dvdcss_t, struct iovec *, int );
0211de3039eb update libdvdcss in libmpdvdkit to latest version (1.2.4)
arpi
parents: 7032
diff changeset
42
7027
c9a4dfaa9868 importing libdvdcss 1.2.2 files
arpi
parents:
diff changeset
43 /* Decryption stuff */
c9a4dfaa9868 importing libdvdcss 1.2.2 files
arpi
parents:
diff changeset
44 int i_method;
c9a4dfaa9868 importing libdvdcss 1.2.2 files
arpi
parents:
diff changeset
45 css_t css;
c9a4dfaa9868 importing libdvdcss 1.2.2 files
arpi
parents:
diff changeset
46 int b_ioctls;
c9a4dfaa9868 importing libdvdcss 1.2.2 files
arpi
parents:
diff changeset
47 int b_scrambled;
c9a4dfaa9868 importing libdvdcss 1.2.2 files
arpi
parents:
diff changeset
48 dvd_title_t *p_titles;
9333
f0f0f176d298 sync with libdvdcss 1.2.5 (including u8->uint8_t and whitespace cosmetics...)
arpi
parents: 8637
diff changeset
49
f0f0f176d298 sync with libdvdcss 1.2.5 (including u8->uint8_t and whitespace cosmetics...)
arpi
parents: 8637
diff changeset
50 /* Key cache directory and pointer to the filename */
f0f0f176d298 sync with libdvdcss 1.2.5 (including u8->uint8_t and whitespace cosmetics...)
arpi
parents: 8637
diff changeset
51 char psz_cachefile[PATH_MAX];
f0f0f176d298 sync with libdvdcss 1.2.5 (including u8->uint8_t and whitespace cosmetics...)
arpi
parents: 8637
diff changeset
52 char * psz_block;
7027
c9a4dfaa9868 importing libdvdcss 1.2.2 files
arpi
parents:
diff changeset
53
c9a4dfaa9868 importing libdvdcss 1.2.2 files
arpi
parents:
diff changeset
54 /* Error management */
c9a4dfaa9868 importing libdvdcss 1.2.2 files
arpi
parents:
diff changeset
55 char * psz_error;
c9a4dfaa9868 importing libdvdcss 1.2.2 files
arpi
parents:
diff changeset
56 int b_errors;
c9a4dfaa9868 importing libdvdcss 1.2.2 files
arpi
parents:
diff changeset
57 int b_debug;
c9a4dfaa9868 importing libdvdcss 1.2.2 files
arpi
parents:
diff changeset
58
c9a4dfaa9868 importing libdvdcss 1.2.2 files
arpi
parents:
diff changeset
59 #ifdef WIN32
8637
0211de3039eb update libdvdcss in libmpdvdkit to latest version (1.2.4)
arpi
parents: 7032
diff changeset
60 int b_file;
7027
c9a4dfaa9868 importing libdvdcss 1.2.2 files
arpi
parents:
diff changeset
61 char * p_readv_buffer;
c9a4dfaa9868 importing libdvdcss 1.2.2 files
arpi
parents:
diff changeset
62 int i_readv_buf_size;
c9a4dfaa9868 importing libdvdcss 1.2.2 files
arpi
parents:
diff changeset
63 #endif
c9a4dfaa9868 importing libdvdcss 1.2.2 files
arpi
parents:
diff changeset
64
c9a4dfaa9868 importing libdvdcss 1.2.2 files
arpi
parents:
diff changeset
65 #ifndef WIN32
c9a4dfaa9868 importing libdvdcss 1.2.2 files
arpi
parents:
diff changeset
66 int i_raw_fd;
c9a4dfaa9868 importing libdvdcss 1.2.2 files
arpi
parents:
diff changeset
67 #endif
c9a4dfaa9868 importing libdvdcss 1.2.2 files
arpi
parents:
diff changeset
68 };
c9a4dfaa9868 importing libdvdcss 1.2.2 files
arpi
parents:
diff changeset
69
c9a4dfaa9868 importing libdvdcss 1.2.2 files
arpi
parents:
diff changeset
70 /*****************************************************************************
c9a4dfaa9868 importing libdvdcss 1.2.2 files
arpi
parents:
diff changeset
71 * libdvdcss method: used like init flags
c9a4dfaa9868 importing libdvdcss 1.2.2 files
arpi
parents:
diff changeset
72 *****************************************************************************/
c9a4dfaa9868 importing libdvdcss 1.2.2 files
arpi
parents:
diff changeset
73 #define DVDCSS_METHOD_KEY 0
c9a4dfaa9868 importing libdvdcss 1.2.2 files
arpi
parents:
diff changeset
74 #define DVDCSS_METHOD_DISC 1
c9a4dfaa9868 importing libdvdcss 1.2.2 files
arpi
parents:
diff changeset
75 #define DVDCSS_METHOD_TITLE 2
c9a4dfaa9868 importing libdvdcss 1.2.2 files
arpi
parents:
diff changeset
76
c9a4dfaa9868 importing libdvdcss 1.2.2 files
arpi
parents:
diff changeset
77 /*****************************************************************************
c9a4dfaa9868 importing libdvdcss 1.2.2 files
arpi
parents:
diff changeset
78 * Functions used across the library
c9a4dfaa9868 importing libdvdcss 1.2.2 files
arpi
parents:
diff changeset
79 *****************************************************************************/
16630
954cdf2171f6 upgrade to libdvdcss 1.2.9
diego
parents: 9333
diff changeset
80 #define print_error(dvdcss,msg) _print_error(dvdcss,msg)
20425
f59726d0761e Sync with upstream r201.
diego
parents: 16630
diff changeset
81 #if defined( _MSC_VER )
f59726d0761e Sync with upstream r201.
diego
parents: 16630
diff changeset
82 #include <stdarg.h>
f59726d0761e Sync with upstream r201.
diego
parents: 16630
diff changeset
83 __forceinline void print_debug(dvdcss_t dvdcss, const char *msg,...)
f59726d0761e Sync with upstream r201.
diego
parents: 16630
diff changeset
84 {
f59726d0761e Sync with upstream r201.
diego
parents: 16630
diff changeset
85 va_list args;
f59726d0761e Sync with upstream r201.
diego
parents: 16630
diff changeset
86
f59726d0761e Sync with upstream r201.
diego
parents: 16630
diff changeset
87 fprintf( stderr, "libdvdcss debug: " );
f59726d0761e Sync with upstream r201.
diego
parents: 16630
diff changeset
88 va_start( args, msg );
f59726d0761e Sync with upstream r201.
diego
parents: 16630
diff changeset
89 vfprintf( stderr, msg, args );
f59726d0761e Sync with upstream r201.
diego
parents: 16630
diff changeset
90 va_end( args );
f59726d0761e Sync with upstream r201.
diego
parents: 16630
diff changeset
91 fprintf( stderr, "\n" );
f59726d0761e Sync with upstream r201.
diego
parents: 16630
diff changeset
92 }
f59726d0761e Sync with upstream r201.
diego
parents: 16630
diff changeset
93 #else
16630
954cdf2171f6 upgrade to libdvdcss 1.2.9
diego
parents: 9333
diff changeset
94 #define print_debug(dvdcss,msg,args...) \
954cdf2171f6 upgrade to libdvdcss 1.2.9
diego
parents: 9333
diff changeset
95 if( dvdcss->b_debug ) \
954cdf2171f6 upgrade to libdvdcss 1.2.9
diego
parents: 9333
diff changeset
96 { \
954cdf2171f6 upgrade to libdvdcss 1.2.9
diego
parents: 9333
diff changeset
97 fprintf( stderr, "libdvdcss debug: " ); \
954cdf2171f6 upgrade to libdvdcss 1.2.9
diego
parents: 9333
diff changeset
98 fprintf( stderr, msg, ##args ); \
954cdf2171f6 upgrade to libdvdcss 1.2.9
diego
parents: 9333
diff changeset
99 fprintf( stderr, "\n" ); \
954cdf2171f6 upgrade to libdvdcss 1.2.9
diego
parents: 9333
diff changeset
100 }
20425
f59726d0761e Sync with upstream r201.
diego
parents: 16630
diff changeset
101 #endif
7027
c9a4dfaa9868 importing libdvdcss 1.2.2 files
arpi
parents:
diff changeset
102
16630
954cdf2171f6 upgrade to libdvdcss 1.2.9
diego
parents: 9333
diff changeset
103 void _print_error ( dvdcss_t, char * );
954cdf2171f6 upgrade to libdvdcss 1.2.9
diego
parents: 9333
diff changeset
104