libdvdcss 1.4.0

dvdcss.h
Go to the documentation of this file.
1
11 /*
12 * Copyright (C) 1998-2008 VideoLAN
13 *
14 * libdvdcss 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 * libdvdcss 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 #include <stdint.h>
35
36 #include "version.h"
37
38 #ifdef __cplusplus
39 extern "C" {
40 #endif
41
43 typedef struct dvdcss_s* dvdcss_t;
44
46 typedef struct dvdcss_stream_cb
47 {
49 int ( *pf_seek ) ( void *p_stream, uint64_t i_pos);
51 int ( *pf_read ) ( void *p_stream, void *buffer, int i_read);
53 int ( *pf_readv ) ( void *p_stream, const void *p_iovec, int i_blocks);
54 } dvdcss_stream_cb;
55
56
58 #define DVDCSS_BLOCK_SIZE 2048
59
61 #define DVDCSS_NOFLAGS 0
62
64 #define DVDCSS_READ_DECRYPT (1 << 0)
65
67 #define DVDCSS_SEEK_MPEG (1 << 0)
68
70 #define DVDCSS_SEEK_KEY (1 << 1)
71
72
76 #if defined(LIBDVDCSS_EXPORTS)
77 #define LIBDVDCSS_EXPORT __declspec(dllexport) extern
78 #elif defined(LIBDVDCSS_IMPORTS)
79 #define LIBDVDCSS_EXPORT __declspec(dllimport) extern
80 #elif defined(SUPPORT_ATTRIBUTE_VISIBILITY_DEFAULT)
81 #define LIBDVDCSS_EXPORT __attribute__((visibility("default"))) extern
82 #else
83 #define LIBDVDCSS_EXPORT extern
84 #endif
85
86
87 /*
88 * Exported prototypes.
89 */
90 LIBDVDCSS_EXPORT dvdcss_t dvdcss_open ( const char *psz_target );
91 LIBDVDCSS_EXPORT dvdcss_t dvdcss_open_stream( void *p_stream,
92 dvdcss_stream_cb *p_stream_cb );
93 LIBDVDCSS_EXPORT int dvdcss_close ( dvdcss_t );
94 LIBDVDCSS_EXPORT int dvdcss_seek ( dvdcss_t,
95 int i_blocks,
96 int i_flags );
97 LIBDVDCSS_EXPORT int dvdcss_read ( dvdcss_t,
98 void *p_buffer,
99 int i_blocks,
100 int i_flags );
101 LIBDVDCSS_EXPORT int dvdcss_readv ( dvdcss_t,
102 void *p_iovec,
103 int i_blocks,
104 int i_flags );
105 LIBDVDCSS_EXPORT const char *dvdcss_error ( const dvdcss_t );
106
107 LIBDVDCSS_EXPORT int dvdcss_is_scrambled ( dvdcss_t );
108
109 #ifdef __cplusplus
110 }
111 #endif
112
113 #endif /* DVDCSS_DVDCSS_H */
dvdcss_stream_cb::pf_readv
int(* pf_readv)(void *p_stream, const void *p_iovec, int i_blocks)
Definition: dvdcss.h:53
LIBDVDCSS_EXPORT
#define LIBDVDCSS_EXPORT
Definition: dvdcss.h:83
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:672
dvdcss_is_scrambled
LIBDVDCSS_EXPORT int dvdcss_is_scrambled(dvdcss_t)
Detect whether or not a DVD is scrambled.
Definition: libdvdcss.c:831
dvdcss_error
LIBDVDCSS_EXPORT const char * dvdcss_error(const dvdcss_t)
Return a string containing the last error that occurred in the given libdvdcss instance.
Definition: libdvdcss.c:604
dvdcss_close
LIBDVDCSS_EXPORT int dvdcss_close(dvdcss_t)
Clean up library state and structures.
Definition: libdvdcss.c:803
dvdcss_t
struct dvdcss_s * dvdcss_t
Definition: dvdcss.h:43
dvdcss_open_stream
LIBDVDCSS_EXPORT dvdcss_t dvdcss_open_stream(void *p_stream, dvdcss_stream_cb *p_stream_cb)
Open a DVD device using dvdcss_stream_cb.
Definition: libdvdcss.c:488
dvdcss_stream_cb::pf_read
int(* pf_read)(void *p_stream, void *buffer, int i_read)
Definition: dvdcss.h:51
dvdcss_stream_cb
Definition: dvdcss.h:46
dvdcss_readv
LIBDVDCSS_EXPORT int dvdcss_readv(dvdcss_t, void *p_iovec, int i_blocks, int i_flags)
Read data from the disc into multiple buffers and decrypt data if requested.
Definition: libdvdcss.c:746
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:632
dvdcss_stream_cb::pf_seek
int(* pf_seek)(void *p_stream, uint64_t i_pos)
Definition: dvdcss.h:49
dvdcss_open
LIBDVDCSS_EXPORT dvdcss_t dvdcss_open(const char *psz_target)
Open a DVD device or directory and return a dvdcss instance.
Definition: libdvdcss.c:474
dvdcss_stream_cb
struct dvdcss_stream_cb dvdcss_stream_cb