DVDIOHandler Class Reference

Definition of the DVDIOHandler class. More...

#include <dvd_io_handler.h>

Inheritance diagram for DVDIOHandler:
IOHandler zmm::Object

Public Member Functions

 DVDIOHandler (zmm::String dvdname, int track, int chapter, int audio_stream_id)
 Sets the dvdname to work with.
 ~DVDIOHandler ()
virtual void open (IN enum UpnpOpenFileMode mode)
 Opens dvd for reading (writing is not supported).
virtual int read (OUT char *buf, IN size_t length)
 Reads a previously opened dvd sequentially.
virtual int write (OUT char *buf, IN size_t length)
 Writes to a previously opened dvd.
virtual void seek (IN off_t offset, IN int whence)
 Performs seek on an open dvd.
virtual void close ()
 Close a previously opened dvd.
off_t length ()
 Returns the length of the stream in bytes.
virtual void open (enum UpnpOpenFileMode mode)
 Opens a data for the web server.
virtual int read (char *buf, size_t length)
 Reads previously opened/initialized data sequentially.
virtual int write (char *buf, size_t length)
 Writes to previously opened/initialized data sequentially.
virtual void seek (off_t offset, int whence)
 Performs a seek on an open/initialized data.
void retain ()
void release ()
int getRefCount ()

Static Public Member Functions

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

Protected Attributes

zmm::String dvdname
 Name of the DVD image.
zmm::Ref< DVDNavReaderdvd
 Handle of the DVD.
off_t total_size
unsigned char * small_buffer
unsigned char * small_buffer_pos
bool last_read
mt_atomic_t _ref_count
pthread_mutex_t mutex

Detailed Description

Definition of the DVDIOHandler class.

Allows the web server to read from a dvd.

Definition at line 41 of file dvd_io_handler.h.


Constructor & Destructor Documentation

DVDIOHandler::DVDIOHandler ( zmm::String  dvdname,
int  track,
int  chapter,
int  audio_stream_id 
)

Sets the dvdname to work with.

DVDIOHandler::~DVDIOHandler (  ) 

Member Function Documentation

virtual void DVDIOHandler::close (  )  [virtual]

Close a previously opened dvd.

Reimplemented from IOHandler.

int Object::getRefCount (  )  [inherited]

Definition at line 78 of file object.cc.

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

off_t DVDIOHandler::length (  ) 

Returns the length of the stream in bytes.

virtual void IOHandler::open ( enum UpnpOpenFileMode  mode  )  [virtual, inherited]

Opens a data for the web server.

Parameters:
mode in which the data will be opened (we only support UPNP_READ)
Todo:
Genych, ya tut che to zapamyatowal kak gawno rabotaet? kto filename poluchaet??

Reimplemented in BufferedIOHandler, and IOHandlerBufferHelper.

virtual void DVDIOHandler::open ( IN enum UpnpOpenFileMode  mode  )  [virtual]

Opens dvd for reading (writing is not supported).

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.

virtual int IOHandler::read ( char *  buf,
size_t  length 
) [virtual, inherited]

Reads previously opened/initialized data sequentially.

Parameters:
buf This buffer will be filled by our read functions.
length Number of bytes to read.

Reimplemented in IOHandlerBufferHelper.

Referenced by web_read().

virtual int DVDIOHandler::read ( OUT char *  buf,
IN size_t  length 
) [virtual]

Reads a previously opened dvd sequentially.

Parameters:
buf Data from the dvd will be copied into this buffer.
length Number of bytes to be copied into the buffer.
void Object::release (  )  [inherited]
void Object::retain (  )  [inherited]
virtual void IOHandler::seek ( off_t  offset,
int  whence 
) [virtual, inherited]

Performs a seek on an open/initialized data.

Parameters:
offset Number of bytes to move in the buffer. For seeking forwards positive values are used, for seeking backwards - negative. Offset must be positive if origin is set to SEEK_SET
whence The position to move relative to. SEEK_CUR to move relative to current position, SEEK_END to move relative to the end of file, SEEK_SET to specify an absolute offset.

Reimplemented in IOHandlerBufferHelper.

Referenced by web_seek().

virtual void DVDIOHandler::seek ( IN off_t  offset,
IN int  whence 
) [virtual]

Performs seek on an open dvd.

Parameters:
offset Number of bytes to move in the dvd. For seeking forwards positive values are used, for seeking backwards - negative. Offset must be positive if origin is set to SEEK_SET
whence The position to move relative to. SEEK_CUR to move relative to current position, SEEK_END to move relative to the end of dvd, SEEK_SET to specify an absolute offset.
virtual int IOHandler::write ( char *  buf,
size_t  length 
) [virtual, inherited]

Writes to previously opened/initialized data sequentially.

Parameters:
buf Data to be written.
length Number of bytes to write.
virtual int DVDIOHandler::write ( OUT char *  buf,
IN size_t  length 
) [virtual]

Writes to a previously opened dvd.

Parameters:
buf Data from the buffer will be written to the dvd.
length Number of bytes to be written from the buffer.
Returns:
number of bytes written.

Field Documentation

mt_atomic_t zmm::Object::_ref_count [protected, inherited]

Handle of the DVD.

Definition at line 48 of file dvd_io_handler.h.

Name of the DVD image.

Definition at line 45 of file dvd_io_handler.h.

bool DVDIOHandler::last_read [protected]

Definition at line 54 of file dvd_io_handler.h.

pthread_mutex_t zmm::Object::mutex [protected, inherited]
unsigned char* DVDIOHandler::small_buffer [protected]

Definition at line 52 of file dvd_io_handler.h.

unsigned char* DVDIOHandler::small_buffer_pos [protected]

Definition at line 53 of file dvd_io_handler.h.

off_t DVDIOHandler::total_size [protected]

Definition at line 50 of file dvd_io_handler.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