Allows to read selected streams from a DVD image. More...
#include <dvdnav_read.h>
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< Mutex > | mutex |
| mt_atomic_t | _ref_count |
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.
| DVDNavReader::DVDNavReader | ( | zmm::String | path | ) |
Sets the filename to work with. Can be an ISO, device or directory.
| DVDNavReader::~DVDNavReader | ( | ) |
| 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
| 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] |
| void * Object::operator new | ( | size_t | size | ) | [static, inherited] |
| size_t DVDNavReader::readSector | ( | unsigned char * | buffer, | |
| size_t | length | |||
| ) |
Reads the stream, specified by selectPGC from the DVD.
| buffer | buffer to store the data | |
| length | length of the buffer |
| void Object::release | ( | ) | [inherited] |
Definition at line 66 of file object.cc.
References zmm::Object::_ref_count, atomic_dec(), and zmm::Object::mutex.
Referenced by zmm::ArrayBase::clear(), zmm::String::operator=(), DSOHash< zmm::Array< CacheObject > >::releaseData(), DSBHash< VT >::releaseData(), DSOHash< zmm::Array< CacheObject > >::remove(), zmm::ArrayBase::remove(), zmm::ArrayBase::removeUnordered(), zmm::ArrayBase::set(), zmm::ArrayBase::~ArrayBase(), DSOHash< zmm::Array< CacheObject > >::~DSOHash(), zmm::ObjectQueue< AutoscanDirectory >::~ObjectQueue(), zmm::ObjectStack< Element >::~ObjectStack(), and zmm::String::~String().
| void Object::retain | ( | ) | [inherited] |
Definition at line 58 of file object.cc.
References zmm::Object::_ref_count, atomic_inc(), and zmm::Object::mutex.
Referenced by zmm::ArrayBase::append(), zmm::ObjectQueue< AutoscanDirectory >::enqueue(), zmm::ArrayBase::insert(), zmm::String::operator=(), zmm::ObjectStack< Element >::push(), DSOHash< zmm::Array< CacheObject > >::put(), DSBHash< VT >::put(), zmm::ArrayBase::set(), and zmm::String::String().
| 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.
| 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
mt_atomic_t zmm::Object::_ref_count [protected, inherited] |
Definition at line 54 of file object.h.
Referenced by zmm::Object::getRefCount(), zmm::Object::Object(), zmm::Object::release(), and zmm::Object::retain().
dvdnav_t* DVDNavReader::dvd [protected] |
DVD handle.
Definition at line 117 of file dvdnav_read.h.
zmm::String DVDNavReader::dvd_path [protected] |
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.
zmm::Ref<Mutex> DVDNavReader::mutex [protected] |
Reimplemented from zmm::Object.
Definition at line 122 of file dvdnav_read.h.
1.6.1