DVDNavReader Class Reference

Allows to read selected streams from a DVD image. More...

#include <dvdnav_read.h>

Inheritance diagram for DVDNavReader:
zmm::Object

Public Member Functions

 DVDNavReader (zmm::String path)
 Sets the filename to work with. Can be an ISO, device or directory.
 ~DVDNavReader ()
int titleCount ()
 returns the number of titles on the DVD
int chapterCount (int title_idx)
 returns the number of chapters for a given title
int audioTrackCount ()
 Returns the number of audio streams for the selected PGC.
void selectPGC (int title_idx, int chapter_idx)
 Selects the title, chapter and angle to play, returns the number of bytes for the selection.
size_t readSector (unsigned char *buffer, size_t length)
 Reads the stream, specified by selectPGC from the DVD.
zmm::String audioLanguage (int stream_idx)
 Returns a human readable language string of the audio stream.
int audioSampleFrequency (int stream_idx)
 Returns the sampling frequency of the given audio stream.
int audioChannels (int stream_idx)
 Returns the number of channels for the given audio stream.
int audioStreamID (int stream_idx)
 Returns the id of the audio stream.
zmm::String audioFormat (int stream_idx)
 Returns a human readable name of the audio format.
void retain ()
void release ()
int getRefCount ()

Static Public Member Functions

static void * operator new (size_t size)
static void operator delete (void *ptr)

Protected Member Functions

zmm::String getLanguage (char *code)

Protected Attributes

zmm::String dvd_path
 Name of the DVD file.
dvdnav_t * dvd
 DVD handle.
bool EOT
 end of title flag
zmm::Ref< Mutexmutex
mt_atomic_t _ref_count

Detailed Description

Allows to read selected streams from a DVD image.

There are some constraints on the usage of this class: First of all - you *must* call the selectPGC() function before you attempt to read data or get the stream length.

You must call selectPGC() each time when you want to reset read; calling read consequently will return the stream data and advance further in the stream.

The class is thread safe, meaning that locks are in place, however it's design does not suggest multithreaded usage. selectPGC(), read(), getLength() will not work in parallel but block if one of the functions is running.

Definition at line 56 of file dvdnav_read.h.


Constructor & Destructor Documentation

DVDNavReader::DVDNavReader ( zmm::String  path  ) 

Sets the filename to work with. Can be an ISO, device or directory.

DVDNavReader::~DVDNavReader (  ) 

Member Function Documentation

int DVDNavReader::audioChannels ( int  stream_idx  ) 

Returns the number of channels for the given audio stream.

zmm::String DVDNavReader::audioFormat ( int  stream_idx  ) 

Returns a human readable name of the audio format.

zmm::String DVDNavReader::audioLanguage ( int  stream_idx  ) 

Returns a human readable language string of the audio stream.

int DVDNavReader::audioSampleFrequency ( int  stream_idx  ) 

Returns the sampling frequency of the given audio stream.

int DVDNavReader::audioStreamID ( int  stream_idx  ) 

Returns the id of the audio stream.

int DVDNavReader::audioTrackCount (  ) 

Returns the number of audio streams for the selected PGC.

int DVDNavReader::chapterCount ( int  title_idx  ) 

returns the number of chapters for a given title

Parameters:
title_idx index of the title
zmm::String DVDNavReader::getLanguage ( char *  code  )  [protected]
int Object::getRefCount (  )  [inherited]

Definition at line 78 of file object.cc.

References zmm::Object::_ref_count, and atomic_get().

void Object::operator delete ( void *  ptr  )  [static, inherited]

Definition at line 87 of file object.cc.

References FREE.

void * Object::operator new ( size_t  size  )  [static, inherited]

Definition at line 83 of file object.cc.

References MALLOC.

size_t DVDNavReader::readSector ( unsigned char *  buffer,
size_t  length 
)

Reads the stream, specified by selectPGC from the DVD.

Parameters:
buffer buffer to store the data
length length of the buffer
Returns:
number of bytes read (can be shorter than buffer length), value of 0 indicates end of stream.
void Object::release (  )  [inherited]
void Object::retain (  )  [inherited]
void DVDNavReader::selectPGC ( int  title_idx,
int  chapter_idx 
)

Selects the title, chapter and angle to play, returns the number of bytes for the selection.

The DVD is divided into titles, each title is didvided into chapters and can have one or more angles. This function selects what data we want to retrieve from the DVD (i.e. what stream we want to watch), and returns the size of the stream in bytes. Note, that we will always treat the chapter as "starting point", i.e. we will play from the given chapter to the very end, we will not stop at the end of the chapter.

Parameters:
title_idx index of the title
chapter_idx index of the chapter from where we start
int DVDNavReader::titleCount (  ) 

returns the number of titles on the DVD


Field Documentation

mt_atomic_t zmm::Object::_ref_count [protected, inherited]
dvdnav_t* DVDNavReader::dvd [protected]

DVD handle.

Definition at line 117 of file dvdnav_read.h.

Name of the DVD file.

Definition at line 114 of file dvdnav_read.h.

bool DVDNavReader::EOT [protected]

end of title flag

Definition at line 120 of file dvdnav_read.h.

Reimplemented from zmm::Object.

Definition at line 122 of file dvdnav_read.h.


The documentation for this class was generated from the following file:

Generated on Fri Mar 26 20:16:56 2010 for MediaTomb by  doxygen 1.6.1