28 #ifndef OPENSHOT_CACHE_MEMORY_H 29 #define OPENSHOT_CACHE_MEMORY_H 50 map<long int, std::shared_ptr<Frame> > frames;
51 deque<long int> frame_numbers;
53 bool needs_range_processing;
55 vector<long int> ordered_frame_numbers;
56 map<long int, long int> frame_ranges;
57 long int range_version;
63 void CalculateRanges();
78 void Add(std::shared_ptr<Frame> frame);
88 std::shared_ptr<Frame>
GetFrame(
long int frame_number);
102 void Remove(
long int frame_number);
107 void Remove(
long int start_frame_number,
long int end_frame_number);
void MoveToFront(long int frame_number)
Move frame to front of queue (so it lasts longer)
void Remove(long int frame_number)
Remove a specific frame.
void SetJsonValue(Json::Value root)
Load Json::JsonValue into this object.
long long int max_bytes
This is the max number of bytes to cache (0 = no limit)
Json::Value JsonValue()
Generate Json::JsonValue for this object.
void Add(std::shared_ptr< Frame > frame)
Add a Frame to the cache.
CacheMemory()
Default constructor, no max bytes.
void SetJson(string value)
Load JSON string into this object.
Exception when a reader is closed, and a frame is requested.
long long int GetBytes()
Gets the maximum bytes value.
std::shared_ptr< Frame > GetSmallestFrame()
Get the smallest frame number.
Header file for CacheBase class.
Header file for all Exception classes.
Header file for Frame class.
Exception for files that can not be found or opened.
All cache managers in libopenshot are based on this CacheBase class.
void Clear()
Clear the cache of all frames.
This namespace is the default namespace for all code in the openshot library.
Exception for invalid JSON.
long int Count()
Count the frames in the queue.
string Json()
Get and Set JSON methods.
std::shared_ptr< Frame > GetFrame(long int frame_number)
Get a frame from the cache.
This class is a memory-based cache manager for Frame objects.