18#ifndef ACTIVEFRAMEPOOL_H
19#define ACTIVEFRAMEPOOL_H
22#include <unordered_map>
41 void resize(quint64 memoryBudget);
43 void setMinFrameCount(
size_t frameCount);
45 void onKeyFrameDestroy(
KeyFrame*)
override;
48 void discardLeastUsedFrames();
50 void recalcuateTotalUsedMemory();
52 using list_iterator_t = std::list<KeyFrame*>::iterator;
54 std::list<KeyFrame*> mCacheFramesList;
55 std::unordered_map<KeyFrame*, list_iterator_t> mCacheFramesMap;
56 quint64 mMemoryBudgetInBytes = 1024 * 1024 * 1024;
57 quint64 mTotalUsedMemory = 0;
58 size_t mMinFrameCount = 15;
ActiveFramePool implemented a LRU cache to keep tracking the most recent accessed key frames A key fr...