From: Sebastian Dröge Date: Thu, 26 Sep 2024 12:48:54 +0000 (+0300) Subject: avviddec: Unlock video decoder stream lock temporarily while finishing frames X-Git-Tag: 1.24.9~70 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=6b18f0233900ae4ecdbcde0ce76ab55fd85286f4;p=platform%2Fupstream%2Fgstreamer.git avviddec: Unlock video decoder stream lock temporarily while finishing frames Temporarily release the video decoder stream lock so that other threads can continue decoding (e.g. call get_frame()) while data is being pushed downstream. At this point it is locked twice, we release one, and then the base class releases the last one just before pushing the data. Part-of: --- diff --git a/subprojects/gst-libav/ext/libav/gstavviddec.c b/subprojects/gst-libav/ext/libav/gstavviddec.c index fe51832d23..ab77eee67e 100644 --- a/subprojects/gst-libav/ext/libav/gstavviddec.c +++ b/subprojects/gst-libav/ext/libav/gstavviddec.c @@ -2092,9 +2092,16 @@ gst_ffmpegviddec_video_frame (GstFFMpegVidDec * ffmpegdec, GST_VIDEO_BUFFER_FLAG_TFF); } } + + /* Temporarily release the video decoder stream lock so that other + * threads can continue decoding (e.g. call get_frame()) while data + * is being pushed downstream. + */ + GST_VIDEO_DECODER_STREAM_UNLOCK (ffmpegdec); *ret = gst_video_decoder_finish_frame (GST_VIDEO_DECODER (ffmpegdec), output_frame); + GST_VIDEO_DECODER_STREAM_LOCK (ffmpegdec); beach: GST_DEBUG_OBJECT (ffmpegdec, "return flow %s, got frame: %d",