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 571299 - [appsink] Handoff callback API
[appsink] Handoff callback API
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gst-plugins-base
git master
Other All
: Normal enhancement
: 0.10.23
Assigned To: Wim Taymans
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2009-02-11 12:49 UTC by Martin Samuelsson
Modified: 2009-02-19 09:48 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Patch implementing a handoff callback API (3.64 KB, patch)
2009-02-11 12:52 UTC, Martin Samuelsson
none Details | Review
Updated version of previous attachment (3.59 KB, patch)
2009-02-11 15:28 UTC, Martin Samuelsson
none Details | Review
Update fixing a potential mem leak in _set() (3.87 KB, patch)
2009-02-11 16:16 UTC, Martin Samuelsson
none Details | Review
Same as above, but with some unit tests. (10.26 KB, patch)
2009-02-13 16:00 UTC, Martin Samuelsson
committed Details | Review

Description Martin Samuelsson 2009-02-11 12:49:34 UTC
Using the new-buffer signal has a substantial impact on performance when having streams with new buffers every 30th millisecond. The second possibility, polling for new buffers is not always desired. Having the render function run a callback, adds a third way to use appsink and can be used where the two others are not suitable. This makes appsink more flexible, as the documentation statement: "Appsink is a sink plugin that supports many different methods for making the application get a handle on the GStreamer data in a pipeline." suggests it should be.

The attached patch implements such a callback with addition of a set function to the API.
Comment 1 Martin Samuelsson 2009-02-11 12:52:54 UTC
Created attachment 128463 [details] [review]
Patch implementing a handoff callback API
Comment 2 Martin Samuelsson 2009-02-11 15:28:33 UTC
Created attachment 128471 [details] [review]
Updated version of previous attachment

Indentation fixed and fields moved to priv struct after receiving comments.
Comment 3 Martin Samuelsson 2009-02-11 16:16:13 UTC
Created attachment 128476 [details] [review]
Update fixing a potential mem leak in _set()
Comment 4 Martin Samuelsson 2009-02-13 16:00:42 UTC
Created attachment 128647 [details] [review]
Same as above, but with some unit tests.
Comment 5 Wim Taymans 2009-02-19 09:48:12 UTC
I modified the patch a little to make it work with the other signals too.

commit e5d8551552b7ef02b686f300efd373bd38f294df
Author: Wim Taymans <wim.taymans@collabora.co.uk>
Date:   Thu Feb 19 10:44:31 2009 +0100

    Add method to install callbacks on appsink
    
    Based on pacth by Martin Samuelsson <martin dot samuelsson at axis dot com>
    Fixes #571299.
    
    Add gst_app_sink_set_callbacks() to install a set of callbacks. This is a more
    performant alternative to connecting to the signals.
    
    Add a unit test for appsink.
    
    Clean up some of the appsink docs.
    
    API: GstAppSink::gst_app_sink_set_callbacks()