GNOME Bugzilla – Bug 571299
[appsink] Handoff callback API
Last modified: 2009-02-19 09:48:12 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.
Created attachment 128463 [details] [review] Patch implementing a handoff callback API
Created attachment 128471 [details] [review] Updated version of previous attachment Indentation fixed and fields moved to priv struct after receiving comments.
Created attachment 128476 [details] [review] Update fixing a potential mem leak in _set()
Created attachment 128647 [details] [review] Same as above, but with some unit tests.
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()