Welcome to the most active Linux Forum on the web.
Go Back > Forums > Non-*NIX Forums > Programming
User Name
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.


  Search this Thread
Old 10-11-2008, 02:25 AM   #1
LQ Newbie
Registered: Sep 2008
Location: China
Distribution: Fedora (temporary)
Posts: 4

Rep: Reputation: 0
[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:
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:
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.

Last edited by chp; 10-11-2008 at 02:58 AM. Reason: problem solved
Old 10-11-2008, 02:56 AM   #2
LQ Newbie
Registered: Sep 2008
Location: China
Distribution: Fedora (temporary)
Posts: 4

Original Poster
Rep: Reputation: 0
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.

Last edited by chp; 10-11-2008 at 02:57 AM. Reason: adding information



Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
'pkg-config --modversion glib-2.0' returned 2.16.3, but GLIB (2.14.6) pgb205 Linux - Software 7 05-17-2008 03:21 PM
Learning Glib-GObject programming varun_shrivastava Programming 0 04-30-2007 04:40 AM
xmms install (needs glib>1.22), just installed glib 2.4.8 and still get error message eskiled Linux - Software 2 12-19-2005 09:12 PM
glib programming tutorial (c) con Programming 3 12-16-2005 12:21 AM
can't install gtk 2.4.4: "Requested 'glib-2.0 >= 2.4.0' but version of GLib is 2.2.3 webazoid Linux - Software 0 07-15-2004 06:07 PM > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 10:54 PM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration