[gst-devel] handoff calling C++ object member function
mnews2 at wp.pl
Tue Jan 6 11:34:02 CET 2004
W liście z wto, 06-01-2004, godz. 20:06, Quan Nguyen pisze:
> I am having a problem with calling a C++ object's member function from
> a handoff. I want to be able to call a member function of an object
> from a listener handoff function. I assume that I will have to pass
> to the handoff function a pointer to that object, but I do not know
> how to do it. Here is some sample code of what I am trying to do.
> g_signal_connect (G_OBJECT (listener), "handoff", G_CALLBACK
> (cb_manipulate), NULL);
> static void cb_manipulate (GstElement *element, GstData *data)
> I want to be able to call useful_func() for some_object. My question
> is how do I pass more parameters to the handoff function?
Use the last param for g_signal_connect, so it should look like:
MyDataType *my_data = // ... fill my_data
g_signal_connect (G_OBJECT (listener), "handoff", G_CALLBACK
static void cb_manipulate(GstElement *elem, MyDataType *data)
// data is my_data you passed earlier on
Also, is there any specific reason to declare cb_manipulate as static?
You want to keep it private for file or some other one?
"Tautologizm to coś tautologicznego"
Maciej Katafiasz <mnews2 at wp.pl>
More information about the gstreamer-devel