[Bug 733864] v4l2videodec: Implement EOS handling through V4L2_DEC_CMD_STOP

GStreamer (GNOME Bugzilla) bugzilla at gnome.org
Fri May 20 14:22:15 UTC 2016


https://bugzilla.gnome.org/show_bug.cgi?id=733864

--- Comment #25 from Philipp Zabel <p.zabel at pengutronix.de> ---
I don't think I used the wrong lock. The GST_TASK_WAIT expands to
g_cond_wait(GST_TASK_GET_COND (task, GST_OBJECT_GET_LOCK (task)), so
g_cond_wait first tries to unlock the object lock, which is what protects
task->running and task->state.

Also I think spinning on (task->running) won't terminate because
gst_v4l2_video_dec_loop() only calls gst_pad_pause_task(). gst_pad_task_stop()
is called from gst_v4l2_video_dec_finish() right after this code.

How about this instead:

    GstTask *task = decoder->srcpad->task;

    /* If the decoder stop command succeeded, just wait until processing is
     * finished */
    GST_OBJECT_LOCK (task);
    while (GST_TASK_STATE (task) == GST_TASK_STARTED)
      GST_TASK_WAIT (task);
    GST_OBJECT_UNLOCK (task);

Or should the beach: label in gst_v4l2_video_dec_loop() be changed to call
gst_pad_task_stop() if ret == GST_FLOW_EOS?

-- 
You are receiving this mail because:
You are the QA Contact for the bug.
You are the assignee for the bug.


More information about the gstreamer-bugs mailing list