revised video renderer's invalidate cache to use ranges rather than discrete
frames Previously, when the video renderer received a dirty cache signal, it would proceed to extract all frames from the range and queue them. However, this could be extremely slow for long ranges since it had to iterate through the entire range and calculate the individual frames it contained. Now, we use the same range combining system as audio and automatically calculate the next frame within the range only when necessary. Essentially the same work, but split up over time and done only when needed leading to no discernible UI pause when invalidating cache.
This commit is contained in:
@@ -30,7 +30,7 @@ public:
|
||||
ViewerOutput* viewer_node() const;
|
||||
|
||||
public slots:
|
||||
virtual void InvalidateCache(const rational &start_range, const rational &end_range);
|
||||
void InvalidateCache(const rational &start_range, const rational &end_range);
|
||||
|
||||
bool Compile();
|
||||
|
||||
@@ -52,6 +52,8 @@ protected:
|
||||
|
||||
virtual bool CanRender();
|
||||
|
||||
virtual TimeRange PopNextFrameFromQueue();
|
||||
|
||||
rational GetSequenceLength();
|
||||
|
||||
const QVector<QThread*>& threads();
|
||||
@@ -98,6 +100,9 @@ protected:
|
||||
|
||||
QHash<TimeRange, qint64> render_job_info_;
|
||||
|
||||
protected slots:
|
||||
void QueueRecompile();
|
||||
|
||||
private:
|
||||
bool AllProcessorsAreAvailable() const;
|
||||
|
||||
@@ -136,9 +141,6 @@ private:
|
||||
|
||||
QVector<bool> processor_busy_state_;
|
||||
|
||||
private slots:
|
||||
void QueueRecompile();
|
||||
|
||||
};
|
||||
|
||||
#endif // RENDERBACKEND_H
|
||||
|
||||
Reference in New Issue
Block a user