cache: better implemented changing disk cache folders

Not complete yet, but getting there.
This commit is contained in:
itsmattkc
2020-08-07 02:31:46 +10:00
parent 00d84cfda0
commit df14c2aaa7
33 changed files with 701 additions and 431 deletions
+4 -4
View File
@@ -361,9 +361,9 @@ void ViewerWidget::SetGizmos(Node *node)
display_widget_->SetGizmos(node);
}
FramePtr DecodeCachedImage(const QString &fn, const rational& time)
FramePtr ViewerWidget::DecodeCachedImage(const QString &fn, const rational& time) const
{
FramePtr frame = FrameHashCache::LoadCacheFrame(fn);
FramePtr frame = GetConnectedNode()->video_frame_cache()->LoadCacheFrame(fn);
if (frame) {
frame->set_timestamp(time);
@@ -374,7 +374,7 @@ FramePtr DecodeCachedImage(const QString &fn, const rational& time)
return frame;
}
void DecodeCachedImage(RenderTicketPtr ticket, const QString &fn, const rational& time)
void ViewerWidget::DecodeCachedImage(RenderTicketPtr ticket, const QString &fn, const rational& time) const
{
ticket->Finish(QVariant::fromValue(DecodeCachedImage(fn, time)));
}
@@ -606,7 +606,7 @@ RenderTicketPtr ViewerWidget::GetFrame(const rational &t, bool clear_render_queu
// Frame has been cached, grab the frame
RenderTicketPtr ticket = std::make_shared<RenderTicket>(RenderTicket::kTypeVideo,
QVariant::fromValue(t));
QtConcurrent::run(DecodeCachedImage, ticket, cache_fn, t);
QtConcurrent::run(this, &ViewerWidget::DecodeCachedImage, ticket, cache_fn, t);
return ticket;
}