dvdcss.h
Go to the documentation of this file.
1
11 /*
12 * Copyright (C) 1998-2008 VideoLAN
13 *
14 * This program is free software; you can redistribute it and/or modify
15 * it under the terms of the GNU General Public License as published by
16 * the Free Software Foundation; either version 2 of the License, or
17 * (at your option) any later version.
18 *
19 * This program is distributed in the hope that it will be useful,
20 * but WITHOUT ANY WARRANTY; without even the implied warranty of
21 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
22 * GNU General Public License for more details.
23 *
24 * You should have received a copy of the GNU General Public License along
25 * with libdvdcss; if not, write to the Free Software Foundation, Inc.,
26 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
27 */
28
29 #ifndef DVDCSS_DVDCSS_H
30 #ifndef _DOXYGEN_SKIP_ME
31 #define DVDCSS_DVDCSS_H 1
32 #endif
33
34 #ifdef __cplusplus
35 extern "C" {
36 #endif
37
39 typedef struct dvdcss_s* dvdcss_t;
40
41
43 #define DVDCSS_BLOCK_SIZE 2048
44
46 #define DVDCSS_NOFLAGS 0
47
49 #define DVDCSS_READ_DECRYPT (1 << 0)
50
52 #define DVDCSS_SEEK_MPEG (1 << 0)
53
55 #define DVDCSS_SEEK_KEY (1 << 1)
56
57
58 #if defined(LIBDVDCSS_EXPORTS)
59 #define LIBDVDCSS_EXPORT __declspec(dllexport) extern
60 #elif defined(LIBDVDCSS_IMPORTS)
61 #define LIBDVDCSS_EXPORT __declspec(dllimport) extern
62 #elif defined(SUPPORT_ATTRIBUTE_VISIBILITY_DEFAULT)
63 #define LIBDVDCSS_EXPORT __attribute__((visibility("default"))) extern
64 #else
65 #define LIBDVDCSS_EXPORT extern
66 #endif
67
68 /*
69 * Our version number. The variable name contains the interface version.
70 */
71 LIBDVDCSS_EXPORT char * dvdcss_interface_2;
72
73
74 /*
75 * Exported prototypes.
76 */
77 LIBDVDCSS_EXPORT dvdcss_t dvdcss_open ( char *psz_target );
78 LIBDVDCSS_EXPORT int dvdcss_close ( dvdcss_t );
79 LIBDVDCSS_EXPORT int dvdcss_seek ( dvdcss_t,
80 int i_blocks,
81 int i_flags );
82 LIBDVDCSS_EXPORT int dvdcss_read ( dvdcss_t,
83 void *p_buffer,
84 int i_blocks,
85 int i_flags );
86 LIBDVDCSS_EXPORT int dvdcss_readv ( dvdcss_t,
87 void *p_iovec,
88 int i_blocks,
89 int i_flags );
90 LIBDVDCSS_EXPORT char * dvdcss_error ( dvdcss_t );
91
92 LIBDVDCSS_EXPORT int dvdcss_is_scrambled ( dvdcss_t );
93
94
95 /*
96 * Deprecated stuff.
97 */
98 #ifndef _DOXYGEN_SKIP_ME
99 #define dvdcss_title(a,b) dvdcss_seek(a,b,DVDCSS_SEEK_KEY)
100 #define dvdcss_handle dvdcss_t
101 #endif
102
103
104 #ifdef __cplusplus
105 }
106 #endif
107
108 #endif /* DVDCSS_DVDCSS_H */
dvdcss_error
LIBDVDCSS_EXPORT char * dvdcss_error(dvdcss_t)
Return a string containing the latest error that occurred in the given libdvdcss instance.
Definition: libdvdcss.c:576
dvdcss_read
LIBDVDCSS_EXPORT int dvdcss_read(dvdcss_t, void *p_buffer, int i_blocks, int i_flags)
Read from the disc and decrypt data if requested.
Definition: libdvdcss.c:645
dvdcss_is_scrambled
LIBDVDCSS_EXPORT int dvdcss_is_scrambled(dvdcss_t)
Return 1 if the DVD is scrambled, 0 otherwise.
Definition: libdvdcss.c:820
dvdcss_close
LIBDVDCSS_EXPORT int dvdcss_close(dvdcss_t)
Close the DVD and clean up the library.
Definition: libdvdcss.c:776
dvdcss_t
struct dvdcss_s * dvdcss_t
Definition: dvdcss.h:39
dvdcss_readv
LIBDVDCSS_EXPORT int dvdcss_readv(dvdcss_t, void *p_iovec, int i_blocks, int i_flags)
Read from the disc into multiple buffers and decrypt data if requested.
Definition: libdvdcss.c:718
dvdcss_seek
LIBDVDCSS_EXPORT int dvdcss_seek(dvdcss_t, int i_blocks, int i_flags)
Seek in the disc and change the current key if requested.
Definition: libdvdcss.c:605
dvdcss_open
LIBDVDCSS_EXPORT dvdcss_t dvdcss_open(char *psz_target)
Open a DVD device or directory and return a dvdcss instance.
Definition: libdvdcss.c:161