fixes jitters by using signals/slots to pass image buffers around
Updating values rapidly would cause strange jitters as a byproduct of the viewer trying to update from the renderer while it was still working. Rather than the viewer trying to access the the renderer, we now send textures in the initial update signal to keep everything synchronized.
This commit is contained in:
@@ -77,7 +77,8 @@ ViewerWidget::ViewerWidget(QWidget *parent) :
|
||||
|
||||
// Start background renderers
|
||||
video_renderer_ = new OpenGLBackend(this);
|
||||
connect(video_renderer_, SIGNAL(CachedFrameReady(const rational&)), this, SLOT(RendererCachedFrame(const rational&)));
|
||||
connect(video_renderer_, SIGNAL(CachedFrameReady(const rational&, QVariant)), this, SLOT(RendererCachedFrame(const rational&, QVariant)));
|
||||
connect(video_renderer_, SIGNAL(CachedTimeReady(const rational&)), this, SLOT(RendererCachedTime(const rational&)));
|
||||
audio_renderer_ = new AudioBackend(this);
|
||||
}
|
||||
|
||||
@@ -347,7 +348,14 @@ void ViewerWidget::PlaybackTimerUpdate()
|
||||
SetTime(current_time);
|
||||
}
|
||||
|
||||
void ViewerWidget::RendererCachedFrame(const rational &time)
|
||||
void ViewerWidget::RendererCachedFrame(const rational &time, QVariant value)
|
||||
{
|
||||
if (GetTime() == time) {
|
||||
SetTexture(value.value<OpenGLTexturePtr>());
|
||||
}
|
||||
}
|
||||
|
||||
void ViewerWidget::RendererCachedTime(const rational &time)
|
||||
{
|
||||
if (GetTime() == time) {
|
||||
UpdateTextureFromNode(GetTime());
|
||||
|
||||
Reference in New Issue
Block a user