dvdcss.h 3.01 KB
Newer Older
1
2
/**
 * \file dvdcss.h
3
 * \author Stéphane Borel <stef@via.ecp.fr>
4
 * \author Sam Hocevar <sam@zoy.org>
5
 *
6
 * \brief The \e libdvdcss public header.
Sam Hocevar's avatar
 
Sam Hocevar committed
7
 *
8
 * Public types and functions that describe the API of the \e libdvdcss library.
9
10
11
 */

/*
12
 * Copyright (C) 1998-2008 VideoLAN
Sam Hocevar's avatar
 
Sam Hocevar committed
13
 *
14
 * libdvdcss is free software; you can redistribute it and/or modify
Sam Hocevar's avatar
 
Sam Hocevar committed
15
16
17
 * 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.
Sam Hocevar's avatar
Sam Hocevar committed
18
 *
19
 * libdvdcss is distributed in the hope that it will be useful,
Sam Hocevar's avatar
 
Sam Hocevar committed
20
21
22
23
 * 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.
 *
Diego Biurrun's avatar
Diego Biurrun committed
24
25
26
 * You should have received a copy of the GNU General Public License along
 * with libdvdcss; if not, write to the Free Software Foundation, Inc.,
 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
27
 */
Sam Hocevar's avatar
 
Sam Hocevar committed
28

29
#ifndef DVDCSS_DVDCSS_H
30
#ifndef _DOXYGEN_SKIP_ME
31
#define DVDCSS_DVDCSS_H 1
32
#endif
33
34
35
36
37

#ifdef __cplusplus
extern "C" {
#endif

38
/** Library instance handle, to be used for each library call. */
39
typedef struct dvdcss_s* dvdcss_t;
Sam Hocevar's avatar
 
Sam Hocevar committed
40

41
42

/** The block size of a DVD. */
Sam Hocevar's avatar
 
Sam Hocevar committed
43
44
#define DVDCSS_BLOCK_SIZE      2048

45
/** The default flag to be used by \e libdvdcss functions. */
Sam Hocevar's avatar
 
Sam Hocevar committed
46
#define DVDCSS_NOFLAGS         0
47
48

/** Flag to ask dvdcss_read() to decrypt the data it reads. */
Sam Hocevar's avatar
 
Sam Hocevar committed
49
#define DVDCSS_READ_DECRYPT    (1 << 0)
50
51

/** Flag to tell dvdcss_seek() it is seeking in MPEG data. */
Sam Hocevar's avatar
 
Sam Hocevar committed
52
#define DVDCSS_SEEK_MPEG       (1 << 0)
53
54

/** Flag to ask dvdcss_seek() to check the current title key. */
Sam Hocevar's avatar
 
Sam Hocevar committed
55
56
#define DVDCSS_SEEK_KEY        (1 << 1)

57

58
59
60
/** Macro for setting symbol storage-class or visibility.
 * Define LIBDVDCSS_IMPORTS before importing this header to get the
 * correct DLL storage-class when using \e libdvdcss from MSVC. */
61
#if defined(LIBDVDCSS_EXPORTS)
62
#define LIBDVDCSS_EXPORT __declspec(dllexport) extern
63
#elif defined(LIBDVDCSS_IMPORTS)
64
#define LIBDVDCSS_EXPORT __declspec(dllimport) extern
65
#elif defined(SUPPORT_ATTRIBUTE_VISIBILITY_DEFAULT)
66
#define LIBDVDCSS_EXPORT __attribute__((visibility("default"))) extern
67
#else
68
69
70
#define LIBDVDCSS_EXPORT extern
#endif

71
72
73
74

/*
 * Exported prototypes.
 */
75
LIBDVDCSS_EXPORT dvdcss_t dvdcss_open  ( const char *psz_target );
76
77
LIBDVDCSS_EXPORT int      dvdcss_close ( dvdcss_t );
LIBDVDCSS_EXPORT int      dvdcss_seek  ( dvdcss_t,
78
79
                               int i_blocks,
                               int i_flags );
80
LIBDVDCSS_EXPORT int      dvdcss_read  ( dvdcss_t,
81
82
83
                               void *p_buffer,
                               int i_blocks,
                               int i_flags );
84
LIBDVDCSS_EXPORT int      dvdcss_readv ( dvdcss_t,
85
86
87
                               void *p_iovec,
                               int i_blocks,
                               int i_flags );
Diego Biurrun's avatar
Diego Biurrun committed
88
LIBDVDCSS_EXPORT const char *dvdcss_error ( const dvdcss_t );
89

90
91
LIBDVDCSS_EXPORT int      dvdcss_is_scrambled ( dvdcss_t );

92
93
94
95
#ifdef __cplusplus
}
#endif

Diego Biurrun's avatar
Diego Biurrun committed
96
#endif /* DVDCSS_DVDCSS_H  */