All Classes Namespaces Functions Variables Enumerations Properties Pages
Public Member Functions | Private Types | Private Member Functions | Private Attributes | List of all members
ActiveFramePool Class Reference

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>

+ Inheritance diagram for ActiveFramePool:

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
 

Detailed Description

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.


The documentation for this class was generated from the following files: