Linking xvimagesink to a gtk window.

Nathanael D. Noblet nathanael at
Wed Aug 24 08:02:53 PDT 2011

On 08/24/2011 12:08 AM, akaChella wrote:
> But when i include gtk_main(); it does not come out of that, means it is
> executing gtk_mian() and does not returning to the method where i called
> this function.
> I have two different class, One, which constructs the pipeline (pipeline.c)
> and the other one which is constructing a window (ui.c). I have a main
> function in gstreamer class i.e, which is constructing the pipeline.
> During the construction of the pipeline, i am calling create window function
> of ui.c class. which has, gtk_init method and a method to construc the
> window. If i include gtk_main() there, it is not returning to the pipeline.c
> class.

As stated elsewhere, gtk_main() is how you are *supposed* to write a gtk 
app. I would suggest you go through a few gtk sample apps to 'get' how 
it works. Once you understand what is happening, everything will make 
more sense. For example suppose you have a GUI GTK app and you click a 
button. How does your app know? Your program would have a function that 
acts as a 'callback'. gtk_main is running the event loop that sends 
those callbacks.

So yeah, ignore what you are trying to do with gstreamer for a moment, 
and step back and look at GTK apps for a bit.

More information about the gstreamer-devel mailing list