]> Gitweb @ Texas Instruments - Open Source Git Repositories - git.TI.com/gitweb - glsdk/gstreamer0-10.git/blob - testsuite/elements/property.h
gst-indent run on core
[glsdk/gstreamer0-10.git] / testsuite / elements / property.h
1 /* extracted from gst-launch */
2 static void
3 property_change_callback (GObject * object, GstObject * orig,
4     GParamSpec * pspec)
5 {
6   GValue value = { 0, };        /* the important thing is that value.type = 0 */
7   gchar *str = 0;
9   if (pspec->flags & G_PARAM_READABLE) {
10     g_value_init (&value, G_PARAM_SPEC_VALUE_TYPE (pspec));
11     g_object_get_property (G_OBJECT (orig), pspec->name, &value);
12     /* fix current bug with g_strdup_value_contents not working with gint64 */
13     if (G_IS_PARAM_SPEC_INT64 (pspec))
14       str = g_strdup_printf ("%lld", g_value_get_int64 (&value));
15     else
16       str = g_strdup_value_contents (&value);
17     g_print ("%s: %s = %s\n", GST_OBJECT_NAME (orig), pspec->name, str);
18     g_free (str);
19     g_value_unset (&value);
20   } else {
21     g_warning ("Parameter not readable. What's up with that?");
22   }
23 }