omx: Flush and stop srcpad when configuring new caps

This commit is contained in:
Sebastian Dröge 2013-03-08 15:11:27 +01:00
parent 716adfa5be
commit c014b1c9a3
3 changed files with 6 additions and 0 deletions

View file

@ -633,6 +633,8 @@ gst_omx_audio_enc_set_format (GstAudioEncoder * encoder, GstAudioInfo * info)
if (needs_disable) {
GST_DEBUG_OBJECT (self, "Need to disable and drain encoder");
gst_omx_audio_enc_drain (self);
gst_omx_port_set_flushing (self->enc_out_port, 5 * GST_SECOND, TRUE);
gst_pad_stop_task (GST_AUDIO_ENCODER_SRC_PAD (encoder));
if (gst_omx_port_set_enabled (self->enc_in_port, FALSE) != OMX_ErrorNone)
return FALSE;

View file

@ -1982,6 +1982,8 @@ gst_omx_video_dec_set_format (GstVideoDecoder * decoder,
GST_DEBUG_OBJECT (self, "Need to disable and drain decoder");
gst_omx_video_dec_drain (self, FALSE);
gst_omx_port_set_flushing (self->dec_out_port, 5 * GST_SECOND, TRUE);
gst_pad_stop_task (GST_VIDEO_DECODER_SRC_PAD (decoder));
if (klass->cdata.hacks & GST_OMX_HACK_NO_COMPONENT_RECONFIGURE) {
GST_VIDEO_DECODER_STREAM_UNLOCK (self);

View file

@ -1101,6 +1101,8 @@ gst_omx_video_enc_set_format (GstVideoEncoder * encoder,
if (needs_disable) {
GST_DEBUG_OBJECT (self, "Need to disable and drain encoder");
gst_omx_video_enc_drain (self, FALSE);
gst_omx_port_set_flushing (self->enc_out_port, 5 * GST_SECOND, TRUE);
gst_pad_stop_task (GST_VIDEO_ENCODER_SRC_PAD (encoder));
if (gst_omx_port_set_enabled (self->enc_in_port, FALSE) != OMX_ErrorNone)
return FALSE;