37 CacheBase::CacheBase() : max_bytes(0) {
52 int64_t bytes = number_of_frames * (height * width * 4 + (sample_rate * channels * 4));
61 std::stringstream max_bytes_stream;
63 root[
"max_bytes"] = max_bytes_stream.str();
73 if (!root[
"max_bytes"].isNull())
74 max_bytes = std::stoll(root[
"max_bytes"].asString());
Header file for CacheBase class.
CacheBase()
Default constructor, no max bytes.
virtual Json::Value JsonValue()=0
Generate Json::Value for this object.
virtual void SetJsonValue(const Json::Value root)=0
Load Json::Value into this object.
juce::CriticalSection * cacheCriticalSection
Section lock for multiple threads.
int64_t max_bytes
This is the max number of bytes to cache (0 = no limit)
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.
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.