mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-29 21:21:12 +00:00
omxaudioenc: Shutdown component in PAUSED->READY and deallocate buffers
This commit is contained in:
parent
2408e0d33a
commit
7df465bfb3
1 changed files with 18 additions and 1 deletions
|
@ -285,11 +285,14 @@ gst_omx_audio_enc_open (GstOMXAudioEnc * self)
|
|||
return TRUE;
|
||||
}
|
||||
|
||||
|
||||
static gboolean
|
||||
gst_omx_audio_enc_close (GstOMXAudioEnc * self)
|
||||
gst_omx_audio_enc_shutdown (GstOMXAudioEnc * self)
|
||||
{
|
||||
OMX_STATETYPE state;
|
||||
|
||||
GST_DEBUG_OBJECT (self, "Shutting down encoder");
|
||||
|
||||
state = gst_omx_component_get_state (self->component, 0);
|
||||
if (state > OMX_StateLoaded || state == OMX_StateInvalid) {
|
||||
if (state > OMX_StateIdle) {
|
||||
|
@ -303,6 +306,17 @@ gst_omx_audio_enc_close (GstOMXAudioEnc * self)
|
|||
gst_omx_component_get_state (self->component, 5 * GST_SECOND);
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static gboolean
|
||||
gst_omx_audio_enc_close (GstOMXAudioEnc * self)
|
||||
{
|
||||
GST_DEBUG_OBJECT (self, "Closing encoder");
|
||||
|
||||
if (!gst_omx_audio_enc_shutdown (self))
|
||||
return FALSE;
|
||||
|
||||
self->in_port = NULL;
|
||||
self->out_port = NULL;
|
||||
if (self->component)
|
||||
|
@ -379,6 +393,9 @@ gst_omx_audio_enc_change_state (GstElement * element, GstStateChange transition)
|
|||
case GST_STATE_CHANGE_PAUSED_TO_READY:
|
||||
self->downstream_flow_ret = GST_FLOW_WRONG_STATE;
|
||||
self->started = FALSE;
|
||||
|
||||
if (!gst_omx_audio_enc_shutdown (self))
|
||||
ret = GST_STATE_CHANGE_FAILURE;
|
||||
break;
|
||||
case GST_STATE_CHANGE_READY_TO_NULL:
|
||||
if (!gst_omx_audio_enc_close (self))
|
||||
|
|
Loading…
Reference in a new issue