nodes: optimize job infrastructure

Rework traversing so that jobs are only resolved when they are used. This should provide moderate optimize to the traversing process.
This commit is contained in:
itsmattkc
2022-05-03 11:19:21 -07:00
parent 5351e634b0
commit 028d2fd60c
31 changed files with 78 additions and 166 deletions
+7 -1
View File
@@ -341,6 +341,8 @@ void Footage::Value(const NodeValueRow &value, const NodeGlobals &globals, NodeV
Track::Reference ref = GetReferenceFromRealIndex(i);
FootageJob job(decoder_, filename(), ref.type(), GetLength(), loop_mode);
NodeValue::Type type;
if (ref.type() == Track::kVideo) {
VideoParams vp = GetVideoParams(ref.index());
@@ -348,13 +350,17 @@ void Footage::Value(const NodeValueRow &value, const NodeGlobals &globals, NodeV
vp.set_colorspace(GetColorspaceToUse(vp));
job.set_video_params(vp);
type = NodeValue::kTexture;
} else {
AudioParams ap = GetAudioParams(ref.index());
job.set_audio_params(ap);
job.set_cache_path(project()->cache_path());
type = NodeValue::kSamples;
}
table->Push(NodeValue::kFootageJob, QVariant::fromValue(job), this, false, ref.ToString());
table->Push(type, QVariant::fromValue(job), this, false, ref.ToString());
}
}
}