omxvideoenc: Make srcpad caps setting threadsafe

This commit is contained in:
Sebastian Dröge 2011-11-10 15:17:56 +01:00
parent 30d2f970f9
commit 0a4e222e60

View file

@ -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;