viewer: use internal texture to allow viewer to control texture as part of its

context

More intuitive code flow and allows the user to undock the viewer (which
forcibly destroys and recreates the context) and the viewer will handle
creation of the new texture in said new context.
This commit is contained in:
itsmattkc
2020-02-16 18:24:49 +11:00
parent 21755c7f20
commit ceb70a1870
14 changed files with 116 additions and 227 deletions
+2 -19
View File
@@ -60,21 +60,13 @@ public:
bool IsRendered(const rational& time) const;
QString GetCachedFrame(const rational& time);
VideoRenderFrameCache* frame_cache();
const VideoRenderingParams& params() const;
protected:
/**
* @brief Allocate and start the multithreaded backend
*/
virtual bool InitInternal() override;
/**
* @brief Terminate and deallocate the multithreaded backend
*/
virtual void CloseInternal() override;
struct HashTimeMapping {
rational time;
QByteArray hash;
@@ -84,8 +76,6 @@ protected:
virtual void DisconnectViewer(ViewerOutput* node) override;
const char *GetCachedFrame(const rational& time);
virtual NodeInput* GetDependentInput() override;
virtual bool CanRender() override;
@@ -101,8 +91,6 @@ protected:
virtual void ConnectWorkerToThis(RenderWorker* processor) override;
virtual void EmitCachedFrameReady(const rational &time, const QVariant& value, qint64 job_time);
virtual void InvalidateCacheInternal(const rational &start_range, const rational &end_range) override;
virtual void ParamsChangedEvent();
@@ -110,7 +98,6 @@ protected:
VideoRenderWorker::OperatingMode operating_mode_;
signals:
void CachedFrameReady(const rational& time, QVariant value, qint64 job_time);
void CachedTimeReady(const rational& time, qint64 job_time);
void RangeInvalidated(const TimeRange& range);
@@ -124,12 +111,8 @@ private:
void Requeue();
void ResizeCacheLoadBuffer();
VideoRenderingParams params_;
QByteArray cache_frame_load_buffer_;
VideoRenderFrameCache frame_cache_;
TimeRangeList invalidated_;