fixed viewer flicker when rapidly changing parameters

This commit is contained in:
itsmattkc
2019-09-08 22:50:04 +10:00
parent d700f89f57
commit 6fcfd01c8f
8 changed files with 102 additions and 44 deletions
@@ -13,30 +13,35 @@ public:
const olive::PixelFormat& format,
const olive::RenderMode& mode);
void Queue(RenderTexturePtr texture, const QString &fn, const rational &time);
void Queue(RenderTexturePtr texture, const QString &fn, const rational &time, const QByteArray &hash);
public slots:
virtual void Cancel() override;
signals:
void Downloaded(const rational& time);
void Downloaded(const rational& time, const QByteArray& hash);
protected:
virtual void ProcessLoop() override;
private:
struct DownloadQueueEntry {
RenderTexturePtr texture;
QString filename;
rational time;
QByteArray hash;
};
GLuint read_buffer_;
QVector<RenderTexturePtr> texture_queue_;
QVector<QString> download_filenames_;
QVector<rational> texture_times_;
QVector<DownloadQueueEntry> texture_queue_;
QMutex texture_queue_lock_;
QAtomicInt cancelled_;
QByteArray hash_;
};
using RendererDownloadThreadPtr = std::shared_ptr<RendererDownloadThread>;