41#include <libavutil/rational.h>
44static int parse_vcd(
const std::string & path,
const struct stat * statbuf,
void * buf, fuse_fill_dir_t filler);
60 std::string title_buf;
66 size =
static_cast<size_t>(chapter1->
get_size());
72 size =
static_cast<size_t>(vcd.
get_size());
87 if (virtualfile ==
nullptr)
115 AVRational framerate = av_make_q(25000, 1000);
116 virtualfile->
m_video_frame_count =
static_cast<uint32_t
>(av_rescale_q(duration, av_get_time_base_q(), av_inv_q(framerate)));
130static int parse_vcd(
const std::string & path,
const struct stat * statbuf,
void * buf, fuse_fill_dir_t filler)
159int check_vcd(
const std::string & path,
void *buf, fuse_fill_dir_t filler)
161 std::string _path(path);
167 if (stat((_path +
"SVCD/INFO.SVD").c_str(), &stbuf) == 0)
172 res =
parse_vcd(_path, &stbuf, buf, filler);
177 res =
load_path(_path, &stbuf, buf, filler);
182 else if (stat((_path +
"VCD/INFO.VCD").c_str(), &stbuf) == 0)
187 res =
parse_vcd(_path, &stbuf, buf, filler);
192 res =
load_path(_path, &stbuf, buf, filler);
static void debug(const T filename, const std::string &format_string, Args &&...args)
Write debug level log entry.
static void trace(const T filename, const std::string &format_string, Args &&...args)
Write trace level log entry.
static void error(const T filename, const std::string &format_string, Args &&...args)
Write error level log entry.
int get_track_no() const
Get the track number of this chapter.
uint64_t get_size() const
Get the size of this chapter in bytes.
uint64_t get_start_pos() const
Get file position of chapter in bytes.
uint64_t get_end_pos() const
Get end position of chapter in bytes.
int64_t get_duration() const
Get chapter duration, in AV_TIME_BASE fractional seconds.
uint64_t get_size() const
Get disk size (DAT/MPEG only).
int get_number_of_chapters() const
Get number of chapters on this disk.
const std::string & get_disk_path() const
Get disk directory.
int load_file(const std::string &path)
Load VCD from path.
const VcdChapter * get_chapter(int chapter_idx) const
Get chapter object.
int64_t get_duration() const
Get the total disk duration in AV_TIME_BASE fractional seconds.
std::string format_duration(int64_t value, uint32_t fracs)
Format a time in format HH:MM:SS.fract.
const std::string & append_sep(std::string *path)
Add / to the path if required.
std::string replace_all(std::string str, const std::string &from, const std::string &to)
Same as std::string replace(), but replaces all occurrences.
const std::string & strsprintf(std::string *str, const std::string &format, Args ... args)
Format a std::string sprintf-like.
@ VIDEO
FFmpegfs_Format info, 0: video file.
FFMPEGFS_FORMAT_ARR ffmpeg_format
Two FFmpegfs_Format infos, 0: video file, 1: audio file.
Main include for FFmpegfs project.
int add_dotdot(void *buf, fuse_fill_dir_t filler, const struct stat *stbuf, off_t off)
Make dot and double dot entries for a virtual directory.
LPVIRTUALFILE insert_dir(VIRTUALTYPE type, const std::string &virtdir, const struct stat *stbuf, int flags=VIRTUALFLAG_NONE)
Add new virtual directory to the internal list. If the file already exists, it will be updated.
int add_fuse_entry(void *buf, fuse_fill_dir_t filler, const std::string &name, const struct stat *stbuf, off_t off)
Wrapper to the Fuse filler function.
int load_path(const std::string &path, const struct stat *statbuf, void *buf, fuse_fill_dir_t filler)
Load a path with virtual files for FUSE.
bool check_path(const std::string &path)
Check if the path has already been parsed. Only useful if for DVD, Blu-ray or VCD where it is guarant...
LPVIRTUALFILE insert_file(VIRTUALTYPE type, const std::string &virtfile, const struct stat *stbuf, int flags=VIRTUALFLAG_NONE)
Add new virtual file to internal list.
Provide various log facilities to stderr, disk or syslog.
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..)
bool m_full_title
If true, ignore m_chapter_no and provide full track.
size_t m_predicted_size
Use this as the size instead of computing it over and over.
struct stat m_st
stat structure with size etc.
size_t m_format_idx
Index into params.format[] array.
struct VIRTUALFILE::VCD_CHAPTER m_vcd
S/VCD track/chapter info.
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.
int check_vcd(const std::string &path, void *buf, fuse_fill_dir_t filler)
Get number of chapters on S/VCD.
static int parse_vcd(const std::string &path, const struct stat *statbuf, void *buf, fuse_fill_dir_t filler)
Parse VCD directory and get all VCD chapters as virtual files.
static bool create_vcd_virtualfile(const VcdEntries &vcd, const struct stat *statbuf, void *buf, fuse_fill_dir_t filler, bool full_title, int chapter_no)
Create a virtual file for a video CD.
Video CD and Super Video CD parser.