move cache saving to renderprocessor

In my testing, this doesn't seem to help performance whatsoever, but at least the code is cleaner.
This commit is contained in:
itsmattkc
2022-05-16 17:02:18 -07:00
parent 9ba3f24f3b
commit 5539440e7f
6 changed files with 18 additions and 91 deletions
+8 -11
View File
@@ -182,6 +182,14 @@ void RenderProcessor::Run()
// Convert to CPU frame
FramePtr frame = GenerateFrame(texture, time);
QString cache = ticket_->property("cache").toString();
if (!cache.isEmpty()) {
rational timebase = ticket_->property("cachetimebase").value<rational>();
QUuid uuid = ticket_->property("cacheuuid").value<QUuid>();
bool cache_result = FrameHashCache::SaveCacheFrame(cache, uuid, time, timebase, frame);
ticket_->setProperty("cached", cache_result);
}
ticket_->Finish(QVariant::fromValue(frame));
}
break;
@@ -215,17 +223,6 @@ void RenderProcessor::Run()
}
break;
}
case RenderManager::kTypeVideoDownload:
{
QString cache = ticket_->property("cache").toString();
FramePtr frame = ticket_->property("frame").value<FramePtr>();
rational time = ticket_->property("time").value<rational>();
rational timebase = ticket_->property("timebase").value<rational>();
QUuid uuid = ticket_->property("uuid").value<QUuid>();
ticket_->Finish(FrameHashCache::SaveCacheFrame(cache, uuid, time, timebase, frame));
break;
}
default:
// Fail
ticket_->Finish();