connect length to viewer node for now
This commit is contained in:
@@ -24,9 +24,13 @@ ViewerOutput::ViewerOutput() :
|
||||
viewer_width_(0),
|
||||
viewer_height_(0)
|
||||
{
|
||||
texture_input_ = new NodeInput("tex_out");
|
||||
texture_input_ = new NodeInput("tex_in");
|
||||
texture_input_->add_data_input(NodeInput::kTexture);
|
||||
AddParameter(texture_input_);
|
||||
|
||||
length_input_ = new NodeInput("length_in");
|
||||
length_input_->add_data_input(NodeInput::kRational);
|
||||
AddParameter(length_input_);
|
||||
}
|
||||
|
||||
QString ViewerOutput::Name()
|
||||
@@ -66,6 +70,11 @@ NodeInput *ViewerOutput::texture_input()
|
||||
return texture_input_;
|
||||
}
|
||||
|
||||
NodeInput *ViewerOutput::length_input()
|
||||
{
|
||||
return length_input_;
|
||||
}
|
||||
|
||||
RenderTexturePtr ViewerOutput::GetTexture(const rational &time)
|
||||
{
|
||||
return texture_input_->get_value(time).value<RenderTexturePtr>();
|
||||
@@ -98,6 +107,11 @@ const int &ViewerOutput::ViewerHeight()
|
||||
return viewer_height_;
|
||||
}
|
||||
|
||||
rational ViewerOutput::Length()
|
||||
{
|
||||
return length_input_->get_value(0).value<rational>();
|
||||
}
|
||||
|
||||
QVariant ViewerOutput::Value(NodeOutput *output, const rational &time)
|
||||
{
|
||||
Q_UNUSED(output)
|
||||
|
||||
@@ -44,6 +44,7 @@ public:
|
||||
void SetTimebase(const rational& timebase);
|
||||
|
||||
NodeInput* texture_input();
|
||||
NodeInput* length_input();
|
||||
|
||||
RenderTexturePtr GetTexture(const rational& time);
|
||||
|
||||
@@ -54,6 +55,8 @@ public:
|
||||
const int& ViewerWidth();
|
||||
const int& ViewerHeight();
|
||||
|
||||
rational Length();
|
||||
|
||||
signals:
|
||||
void TimebaseChanged(const rational&);
|
||||
|
||||
@@ -67,6 +70,8 @@ protected:
|
||||
private:
|
||||
NodeInput* texture_input_;
|
||||
|
||||
NodeInput* length_input_;
|
||||
|
||||
rational timebase_;
|
||||
|
||||
int viewer_width_;
|
||||
|
||||
@@ -75,6 +75,9 @@ void Sequence::add_default_nodes()
|
||||
// Connect track to viewer
|
||||
NodeParam::ConnectEdge(video_track_output_->texture_output(), viewer_output_->texture_input());
|
||||
|
||||
// Connect timeline length to viewer
|
||||
NodeParam::ConnectEdge(timeline_output_->length_output(), viewer_output_->length_input());
|
||||
|
||||
// Connect track to timeline
|
||||
NodeParam::ConnectEdge(video_track_output_->track_output(), timeline_output_->track_input(kTrackTypeVideo));
|
||||
NodeParam::ConnectEdge(audio_track_output_->track_output(), timeline_output_->track_input(kTrackTypeAudio));
|
||||
|
||||
@@ -69,10 +69,7 @@ void VideoRendererProcessor::InvalidateCache(const rational &start_range, const
|
||||
|
||||
// Adjust range to min/max values
|
||||
rational start_range_adj = qMax(rational(0), start_range);
|
||||
|
||||
// FIXME: Needs real length value
|
||||
//rational end_range_adj = qMin(length_input()->get_value(0).value<rational>(), end_range);
|
||||
rational end_range_adj = qMin(rational(60), end_range);
|
||||
rational end_range_adj = qMin(viewer_node_->Length(), end_range);
|
||||
|
||||
qDebug() << "Cache invalidated between"
|
||||
<< start_range_adj.toDouble()
|
||||
|
||||
Reference in New Issue
Block a user