FFmpegfs Fuse Multi Media Filesystem 2.16
|
Blu-ray I/O class. More...
#include <blurayio.h>
Public Member Functions | |
BlurayIO () | |
Create BlurayIO object. More... | |
virtual | ~BlurayIO () |
Free BlurayIO object. More... | |
virtual VIRTUALTYPE | type () const override |
Get type of the virtual file. More... | |
virtual size_t | bufsize () const override |
Get the ideal buffer size. More... | |
virtual int | openio (LPVIRTUALFILE virtualfile) override |
Open a virtual file. More... | |
virtual size_t | readio (void *data, size_t size) override |
Read data from file. More... | |
virtual int | error () const override |
Get last error. More... | |
virtual int64_t | duration () const override |
Get the duration of the file, in AV_TIME_BASE fractional seconds. More... | |
virtual size_t | size () const override |
Get the file size. More... | |
virtual size_t | tell () const override |
Get current read position. More... | |
virtual int | seek (int64_t offset, int whence) override |
Seek to position in file. More... | |
virtual bool | eof () const override |
Check if at end of file. More... | |
virtual void | closeio () override |
Close virtual file. More... | |
Public Member Functions inherited from FileIO | |
FileIO () | |
Create FileIO object. More... | |
virtual | ~FileIO ()=default |
Free FileIO object. | |
virtual VIRTUALTYPE | type () const =0 |
Get type of the virtual file. More... | |
virtual size_t | bufsize () const =0 |
Get the ideal buffer size. More... | |
virtual int | openio (LPVIRTUALFILE virtualfile)=0 |
Open a virtual file. More... | |
virtual size_t | readio (void *data, size_t size)=0 |
Read data from a file. More... | |
virtual int | error () const =0 |
Get last error. More... | |
virtual int64_t | duration () const =0 |
Get the duration of the file, in AV_TIME_BASE fractional seconds. More... | |
virtual size_t | size () const =0 |
Get the file size. More... | |
virtual size_t | tell () const =0 |
Get current read position. More... | |
virtual int | seek (int64_t offset, int whence)=0 |
Seek to position in file. More... | |
virtual bool | eof () const =0 |
Check if at end of file. More... | |
virtual void | closeio ()=0 |
Close virtual file. More... | |
LPVIRTUALFILE | virtualfile () |
Get virtual file object. More... | |
const std::string & | filename () const |
Get source filename. More... | |
const std::string & | path () const |
Path to source file (without file name) More... | |
Protected Attributes | |
BLURAY * | m_bd |
Blu-ray disk handle. More... | |
bool | m_is_eof |
true if at end of virtual file More... | |
int | m_errno |
Last errno. More... | |
size_t | m_rest_size |
Rest bytes in buffer. More... | |
size_t | m_rest_pos |
Position in buffer. More... | |
int64_t | m_cur_pos |
Current position in virtual file. More... | |
int64_t | m_start_pos |
Start offset in bytes. More... | |
int64_t | m_end_pos |
End offset in bytes (not including this byte) More... | |
bool | m_full_title |
If true, ignore m_chapter_no and provide full track. More... | |
uint32_t | m_title_idx |
Track index (track number - 1) More... | |
unsigned | m_chapter_idx |
Chapter index (chapter number - 1) More... | |
unsigned | m_angle_idx |
Selected angle index (angle number -1) More... | |
std::array< uint8_t, 192 *1024 > | m_data |
Buffer for readio() data. More... | |
int64_t | m_duration |
Track/chapter duration, in AV_TIME_BASE fractional seconds. More... | |
Private Member Functions | |
void | pvt_close () |
Close virtual file. Non-virtual version to be safely called from constructor/destructor. More... | |
Additional Inherited Members | |
Static Public Member Functions inherited from FileIO | |
static std::shared_ptr< FileIO > | alloc (VIRTUALTYPE type) |
Allocate the correct object for type(). More... | |
Protected Member Functions inherited from FileIO | |
void | set_virtualfile (LPVIRTUALFILE virtualfile) |
Set the virtual file object. More... | |
Blu-ray I/O class.
Definition at line 50 of file blurayio.h.
|
explicit |
|
virtual |
|
overridevirtual |
Get the ideal buffer size.
Implements FileIO.
Definition at line 67 of file blurayio.cc.
References m_data.
|
overridevirtual |
Close virtual file.
Implements FileIO.
Definition at line 301 of file blurayio.cc.
References pvt_close().
|
overridevirtual |
Get the duration of the file, in AV_TIME_BASE fractional seconds.
Implements FileIO.
Definition at line 236 of file blurayio.cc.
References m_duration.
|
overridevirtual |
Check if at end of file.
Implements FileIO.
Definition at line 296 of file blurayio.cc.
|
overridevirtual |
Get last error.
Implements FileIO.
Definition at line 231 of file blurayio.cc.
References m_errno.
|
overridevirtual |
Open a virtual file.
[in] | virtualfile | - LPCVIRTUALFILE of file to open |
Implements FileIO.
Definition at line 72 of file blurayio.cc.
References Logging::debug(), Logging::error(), m_angle_idx, VIRTUALFILE::BLURAY_CHAPTER::m_angle_no, m_bd, VIRTUALFILE::m_bluray, m_chapter_idx, VIRTUALFILE::BLURAY_CHAPTER::m_chapter_no, m_duration, VIRTUALFILE::m_duration, m_end_pos, m_full_title, VIRTUALFILE::m_full_title, m_rest_pos, m_rest_size, m_start_pos, m_title_idx, VIRTUALFILE::BLURAY_CHAPTER::m_title_no, FileIO::path(), FileIO::set_virtualfile(), FileIO::virtualfile(), and Logging::warning().
|
private |
Close virtual file. Non-virtual version to be safely called from constructor/destructor.
Definition at line 306 of file blurayio.cc.
References m_bd.
Referenced by closeio(), and ~BlurayIO().
|
overridevirtual |
Read data from file.
[out] | data | - buffer to store read bytes in. Must be large enough to hold up to size bytes. |
[in] | size | - number of bytes to read |
Implements FileIO.
Definition at line 171 of file blurayio.cc.
References Logging::error(), m_bd, m_cur_pos, m_data, m_end_pos, m_rest_pos, m_rest_size, FileIO::path(), and size().
|
overridevirtual |
Seek to position in file.
Repositions the offset of the open file to the argument offset according to the directive whence.
[in] | offset | - offset in bytes |
[in] | whence | - how to seek: SEEK_SET: The offset is set to offset bytes. SEEK_CUR: The offset is set to its current location plus offset bytes. SEEK_END: The offset is set to the size of the file plus offset bytes. |
Implements FileIO.
Definition at line 251 of file blurayio.cc.
References m_bd, m_cur_pos, m_end_pos, and m_start_pos.
|
overridevirtual |
Get the file size.
Implements FileIO.
Definition at line 241 of file blurayio.cc.
References m_end_pos, and m_start_pos.
Referenced by readio().
|
overridevirtual |
Get current read position.
Implements FileIO.
Definition at line 246 of file blurayio.cc.
References m_bd, and m_start_pos.
|
overridevirtual |
Get type of the virtual file.
Implements FileIO.
Definition at line 62 of file blurayio.cc.
References BLURAY.
|
protected |
Selected angle index (angle number -1)
Definition at line 156 of file blurayio.h.
Referenced by openio().
|
protected |
Blu-ray disk handle.
Definition at line 143 of file blurayio.h.
Referenced by openio(), pvt_close(), readio(), seek(), and tell().
|
protected |
Chapter index (chapter number - 1)
Definition at line 155 of file blurayio.h.
Referenced by openio().
|
protected |
Current position in virtual file.
Definition at line 149 of file blurayio.h.
|
protected |
Definition at line 158 of file blurayio.h.
Referenced by BlurayIO(), bufsize(), and readio().
|
protected |
Track/chapter duration, in AV_TIME_BASE fractional seconds.
Definition at line 160 of file blurayio.h.
Referenced by duration(), and openio().
|
protected |
|
protected |
|
protected |
If true, ignore m_chapter_no and provide full track.
Definition at line 153 of file blurayio.h.
Referenced by openio().
|
protected |
true if at end of virtual file
Definition at line 145 of file blurayio.h.
|
protected |
Position in buffer.
Definition at line 148 of file blurayio.h.
|
protected |
Rest bytes in buffer.
Definition at line 147 of file blurayio.h.
|
protected |
|
protected |