42 , m_virtualfile(virtualfile)
43 , m_is_decoding(false)
44 , m_suspend_timeout(false)
53 m_buffer = std::make_unique<Buffer>();
67 std::unique_lock<std::recursive_mutex> lock_active_mutex(
m_active_mutex);
274 size_t current_size =
m_buffer->buffer_watermark();
@ FINISHED_ERROR
Transcode finished with error.
@ FINISHED_INCOMPLETE
Transcode finished, but incomplete.
@ NONE
No result code available.
@ FINISHED_SUCCESS
Transcode finished successfully.
size_t size() const
Return size of output file, as computed by encoder.
CACHE_INFO m_cache_info
Info about cached object.
bool update_access(bool update_database=false)
Update last access time.
bool is_finished_error() const
Get if cache has been finished and with an error.
static Cache_Entry * create(Cache *owner, LPVIRTUALFILE virtualfile)
Create a new Cache_Entry object.
time_t age() const
Get the age of the cache entry.
bool is_finished() const
Get if cache has been finished.
std::recursive_mutex m_mutex
Access mutex.
bool suspend_timeout() const
Check for decode suspend timeout.
Cache * m_owner
Owner cache object.
int ref_count() const
Get the current reference counter.
void lock()
Lock the access mutex.
std::atomic_bool m_is_decoding
true while file is decoding
void close_buffer(int flags)
Close buffer object.
const char * virtname() const
Return virtual filename. Same as destination filename, but with virtual (mount) path....
LPVIRTUALFILE m_virtualfile
Underlying virtual file object.
void clear(bool fetch_file_time=true)
Clear the cache entry.
const char * destname() const
Return destination filename.
LPVIRTUALFILE virtualfile()
Get the underlying VIRTUALFILE object.
bool write_info()
Write cache info.
bool destroy()
Destroy this Cache_Entry object.
bool openio(bool create_cache=true)
Open the cache file.
Cache_Entry(Cache *owner, LPVIRTUALFILE virtualfile)
Create Cache_Entry object.
void update_read_count()
Update read counter.
std::atomic_int m_ref_count
Reference counter.
const char * filename() const
Return source filename.
int decr_refcount()
Decrement the current reference counter.
time_t last_access() const
Get last access time.
std::recursive_mutex m_active_mutex
Mutex while thread is active.
ID3v1 m_id3v1
ID3v1 structure which is used to send to clients.
uint32_t video_frame_count() const
Get the video frame count.
bool closeio(int flags)
Close the cache entry.
unsigned int read_count() const
Get read counter.
int inc_refcount()
Increment the current reference counter.
bool flush()
Flush current memory cache to disk.
bool decode_timeout() const
Check for decode timeout.
void unlock()
Unlock the access mutex.
bool is_finished_incomplete() const
Get if cache has been finished, but not completely filled.
bool is_finished_success() const
Get if cache has been finished and filled successfully.
bool outdated() const
Check if cache entry needs to be recoded.
std::unique_ptr< Buffer > m_buffer
Buffer object.
bool delete_info()
Delete cache info.
virtual ~Cache_Entry()
Destroy Cache_Entry object.
bool read_info()
Read cache info.
bool expired() const
Check if cache entry expired.
bool delete_info(const std::string &filename, const std::string &desttype)
Delete cache file info.
bool write_info(LPCCACHE_INFO cache_info)
Write cache file info.
bool read_info(LPCACHE_INFO cache_info)
Read cache file info.
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.
void init_id3v1(ID3v1 *id3v1)
Initialise ID3v1 tag.
FFMPEGFS_PARAMS params
FFmpegfs command line parameters.
Main include for FFmpegfs project.
Provide various log facilities to stderr, disk or syslog.
uint32_t m_video_frame_count
Number of frames in video or 0 if not a video.
int64_t m_audiobitrate
Audio bitrate in bit/s.
size_t m_file_size
Source file file size.
time_t m_access_time
Source file last access time.
RESULTCODE m_result
Result code:
bool m_deinterlace
true if video was deinterlaced
size_t m_encoded_filesize
Actual file size after encode.
int m_audiosamplerate
Audio sample rate in Hz.
bool m_error
true if encode failed
size_t m_predicted_filesize
Predicted file size.
std::string m_destfile
Destination filename after transcode.
int m_averror
FFmpeg error code if encode failed.
std::string m_origfile
Original filename before transcode.
time_t m_file_time
Source file file time.
std::array< char, 11 > m_desttype
Destination type.
int m_videowidth
Video width.
int m_videoheight
Video height.
int64_t m_videobitrate
Video bitrate in bit/s.
unsigned int m_access_count
Read access counter.
int m_errno
errno if encode failed
time_t m_creation_time
Source file creation time.
time_t m_max_inactive_suspend
Time (seconds) that must elapse without access until transcoding is suspended.
int m_deinterlace
1: deinterlace video, 0: no deinterlace
time_t m_expiry_time
Time (seconds) after which an cache entry is deleted.
const FFmpegfs_Format * current_format(LPCVIRTUALFILE virtualfile) const
Get FFmpegfs_Format for a virtual file.
int m_videowidth
Output video width.
BITRATE m_videobitrate
Output video bit rate (bits per second)
int m_videoheight
Output video height.
BITRATE m_audiobitrate
Output audio bit rate (bits per second)
int m_audiosamplerate
Output audio sample rate (in Hz)
time_t m_max_inactive_abort
Time (seconds) that must elapse without access until transcoding is aborted.
std::string m_destfile
Name and path of destination file.
std::string m_origfile
Sanitised name and path of original file.
std::string m_virtfile
Name and path of virtual file.