mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-07-20 13:28:21 +00:00
v4l2videodec: Handle flush while in start_streaming
We need to handle the case where a flush occure while the streaming thread is being brought up. In this case, the flushing state of the poll object is cleared. To solve this, we simply set the capture poll to flushing again, this way we know the thread will exit. The decoder streamlock is used to synchronize with handle frame.
This commit is contained in:
parent
58716e054f
commit
7df99f7469
|
@ -263,8 +263,10 @@ gst_v4l2_video_dec_flush (GstVideoDecoder * decoder)
|
|||
|
||||
/* Wait for capture thread to stop */
|
||||
GST_VIDEO_DECODER_STREAM_UNLOCK (decoder);
|
||||
gst_v4l2_object_unlock (self->v4l2capture);
|
||||
gst_pad_stop_task (decoder->srcpad);
|
||||
GST_VIDEO_DECODER_STREAM_LOCK (decoder);
|
||||
|
||||
self->output_flow = GST_FLOW_OK;
|
||||
|
||||
if (self->v4l2output->pool)
|
||||
|
@ -309,7 +311,7 @@ gst_v4l2_video_dec_finish (GstVideoDecoder * decoder)
|
|||
GST_VIDEO_DECODER_STREAM_LOCK (decoder);
|
||||
|
||||
/* Ensure the processing thread has stopped */
|
||||
if (self->processing) {
|
||||
if (g_atomic_int_get (&self->processing)) {
|
||||
gst_v4l2_object_unlock (self->v4l2capture);
|
||||
gst_pad_stop_task (decoder->srcpad);
|
||||
g_assert (g_atomic_int_get (&self->processing) == FALSE);
|
||||
|
|
Loading…
Reference in a new issue