From f6838120ead0361463c800c25a711b799fae29ee Mon Sep 17 00:00:00 2001 From: Yoann Lopes Date: Thu, 21 Sep 2017 12:21:11 +0200 Subject: 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 --- src/gsttools/qgstvideorenderersink.cpp | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/gsttools/qgstvideorenderersink.cpp b/src/gsttools/qgstvideorenderersink.cpp index f66095a7d..4c73c26a3 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) -- cgit v1.2.3