From 0a4e222e60a68be3c427b370630e205ba407599a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20Dr=C3=B6ge?= Date: Thu, 10 Nov 2011 15:17:56 +0100 Subject: [PATCH] omxvideoenc: Make srcpad caps setting threadsafe --- omx/gstomxvideoenc.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/omx/gstomxvideoenc.c b/omx/gstomxvideoenc.c index ee4a9d2eb6..f91e87deda 100644 --- a/omx/gstomxvideoenc.c +++ b/omx/gstomxvideoenc.c @@ -727,12 +727,15 @@ gst_omx_video_enc_loop (GstOMXVideoEnc * self) GstVideoState *state = &GST_BASE_VIDEO_CODEC (self)->state; GstCaps *caps; + GST_BASE_VIDEO_CODEC_STREAM_LOCK (self); + GST_DEBUG_OBJECT (self, "Port settings have changed, updating caps"); caps = klass->get_caps (self, self->out_port, state); if (!caps) { if (buf) gst_omx_port_release_buffer (self->out_port, buf); + GST_BASE_VIDEO_CODEC_STREAM_UNLOCK (self); goto caps_failed; } @@ -740,10 +743,13 @@ gst_omx_video_enc_loop (GstOMXVideoEnc * self) gst_caps_unref (caps); if (buf) gst_omx_port_release_buffer (self->out_port, buf); + GST_BASE_VIDEO_CODEC_STREAM_UNLOCK (self); goto caps_failed; } gst_caps_unref (caps); + GST_BASE_VIDEO_CODEC_STREAM_UNLOCK (self); + /* Now get a buffer */ if (acq_return != GST_OMX_ACQUIRE_BUFFER_OK) return;