moved sequence params into node graph too
Reduces code by reusing more of the existing node infrastructure to synchronize sequence parameters the render backend.
This commit is contained in:
+27
-5
@@ -1456,7 +1456,8 @@ void GetDependenciesRecursively(QVector<Node*>& list, const Node* node, bool tra
|
||||
for (auto it=node->input_connections().cbegin(); it!=node->input_connections().cend(); it++) {
|
||||
Node* connected_node = it->second.node();
|
||||
|
||||
if (connected_node->outputs().size() == 1 || !exclusive_only) {
|
||||
if (!exclusive_only
|
||||
|| (connected_node->outputs().size() == 1 && !dynamic_cast<Item*>(connected_node))) {
|
||||
if (!list.contains(connected_node)) {
|
||||
list.append(connected_node);
|
||||
|
||||
@@ -1764,11 +1765,22 @@ void Node::LoadImmediate(QXmlStreamReader *reader, const QString& input, int ele
|
||||
}
|
||||
|
||||
if (reader->name() == QStringLiteral("track")) {
|
||||
QString value_text = reader->readElementText();
|
||||
QVariant value_on_track;
|
||||
|
||||
if (!value_text.isEmpty()) {
|
||||
value_on_track = NodeValue::StringToValue(data_type, value_text, element);
|
||||
if (data_type == NodeValue::kVideoParams) {
|
||||
VideoParams vp;
|
||||
vp.Load(reader);
|
||||
value_on_track = QVariant::fromValue(vp);
|
||||
} else if (data_type == NodeValue::kAudioParams) {
|
||||
AudioParams ap;
|
||||
ap.Load(reader);
|
||||
value_on_track = QVariant::fromValue(ap);
|
||||
} else {
|
||||
QString value_text = reader->readElementText();
|
||||
|
||||
if (!value_text.isEmpty()) {
|
||||
value_on_track = NodeValue::StringToValue(data_type, value_text, element);
|
||||
}
|
||||
}
|
||||
|
||||
SetSplitStandardValueOnTrack(input, val_index, value_on_track, element);
|
||||
@@ -1865,7 +1877,17 @@ void Node::SaveImmediate(QXmlStreamWriter *writer, const QString& input, int ele
|
||||
writer->writeStartElement(QStringLiteral("standard"));
|
||||
|
||||
foreach (const QVariant& v, GetSplitStandardValue(input, element)) {
|
||||
writer->writeTextElement(QStringLiteral("track"), NodeValue::ValueToString(data_type, v, true));
|
||||
writer->writeStartElement(QStringLiteral("track"));
|
||||
|
||||
if (data_type == NodeValue::kVideoParams) {
|
||||
v.value<VideoParams>().Save(writer);
|
||||
} else if (data_type == NodeValue::kAudioParams) {
|
||||
v.value<AudioParams>().Save(writer);
|
||||
} else {
|
||||
writer->writeCharacters(NodeValue::ValueToString(data_type, v, true));
|
||||
}
|
||||
|
||||
writer->writeEndElement(); // track
|
||||
}
|
||||
|
||||
writer->writeEndElement(); // standard
|
||||
|
||||
@@ -128,7 +128,7 @@ NodeValueTable NodeTraverser::GenerateBlockTable(const Track *track, const TimeR
|
||||
return table;
|
||||
}
|
||||
|
||||
QVariant NodeTraverser::ProcessVideoFootage(const Footage::StreamReference& stream, const rational &input_time)
|
||||
QVariant NodeTraverser::ProcessVideoFootage(const FootageJob &stream, const rational &input_time)
|
||||
{
|
||||
Q_UNUSED(stream)
|
||||
Q_UNUSED(input_time)
|
||||
@@ -136,7 +136,7 @@ QVariant NodeTraverser::ProcessVideoFootage(const Footage::StreamReference& stre
|
||||
return QVariant();
|
||||
}
|
||||
|
||||
QVariant NodeTraverser::ProcessAudioFootage(const Footage::StreamReference& stream, const TimeRange &input_time)
|
||||
QVariant NodeTraverser::ProcessAudioFootage(const FootageJob& stream, const TimeRange &input_time)
|
||||
{
|
||||
Q_UNUSED(stream)
|
||||
Q_UNUSED(input_time)
|
||||
@@ -232,9 +232,9 @@ void NodeTraverser::PostProcessTable(const Node *node, const TimeRange &range, N
|
||||
// Retrieve video frames
|
||||
foreach (const NodeValue& v, footage_jobs_to_run) {
|
||||
// Assume this is a VideoStream, we did a type check earlier in the function
|
||||
Footage::StreamReference job = v.data().value<Footage::StreamReference>();
|
||||
FootageJob job = v.data().value<FootageJob>();
|
||||
|
||||
if (job.IsValid() && job.type() == Stream::kVideo && job.footage()->IsValid()) {
|
||||
if (job.type() == Stream::kVideo) {
|
||||
QVariant value = ProcessVideoFootage(job, range.in());
|
||||
|
||||
if (!value.isNull()) {
|
||||
@@ -265,9 +265,9 @@ void NodeTraverser::PostProcessTable(const Node *node, const TimeRange &range, N
|
||||
// Retrieve audio samples
|
||||
foreach (const NodeValue& v, footage_jobs_to_run) {
|
||||
// Assume this is an AudioStream, we did a type check earlier in the function
|
||||
Footage::StreamReference job = v.data().value<Footage::StreamReference>();
|
||||
FootageJob job = v.data().value<FootageJob>();
|
||||
|
||||
if (job.IsValid() && job.type() == Stream::kAudio && job.footage()->IsValid()) {
|
||||
if (job.type() == Stream::kAudio) {
|
||||
QVariant value = ProcessAudioFootage(job, range);
|
||||
|
||||
if (!value.isNull()) {
|
||||
|
||||
@@ -26,6 +26,7 @@
|
||||
#include "codec/decoder.h"
|
||||
#include "common/cancelableobject.h"
|
||||
#include "node/output/track/track.h"
|
||||
#include "render/job/footagejob.h"
|
||||
#include "value.h"
|
||||
|
||||
namespace olive {
|
||||
@@ -48,9 +49,9 @@ protected:
|
||||
|
||||
virtual NodeValueTable GenerateBlockTable(const Track *track, const TimeRange& range);
|
||||
|
||||
virtual QVariant ProcessVideoFootage(const Footage::StreamReference &stream, const rational &input_time);
|
||||
virtual QVariant ProcessVideoFootage(const FootageJob &stream, const rational &input_time);
|
||||
|
||||
virtual QVariant ProcessAudioFootage(const Footage::StreamReference &stream, const TimeRange &input_time);
|
||||
virtual QVariant ProcessAudioFootage(const FootageJob &stream, const TimeRange &input_time);
|
||||
|
||||
virtual QVariant ProcessShader(const Node *node, const TimeRange &range, const ShaderJob& job);
|
||||
|
||||
|
||||
+10
-8
@@ -28,6 +28,8 @@
|
||||
|
||||
#include "common/tohex.h"
|
||||
#include "project/item/footage/stream.h"
|
||||
#include "render/audioparams.h"
|
||||
#include "render/videoparams.h"
|
||||
#include "render/color.h"
|
||||
|
||||
namespace olive {
|
||||
@@ -115,10 +117,10 @@ QByteArray NodeValue::ValueToBytes(NodeValue::Type type, const QVariant &value)
|
||||
case kVec4: return ValueToBytesInternal<QVector4D>(value);
|
||||
case kCombo: return ValueToBytesInternal<int>(value);
|
||||
|
||||
case kVideoStreamProperties:
|
||||
case kAudioStreamProperties:
|
||||
return value.value<Stream>().toBytes();
|
||||
|
||||
case kVideoParams:
|
||||
return value.value<VideoParams>().toBytes();
|
||||
case kAudioParams:
|
||||
return value.value<AudioParams>().toBytes();
|
||||
|
||||
// These types have no persistent input
|
||||
case kNone:
|
||||
@@ -307,10 +309,10 @@ QString NodeValue::GetPrettyDataTypeName(Type type)
|
||||
return QCoreApplication::translate("NodeValue", "Vector 3D");
|
||||
case kVec4:
|
||||
return QCoreApplication::translate("NodeValue", "Vector 4D");
|
||||
case kVideoStreamProperties:
|
||||
return QCoreApplication::translate("NodeValue", "Video Stream Properties");
|
||||
case kAudioStreamProperties:
|
||||
return QCoreApplication::translate("NodeValue", "Audio Stream Properties");
|
||||
case kVideoParams:
|
||||
return QCoreApplication::translate("NodeValue", "Video Parameters");
|
||||
case kAudioParams:
|
||||
return QCoreApplication::translate("NodeValue", "Audio Parameters");
|
||||
|
||||
case kFootageJob:
|
||||
case kShaderJob:
|
||||
|
||||
+6
-6
@@ -150,18 +150,18 @@ public:
|
||||
kCombo,
|
||||
|
||||
/**
|
||||
* Properties pertaining to the video stream of a footage file
|
||||
* Video Parameters type
|
||||
*
|
||||
* Resolves to a `Stream` object.
|
||||
* Resolves to `VideoParams`
|
||||
*/
|
||||
kVideoStreamProperties,
|
||||
kVideoParams,
|
||||
|
||||
/**
|
||||
* Properties pertaining to the audio stream of a footage file
|
||||
* Audio Parameters type
|
||||
*
|
||||
* Resolves to a `Stream` object.
|
||||
* Resolves to `AudioParams`
|
||||
*/
|
||||
kAudioStreamProperties,
|
||||
kAudioParams,
|
||||
|
||||
/**
|
||||
* Job type
|
||||
|
||||
Reference in New Issue
Block a user