OpenShot Library | libopenshot
0.2.2
|
Go to the documentation of this file.
28 #ifndef OPENSHOT_CACHE_MEMORY_H
29 #define OPENSHOT_CACHE_MEMORY_H
50 map<int64_t, std::shared_ptr<Frame> > frames;
51 deque<int64_t> frame_numbers;
53 bool needs_range_processing;
55 vector<int64_t> ordered_frame_numbers;
56 map<int64_t, int64_t> frame_ranges;
57 int64_t range_version;
63 void CalculateRanges();
78 void Add(std::shared_ptr<Frame> frame);
88 std::shared_ptr<Frame>
GetFrame(int64_t frame_number);
102 void Remove(int64_t frame_number);
107 void Remove(int64_t start_frame_number, int64_t end_frame_number);
void Clear()
Clear the cache of all frames.
int64_t Count()
Count the frames in the queue.
void SetJsonValue(Json::Value root)
Load Json::JsonValue into this object.
int64_t GetBytes()
Gets the maximum bytes value.
std::shared_ptr< 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)
This namespace is the default namespace for all code in the openshot library.
string Json()
Get and Set JSON methods.
void Add(std::shared_ptr< Frame > frame)
Add a Frame to the cache.
void Remove(int64_t frame_number)
Remove a specific frame.
Json::Value JsonValue()
Generate Json::JsonValue 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.
Header file for Frame class.
std::shared_ptr< Frame > GetSmallestFrame()
Get the smallest frame number.
void SetJson(string value)
Load JSON string into this object.
CacheMemory()
Default constructor, no max bytes.
void MoveToFront(int64_t frame_number)
Move frame to front of queue (so it lasts longer)
Header file for all Exception classes.