28 #include "../include/CacheBase.h" 34 CacheBase::CacheBase() : max_bytes(0) {
49 int64_t bytes = number_of_frames * (height * width * 4 + (sample_rate * channels * 4));
58 stringstream max_bytes_stream;
60 root[
"max_bytes"] = max_bytes_stream.str();
70 if (!root[
"max_bytes"].isNull())
71 max_bytes = atoll(root[
"max_bytes"].asString().c_str());
CriticalSection * cacheCriticalSection
Section lock for multiple threads.
void SetMaxBytesFromInfo(int64_t number_of_frames, int width, int height, int sample_rate, int channels)
Set maximum bytes to a different amount based on a ReaderInfo struct.
CacheBase()
Default constructor, no max bytes.
virtual Json::Value JsonValue()=0
Generate Json::JsonValue for this object.
void SetMaxBytes(int64_t number_of_bytes)
Set maximum bytes to a different amount.
This namespace is the default namespace for all code in the openshot library.
int64_t max_bytes
This is the max number of bytes to cache (0 = no limit)
virtual void SetJsonValue(Json::Value root)=0
Load Json::JsonValue into this object.