mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-02-23 14:36:24 +00:00
omxvideodec: Release the video codec stream lock before acquiring an input buffer
Otherwise the srcpad task might block on this lock and no buffers ever become available again.
This commit is contained in:
parent
17d0751887
commit
3da6d8bfa3
1 changed files with 15 additions and 2 deletions
|
@ -1446,6 +1446,11 @@ gst_omx_video_dec_finish (GstBaseVideoDecoder * decoder)
|
||||||
return GST_BASE_VIDEO_DECODER_FLOW_DROPPED;
|
return GST_BASE_VIDEO_DECODER_FLOW_DROPPED;
|
||||||
self->eos = TRUE;
|
self->eos = TRUE;
|
||||||
|
|
||||||
|
/* Make sure to release the base class stream lock, otherwise
|
||||||
|
* _loop() can't call _finish_frame() and we might block forever
|
||||||
|
* because no input buffers are released */
|
||||||
|
GST_BASE_VIDEO_CODEC_STREAM_UNLOCK (self);
|
||||||
|
|
||||||
/* Send an EOS buffer to the component and let the base
|
/* Send an EOS buffer to the component and let the base
|
||||||
* class drop the EOS event. We will send it later when
|
* class drop the EOS event. We will send it later when
|
||||||
* the EOS buffer arrives on the output port. */
|
* the EOS buffer arrives on the output port. */
|
||||||
|
@ -1455,6 +1460,8 @@ gst_omx_video_dec_finish (GstBaseVideoDecoder * decoder)
|
||||||
gst_omx_port_release_buffer (self->in_port, buf);
|
gst_omx_port_release_buffer (self->in_port, buf);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
GST_BASE_VIDEO_CODEC_STREAM_LOCK (self);
|
||||||
|
|
||||||
return GST_BASE_VIDEO_DECODER_FLOW_DROPPED;
|
return GST_BASE_VIDEO_DECODER_FLOW_DROPPED;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1474,14 +1481,20 @@ gst_omx_video_dec_drain (GstOMXVideoDec * self)
|
||||||
if (self->eos)
|
if (self->eos)
|
||||||
return GST_FLOW_OK;
|
return GST_FLOW_OK;
|
||||||
|
|
||||||
|
/* Make sure to release the base class stream lock, otherwise
|
||||||
|
* _loop() can't call _finish_frame() and we might block forever
|
||||||
|
* because no input buffers are released */
|
||||||
|
GST_BASE_VIDEO_CODEC_STREAM_UNLOCK (self);
|
||||||
|
|
||||||
/* Send an EOS buffer to the component and let the base
|
/* Send an EOS buffer to the component and let the base
|
||||||
* class drop the EOS event. We will send it later when
|
* class drop the EOS event. We will send it later when
|
||||||
* the EOS buffer arrives on the output port. */
|
* the EOS buffer arrives on the output port. */
|
||||||
acq_ret = gst_omx_port_acquire_buffer (self->in_port, &buf);
|
acq_ret = gst_omx_port_acquire_buffer (self->in_port, &buf);
|
||||||
if (acq_ret != GST_OMX_ACQUIRE_BUFFER_OK)
|
if (acq_ret != GST_OMX_ACQUIRE_BUFFER_OK) {
|
||||||
|
GST_BASE_VIDEO_CODEC_STREAM_LOCK (self);
|
||||||
return GST_FLOW_ERROR;
|
return GST_FLOW_ERROR;
|
||||||
|
}
|
||||||
|
|
||||||
GST_BASE_VIDEO_CODEC_STREAM_UNLOCK (self);
|
|
||||||
g_mutex_lock (self->drain_lock);
|
g_mutex_lock (self->drain_lock);
|
||||||
self->draining = TRUE;
|
self->draining = TRUE;
|
||||||
buf->omx_buf->nFlags |= OMX_BUFFERFLAG_EOS;
|
buf->omx_buf->nFlags |= OMX_BUFFERFLAG_EOS;
|
||||||
|
|
Loading…
Reference in a new issue