OpenShot Library | libopenshot
0.4.0
|
Go to the documentation of this file.
13 #ifndef OPENSHOT_CACHE_DISK_H
14 #define OPENSHOT_CACHE_DISK_H
33 std::map<int64_t, int64_t> frames;
34 std::deque<int64_t> frame_numbers;
35 std::string image_format;
38 int64_t frame_size_bytes;
44 void InitPath(std::string cache_path);
52 CacheDisk(std::string cache_path, std::string format,
float quality,
float scale);
60 CacheDisk(std::string cache_path, std::string format,
float quality,
float scale, int64_t
max_bytes);
67 void Add(std::shared_ptr<openshot::Frame> frame);
81 std::shared_ptr<openshot::Frame>
GetFrame(int64_t frame_number);
84 std::vector<std::shared_ptr<openshot::Frame>>
GetFrames();
98 void Remove(int64_t frame_number);
103 void Remove(int64_t start_frame_number, int64_t end_frame_number);
107 void SetJson(
const std::string value);
int64_t max_bytes
This is the max number of bytes to cache (0 = no limit)
This class is a disk-based cache manager for Frame objects.
This namespace is the default namespace for all code in the openshot library.
bool Contains(int64_t frame_number)
Check if frame is already contained in cache.
void Remove(int64_t frame_number)
Remove a specific frame.
void Clear()
Clear the cache of all frames.
All cache managers in libopenshot are based on this CacheBase class.
Header file for CacheBase class.
void SetJsonValue(const Json::Value root)
Load Json::Value into this object.
int64_t Count()
Count the frames in the queue.
std::string Json()
Generate JSON string of this object.
CacheDisk(std::string cache_path, std::string format, float quality, float scale)
Default constructor, no max bytes.
std::shared_ptr< openshot::Frame > GetFrame(int64_t frame_number)
Get a frame from the cache.
int64_t GetBytes()
Gets the maximum bytes value.
std::vector< std::shared_ptr< openshot::Frame > > GetFrames()
Get an array of all Frames.
Json::Value JsonValue()
Generate Json::Value for this object.
std::shared_ptr< openshot::Frame > GetSmallestFrame()
Get the smallest frame number.
void SetJson(const std::string value)
Load JSON string into this object.
void Add(std::shared_ptr< openshot::Frame > frame)
Add a Frame to the cache.
void MoveToFront(int64_t frame_number)
Move frame to front of queue (so it lasts longer)