mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-19 23:06:49 +00:00
omxaudioenc: Implement hack for not disabling the output port after set_format until the output format is known
Needed on some OMX implementations, e.g. the one from Atmel. It does not send the settings-changed event on the output port if it is disabled.
This commit is contained in:
parent
40869afea7
commit
2c3797acfe
1 changed files with 36 additions and 11 deletions
|
@ -783,26 +783,51 @@ gst_omx_audio_enc_set_format (GstAudioEncoder * encoder, GstAudioInfo * info)
|
||||||
return FALSE;
|
return FALSE;
|
||||||
if (gst_omx_port_allocate_buffers (self->enc_in_port) != OMX_ErrorNone)
|
if (gst_omx_port_allocate_buffers (self->enc_in_port) != OMX_ErrorNone)
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
|
||||||
|
if ((klass->cdata.hacks & GST_OMX_HACK_NO_DISABLE_OUTPORT)) {
|
||||||
|
if (gst_omx_port_set_enabled (self->enc_out_port, TRUE) != OMX_ErrorNone)
|
||||||
|
return FALSE;
|
||||||
|
if (gst_omx_port_allocate_buffers (self->enc_out_port) != OMX_ErrorNone)
|
||||||
|
return FALSE;
|
||||||
|
|
||||||
|
if (gst_omx_port_wait_enabled (self->enc_out_port,
|
||||||
|
5 * GST_SECOND) != OMX_ErrorNone)
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
if (gst_omx_port_wait_enabled (self->enc_in_port,
|
if (gst_omx_port_wait_enabled (self->enc_in_port,
|
||||||
5 * GST_SECOND) != OMX_ErrorNone)
|
5 * GST_SECOND) != OMX_ErrorNone)
|
||||||
return FALSE;
|
return FALSE;
|
||||||
if (gst_omx_port_mark_reconfigured (self->enc_in_port) != OMX_ErrorNone)
|
if (gst_omx_port_mark_reconfigured (self->enc_in_port) != OMX_ErrorNone)
|
||||||
return FALSE;
|
return FALSE;
|
||||||
} else {
|
} else {
|
||||||
/* Disable output port */
|
if (!(klass->cdata.hacks & GST_OMX_HACK_NO_DISABLE_OUTPORT)) {
|
||||||
if (gst_omx_port_set_enabled (self->enc_out_port, FALSE) != OMX_ErrorNone)
|
/* Disable output port */
|
||||||
return FALSE;
|
if (gst_omx_port_set_enabled (self->enc_out_port, FALSE) != OMX_ErrorNone)
|
||||||
|
return FALSE;
|
||||||
|
|
||||||
if (gst_omx_port_wait_enabled (self->enc_out_port,
|
if (gst_omx_port_wait_enabled (self->enc_out_port,
|
||||||
1 * GST_SECOND) != OMX_ErrorNone)
|
1 * GST_SECOND) != OMX_ErrorNone)
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
|
||||||
if (gst_omx_component_set_state (self->enc, OMX_StateIdle) != OMX_ErrorNone)
|
if (gst_omx_component_set_state (self->enc,
|
||||||
return FALSE;
|
OMX_StateIdle) != OMX_ErrorNone)
|
||||||
|
return FALSE;
|
||||||
|
|
||||||
/* Need to allocate buffers to reach Idle state */
|
/* Need to allocate buffers to reach Idle state */
|
||||||
if (gst_omx_port_allocate_buffers (self->enc_in_port) != OMX_ErrorNone)
|
if (gst_omx_port_allocate_buffers (self->enc_in_port) != OMX_ErrorNone)
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
} else {
|
||||||
|
if (gst_omx_component_set_state (self->enc,
|
||||||
|
OMX_StateIdle) != OMX_ErrorNone)
|
||||||
|
return FALSE;
|
||||||
|
|
||||||
|
/* Need to allocate buffers to reach Idle state */
|
||||||
|
if (gst_omx_port_allocate_buffers (self->enc_in_port) != OMX_ErrorNone)
|
||||||
|
return FALSE;
|
||||||
|
if (gst_omx_port_allocate_buffers (self->enc_out_port) != OMX_ErrorNone)
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
if (gst_omx_component_get_state (self->enc,
|
if (gst_omx_component_get_state (self->enc,
|
||||||
GST_CLOCK_TIME_NONE) != OMX_StateIdle)
|
GST_CLOCK_TIME_NONE) != OMX_StateIdle)
|
||||||
|
|
Loading…
Reference in a new issue