Utility functions
while you can use the regular g_object_getv () function to
query the value of an object property, GStreamer
provides some easy wrappers for this common operation.
Instead of writing the following Gtk+ code to query the GTK_STRING value
of an object:
GtkArg arg;
guchar *value;
arg.name = argname;
g_object_getv (G_OBJECT (object), 1, &arg);
value = GTK_VALUE_STRING (arg);
You can also use:
value = gst_util_get_string_arg (object, argname);
These convenience functions exist for the following types:
gint: with gst_util_get_int_arg ();
gboolean: with gst_util_get_bool_arg ();
glong: with gst_util_get_long_arg ();
gfloat: with gst_util_get_float_arg ();
gdouble: with gst_util_get_double_arg ();
guchar*: with gst_util_get_string_arg ();
gpointer: with gst_util_get_pointer_arg ();
One usually sets object properties using g_object_set (). The problem with this
method is that you need to know the type of the property. A convenience function,
gst_utils_set_object_arg () is therefore provided so that you can always set
the property with a string value. for example:
gst_util_set_object_arg (someobject, "int_property", "1000");
Will do The Right Thing(tm), converting the string to the type of the property when
needed.
There is also another utility function that can be used to dump a block
of memory on the console. This function is very usefull for plugin
developers. The function will dump size bytes of the memory pointed
to by mem.
void gst_util_dump_mem (guchar *mem, guint size);