summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLev Zelenskiy <lev.zelenskiy@nokia.com>2012-02-03 13:01:38 +1000
committerQt by Nokia <qt-info@nokia.com>2012-02-06 08:56:29 +0100
commit7415e4c879e930927afae21790eede7f7c35c965 (patch)
treebf2c2b63a2e99e7c9072f83e59c084f8a7258cad
parentc0fd63d143e798203f1108824e7a7c6a3ea6e0e2 (diff)
Gst player backend: fixed prerolled frames rendering
Don't use queued render request if it's called from the object own thread. Change-Id: I61ac11f5cf68edf82d0681c95123e804869d0647 Reviewed-by: Dmytro Poplavskiy <dmytro.poplavskiy@nokia.com>
-rw-r--r--src/gsttools/qvideosurfacegstsink.cpp15
1 files changed, 9 insertions, 6 deletions
diff --git a/src/gsttools/qvideosurfacegstsink.cpp b/src/gsttools/qvideosurfacegstsink.cpp
index 8809551a..53b790ed 100644
--- a/src/gsttools/qvideosurfacegstsink.cpp
+++ b/src/gsttools/qvideosurfacegstsink.cpp
@@ -208,15 +208,18 @@ GstFlowReturn QVideoSurfaceGstDelegate::render(GstBuffer *buffer)
m_frame.setEndTime((startTime + duration)/G_GINT64_CONSTANT (1000000));
}
- QMetaObject::invokeMethod(this, "queuedRender", Qt::QueuedConnection);
+ m_renderReturn = GST_FLOW_OK;
- if (!m_renderCondition.wait(&m_mutex, 300)) {
- m_frame = QVideoFrame();
-
- return GST_FLOW_OK;
+ if (QThread::currentThread() == thread()) {
+ if (!m_surface.isNull())
+ m_surface->present(m_frame);
} else {
- return m_renderReturn;
+ QMetaObject::invokeMethod(this, "queuedRender", Qt::QueuedConnection);
+ m_renderCondition.wait(&m_mutex, 300);
}
+
+ m_frame = QVideoFrame();
+ return m_renderReturn;
}
void QVideoSurfaceGstDelegate::queuedStart()