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 |
virtual void | onKeyFrameDestroy (KeyFrame *)=0 |
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.
|
private |
Definition at line 52 of file activeframepool.h.
|
explicit |
Definition at line 23 of file activeframepool.cpp.
|
virtual |
Definition at line 28 of file activeframepool.cpp.
void ActiveFramePool::clear | ( | ) |
Definition at line 62 of file activeframepool.cpp.
|
private |
Definition at line 105 of file activeframepool.cpp.
bool ActiveFramePool::isFrameInPool | ( | KeyFrame * | key | ) |
Definition at line 80 of file activeframepool.cpp.
|
overridevirtual |
Implements KeyFrameEventListener.
Definition at line 91 of file activeframepool.cpp.
void ActiveFramePool::put | ( | KeyFrame * | key | ) |
Definition at line 33 of file activeframepool.cpp.
|
private |
Definition at line 128 of file activeframepool.cpp.
void ActiveFramePool::resize | ( | quint64 | memoryBudget | ) |
Definition at line 72 of file activeframepool.cpp.
void ActiveFramePool::setMinFrameCount | ( | size_t | frameCount | ) |
Definition at line 86 of file activeframepool.cpp.
|
private |
Definition at line 122 of file activeframepool.cpp.
|
private |
Definition at line 54 of file activeframepool.h.
|
private |
Definition at line 55 of file activeframepool.h.
|
private |
Definition at line 56 of file activeframepool.h.
|
private |
Definition at line 58 of file activeframepool.h.
|
private |
Definition at line 57 of file activeframepool.h.