dvd_reader
Up

The DVD access interface.
 
This module contains the functions that form the interface to reading files located on a DVD.

 
Classes
       
dvd_stat_t
 
class dvd_stat_t
    Contains information about the size of a file and the number of parts
in case of a multipart file and the respective sizes of the parts.
 
A multipart file is for instance VTS_02_1.VOB, VTS_02_2.VOB...
The size of VTS_02_1.VOB will be stored in parts_size[0],
VTS_02_2.VOB in parts_size[1]...
 
The total size (sum of all parts) is stored in size and nr_parts will
hold the number of parts.
 
Only DVD_READ_TITLE_VOBS (VTS_??_[1-9].VOB) can be multipart files.
 
  Methods defined here:
__del__ lambda self
__getattr__ lambda self, name
__init__(self, *args)
__init__(self) -> dvd_stat_t
__repr__ = _swig_repr(self)
__setattr__ lambda self, name, value
set_parts_size(*args)
set_parts_size(self, index, obj)

Properties defined here:
nr_parts
get = dvd_stat_t_nr_parts_get(...)
set = dvd_stat_t_nr_parts_set(...)
parts_size
get = dvd_stat_t_parts_size_get(...)
set = dvd_stat_t_parts_size_set(...)
size
get = dvd_stat_t_size_get(...)
set = dvd_stat_t_size_set(...)

Data and other attributes defined here:
__dict__ = <dictproxy object>
dictionary for instance variables (if defined)
__swig_destroy__ = <built-in function delete_dvd_stat_t>
__swig_getmethods__ = {'nr_parts': <built-in function dvd_stat_t_nr_parts_get>, 'parts_size': <built-in function dvd_stat_t_parts_size_get>, 'size': <built-in function dvd_stat_t_size_get>}
__swig_setmethods__ = {'nr_parts': <built-in function dvd_stat_t_nr_parts_set>, 'parts_size': <built-in function dvd_stat_t_parts_size_set>, 'size': <built-in function dvd_stat_t_size_set>}
__weakref__ = <attribute '__weakref__' of 'dvd_stat_t' objects>
list of weak references to the object (if defined)

 
Functions
       
DVDClose(*args)
DVDClose(dvd)
 
Closes and cleans up the DVD reader object.
 
NOTE: You must close all open files before calling this function.
DVDCloseFile(*args)
DVDCloseFile(dvd_file)
 
Closes a file and frees the associated structure.
DVDDiscID(dvd)
Get a unique 128 bit disc ID.
 
This is the MD5 sum of VIDEO_TS.IFO and the VTS_0?_0.IFO files
in title order (those that exist).
 
If you need a 'text' representation of the id, print it as a
hexadecimal number, using lowercase letters, discid[0] first.
I.e. the same format as the command-line 'md5sum' program uses.
 
On success, returns a 16 char string.
On error, raises a RuntimeError exception.
DVDFileSeek(*args)
DVDFileSeek(dvd_file, seek_offset) -> offset_set
 
Seek to the given position in the file.
 
Returns the resulting position in bytes from the beginning of the file.
 
The seek position is only used for byte reads from the file,
the block read call always reads from the given offset.
DVDFileSize(*args)
DVDFileSize(dvd_file) -> blocks
 
Returns the file size in blocks.
 
If an error occurs, RuntimeError is raised.
DVDFileStat(*args)
DVDFileStat(dvd, titlenum, domain) -> dvd_stat_t
 
Stats a file on the DVD given the title number and domain.
 
This function is only of use if you want to get the size of each file
in the filesystem. These sizes are not needed to use any other functions.
 
RuntimeError is raised on failure.
DVDFinish(*args)
DVDFinish()
 
Frees any dlopened objects.
 
NOTE: You must DVDClose all handles opened with DVDOpen before calling this.
DVDISOVolumeInfo(dvd)
Get the ISO9660 VolumeIdentifier and VolumeSetIdentifier
 
* Only use this function as fallback if DVDUDFVolumeInfo fails       *
* This will happen on a disc mastered only with a iso9660 filesystem *
* All video DVD discs have UDF filesystem                            *
 
On success, a tuple containing the VolumeIdentifier and VolumeSetIdentifier is returned.
On failure, RuntimeError is raised.
DVDInit(*args)
DVDInit()
 
Initializes support for multiple threads.
 
NOTE: You must call DVDInit before using any of the other functions
if you are going to use them in a multithreading app.
DVDOpen(*args)
DVDOpen(path) -> dvd
 
Opens a block device of a DVD-ROM file, or an image file, or a directory 
name for a mounted DVD or HD copy of a DVD.
 
If the given file is a block device, or is the mountpoint for a block 
device, then that device is used for CSS authentication using libdvdcss.
If no device is available, then no CSS authentication is performed, 
and we hope that the image is decrypted.
 
If the path given is a directory, then the files in that directory may be 
in any one of these formats:
 
  path/VIDEO_TS/VTS_01_1.VOB
  path/video_ts/vts_01_1.vob
  path/VTS_01_1.VOB
  path/vts_01_1.vob
 
On failure, RuntimeError is raised.
 
Threads: this function uses chdir() and getcwd().
The current working directory is global to all threads, 
so using chdir/getcwd in another thread could give unexpected results.
DVDOpenFile(*args)
DVDOpenFile(dvd, titlenum, domain) -> dvd_file
 
Opens a file on the DVD, given the title number and domain.
 
If the title number is 0, the video manager information is opened
(VIDEO_TS.[IFO,BUP,VOB]).
 
On success, returns a file structure which may be used for reads.
On failure, raises a RuntimeError.
DVDReadBlocks(dvd_file, offset, block_count)
Reads block_count number of blocks from the file at the given block offset.
 
On failure, raises RuntimeError.
 
This call is only for reading VOB data, and should not be used when reading the IFO files.
When reading from an encrypted drive, blocks are decrypted using libdvdcss where required.
DVDReadBytes(dvd_file, bytes)
Reads the given number of bytes from the file.
 
This call can only be used on the information files,
and may not be used for reading from a VOB.
This reads from and increments the current seek position for the file.
 
On failure, raises RuntimeError.
DVDUDFCacheLevel(*args)
DVDUDFCacheLevel(dvd, level) -> set_level
 
Sets the level of caching that is done when reading from a device.
 
The level parameter can take any of the following values:
   -1 - returns the current setting.
    0 - UDF Cache turned off.
    1 - (default level) Pointers to IFO files and some data from
        PrimaryVolumeDescriptor are cached.
DVDUDFVolumeInfo(dvd)
Get the UDF VolumeIdentifier and VolumeSetIdentifier from the PrimaryVolumeDescriptor.
 
On success, a tuple containing the VolumeIdentifier and VolumeSetIdentifier is returned.
On failure, RuntimeError is raised.
DVDVersion(*args)
DVDVersion() -> int
 
Returns the version of libdvdread.

 
Data
        DVD_READ_INFO_BACKUP_FILE = 1
DVD_READ_INFO_FILE = 0
DVD_READ_MENU_VOBS = 2
DVD_READ_TITLE_VOBS = 3
DVD_VIDEO_LB_LEN = 2048
MAX_UDF_FILE_NAME_LEN = 2048