Search code examples
cstreaminggstreamergobject

concept of gobject and how can we use it in gstresmer application devolepment


I am developing a gstreamer application. There are some basic concepts I don't understand. Can anyone please explain the concept of g Object? Also what is gobject initialisation, gobject properties, gobject casting, gobject referencing, and please provide a good link too...


Solution

  • When learning gstreamer, you may not need to know/ learn about GObject. In one basic line GObject, and its lower-level type system, GType, are used by GTK+ and most GNOME libraries to provide: object-oriented C-based APIs

    However if you still want to know the connection it has with gstreamer. I can count the following simple examples,

    1.. When you check the hierarchy of any GstElement or any other gst type, you will see they all are derived from GObject, like the one below. This means all the methods used and defined for GObject can also be used for GstObject etc.

    enter image description here

    2.. Even though the only header file included is gst.h. When we check code of gst.h it internally has already included glib.h.

    enter image description here

    3.. While you go through tutorials, there can be some functions which are not defined in gstreamer sdk but are imported/included using glib.h headers and linked using glib.so.
    You can refer gstreamer tutorials.

    g_object_set (data.source, "uri", "http://docs.gstreamer.com/media/sintel_trailer-480p.webm", NULL);
    g_timeout_add (200, (GSourceFunc) cb_print_position, pipeline); [more here ]
    g_main_loop_run (loop);

    Like I said these signal connect and object set functions are intuitive and need not to be known to learn gstreamer.

    ...
    As you asked here is an intro to GObject.