nodes are given a time range

This commit is contained in:
itsmattkc
2019-10-22 14:58:06 +11:00
parent 9da5e7c9be
commit 5f86b9b9c7
32 changed files with 110 additions and 77 deletions
+7 -5
View File
@@ -129,8 +129,10 @@ void MediaInput::Hash(QCryptographicHash *hash, NodeOutput *from, const rational
}
}
QVariant MediaInput::Value(NodeOutput *output, const rational &time)
QVariant MediaInput::Value(NodeOutput *output, const rational &in, const rational &out)
{
Q_UNUSED(out)
// FIXME: Hardcoded value
bool alpha_is_associated = false;
@@ -149,12 +151,12 @@ QVariant MediaInput::Value(NodeOutput *output, const rational &time)
}
// Check if we need to get a frame or not
if (frame_ == nullptr || frame_->native_timestamp() != decoder_->GetTimestampFromTime(time)) {
if (frame_ == nullptr || frame_->native_timestamp() != decoder_->GetTimestampFromTime(in)) {
// Get frame from Decoder
frame_ = decoder_->Retrieve(time);
frame_ = decoder_->Retrieve(in);
if (frame_ == nullptr) {
qDebug() << "Received a null frame while time was" << time.toDouble();
qDebug() << "Received a null frame while time was" << in.toDouble();
return 0;
}
@@ -261,7 +263,7 @@ QVariant MediaInput::Value(NodeOutput *output, const rational &time)
2.0f / static_cast<float>(renderer->height() * renderer->divider()));
// Multiply by input transformation
transform *= matrix_input_->get_value(time).value<QMatrix4x4>();
transform *= matrix_input_->get_value(in).value<QMatrix4x4>();
// Scale texture to the media size
transform.scale(static_cast<float>(frame_->width()), static_cast<float>(frame_->height()));
+1 -1
View File
@@ -55,7 +55,7 @@ public:
virtual void Hash(QCryptographicHash *hash, NodeOutput* from, const rational &time) override;
protected:
virtual QVariant Value(NodeOutput* output, const rational& time) override;
virtual QVariant Value(NodeOutput* output, const rational& in, const rational& out) override;
private:
bool SetupDecoder();