3
MediaTomb - http://www.mediatomb.cc/
5
dvd_io_handler.h - this file is part of MediaTomb.
7
Copyright (C) 2005 Gena Batyan <bgeradz@mediatomb.cc>,
8
Sergey 'Jin' Bostandzhyan <jin@mediatomb.cc>
10
Copyright (C) 2006-2009 Gena Batyan <bgeradz@mediatomb.cc>,
11
Sergey 'Jin' Bostandzhyan <jin@mediatomb.cc>,
12
Leonhard Wimmer <leo@mediatomb.cc>
14
MediaTomb is free software; you can redistribute it and/or modify
15
it under the terms of the GNU General Public License version 2
16
as published by the Free Software Foundation.
18
MediaTomb is distributed in the hope that it will be useful,
19
but WITHOUT ANY WARRANTY; without even the implied warranty of
20
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21
GNU General Public License for more details.
23
You should have received a copy of the GNU General Public License
24
version 2 along with MediaTomb; if not, write to the Free Software
25
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
30
/// \file dvd_io_handler.h
32
/// \brief Definition of the DVDIOHandler class.
33
#ifndef __DVD_IO_HANDLER_H__
34
#define __DVD_IO_HANDLER_H__
37
#include "io_handler.h"
38
#include "dvdnav_read.h"
40
/// \brief Allows the web server to read from a dvd.
41
class DVDIOHandler : public IOHandler
44
/// \brief Name of the DVD image.
47
/// \brief Handle of the DVD.
48
zmm::Ref<DVDNavReader> dvd;
52
unsigned char *small_buffer;
53
unsigned char *small_buffer_pos;
57
/// \brief Sets the dvdname to work with.
58
DVDIOHandler(zmm::String dvdname, int track, int chapter,
62
/// \brief Opens dvd for reading (writing is not supported)
63
virtual void open(IN enum UpnpOpenFileMode mode);
65
/// \brief Reads a previously opened dvd sequentially.
66
/// \param buf Data from the dvd will be copied into this buffer.
67
/// \param length Number of bytes to be copied into the buffer.
68
virtual int read(OUT char *buf, IN size_t length);
70
/// \brief Writes to a previously opened dvd.
71
/// \param buf Data from the buffer will be written to the dvd.
72
/// \param length Number of bytes to be written from the buffer.
73
/// \return number of bytes written.
74
virtual int write(OUT char *buf, IN size_t length);
76
/// \brief Performs seek on an open dvd.
77
/// \param offset Number of bytes to move in the dvd. For seeking forwards
78
/// positive values are used, for seeking backwards - negative. Offset must
79
/// be positive if origin is set to SEEK_SET
80
/// \param whence The position to move relative to. SEEK_CUR to move relative
81
/// to current position, SEEK_END to move relative to the end of dvd,
82
/// SEEK_SET to specify an absolute offset.
83
virtual void seek(IN off_t offset, IN int whence);
85
/// \brief Close a previously opened dvd.
88
/// \brief Returns the length of the stream in bytes
93
#endif // __DVD_IO_HANDLER_H__