mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-18 14:26:43 +00:00
omxvideodec: Shutdown component in PAUSED->READY and deallocate buffers
This commit is contained in:
parent
879349ba11
commit
30610a746e
1 changed files with 16 additions and 2 deletions
|
@ -283,11 +283,11 @@ gst_omx_video_dec_open (GstOMXVideoDec * self)
|
|||
}
|
||||
|
||||
static gboolean
|
||||
gst_omx_video_dec_close (GstOMXVideoDec * self)
|
||||
gst_omx_video_dec_shutdown (GstOMXVideoDec * self)
|
||||
{
|
||||
OMX_STATETYPE state;
|
||||
|
||||
GST_DEBUG_OBJECT (self, "Closing decoder");
|
||||
GST_DEBUG_OBJECT (self, "Shutting down decoder");
|
||||
|
||||
state = gst_omx_component_get_state (self->component, 0);
|
||||
if (state > OMX_StateLoaded || state == OMX_StateInvalid) {
|
||||
|
@ -302,6 +302,17 @@ gst_omx_video_dec_close (GstOMXVideoDec * self)
|
|||
gst_omx_component_get_state (self->component, 5 * GST_SECOND);
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static gboolean
|
||||
gst_omx_video_dec_close (GstOMXVideoDec * self)
|
||||
{
|
||||
GST_DEBUG_OBJECT (self, "Closing decoder");
|
||||
|
||||
if (!gst_omx_video_dec_shutdown (self))
|
||||
return FALSE;
|
||||
|
||||
self->in_port = NULL;
|
||||
self->out_port = NULL;
|
||||
if (self->component)
|
||||
|
@ -381,6 +392,9 @@ gst_omx_video_dec_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_video_dec_shutdown (self))
|
||||
ret = GST_STATE_CHANGE_FAILURE;
|
||||
break;
|
||||
case GST_STATE_CHANGE_READY_TO_NULL:
|
||||
if (!gst_omx_video_dec_close (self))
|
||||
|
|
Loading…
Reference in a new issue