NAME
DVD::Read::DVDCSS - libdvdcss perl binding, you can descramble encrypted DVD-s
SYNOPSIS
use DVD::Read::DVDCSS;
DESCRIPTION
This module provide way to read scrambled sectors from a DVD-VIDEO disc or ISO file using libdvdcss.
EXPORT
None by default.
Exportable functions :func
dvdcss_open()
dvdcss_t dvdcss_open ( const char *psz_target )
dvdcss_close()
int dvdcss_close ( dvdcss_t )
dvdcss_error()
const char *dvdcss_error ( const dvdcss_t )
dvdcss_is_scrambled()
int dvdcss_is_scrambled ( dvdcss_t )
dvdcss_read()
int dvdcss_read ( dvdcss_t,
void *p_buffer,
int i_blocks,
int i_flags )
dvdcss_seek()
int dvdcss_seek ( dvdcss_t,
int i_blocks,
int i_flags )
Exportable constants :const
DVDCSS_BLOCK_SIZE = 2048
DVDCSS_NOFLAGS = 0
DVDCSS_READ_DECRYPT = 1
DVDCSS_SEEK_KEY = 2
DVDCSS_SEEK_MPEG = 1
SEE ALSO
https://www.videolan.org/developers/libdvdcss.html
If you have a web site set up for your module, mention it here.
EXAMPLES
use DVD::Read::DVDCSS qw(:all);
#open /dev/cdrom
$dvdcss = DVD::Read::DVDCSS->new('/dev/cdrom');
or
$dvdcss = DVD::Read::DVDCSS->new();
$dvdcss-open('/dev/cdrom');>
or
$dvd = dvdcss_open('/dev/cdrom');
#note: $dvd is not the same as $dvdcss, so you cannot mix OO and non-OO style.
#note2: $dvdcss->{dvdcss} is a $dvd, so you may try dvdcss_is_scrambled($dvdcss->{dvdcss})
#check is dvd scrambled
$is_scrambled = $dvdcss->is_scrambled();
or
$is_scrambled = dvdcss_is_scrambled($dvd);
#seek to ISO9660 volume descriptor (sector 16 = 16 x 2048 byte) and get TITLE KEY
$pos = $dvdcss->seek(16, DVDCSS_SEEK_KEY);
or
$pos = dvdcss_seek($dvd, 16, DVDCSS_SEEK_KEY);
#note: $pos = -1 if seek failed
#read 2 sector (2 x 2048 byte) without descramble sectors
$data = $dvdcss->read(2, DVDCSS_NOFLAGS);
or
$ret = dvdcss_read($dvd, $sec_data, 2, DVDCSS_NOFLAGS);
#note: $data/$sec_data is contain the read data or undef if $dvdcss->read() cannot read, $ret is the number of read sectors or -1 if dvdcss_read() cannot read; $sector_data is untouched (not undef!) when read error
#read last error
$error_str = $dvdcss->error();
or
$error_str = dvdcss_error($dvd);
#tell current pos (sector)
$pos = $dvdcss->tell();
#note OO tracks current sector position itself, but libdvdcss not (not in public), so you are alone if do not use OO
#close
$ret = $dvdcss->close();
or
$ret = dvdcss_close($dvd);
AUTHOR
Gergely Szasz, <szaszg@hu.inter.net>
COPYRIGHT AND LICENSE
Copyright (C) 2022 by Gergely Szasz
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself, either Perl version 5.32.1 or, at your option, any later version of Perl 5 you may have available.