45#include <dvdread/ifo_read.h>
84 virtual size_t bufsize()
const override;
104 virtual size_t readio(
void *data,
size_t size)
override;
109 virtual int error()
const override;
114 virtual int64_t
duration()
const override;
119 virtual size_t size()
const override;
124 virtual size_t tell()
const override;
139 virtual int seek(int64_t offset,
int whence)
override;
144 virtual bool eof()
const override;
148 virtual void closeio()
override;
162 bool is_nav_pack(
const unsigned char *buffer)
const;
185 size_t demux_pes(uint8_t *out,
const uint8_t *in,
size_t len)
const;
194 DSITYPE handle_DSI(
void *_dsi_pack,
size_t *cur_output_size,
unsigned int * next_block, uint8_t *data);
227 std::array<unsigned char, 1024 * DVD_VIDEO_LB_LEN>
m_data;
228 std::array<unsigned char, 1024 * DVD_VIDEO_LB_LEN>
m_buffer;
bool m_is_eof
true if at "end of file", i.e, end of chapter or title
bool get_packet_size(const uint8_t *p, size_t peek, size_t *size) const
return the size of the next packet
int m_cur_cell
Current cell.
int m_errno
errno of last operation
virtual VIRTUALTYPE type() const override
Get type of the virtual file.
bool m_goto_next_cell
If logc needs to go to next cell before next read.
bool m_full_title
If true, ignore m_chapter_no and provide full track.
void rewind()
Rewind to start of stream.
virtual int seek(int64_t offset, int whence) override
Seek to position in file.
virtual size_t size() const override
Get the file size.
size_t m_size
Size of virtual file.
DSITYPE handle_DSI(void *_dsi_pack, size_t *cur_output_size, unsigned int *next_block, uint8_t *data)
Handle DSI (Data Search Information) packet.
void pvt_close()
Close virtual file. Non-virtual version to be safely called from constructor/destructor.
ifo_handle_t * m_vmg_file
DVD video manager handle.
bool is_nav_pack(const unsigned char *buffer) const
Do a rough check if this is really a navigation packet.
std::array< unsigned char, 1024 *DVD_VIDEO_LB_LEN > m_buffer
Buffer for data extracted from VOB file.
size_t m_rest_size
Rest bytes in buffer.
int m_title_idx
Track index (track number - 1)
virtual void closeio() override
Close virtual file.
virtual size_t bufsize() const override
Get the ideal buffer size.
void next_cell()
Goto next DVD cell.
int64_t m_duration
Track/chapter duration, in AV_TIME_BASE fractional seconds.
DSITYPE
Type of a DSI block.
DvdIO()
Create DvdIO object.
virtual int openio(LPVIRTUALFILE virtualfile) override
Open a virtual file.
int m_next_cell
Next cell to be processed.
int get_pes_id(const uint8_t *buffer, size_t size) const
return the id of a Packetized Elementary Stream (PES) (should be valid)
virtual bool eof() const override
Check if at end of file.
virtual size_t readio(void *data, size_t size) override
Read data from file.
virtual int error() const override
Get last error.
int m_chapter_idx
Chapter index (chapter number - 1)
size_t m_cur_pos
Current position in virtual file.
ifo_handle_t * m_vts_file
DVD video title stream handle.
dvd_reader_t * m_dvd
DVD reader handle.
pgc_t * m_cur_pgc
Current program chain.
dvd_file_t * m_dvd_title
DVD title handle.
virtual ~DvdIO()
Free DvdIO object.
int m_angle_idx
Selected angle index (angle number -1)
size_t m_rest_pos
Position in buffer.
unsigned int m_cur_block
Current processing block.
std::array< unsigned char, 1024 *DVD_VIDEO_LB_LEN > m_data
Buffer for readio() data.
int m_end_cell
End cell (of title)
int m_start_cell
Start cell.
virtual size_t tell() const override
Get current read position.
size_t demux_pes(uint8_t *out, const uint8_t *in, size_t len) const
Extract only the interesting portion of the VOB input stream.
virtual int64_t duration() const override
Get the duration of the file, in AV_TIME_BASE fractional seconds.
LPVIRTUALFILE virtualfile()
Get virtual file object.
VIRTUALTYPE
Virtual file types enum.