GNOME Bugzilla – Bug 520892
[dshowvideosrc] latency and shutdown improvements
Last modified: 2008-04-11 19:35:27 UTC
Please describe the problem: dshowvideosrc should drop late buffers instead of queuing them and accumulating latency. It would also be nice if it did unlocking for improved teardown. Steps to reproduce: Actual results: Expected results: Does this happen every time? Other information:
Created attachment 106740 [details] [review] dshowvideosrc_drop_late_and_support_unlock Only keep the last video-frame, and also handle unlocking. * It's not a good idea to keep frames in a GAsyncQueue if the streaming thread doesn't read fast enough. For instance if the thread gets starved it could end up lagging behind by n frames and thus accumulating latency. * Remaining GstBuffers on the queue weren't unreffed on teardown. * Another issue was that there wasn't any unblocking implemented for the call to g_async_queue_pop() in create() if the queue was drained at the point when the capture was stopped.
Hi, how can I update the files? I made a fix there: http://bugzilla.gnome.org/show_bug.cgi?id=517203 thx
ok forgot my question lol, mistake
Committed, thanks: 2008-04-11 Tim-Philipp Müller <tim at centricular dot net> Patch by: Ole André Vadla Ravnås <ole.andre.ravnas at tandberg com> * sys/dshowsrcwrapper/gstdshowvideosrc.c: (PROP_DEVICE_NAME), (gst_dshowvideosrc_class_init), (gst_dshowvideosrc_init), (gst_dshowvideosrc_dispose), (gst_dshowvideosrc_stop), (gst_dshowvideosrc_unlock), (gst_dshowvideosrc_unlock_stop), (gst_dshowvideosrc_create), (gst_dshowvideosrc_push_buffer): * sys/dshowsrcwrapper/gstdshowvideosrc.h: Don't increase latency by queuing buffers in an async queue when the streaming thread can't keep up or isn't scheduled often enough for some other reason, but just drop the previous buffer in that case. Also implement GstBaseSrc::unlock for faster unlocking when shutting down. (#520892). FWIW, the GST_CAT_{LOG|DEBUG|ERROR|*} statements could use a bit of cleaning up - the _CAT part and argument is not required at all, the #define GST_CAT_DEFAULT dshowvideosrc_debug takes care of that already.