mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-04-26 06:54:49 +00:00
v4l2videodec: Handle early task stop
This commit is contained in:
parent
a65ab6378d
commit
3acbd9cb99
1 changed files with 16 additions and 1 deletions
|
@ -418,6 +418,20 @@ beach:
|
||||||
gst_pad_pause_task (decoder->srcpad);
|
gst_pad_pause_task (decoder->srcpad);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
gst_v4l2_video_dec_loop_stopped (GstV4l2VideoDec * self)
|
||||||
|
{
|
||||||
|
/* When flushing, decoding thread may never run */
|
||||||
|
if (g_atomic_int_get (&self->processing)) {
|
||||||
|
GST_DEBUG_OBJECT (self, "Early stop of decoding thread");
|
||||||
|
self->output_flow = GST_FLOW_FLUSHING;
|
||||||
|
g_atomic_int_set (&self->processing, FALSE);
|
||||||
|
}
|
||||||
|
|
||||||
|
GST_DEBUG_OBJECT (self, "Decoding task destroyed: %s",
|
||||||
|
gst_flow_get_name (self->output_flow));
|
||||||
|
}
|
||||||
|
|
||||||
static GstFlowReturn
|
static GstFlowReturn
|
||||||
gst_v4l2_video_dec_handle_frame (GstVideoDecoder * decoder,
|
gst_v4l2_video_dec_handle_frame (GstVideoDecoder * decoder,
|
||||||
GstVideoCodecFrame * frame)
|
GstVideoCodecFrame * frame)
|
||||||
|
@ -517,7 +531,8 @@ gst_v4l2_video_dec_handle_frame (GstVideoDecoder * decoder,
|
||||||
* processing to unlock input if draining, or prevent potential block */
|
* processing to unlock input if draining, or prevent potential block */
|
||||||
g_atomic_int_set (&self->processing, TRUE);
|
g_atomic_int_set (&self->processing, TRUE);
|
||||||
if (!gst_pad_start_task (decoder->srcpad,
|
if (!gst_pad_start_task (decoder->srcpad,
|
||||||
(GstTaskFunction) gst_v4l2_video_dec_loop, self, NULL))
|
(GstTaskFunction) gst_v4l2_video_dec_loop, self,
|
||||||
|
(GDestroyNotify) gst_v4l2_video_dec_loop_stopped))
|
||||||
goto start_task_failed;
|
goto start_task_failed;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue