OpenShot Library | libopenshot
0.2.5
|
Go to the documentation of this file.
31 #ifndef OPENSHOT_CACHE_MEMORY_H
32 #define OPENSHOT_CACHE_MEMORY_H
53 std::map<int64_t, std::shared_ptr<openshot::Frame> > frames;
54 std::deque<int64_t> frame_numbers;
56 bool needs_range_processing;
57 std::string json_ranges;
58 std::vector<int64_t> ordered_frame_numbers;
59 std::map<int64_t, int64_t> frame_ranges;
60 int64_t range_version;
66 void CalculateRanges();
81 void Add(std::shared_ptr<openshot::Frame> frame);
91 std::shared_ptr<openshot::Frame>
GetFrame(int64_t frame_number);
105 void Remove(int64_t frame_number);
110 void Remove(int64_t start_frame_number, int64_t end_frame_number);
114 void SetJson(
const std::string value);
void Clear()
Clear the cache of all frames.
int64_t Count()
Count the frames in the queue.
int64_t GetBytes()
Gets the maximum bytes value.
std::shared_ptr< openshot::Frame > GetFrame(int64_t frame_number)
Get a frame from the cache.
int64_t max_bytes
This is the max number of bytes to cache (0 = no limit)
void Add(std::shared_ptr< openshot::Frame > frame)
Add a Frame to the cache.
This namespace is the default namespace for all code in the openshot library.
void Remove(int64_t frame_number)
Remove a specific frame.
Json::Value JsonValue()
Generate Json::Value for this object.
All cache managers in libopenshot are based on this CacheBase class.
Header file for CacheBase class.
This class is a memory-based cache manager for Frame objects.
std::string Json()
Get and Set JSON methods.
Header file for Frame class.
std::shared_ptr< openshot::Frame > GetSmallestFrame()
Get the smallest frame number.
CacheMemory()
Default constructor, no max bytes.
void MoveToFront(int64_t frame_number)
Move frame to front of queue (so it lasts longer)
void SetJson(const std::string value)
Load JSON string into this object.
void SetJsonValue(const Json::Value root)
Load Json::Value into this object.
Header file for all Exception classes.