57#pragma GCC diagnostic push
58#pragma GCC diagnostic ignored "-Wconversion"
59#pragma GCC diagnostic ignored "-Wsign-conversion"
60#include <libavutil/avutil.h>
61#pragma GCC diagnostic pop
68#define IMAGE_FRAME_TAG "IMGFRAME"
111#define VIRTUALFLAG_NONE 0x00000000
112#define VIRTUALFLAG_PASSTHROUGH 0x00000001
113#define VIRTUALFLAG_DIRECTORY 0x00000002
114#define VIRTUALFLAG_FILESET 0x00000004
115#define VIRTUALFLAG_FRAME 0x00000008
116#define VIRTUALFLAG_HLS 0x00000010
117#define VIRTUALFLAG_CUESHEET 0x00000020
118#define VIRTUALFLAG_HIDDEN 0x00000040
141 std::memset(&
m_st, 0,
sizeof(
m_st));
220 struct CUESHEET_TRACK
227 , m_nextfile(
nullptr)
321 virtual size_t size()
const = 0;
326 virtual size_t tell()
const = 0;
340 virtual int seek(int64_t offset,
int whence) = 0;
345 virtual bool eof()
const = 0;
359 const std::string &
filename()
const;
364 const std::string &
path()
const;
struct bluray BLURAY
Forward declaration of libbluray handle.
virtual int seek(int64_t offset, int whence)=0
Seek to position in file.
const std::string & path() const
Path to source file (without file name)
std::string m_path
Source path (directory without file name)
virtual size_t size() const =0
Get the file size.
LPVIRTUALFILE virtualfile()
Get virtual file object.
virtual size_t tell() const =0
Get current read position.
virtual size_t readio(void *data, size_t size)=0
Read data from a file.
LPVIRTUALFILE m_virtualfile
Virtual file object of current file.
virtual ~FileIO()=default
Free FileIO object.
void set_virtualfile(LPVIRTUALFILE virtualfile)
Set the virtual file object.
virtual void closeio()=0
Close virtual file.
virtual VIRTUALTYPE type() const =0
Get type of the virtual file.
virtual int error() const =0
Get last error.
FileIO()
Create FileIO object.
virtual size_t bufsize() const =0
Get the ideal buffer size.
virtual int64_t duration() const =0
Get the duration of the file, in AV_TIME_BASE fractional seconds.
static std::shared_ptr< FileIO > alloc(VIRTUALTYPE type)
Allocate the correct object for type().
virtual int openio(LPVIRTUALFILE virtualfile)=0
Open a virtual file.
virtual bool eof() const =0
Check if at end of file.
const std::string & filename() const
Get source filename.
VIRTUALTYPE
Virtual file types enum.
@ DISK
Regular disk file to transcode.
@ PASSTHROUGH
passthrough file, not used
VIRTUALTYPE LPVIRTUALTYPE
Pointer to const version of VIRTUALTYPE.
struct IMAGE_FRAME IMAGE_FRAME
Image frame header.
IMAGE_FRAME * LPIMAGE_FRAME
Pointer to const version of IMAGE_FRAME.
IMAGE_FRAME const * LPCIMAGE_FRAME
Pointer version of IMAGE_FRAME.
VIRTUALFILE const * LPCVIRTUALFILE
Pointer to const version of VIRTUALFILE.
VIRTUALTYPE const * LPCVIRTUALTYPE
Pointer version of VIRTUALTYPE.
#define VIRTUALFLAG_NONE
No flags.
struct VIRTUALFILE VIRTUALFILE
Virtual file definition.
VIRTUALFILE * LPVIRTUALFILE
Pointer version of VIRTUALFILE.
uint64_t m_offset
Offset in index file.
uint32_t m_size
Image size in bytes.
std::array< uint8_t, 8 > m_reserved
Reserved. Pad structure to 32 bytes.
uint32_t m_frame_no
Number of the frame image. 0 if not yet decoded.
std::array< char, 8 > m_tag
Start tag, always ascii "IMGFRAME".
Extra value structure for Blu-ray disks.
unsigned m_chapter_no
Chapter number (1...n)
uint32_t m_title_no
Track number (1...n)
uint32_t m_playlist_no
Playlist number (1...n)
unsigned m_angle_no
Selected angle number (1...n)
Extra value structure for cue sheets.
std::string m_artist
Track artist.
int64_t m_duration
Track/chapter duration, in AV_TIME_BASE fractional seconds.
std::string m_album
Album title.
std::string m_title
Track title.
int64_t m_start
Track start time, in AV_TIME_BASE fractional seconds.
VIRTUALFILE * m_nextfile
Next (probable) file to be played. Used for cuesheet lists.
int m_trackno
Track number.
int m_tracktotal
Total number of tracks in cue sheet.
std::string m_genre
Album genre.
std::string m_date
Publishing date.
Extra value structure for DVDs.
int m_angle_no
Selected angle number (1...n)
int m_title_no
Track number (1...n)
int m_chapter_no
Chapter number (1...n)
Extra value structure for Video CDs.
int m_chapter_no
Chapter number (1..)
uint64_t m_start_pos
Start offset in bytes.
uint64_t m_end_pos
End offset in bytes (not including this byte)
int m_track_no
Track number (1..)
int m_sample_rate
Audio sample rate - Filled in for the DVD/Blu-ray directory.
struct VIRTUALFILE::DVD_CHAPTER m_dvd
DVD title/chapter info.
bool m_full_title
If true, ignore m_chapter_no and provide full track.
std::string m_destfile
Name and path of destination file.
size_t m_predicted_size
Use this as the size instead of computing it over and over.
VIRTUALTYPE m_type
Type of this virtual file.
bool m_has_audio
True if file has an audio track.
std::string m_origfile
Sanitised name and path of original file.
int m_flags
One of the VIRTUALFLAG_* flags.
int m_width
Video width - Filled in for the DVD/Blu-ray directory.
int m_height
Video height - Filled in for the DVD/Blu-ray directory.
int m_channels
Audio channels - Filled in for the DVD/Blu-ray directory.
std::string m_virtfile
Name and path of virtual file.
AVRational m_framerate
Video frame rate - Filled in for the DVD/Blu-ray directory.
bool m_has_video
True if file has a video track.
struct stat m_st
stat structure with size etc.
bool m_has_subtitle
True if file has a subtitle track.
std::vector< char > m_file_contents
Buffer for virtual files.
std::string m_cuesheet
Cue sheet file contents for physical file.
struct VIRTUALFILE::BLURAY_CHAPTER m_bluray
Blu-ray title/chapter info.
size_t m_format_idx
Index into params.format[] array.
struct VIRTUALFILE::CUESHEET_TRACK m_cuesheet_track
Cue sheet data for track.
struct VIRTUALFILE::VCD_CHAPTER m_vcd
S/VCD track/chapter info.
uint32_t get_segment_count() const
Number of HLS segments in set.
uint32_t m_video_frame_count
Number of frames in video or 0 if not a video.
int64_t m_duration
Track/chapter duration, in AV_TIME_BASE fractional seconds.