libdvdcss 1.4.3
|
The libdvdcss public header. More...
Go to the source code of this file.
Data Structures | |
struct | dvdcss_stream_cb |
Macros | |
#define | DVDCSS_BLOCK_SIZE 2048 |
#define | DVDCSS_NOFLAGS 0 |
#define | DVDCSS_READ_DECRYPT (1 << 0) |
#define | DVDCSS_SEEK_MPEG (1 << 0) |
#define | DVDCSS_SEEK_KEY (1 << 1) |
#define | LIBDVDCSS_EXPORT extern |
Typedefs | |
typedef struct dvdcss_s * | dvdcss_t |
typedef struct dvdcss_stream_cb | dvdcss_stream_cb |
Functions | |
LIBDVDCSS_EXPORT dvdcss_t | dvdcss_open (const char *psz_target) |
Open a DVD device or directory and return a dvdcss instance. | |
LIBDVDCSS_EXPORT dvdcss_t | dvdcss_open_stream (void *p_stream, dvdcss_stream_cb *p_stream_cb) |
Open a DVD device using dvdcss_stream_cb. | |
LIBDVDCSS_EXPORT int | dvdcss_close (dvdcss_t) |
Clean up library state and structures. | |
LIBDVDCSS_EXPORT int | dvdcss_seek (dvdcss_t, int i_blocks, int i_flags) |
Seek in the disc and change the current key if requested. | |
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. | |
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. | |
LIBDVDCSS_EXPORT const char * | dvdcss_error (const dvdcss_t) |
Return a string containing the last error that occurred in the given libdvdcss instance. | |
LIBDVDCSS_EXPORT int | dvdcss_is_scrambled (dvdcss_t) |
Detect whether or not a DVD is scrambled. | |
The libdvdcss public header.
Public types and functions that describe the API of the libdvdcss library.
#define DVDCSS_BLOCK_SIZE 2048 |
The block size of a DVD.
#define DVDCSS_NOFLAGS 0 |
The default flag to be used by libdvdcss functions.
#define DVDCSS_READ_DECRYPT (1 << 0) |
Flag to ask dvdcss_read() to decrypt the data it reads.
#define DVDCSS_SEEK_KEY (1 << 1) |
Flag to ask dvdcss_seek() to check the current title key.
#define DVDCSS_SEEK_MPEG (1 << 0) |
Flag to tell dvdcss_seek() it is seeking in MPEG data.
#define LIBDVDCSS_EXPORT extern |
Macro for setting symbol storage-class or visibility. Define LIBDVDCSS_IMPORTS before importing this header to get the correct DLL storage-class when using libdvdcss from MSVC.
typedef struct dvdcss_stream_cb dvdcss_stream_cb |
Set of callbacks to access DVDs in custom ways.
typedef struct dvdcss_s* dvdcss_t |
Library instance handle, to be used for each library call.
LIBDVDCSS_EXPORT int dvdcss_close | ( | dvdcss_t | dvdcss | ) |
Clean up library state and structures.
dvdcss | a libdvdcss instance |
Close the DVD device and free all the memory allocated by libdvdcss. On return, the dvdcss_t is invalidated and may not be used again.
LIBDVDCSS_EXPORT const char * dvdcss_error | ( | const dvdcss_t | dvdcss | ) |
Return a string containing the last error that occurred in the given libdvdcss instance.
dvdcss | a libdvdcss instance |
Return a string with the last error message produced by libdvdcss. Useful to conveniently format error messages in external applications.
LIBDVDCSS_EXPORT int dvdcss_is_scrambled | ( | dvdcss_t | dvdcss | ) |
Detect whether or not a DVD is scrambled.
dvdcss | a libdvdcss instance. |
LIBDVDCSS_EXPORT dvdcss_t dvdcss_open | ( | const char * | psz_target | ) |
Open a DVD device or directory and return a dvdcss instance.
psz_target | a string containing the target name, for instance "/dev/hdc" or "E:" |
Initialize the libdvdcss library, open the requested DVD device or directory, and return a handle to be used for all subsequent libdvdcss calls. libdvdcss checks whether ioctls can be performed on the disc, and when possible, the disc key is retrieved.
LIBDVDCSS_EXPORT dvdcss_t dvdcss_open_stream | ( | void * | p_stream, |
dvdcss_stream_cb * | p_stream_cb | ||
) |
Open a DVD device using dvdcss_stream_cb.
p_stream | a private handle used by p_stream_cb |
p_stream_cb | a struct containing seek and read functions |
LIBDVDCSS_EXPORT int dvdcss_read | ( | dvdcss_t | dvdcss, |
void * | p_buffer, | ||
int | i_blocks, | ||
int | i_flags | ||
) |
Read from the disc and decrypt data if requested.
dvdcss | a libdvdcss instance |
p_buffer | a buffer that will contain the data read from the disc |
i_blocks | the amount of blocks to read |
i_flags | DVDCSS_NOFLAGS, optionally ORed with DVDCSS_READ_DECRYPT |
Read i_blocks
logical blocks from the DVD.
You typically set i_flags
to DVDCSS_NOFLAGS when reading data from a .IFO file on the DVD.
If DVDCSS_READ_DECRYPT is specified in i_flags
, dvdcss_read() will automatically decrypt scrambled sectors. This flag is typically used when reading data from a .VOB file on the DVD. It has no effect on unscrambled discs or unscrambled sectors and can be safely used on those.
i_blocks
* DVDCSS_BLOCK_SIZE bytes into p_buffer
. References DVDCSS_BLOCK_SIZE, and DVDCSS_READ_DECRYPT.
LIBDVDCSS_EXPORT int dvdcss_readv | ( | dvdcss_t | dvdcss, |
void * | p_iovec, | ||
int | i_blocks, | ||
int | i_flags | ||
) |
Read data from the disc into multiple buffers and decrypt data if requested.
dvdcss | a libdvdcss instance |
p_iovec | a pointer to an array of iovec structures that will contain the data read from the disc |
i_blocks | the amount of blocks to read |
i_flags | DVDCSS_NOFLAGS, optionally ORed with DVDCSS_READ_DECRYPT |
Read i_blocks
logical blocks from the DVD and write them to an array of iovec structures.
You typically set i_flags
to DVDCSS_NOFLAGS when reading data from a .IFO file on the DVD.
If DVDCSS_READ_DECRYPT is specified in i_flags
, dvdcss_readv() will automatically decrypt scrambled sectors. This flag is typically used when reading data from a .VOB file on the DVD. It has no effect on unscrambled discs or unscrambled sectors and can be safely used on those.
i_blocks
* DVDCSS_BLOCK_SIZE bytes into the buffers pointed by p_iovec
. Moreover, all iov_len members of the iovec structures should be multiples of DVDCSS_BLOCK_SIZE. References DVDCSS_BLOCK_SIZE, and DVDCSS_READ_DECRYPT.
LIBDVDCSS_EXPORT int dvdcss_seek | ( | dvdcss_t | dvdcss, |
int | i_blocks, | ||
int | i_flags | ||
) |
Seek in the disc and change the current key if requested.
dvdcss | a libdvdcss instance |
i_blocks | an absolute block offset to seek to |
i_flags | DVDCSS_NOFLAGS, optionally ORed with one of DVDCSS_SEEK_KEY or DVDCSS_SEEK_MPEG |
This function seeks to the requested position, in logical blocks.
You typically set i_flags
to DVDCSS_NOFLAGS when seeking in a .IFO.
If DVDCSS_SEEK_MPEG is specified in i_flags
and if libdvdcss finds it reasonable to do so (i.e., if the dvdcss method is not "title"), the current title key will be checked and a new one will be calculated if necessary. This flag is typically used when reading data from a .VOB file.
If DVDCSS_SEEK_KEY is specified, the title key will always be checked, even with the "title" method. This flag is typically used when seeking in a new title.
References DVDCSS_SEEK_KEY, and DVDCSS_SEEK_MPEG.