ActiveFramePool implemented a LRU cache to keep tracking the most recent accessed key frames A key frame will be unloaded if it's not accessed for a while (at the end of cache list) The ActiveFramePool will be updated whenever Editor::scrubTo() gets called. More...
#include <activeframepool.h>
Public Member Functions | |
void | put (KeyFrame *key) |
void | clear () |
void | resize (quint64 memoryBudget) |
bool | isFrameInPool (KeyFrame *) |
void | setMinFrameCount (size_t frameCount) |
void | onKeyFrameDestroy (KeyFrame *) override |
Private Types | |
using | list_iterator_t = std::list< KeyFrame * >::iterator |
Private Member Functions | |
void | discardLeastUsedFrames () |
void | unloadFrame (KeyFrame *key) |
void | recalcuateTotalUsedMemory () |
Private Attributes | |
std::list< KeyFrame * > | mCacheFramesList |
std::unordered_map< KeyFrame *, list_iterator_t > | mCacheFramesMap |
quint64 | mMemoryBudgetInBytes = 1024 * 1024 * 1024 |
quint64 | mTotalUsedMemory = 0 |
size_t | mMinFrameCount = 15 |
ActiveFramePool implemented a LRU cache to keep tracking the most recent accessed key frames A key frame will be unloaded if it's not accessed for a while (at the end of cache list) The ActiveFramePool will be updated whenever Editor::scrubTo() gets called.
Note: ActiveFramePool does not handle file saving. It loads frames, but never writes frames to disks.
Definition at line 33 of file activeframepool.h.