|
API reference
This is the complete libdvdcss API reference.
dvdcss_handle dvdcss_open( char *psz_target, int i_flags ); |
Initialize libdvdcss and open a DVD device.
Arguments:
char *psz_target : a string containing the target
name, for instance "/dev/hdc" or "E:" .
int i_flags : initialization flag. Can be one or
several of DVDCSS_NOFLAGS (default behaviour),
DVDCSS_INIT_QUIET (don't print error messages) or
DVDCSS_INIT_DEBUG (print debug messages).
Return value:
dvdcss_handle dvdcss_open : a pointer to be used
for future library calls.
|
|
|
int dvdcss_close( dvdcss_handle ); |
Close a previously opened DVD device and clean up library.
Arguments:
dvdcss_handle : the handle returned by
dvdcss_open .
Return value:
int dvdcss_close : zero if no error occured, -1
if close failed.
|
|
|
int dvdcss_seek( dvdcss_handle, int i_blocks ); |
Set position within the device.
Arguments:
dvdcss_handle : the handle returned by
dvdcss_open .
int i_blocks : wanted position, in blocks.
Return value:
int dvdcss_seek : return current position in the
disc if no error occured, -1 if seek failed.
|
|
|
int dvdcss_title( dvdcss_handle, int i_block ); |
To be called on each title change, so that the title key gets
updated if the disc is encrypted. Does nothing if disc is unencrypted.
This function should also be called on a layer change. It is
likely to disappear when we find a proper way to detect when the key has
changed.
Arguments:
dvdcss_handle : the handle returned by
dvdcss_open .
int i_block : a block position in the title.
Return value:
int dvdcss_title : zero if no error occured, -1
if key cracking failed.
|
|
|
int dvdcss_read( dvdcss_handle, void *p_buffer, int i_blocks, int i_flags ); |
Read blocks from the disc. Decrypt data on the fly if requested.
Arguments:
dvdcss_handle : the handle returned by
dvdcss_open .
void *p_buffer : buffer to write data into. Should
be at least i_blocks * DVDCSS_BLOCK_SIZE big.
int i_blocks : amount of blocks to read.
int i_flags : read flag. Can be one or several of
DVDCSS_NOFLAGS (default behaviour, don't decrypt
data) or DVDCSS_READ_DECRYPT (decrypt on the fly
if disc is encrypted).
Return value:
int dvdcss_read : amount of blocks read, -1
if read failed.
|
|
|
int dvdcss_readv( dvdcss_handle, void *p_iovec, int i_blocks, int i_flags ); |
Read blocks from the disc into multiple buffers. Decrypt data on the
fly if requested.
Arguments:
dvdcss_handle : the handle returned by
dvdcss_open .
void *p_iovec : pointer to an iovec structure to
write data into. Total size should be at least i_blocks
* DVDCSS_BLOCK_SIZE big, and all iov_len
values should be multiples of DVDCSS_BLOCK_SIZE .
int i_blocks : amount of blocks to read.
int i_flags : read flag. Can be one or several of
DVDCSS_NOFLAGS (default behaviour, don't decrypt
data) or DVDCSS_READ_DECRYPT (decrypt on the fly
if disc is encrypted).
Return value:
int dvdcss_readv : amount of blocks read, -1
if read failed.
|
|
|
char *dvdcss_error( dvdcss_handle ); |
Return a string containing the latest error that occured in libdvdcss.
Arguments:
dvdcss_handle : the handle returned by
dvdcss_open .
Return value:
char *dvdcss_error : null-terminated string
containing latest error.
|
|
|
|