92 bool openio(
bool create_cache =
true);
102 void clear(
bool fetch_file_time =
true);
std::recursive_mutex m_restart_mutex
Mutex while thread is restarted.
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.
std::atomic_bool m_suspend_timeout
true to temporarly disable read_frame timeout
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::atomic_uint32_t m_seek_to_no
If not 0, seeks to specified frame.
std::unique_ptr< Buffer > m_buffer
Buffer object.
Cache_Entry & operator=(Cache_Entry const &other)=delete
operator = declared deleted, should use create to get this object to maintain reference count.
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.
Cache_Entry(Cache_Entry &)=delete
Copy constructor declared deleted, should use create to get this object to maintain reference count.