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 734342 - pad: allow probes to remove the data item whilst returning PROBE_OK
pad: allow probes to remove the data item whilst returning PROBE_OK
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gstreamer (core)
git master
Other Linux
: Normal normal
: 1.5.1
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2014-08-06 09:41 UTC by Tim-Philipp Müller
Modified: 2015-04-02 23:12 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
pad: allow probes to remove the data item whilst returning PROBE_OK (5.22 KB, patch)
2014-08-06 09:41 UTC, Tim-Philipp Müller
committed Details | Review

Description Tim-Philipp Müller 2014-08-06 09:41:18 UTC
Created attachment 282644 [details] [review]
pad: allow probes to remove the data item whilst returning PROBE_OK

If we just replace the data item in a probe info structure with NULL without returning PROBE_DROP, GStreamer ends up sending a NULL buffer/event to the next element. Arguably this should work, and unfortunately the ProbeReturn isn't a flag but a simple enum.

    Use case: we want to block the source pad of a leaky queue and
    drop the buffer that causes the block. If we return PROBE_DROP
    then the buffer gets dropped, but we get called again. If we
    return PROBE_OK we can't easily drop the buffer. If we just
    replace the item into the GstPadProbeInfo structure with NULL,
    GStreamer will push a NULL buffer to the next element when we
    unblock the pad probe. This patch ensures it doesn't do that.
Comment 1 Nicolas Dufresne (ndufresne) 2015-04-02 21:20:28 UTC
Ping.
Comment 2 Tim-Philipp Müller 2015-04-02 23:11:52 UTC
Thanks, thought I'd pushed that ages ago.

commit 5deb4f658e1673c38364fc6277a4e26df5a60609
Author: Tim-Philipp Müller <tim@centricular.com>
Date:   Wed Aug 6 10:32:39 2014 +0100

    pad: allow probes to remove the data item whilst returning PROBE_OK
    
    Use case: we want to block the source pad of a leaky queue and
    drop the buffer that causes the block. If we return PROBE_DROP
    then the buffer gets dropped, but we get called again. If we
    return PROBE_OK we can't easily drop the buffer. If we just
    replace the item into the GstPadProbeInfo structure with NULL,
    GStreamer will push a NULL buffer to the next element when we
    unblock the pad probe. This patch ensures it doesn't do that.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=734342