QNX: Avoid reading frames faster than they're rendered

The previous code would capture frames with a 60Hz timer
into two pixmaps alternating pixmaps with each successive
frame.  Rendering was somewhat disconnected from this, if
rendering was unable to occur at 60fps, multiple frames
might be copied for each frame rendered.  This meant that
it might try copying a video frame into a pixmap that was
currently being used by the GPU with bad effects.  The
primary effect being severe flicker on i.mx6 targets.

The change is to ensure that we don't read the window data
until we're just about to make use of it.  This means we
don't ever get ahead of ourselves and read the video window
once for every frame rendered.

The code has been significantly refactored.  There is now
a class that manages the pixmaps and egl images.  This is
created on demand and the images are created and destroyed
when sizes change.  Since this all now occurs in the proper
thread, much of the nonsense of setting _q_GLThreadCallback
to arrange a call from the render thread is avoided.

Remove BlackBerry ifdefs that are no longer used.

Change-Id: I4bf5efa4c39c8170e3f55499c167ee10e521e100
Reviewed-by: James McDonnell <jmcdonnell@qnx.com>
Reviewed-by: Rafael Roquetto <rafael.roquetto@kdab.com>
This commit is contained in:
Dan Cape
2016-04-22 14:40:23 -04:00
committed by Yoann Lopes
parent 80deebcee3
commit c1cfbd98d2
5 changed files with 242 additions and 248 deletions

View File

@@ -282,16 +282,6 @@ QSGNode *QDeclarativeVideoRendererBackend::updatePaintNode(QSGNode *oldNode,
obj->event(&ev);
}
}
#if defined (Q_OS_QNX) // On QNX we need to be called back again for creating the egl images
else {
// Internal mechanism to call back the surface renderer from the QtQuick render thread
QObject *obj = m_surface->property("_q_GLThreadCallback").value<QObject*>();
if (obj) {
QEvent ev(static_cast<QEvent::Type>(QEvent::User + 1));
obj->event(&ev);
}
}
#endif
bool isFrameModified = false;
if (m_frameChanged) {