renderer: massive overhaul to move to a vastly simplified threading system
This commit is contained in:
@@ -86,14 +86,14 @@ QString ViewerOutput::Description() const
|
||||
|
||||
void ViewerOutput::InvalidateCache(const TimeRange &range, NodeInput *from, NodeInput *source)
|
||||
{
|
||||
if (from == texture_input()) {
|
||||
emit GraphChangedFrom(from, source);
|
||||
if (from == texture_input_ || from == samples_input_) {
|
||||
emit GraphChangedFrom(source);
|
||||
|
||||
video_frame_cache_.Invalidate(range);
|
||||
} else if (from == samples_input()) {
|
||||
emit GraphChangedFrom(from, source);
|
||||
|
||||
audio_playback_cache_.Invalidate(range);
|
||||
if (from == texture_input_) {
|
||||
video_frame_cache_.Invalidate(range);
|
||||
} else {
|
||||
audio_playback_cache_.Invalidate(range);
|
||||
}
|
||||
}
|
||||
|
||||
Node::InvalidateCache(range, from, source);
|
||||
@@ -114,14 +114,14 @@ void ViewerOutput::set_video_params(const VideoParams &video)
|
||||
|
||||
emit SizeChanged(video_params_.width(), video_params_.height());
|
||||
emit TimebaseChanged(video_params_.time_base());
|
||||
emit VideoParamsChanged();
|
||||
emit ParamsChanged();
|
||||
}
|
||||
|
||||
void ViewerOutput::set_audio_params(const AudioParams &audio)
|
||||
{
|
||||
audio_params_ = audio;
|
||||
|
||||
emit AudioParamsChanged();
|
||||
emit ParamsChanged();
|
||||
}
|
||||
|
||||
rational ViewerOutput::GetLength()
|
||||
|
||||
@@ -113,7 +113,7 @@ public:
|
||||
signals:
|
||||
void TimebaseChanged(const rational&);
|
||||
|
||||
void GraphChangedFrom(NodeInput* from, NodeInput* source);
|
||||
void GraphChangedFrom(NodeInput* source);
|
||||
|
||||
void VisibleInvalidated(NodeInput* source);
|
||||
|
||||
@@ -121,8 +121,7 @@ signals:
|
||||
|
||||
void SizeChanged(int width, int height);
|
||||
|
||||
void VideoParamsChanged();
|
||||
void AudioParamsChanged();
|
||||
void ParamsChanged();
|
||||
|
||||
void BlockAdded(Block* block, TrackReference track);
|
||||
void BlockRemoved(Block* block);
|
||||
|
||||
+22
-15
@@ -24,7 +24,7 @@
|
||||
|
||||
OLIVE_NAMESPACE_ENTER
|
||||
|
||||
NodeValueDatabase NodeTraverser::GenerateDatabase(const Node* node, const TimeRange &range) const
|
||||
NodeValueDatabase NodeTraverser::GenerateDatabase(const Node* node, const TimeRange &range)
|
||||
{
|
||||
NodeValueDatabase database;
|
||||
|
||||
@@ -38,17 +38,7 @@ NodeValueDatabase NodeTraverser::GenerateDatabase(const Node* node, const TimeRa
|
||||
|
||||
TimeRange input_time = node->InputTimeAdjustment(input, range);
|
||||
|
||||
NodeValueTable table;
|
||||
|
||||
if (input->IsConnected()) {
|
||||
// Value will equal something from the connected node, follow it
|
||||
table = GenerateTable(input->get_connected_node(), range);
|
||||
} else {
|
||||
// Push onto the table the value at this time from the input
|
||||
QVariant input_value = input->get_value_at_time(range.in());
|
||||
|
||||
table.Push(input->data_type(), input_value);
|
||||
}
|
||||
NodeValueTable table = ProcessInput(input, input_time);
|
||||
|
||||
// Exception for Footage types where we actually retrieve some Footage data from a decoder
|
||||
if (input->data_type() == NodeParam::kFootage) {
|
||||
@@ -73,7 +63,24 @@ NodeValueDatabase NodeTraverser::GenerateDatabase(const Node* node, const TimeRa
|
||||
return database;
|
||||
}
|
||||
|
||||
NodeValueTable NodeTraverser::GenerateTable(const Node *n, const TimeRange& range) const
|
||||
NodeValueTable NodeTraverser::ProcessInput(NodeInput* input, const TimeRange& range)
|
||||
{
|
||||
if (input->IsConnected()) {
|
||||
// Value will equal something from the connected node, follow it
|
||||
return GenerateTable(input->get_connected_node(), range);
|
||||
} else if (!input->IsArray()) {
|
||||
// Push onto the table the value at this time from the input
|
||||
QVariant input_value = input->get_value_at_time(range.in());
|
||||
|
||||
NodeValueTable table;
|
||||
table.Push(input->data_type(), input_value);
|
||||
return table;
|
||||
}
|
||||
|
||||
return NodeValueTable();
|
||||
}
|
||||
|
||||
NodeValueTable NodeTraverser::GenerateTable(const Node *n, const TimeRange& range)
|
||||
{
|
||||
if (n->IsTrack()) {
|
||||
// If the range is not wholly contained in this Block, we'll need to do some extra processing
|
||||
@@ -93,12 +100,12 @@ NodeValueTable NodeTraverser::GenerateTable(const Node *n, const TimeRange& rang
|
||||
return table;
|
||||
}
|
||||
|
||||
NodeValueTable NodeTraverser::GenerateTable(const Node *n, const rational &in, const rational &out) const
|
||||
NodeValueTable NodeTraverser::GenerateTable(const Node *n, const rational &in, const rational &out)
|
||||
{
|
||||
return GenerateTable(n, TimeRange(in, out));
|
||||
}
|
||||
|
||||
NodeValueTable NodeTraverser::GenerateBlockTable(const TrackOutput *track, const TimeRange &range) const
|
||||
NodeValueTable NodeTraverser::GenerateBlockTable(const TrackOutput *track, const TimeRange &range)
|
||||
{
|
||||
// By default, just follow the in point
|
||||
Block* active_block = track->BlockAtTime(range.in());
|
||||
|
||||
@@ -34,20 +34,22 @@ class NodeTraverser : public CancelableObject
|
||||
public:
|
||||
NodeTraverser() = default;
|
||||
|
||||
NodeValueTable GenerateTable(const Node *n, const TimeRange &range) const;
|
||||
NodeValueTable GenerateTable(const Node *n, const rational &in, const rational& out) const;
|
||||
NodeValueTable GenerateTable(const Node *n, const TimeRange &range);
|
||||
NodeValueTable GenerateTable(const Node *n, const rational &in, const rational& out);
|
||||
|
||||
NodeValueDatabase GenerateDatabase(const Node *node, const TimeRange &range) const;
|
||||
NodeValueDatabase GenerateDatabase(const Node *node, const TimeRange &range);
|
||||
|
||||
protected:
|
||||
virtual NodeValueTable GenerateBlockTable(const TrackOutput *track, const TimeRange& range) const;
|
||||
NodeValueTable ProcessInput(NodeInput *input, const TimeRange &range);
|
||||
|
||||
virtual void FootageProcessingEvent(StreamPtr, const TimeRange&, NodeValueTable*) const {}
|
||||
virtual NodeValueTable GenerateBlockTable(const TrackOutput *track, const TimeRange& range);
|
||||
|
||||
virtual void FootageProcessingEvent(StreamPtr, const TimeRange&, NodeValueTable*) {}
|
||||
|
||||
virtual void ProcessNodeEvent(const Node*,
|
||||
const TimeRange&,
|
||||
NodeValueDatabase&,
|
||||
NodeValueTable&) const {}
|
||||
NodeValueTable&) {}
|
||||
|
||||
private:
|
||||
static StreamPtr ResolveStreamFromInput(NodeInput* input);
|
||||
|
||||
Reference in New Issue
Block a user