mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-18 22:36:33 +00:00
omxvideodec: Only flush the component ports after we passed input to them
This commit is contained in:
parent
252624c7cc
commit
961445aa1b
2 changed files with 15 additions and 7 deletions
|
@ -233,6 +233,7 @@ gst_omx_video_dec_open (GstOMXVideoDec * self)
|
||||||
self->component =
|
self->component =
|
||||||
gst_omx_component_new (GST_OBJECT_CAST (self), klass->core_name,
|
gst_omx_component_new (GST_OBJECT_CAST (self), klass->core_name,
|
||||||
klass->component_name, klass->component_role);
|
klass->component_name, klass->component_role);
|
||||||
|
self->started = FALSE;
|
||||||
|
|
||||||
if (!self->component)
|
if (!self->component)
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
@ -780,6 +781,7 @@ gst_omx_video_dec_reset (GstBaseVideoDecoder * decoder)
|
||||||
GST_BASE_VIDEO_CODEC (self)->frames = NULL;
|
GST_BASE_VIDEO_CODEC (self)->frames = NULL;
|
||||||
GST_OBJECT_UNLOCK (self);
|
GST_OBJECT_UNLOCK (self);
|
||||||
|
|
||||||
|
if (self->started) {
|
||||||
gst_omx_port_set_flushing (self->in_port, TRUE);
|
gst_omx_port_set_flushing (self->in_port, TRUE);
|
||||||
gst_omx_port_set_flushing (self->out_port, TRUE);
|
gst_omx_port_set_flushing (self->out_port, TRUE);
|
||||||
|
|
||||||
|
@ -789,6 +791,7 @@ gst_omx_video_dec_reset (GstBaseVideoDecoder * decoder)
|
||||||
|
|
||||||
gst_omx_port_set_flushing (self->in_port, FALSE);
|
gst_omx_port_set_flushing (self->in_port, FALSE);
|
||||||
gst_omx_port_set_flushing (self->out_port, FALSE);
|
gst_omx_port_set_flushing (self->out_port, FALSE);
|
||||||
|
}
|
||||||
|
|
||||||
/* Start the srcpad loop again */
|
/* Start the srcpad loop again */
|
||||||
gst_pad_start_task (GST_BASE_VIDEO_CODEC_SRC_PAD (self),
|
gst_pad_start_task (GST_BASE_VIDEO_CODEC_SRC_PAD (self),
|
||||||
|
@ -853,6 +856,7 @@ gst_omx_video_dec_handle_frame (GstBaseVideoDecoder * decoder,
|
||||||
memcpy (buf->omx_buf->pBuffer + buf->omx_buf->nOffset,
|
memcpy (buf->omx_buf->pBuffer + buf->omx_buf->nOffset,
|
||||||
GST_BUFFER_DATA (codec_data), GST_BUFFER_SIZE (codec_data));
|
GST_BUFFER_DATA (codec_data), GST_BUFFER_SIZE (codec_data));
|
||||||
|
|
||||||
|
self->started = TRUE;
|
||||||
gst_omx_port_release_buffer (self->in_port, buf);
|
gst_omx_port_release_buffer (self->in_port, buf);
|
||||||
gst_buffer_replace (&self->codec_data, NULL);
|
gst_buffer_replace (&self->codec_data, NULL);
|
||||||
/* Acquire new buffer for the actual frame */
|
/* Acquire new buffer for the actual frame */
|
||||||
|
@ -909,6 +913,7 @@ gst_omx_video_dec_handle_frame (GstBaseVideoDecoder * decoder,
|
||||||
*/
|
*/
|
||||||
|
|
||||||
offset += buf->omx_buf->nFilledLen;
|
offset += buf->omx_buf->nFilledLen;
|
||||||
|
self->started = TRUE;
|
||||||
gst_omx_port_release_buffer (self->in_port, buf);
|
gst_omx_port_release_buffer (self->in_port, buf);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -55,6 +55,9 @@ struct _GstOMXVideoDec
|
||||||
|
|
||||||
/* < private > */
|
/* < private > */
|
||||||
GstBuffer *codec_data;
|
GstBuffer *codec_data;
|
||||||
|
/* TRUE if the component is configured and saw
|
||||||
|
* the first buffer */
|
||||||
|
gboolean started;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct _GstOMXVideoDecClass
|
struct _GstOMXVideoDecClass
|
||||||
|
|
Loading…
Reference in a new issue