Material to learn GObject and Glib

26,909

Solution 1

Start with Glib, its quite easy and well described here: Glib Reference Manual

GObject is mostly a lot of boilerplate code to achieve object orientation. Try out the "maman bar" examples found in the GObject Reference Manual

For me, GStreamer took the most time to understand. The documentation is good but there is alot to read (GStreamer docs). After reading about the basics, try starting a pipeline from the cmdline using gst-launch. Then read the full manual about application development and do some examples. Before trying to build your own plugin, check out some simple plugin and try understand the different parts, a simple place to start is the identity plugin

Good luck!

/Joel Larsson

Solution 2

You may be interested in these sample programs I uploaded to github after I read the chapter in the Gnome Developers Guide and went through the gobject manual.

Solution 3

There is also "the offical Gnome 2 Developer's guide". See 59 ff. on the mentioned book... And it's really a good idea to check the sources of gtk. I've spend the last few weeks on getting into it, and found this book to be very helpful. What's quite tedious is to get the constuctors right and the order of initialization is "quite" mind-bending. What you should check is chapter 4 in the GObject documentation also. It does not cover everything but together with the book it' quite ok. I suggest starting with a very simple derived glass form GObject....., to better understand on base principle

One always has two structures. A Class Structure in which you store all the function pointers and an instance structure which represents one Object. This is the most important thing to get.

Another point which is a bit harder to understand it the reference counting for memory management. It helps if you had contact before with Objective-C and/or libapr and/or COM.

Regards Friedrich

Solution 4

Manage C data using the GLib collections is a introduction of glib collection(links, hash tables, arrays, trees, queues, relations). Lots of examples are included. Good for beginners.

Solution 5

This is best GTK+ book I found, it has a chapter on GLib, but reference manual is the best place to learn and the most up to date "book" you will find.

Share:
26,909
Mohammed Hasan Murad
Author by

Mohammed Hasan Murad

Love web. Complete web guy.

Updated on June 09, 2020

Comments

  • Mohammed Hasan Murad
    Mohammed Hasan Murad almost 4 years

    I am comfortable with C. but need to learn GObject and Glib for gstreamer. All i found on net is Gobject reference manual. Its good but looking for tutorial for Gobject/Glib as the main focus is on gstreamer.

    So pls share any other resources to learn the glib and gobject.

  • resultsway
    resultsway over 10 years
    +1 do you have a simple example that uses : GAsyncReadyCallback
  • kravemir
    kravemir over 9 years
    Nice examples. Do you also have example of class with signals? Couldn't find: g_signal_newv in your code. From developer.gnome.org/gobject/stable/signal.html
  • Clock ZHONG
    Clock ZHONG about 3 years
    @Jake where is the "gobject manual"? I only could find the “reference manual” here--- developer.gnome.org/gobject/2.68