don't segregate disk cached frames by sequence

Allows disk cached frames to be re-used in any context if their hashes are
perfect matches.
This commit is contained in:
itsmattkc
2020-01-09 23:36:53 +11:00
parent 362cb9daef
commit ea42ca36f5
3 changed files with 16 additions and 5 deletions
+3 -4
View File
@@ -65,10 +65,9 @@ NodeInput *AudioRenderBackend::GetDependentInput()
QString AudioRenderBackend::CachePathName()
{
QDir this_cache_dir = QDir(GetMediaCacheLocation()).filePath(cache_id());
this_cache_dir.mkpath(".");
return this_cache_dir.filePath(QStringLiteral("pcm"));
QString cache_fn = cache_id();
cache_fn.append(".pcm");
return QDir(GetMediaCacheLocation()).filePath(cache_fn);
}
bool AudioRenderBackend::CanRender()
+1 -1
View File
@@ -116,7 +116,7 @@ const QMap<rational, QByteArray> &VideoRenderFrameCache::time_hash_map() const
QString VideoRenderFrameCache::CachePathName(const QByteArray &hash) const
{
QDir this_cache_dir = QDir(GetMediaCacheLocation()).filePath(cache_id_);
QDir this_cache_dir = QDir(GetMediaCacheLocation());
this_cache_dir.mkpath(".");
QString filename = QStringLiteral("%1.exr").arg(QString(hash.toHex()));
+12
View File
@@ -26,6 +26,18 @@ NodeValueTable VideoRenderWorker::RenderInternal(const NodeDependency& path, con
QByteArray hash;
if (operating_mode_ & kHashOnly) {
QCryptographicHash hasher(QCryptographicHash::Sha1);
// Embed video parameters into this hash
int vwidth = video_params_.effective_width();
int vheight = video_params_.effective_height();
PixelFormat::Format vfmt = video_params_.format();
RenderMode::Mode vmode = video_params_.mode();
hasher.addData(reinterpret_cast<const char*>(&vwidth), sizeof(int));
hasher.addData(reinterpret_cast<const char*>(&vheight), sizeof(int));
hasher.addData(reinterpret_cast<const char*>(&vfmt), sizeof(PixelFormat::Format));
hasher.addData(reinterpret_cast<const char*>(&vmode), sizeof(RenderMode::Mode));
HashNodeRecursively(&hasher, path.node(), path.in());
hash = hasher.result();
}