LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (https://www.linuxquestions.org/questions/programming-9/)
-   -   help me with glib programming (https://www.linuxquestions.org/questions/programming-9/help-me-with-glib-programming-675632/)

chp 10-11-2008 02:25 AM

[SOLVED] help me with glib programming
 
I'm adapting the code of gnome cheese to my program, but I encountered some difficulties since I'm new to glib programming.


I find in the file cheese-webcam.c a statement:
Code:

g_signal_connect (G_OBJECT (priv->photo_sink), "handoff",
                  G_CALLBACK  (cheese_webcam_photo_data_cb), webcam);

in the function cheese_webcam_take_photo and the prototype of cheese_webcam_photo_data_cb is:
Code:

static void
cheese_webcam_photo_data_cb (GstElement *element, GstBuffer *buffer,
                            GstPad *pad, CheeseWebcam *webcam);

My problem is that I want to make use of this function as a regular function rather than a callback while I don't know where is this GstBuffer *buffer from. I see that the function uses this buffer extensively.

How should I pass an argument to this parameter?

Thanks in advance.

chp 10-11-2008 02:56 AM

Problem solved.

According to James, there is no way to pass this argument as what we ordinarily do. But when I want to call the function I just need to emit a "handoff" signal, the argument is automatically (and implicitly of course) passed by the library. That's all.

I just haven't got used to glib.

Thanks to James.


All times are GMT -5. The time now is 12:01 PM.