summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorYoann Lopes <yoann.lopes@qt.io>2017-09-21 12:21:11 +0200
committerYoann Lopes <yoann.lopes@qt.io>2017-09-22 08:05:28 +0000
commitf6838120ead0361463c800c25a711b799fae29ee (patch)
treed2e784d227cc15a2d81b4abfb5f79fbe1efdbe87 /src
parent18edbfafae7ffb3271c6659da5ce4a29226aaa28 (diff)
GStreamer: fix video output stopping when the main thread is blocked
When a new frame is ready to be rendered, our gst sink waits until the frame is actually processed in the GUI thread, but never more than 300 ms. The time limit is there to avoid potential dead locks in specific situations. Before, if the wait would timeout, the sink would signal that there was an error rendering the frame, which would in turn put the pipeline in an error state and would stop processing any further frame. We now simply skip the frame if the GUI thread is blocked for too long and signal that everything went fine to the pipeline. This was already the logic in place for GStreamer 0.10 (see qvideosurfacegstsink.cpp). Task-number: QTBUG-60509 Change-Id: I5173a15340c0e2065bb2fb5ca3bc045ac84ba7e1 Reviewed-by: Christian Stromme <christian.stromme@qt.io>
Diffstat (limited to 'src')
-rw-r--r--src/gsttools/qgstvideorenderersink.cpp6
1 files changed, 2 insertions, 4 deletions
diff --git a/src/gsttools/qgstvideorenderersink.cpp b/src/gsttools/qgstvideorenderersink.cpp
index f66095a7..4c73c26a 100644
--- a/src/gsttools/qgstvideorenderersink.cpp
+++ b/src/gsttools/qgstvideorenderersink.cpp
@@ -247,13 +247,11 @@ GstFlowReturn QVideoSurfaceGstDelegate::render(GstBuffer *buffer)
m_renderReturn = GST_FLOW_OK;
m_renderBuffer = buffer;
- GstFlowReturn flowReturn = waitForAsyncEvent(&locker, &m_renderCondition, 300)
- ? m_renderReturn
- : GST_FLOW_ERROR;
+ waitForAsyncEvent(&locker, &m_renderCondition, 300);
m_renderBuffer = 0;
- return flowReturn;
+ return m_renderReturn;
}
bool QVideoSurfaceGstDelegate::event(QEvent *event)