mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-04-26 06:54:49 +00:00
omxaudioenc: Disable output port when setting a new format
This commit is contained in:
parent
f518ce5ed9
commit
8bf902b69d
1 changed files with 10 additions and 5 deletions
|
@ -658,14 +658,24 @@ gst_omx_audio_enc_set_format (GstAudioEncoder * encoder, GstAudioInfo * info)
|
||||||
|
|
||||||
if (gst_omx_port_set_enabled (self->enc_in_port, FALSE) != OMX_ErrorNone)
|
if (gst_omx_port_set_enabled (self->enc_in_port, FALSE) != OMX_ErrorNone)
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
if (gst_omx_port_set_enabled (self->enc_out_port, FALSE) != OMX_ErrorNone)
|
||||||
|
return FALSE;
|
||||||
if (gst_omx_port_wait_buffers_released (self->enc_in_port,
|
if (gst_omx_port_wait_buffers_released (self->enc_in_port,
|
||||||
5 * GST_SECOND) != OMX_ErrorNone)
|
5 * GST_SECOND) != OMX_ErrorNone)
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
if (gst_omx_port_wait_buffers_released (self->enc_out_port,
|
||||||
|
1 * GST_SECOND) != OMX_ErrorNone)
|
||||||
|
return FALSE;
|
||||||
if (gst_omx_port_deallocate_buffers (self->enc_in_port) != OMX_ErrorNone)
|
if (gst_omx_port_deallocate_buffers (self->enc_in_port) != OMX_ErrorNone)
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
if (gst_omx_port_deallocate_buffers (self->enc_out_port) != OMX_ErrorNone)
|
||||||
|
return FALSE;
|
||||||
if (gst_omx_port_wait_enabled (self->enc_in_port,
|
if (gst_omx_port_wait_enabled (self->enc_in_port,
|
||||||
1 * GST_SECOND) != OMX_ErrorNone)
|
1 * GST_SECOND) != OMX_ErrorNone)
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
if (gst_omx_port_wait_enabled (self->enc_out_port,
|
||||||
|
1 * GST_SECOND) != OMX_ErrorNone)
|
||||||
|
return FALSE;
|
||||||
|
|
||||||
GST_DEBUG_OBJECT (self, "Encoder drained and disabled");
|
GST_DEBUG_OBJECT (self, "Encoder drained and disabled");
|
||||||
}
|
}
|
||||||
|
@ -795,11 +805,6 @@ gst_omx_audio_enc_set_format (GstAudioEncoder * encoder, GstAudioInfo * info)
|
||||||
gst_omx_port_set_flushing (self->enc_in_port, 5 * GST_SECOND, FALSE);
|
gst_omx_port_set_flushing (self->enc_in_port, 5 * GST_SECOND, FALSE);
|
||||||
gst_omx_port_set_flushing (self->enc_out_port, 5 * GST_SECOND, FALSE);
|
gst_omx_port_set_flushing (self->enc_out_port, 5 * GST_SECOND, FALSE);
|
||||||
|
|
||||||
/* Populate outport with buffers if we any */
|
|
||||||
if (!needs_disable)
|
|
||||||
if (gst_omx_port_populate (self->enc_out_port) != OMX_ErrorNone)
|
|
||||||
return FALSE;
|
|
||||||
|
|
||||||
if (gst_omx_component_get_last_error (self->enc) != OMX_ErrorNone) {
|
if (gst_omx_component_get_last_error (self->enc) != OMX_ErrorNone) {
|
||||||
GST_ERROR_OBJECT (self, "Component in error state: %s (0x%08x)",
|
GST_ERROR_OBJECT (self, "Component in error state: %s (0x%08x)",
|
||||||
gst_omx_component_get_last_error_string (self->enc),
|
gst_omx_component_get_last_error_string (self->enc),
|
||||||
|
|
Loading…
Reference in a new issue