cache: reimplemented auto-caching
Implemented a smarter auto-cache that's context sensitive. Caching will automatically pause when playback begins or values are being changed and resume when inactive.
This commit is contained in:
@@ -204,6 +204,10 @@ void RenderBackend::UpdateInstance(RenderWorker *instance)
|
||||
|
||||
void RenderBackend::Close()
|
||||
{
|
||||
video_pool_.threads.clear();
|
||||
audio_pool_.threads.clear();
|
||||
hash_pool_.threads.clear();
|
||||
|
||||
CancelQueue();
|
||||
|
||||
video_pool_.Destroy();
|
||||
|
||||
@@ -135,6 +135,11 @@ QList<rational> FrameHashCache::GetFrameListFromTimeRange(const TimeRangeList &r
|
||||
return GetFrameListFromTimeRange(range, timebase_);
|
||||
}
|
||||
|
||||
QList<rational> FrameHashCache::GetInvalidatedFrames() const
|
||||
{
|
||||
return GetFrameListFromTimeRange(GetInvalidatedRanges());
|
||||
}
|
||||
|
||||
void FrameHashCache::SaveCacheFrame(const QByteArray& hash,
|
||||
char* data,
|
||||
const VideoRenderingParams& vparam)
|
||||
|
||||
@@ -68,6 +68,7 @@ public:
|
||||
|
||||
static QList<rational> GetFrameListFromTimeRange(TimeRangeList range_list, const rational& timebase);
|
||||
QList<rational> GetFrameListFromTimeRange(const TimeRangeList &range) const;
|
||||
QList<rational> GetInvalidatedFrames() const;
|
||||
|
||||
protected:
|
||||
virtual void LengthChangedEvent(const rational& old, const rational& newlen) override;
|
||||
|
||||
Reference in New Issue
Block a user