FFmpegfs Fuse Multi Media Filesystem 2.16
Public Types | Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
VcdEntries Class Reference

Video CD entries. More...

#include <vcdentries.h>

Public Types

enum class  SEEKRES { NOTFOUND , FOUND , ERROR }
 
typedef SEEKRESLPSEEKRES
 Pointer to SEEKRES. More...
 
typedef const SEEKRESLPCSEEKRES
 Const pointer to SEEKRES. More...
 

Public Member Functions

 VcdEntries ()
 Construct VcdEntries object. More...
 
virtual ~VcdEntries ()=default
 Destroy VcdEntries object.
 
void clear ()
 Reset this object. More...
 
int load_file (const std::string &path)
 Load VCD from path. More...
 
time_t get_file_date () const
 Get date of disk (taken from INFO.VCD or SVD). More...
 
const std::string & get_id () const
 Get disk ID. More...
 
VCDTYPE get_type () const
 Get disk type. More...
 
std::string get_type_str () const
 Get disk type as string. More...
 
VCDPROFILETAG get_profile_tag () const
 Get disk profile tag. More...
 
std::string get_profile_tag_str () const
 Get disk profile tag as string. More...
 
int get_number_of_chapters () const
 Get number of chapters on this disk. More...
 
const VcdChapterget_chapter (int chapter_idx) const
 Get chapter object. More...
 
int64_t get_duration () const
 Get the total disk duration in AV_TIME_BASE fractional seconds. More...
 
uint64_t get_size () const
 Get disk size (DAT/MPEG only). More...
 
const std::string & get_disk_path () const
 Get disk directory. More...
 

Protected Member Functions

int scan_chapters ()
 Scan the disk for chapters. More...
 
SEEKRES seek_sync (FILE *fpi, const std::array< char, 12 > &sync) const
 Seek for sync bytes. More...
 

Protected Attributes

time_t m_file_date
 File date. More...
 
std::string m_id
 ID of CD. More...
 
VCDTYPE m_type
 Type of CD. More...
 
VCDPROFILETAG m_profile_tag
 System profile tag. More...
 
std::vector< VcdChapterm_chapters
 VCD chapters. More...
 
int64_t m_duration
 Total disk duration, in AV_TIME_BASE fractional seconds. More...
 
std::string m_disk_path
 Path to this disk. More...
 

Detailed Description

Video CD entries.

Definition at line 40 of file vcdentries.h.

Member Typedef Documentation

◆ LPCSEEKRES

Const pointer to SEEKRES.

Definition at line 53 of file vcdentries.h.

◆ LPSEEKRES

Pointer to SEEKRES.

Definition at line 52 of file vcdentries.h.

Member Enumeration Documentation

◆ SEEKRES

enum class VcdEntries::SEEKRES
strong

Seek results

Enumerator
NOTFOUND 

Sync not found.

FOUND 

Sync found.

ERROR 

Seek error.

Definition at line 46 of file vcdentries.h.

Constructor & Destructor Documentation

◆ VcdEntries()

VcdEntries::VcdEntries ( )
explicit

Construct VcdEntries object.

Sync bytes for a Video CD picture start. Sync bytes for a Video CD video stream.

Definition at line 54 of file vcdentries.cc.

References clear().

Member Function Documentation

◆ clear()

void VcdEntries::clear ( )

Reset this object.

Definition at line 59 of file vcdentries.cc.

References m_chapters, m_disk_path, m_duration, m_file_date, m_id, m_profile_tag, m_type, and UNKNOWN.

Referenced by load_file(), and VcdEntries().

◆ get_chapter()

const VcdChapter * VcdEntries::get_chapter ( int  chapter_idx) const

Get chapter object.

Note
If a disk is successfully read, at least one chapter is guaranteed to exist.
Parameters
[in]chapter_idx- 0..number of chapters - 1
Returns
VcdChapter object with this chapter, nullptr if chapter_idx is invalid.

Definition at line 389 of file vcdentries.cc.

References get_number_of_chapters(), and m_chapters.

Referenced by create_vcd_virtualfile().

◆ get_disk_path()

const std::string & VcdEntries::get_disk_path ( ) const

Get disk directory.

Returns
Returns disk directory.

Definition at line 415 of file vcdentries.cc.

References m_disk_path.

Referenced by create_vcd_virtualfile().

◆ get_duration()

int64_t VcdEntries::get_duration ( ) const

Get the total disk duration in AV_TIME_BASE fractional seconds.

Returns
Returns total disk duration.

Definition at line 398 of file vcdentries.cc.

References m_duration.

Referenced by create_vcd_virtualfile().

◆ get_file_date()

time_t VcdEntries::get_file_date ( ) const

Get date of disk (taken from INFO.VCD or SVD).

Returns
Returns date of disk.

Definition at line 354 of file vcdentries.cc.

References m_file_date.

◆ get_id()

const std::string & VcdEntries::get_id ( ) const

Get disk ID.

Returns
Returns disk ID.

Definition at line 359 of file vcdentries.cc.

References m_id.

◆ get_number_of_chapters()

int VcdEntries::get_number_of_chapters ( ) const

Get number of chapters on this disk.

Returns
Returns number of chapters on this disk.

Definition at line 384 of file vcdentries.cc.

References m_chapters.

Referenced by get_chapter(), get_size(), and parse_vcd().

◆ get_profile_tag()

VCDPROFILETAG VcdEntries::get_profile_tag ( ) const

Get disk profile tag.

Returns
Returns disk profile tag.

Definition at line 374 of file vcdentries.cc.

References m_profile_tag.

◆ get_profile_tag_str()

std::string VcdEntries::get_profile_tag_str ( ) const

Get disk profile tag as string.

Returns
Returns disk profile tag as string.

Definition at line 379 of file vcdentries.cc.

References VCDUTILS::get_profile_tag_str(), and m_profile_tag.

◆ get_size()

uint64_t VcdEntries::get_size ( ) const

Get disk size (DAT/MPEG only).

Returns
Returns disk size.

Definition at line 403 of file vcdentries.cc.

References get_number_of_chapters(), and m_chapters.

Referenced by create_vcd_virtualfile().

◆ get_type()

VCDTYPE VcdEntries::get_type ( ) const

Get disk type.

Returns
Returns disk type.

Definition at line 364 of file vcdentries.cc.

References m_type.

◆ get_type_str()

std::string VcdEntries::get_type_str ( ) const

Get disk type as string.

Returns
Returns disk type as string.

Definition at line 369 of file vcdentries.cc.

References VCDUTILS::get_type_str(), and m_type.

◆ load_file()

int VcdEntries::load_file ( const std::string &  path)

◆ scan_chapters()

int VcdEntries::scan_chapters ( )
protected

Scan the disk for chapters.

Returns
On success, returns 0; on error, returns errno.

Definition at line 160 of file vcdentries.cc.

References FOUND, VcdChapter::get_start_time(), VCDUTILS::locate_video(), m_chapters, m_disk_path, VcdChapter::m_duration, m_duration, VcdChapter::readio(), seek_sync(), SYNC, and VCD_SECTOR_SIZE.

Referenced by load_file().

◆ seek_sync()

VcdEntries::SEEKRES VcdEntries::seek_sync ( FILE *  fpi,
const std::array< char, 12 > &  sync 
) const
protected

Seek for sync bytes.

Parameters
[in]fpi- file pointer of open file
[in]sync- sync bytes
Returns
Returns SEEKRES result code.

Definition at line 315 of file vcdentries.cc.

References FOUND, and NOTFOUND.

Referenced by scan_chapters().

Member Data Documentation

◆ m_chapters

std::vector<VcdChapter> VcdEntries::m_chapters
protected

VCD chapters.

Definition at line 154 of file vcdentries.h.

Referenced by clear(), get_chapter(), get_number_of_chapters(), get_size(), load_file(), and scan_chapters().

◆ m_disk_path

std::string VcdEntries::m_disk_path
protected

Path to this disk.

Definition at line 158 of file vcdentries.h.

Referenced by clear(), get_disk_path(), load_file(), and scan_chapters().

◆ m_duration

int64_t VcdEntries::m_duration
protected

Total disk duration, in AV_TIME_BASE fractional seconds.

Definition at line 155 of file vcdentries.h.

Referenced by clear(), get_duration(), load_file(), and scan_chapters().

◆ m_file_date

time_t VcdEntries::m_file_date
protected

File date.

Definition at line 149 of file vcdentries.h.

Referenced by clear(), get_file_date(), and load_file().

◆ m_id

std::string VcdEntries::m_id
protected

ID of CD.

Definition at line 150 of file vcdentries.h.

Referenced by clear(), get_id(), and load_file().

◆ m_profile_tag

VCDPROFILETAG VcdEntries::m_profile_tag
protected

System profile tag.

Definition at line 152 of file vcdentries.h.

Referenced by clear(), get_profile_tag(), get_profile_tag_str(), and load_file().

◆ m_type

VCDTYPE VcdEntries::m_type
protected

Type of CD.

Definition at line 151 of file vcdentries.h.

Referenced by clear(), get_type(), get_type_str(), and load_file().


The documentation for this class was generated from the following files: