summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSebastian Dröge <sebastian@centricular.com>2024-09-26 15:48:54 +0300
committerGStreamer Marge Bot <gitlab-merge-bot@gstreamer-foundation.org>2024-09-29 12:55:10 +0000
commit90728a116682563a91275e8d870335c4830a113b (patch)
tree9e5ff381d5c296aa1404e08548309878b2914372
parentbbd3d6f4f671432920cec2a3e4ea424bb3cee1b1 (diff)
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: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/7576>
-rw-r--r--subprojects/gst-libav/ext/libav/gstavviddec.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/subprojects/gst-libav/ext/libav/gstavviddec.c b/subprojects/gst-libav/ext/libav/gstavviddec.c
index c0899c058c..016b2f2740 100644
--- a/subprojects/gst-libav/ext/libav/gstavviddec.c
+++ b/subprojects/gst-libav/ext/libav/gstavviddec.c
@@ -2146,9 +2146,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",