After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 774945 - multiudpsink, dynudpsink, v4l2sink: Block in preroll_wait on unlock
multiudpsink, dynudpsink, v4l2sink: Block in preroll_wait on unlock
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gst-plugins-good
git master
Other Linux
: Normal normal
: 1.13.1
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2016-11-23 17:18 UTC by Olivier Crête
Modified: 2017-12-19 21:51 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
v4l2sink: Block in preroll_wait on unlock (1.39 KB, patch)
2016-11-23 17:19 UTC, Olivier Crête
none Details | Review
v4l2sink: Block in preroll_wait on unlock (1.18 KB, patch)
2016-11-23 19:11 UTC, Olivier Crête
committed Details | Review

Description Olivier Crête 2016-11-23 17:18:52 UTC
multiudpsink & dynudpsink need to use non blocking sockets and call gst_base_sink_wait_preroll() in the cancelled path.

v4l2sink also need to call gst_base_sink_wait_preroll() if the buffer pool was flushing..
Comment 1 Olivier Crête 2016-11-23 17:19:23 UTC
Created attachment 340624 [details] [review]
v4l2sink: Block in preroll_wait on unlock

The correct behaviour of anything stuck in the ->render() function
between ->unlock() and ->unlock_stop() is to call
gst_base_sink_wait_preroll() and only return an error if this returns an
error, otherwise, it must continue where it left off!
Comment 2 Olivier Crête 2016-11-23 17:20:06 UTC
The v4l2 patch is untested as I'd need ot rebuild the kernel with vivid or have a device with a real v4l2 output device.
Comment 3 Nicolas Dufresne (ndufresne) 2016-11-23 19:11:05 UTC
Review of attachment 340624 [details] [review]:

Remove this stylish fix, then merge, thanks !

::: sys/v4l2/gstv4l2sink.c
@@ +586,3 @@
   GST_DEBUG_OBJECT (v4l2sink, "render buffer: %p", buf);
 
+

Would it be possible to remove this empty line ?
Comment 4 Olivier Crête 2016-11-23 19:11:21 UTC
Created attachment 340636 [details] [review]
v4l2sink: Block in preroll_wait on unlock

The correct behaviour of anything stuck in the ->render() function
between ->unlock() and ->unlock_stop() is to call
gst_base_sink_wait_preroll() and only return an error if this returns an
error, otherwise, it must continue where it left off!
Comment 5 Nicolas Dufresne (ndufresne) 2017-03-18 01:14:16 UTC
Review of attachment 340636 [details] [review]:

commit 26e9f26204bff75dc26a87c6f011b5f30b04d2c8
Author: Olivier Crête <olivier.crete@collabora.com>
Date:   Wed Nov 23 12:17:55 2016 -0500

    v4l2sink: Block in preroll_wait on unlock
Comment 6 Sebastian Dröge (slomo) 2017-03-20 09:52:56 UTC
So what's left to be done here? multiudpsink, dynudpsink, anything else?
Comment 7 Nicolas Dufresne (ndufresne) 2017-03-24 00:16:25 UTC
I believe so, according to the title. Olivier, are you going to finish this work ?
Comment 8 Nicolas Dufresne (ndufresne) 2017-12-19 01:47:56 UTC
Olivier ?
Comment 9 Olivier Crête 2017-12-19 21:51:34 UTC
Fixed for multiudpsink.. And the render function of dynudpsink doesn't ever block, so no need for this in there.

commit 6ea569841d5792517ef6c7ba057d289503a13fc6 
Author: Olivier Crête <olivier.crete@collabora.com>
Date:   Tue Dec 19 16:47:52 2017 -0500

    multiudpsink: Call gst_base_sink_wait_preroll on unlock
    
    This means that packets will not be lost on fast pause/playing cycles.
    
    Also refactor the code a little to simplify it.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=774945