[gst-devel] Please, give an example of an action signal usage.

Stefan Kost ensonic at hora-obscura.de
Fri Apr 2 09:21:03 CEST 2010


Am 01.04.2010 18:11, schrieb wl2776:
> 
> Documentation says, that I can freely emit such signals on live instances
> without need of extra pre- and post processing. "They can also be thought of
> as object methods which can be called generically by third-party code."
> 
> I am reading in the playbin2 documentation :
> 
> The "get-audio-tags" signal
> 
> GstTagList* user_function (GstPlayBin2 *playbin,
>                                         gint         stream,
>                                         gpointer     user_data)      : Run
> Last / Action
> 
> How do I use this in my code?
> 
> I usually define a callback function - the signal handler - and call
> g_signal_connect(m_playbin, "signal_name","details", etc )
> And, after this, when the signal emitted, my function is called.
> 
> But, in case of the "get-audio-tags" signal, where the returned GstTagList *
> will go?
> And where should I put its processing?
> 

from the glib docs (please check those first in the future, you need to
understand the underlying technologies, we can help with gstreamer specific
things, which this is not).

----------------------------------------------------------------------------
G_SIGNAL_ACTION

Action signals are signals that may freely be emitted on alive objects from user
code via g_signal_emit() and friends, without the need of being embedded into
extra code that performs pre or post emission adjustments on the object. They
can also be thought of as object methods which can be called generically by
third-party code.
----------------------------------------------------------------------------

You can look e.g. at camerabin example code to see how it is used.

Stefan




More information about the gstreamer-devel mailing list