summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDamien Lespiau <damien.lespiau@intel.com>2010-01-09 08:03:28 +0000
committerDamien Lespiau <damien.lespiau@intel.com>2010-01-09 16:29:24 +0000
commitfe83d9b763b6613b4acad13991b3009c8b8331c9 (patch)
treea652b5b01d49aea579a3462fe8667efac1edb5b5
parent11748f85e5e6c477123f5882e811a582133db179 (diff)
downloadclutter-gst-fe83d9b763b6613b4acad13991b3009c8b8331c9.tar.gz
[Audio] Add CLUTTER_GST_NOTE() traces
ClutterGstAudio has been left behing a bit. Start with adding debugging traces.
-rw-r--r--clutter-gst/clutter-gst-audio.c36
1 files changed, 33 insertions, 3 deletions
diff --git a/clutter-gst/clutter-gst-audio.c b/clutter-gst/clutter-gst-audio.c
index dd7508e..a6ccb9d 100644
--- a/clutter-gst/clutter-gst-audio.c
+++ b/clutter-gst/clutter-gst-audio.c
@@ -8,9 +8,10 @@
* Authored By Matthew Allum <mallum@openedhand.com>
* Jorn Baayen <jorn@openedhand.com>
* Emmanuele Bassi <ebassi@linux.intel.com>
+ * Damien Lespiau <damien.lespiau@intel.com>
*
* Copyright (C) 2006 OpenedHand
- * Copyright (C) 2009 Intel Corp.
+ * Copyright (C) 2009, 2010 Intel Corporation
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
@@ -44,6 +45,8 @@
#include <glib.h>
+#include "clutter-gst-debug.h"
+
struct _ClutterGstAudioPrivate
{
GstElement *pipeline;
@@ -143,6 +146,8 @@ set_uri (ClutterGstAudio *audio,
gst_element_set_state (priv->pipeline, GST_STATE_NULL);
+ CLUTTER_GST_NOTE (MEDIA, "setting URI: %s", uri);
+
g_object_set (priv->pipeline, "uri", uri, NULL);
/* Restore state */
@@ -166,6 +171,8 @@ set_playing (ClutterGstAudio *audio,
if (!priv->pipeline)
return;
+
+ CLUTTER_GST_NOTE (MEDIA, "set playing: %d", playing);
if (priv->uri)
{
@@ -191,6 +198,7 @@ get_playing (ClutterGstAudio *audio)
{
ClutterGstAudioPrivate *priv = audio->priv;
GstState state, pending;
+ gboolean playing;
if (!priv->pipeline)
return FALSE;
@@ -198,9 +206,13 @@ get_playing (ClutterGstAudio *audio)
gst_element_get_state (priv->pipeline, &state, &pending, 0);
if (pending)
- return (pending == GST_STATE_PLAYING);
+ playing = (pending == GST_STATE_PLAYING);
else
- return (state == GST_STATE_PLAYING);
+ playing = (state == GST_STATE_PLAYING);
+
+ CLUTTER_GST_NOTE (MEDIA, "get playing: %d", playing);
+
+ return playing;
}
static void
@@ -215,6 +227,8 @@ set_progress (ClutterGstAudio *audio,
if (!priv->pipeline)
return;
+ CLUTTER_GST_NOTE (MEDIA, "set progress: %.02f", progress);
+
gst_element_get_state (priv->pipeline, &state, &pending, 0);
if (pending)
@@ -281,6 +295,8 @@ get_progress (ClutterGstAudio *audio)
gst_query_unref (position_q);
gst_query_unref (duration_q);
+ CLUTTER_GST_NOTE (MEDIA, "get progress: %.02f", progress);
+
return progress;
}
@@ -293,6 +309,8 @@ set_audio_volume (ClutterGstAudio *audio,
if (!priv->pipeline)
return;
+ CLUTTER_GST_NOTE (MEDIA, "set volume: %.02f", volume);
+
/* the :volume property is in the [0, 10] interval */
g_object_set (G_OBJECT (priv->pipeline), "volume", volume * 10.0, NULL);
@@ -311,6 +329,8 @@ get_audio_volume (ClutterGstAudio *audio)
/* the :volume property is in the [0, 10] interval */
g_object_get (priv->pipeline, "volume", &volume, NULL);
+ CLUTTER_GST_NOTE (MEDIA, "get volume: %.02f", volume);
+
return CLAMP (volume / 10.0, 0.0, 1.0);
}
@@ -488,6 +508,8 @@ bus_message_eos_cb (GstBus *bus,
{
g_object_notify (G_OBJECT (audio), "progress");
+ CLUTTER_GST_NOTE (MEDIA, "EOS");
+
g_signal_emit_by_name (CLUTTER_MEDIA(audio), "eos");
gst_element_set_state (audio->priv->pipeline, GST_STATE_READY);
@@ -514,6 +536,8 @@ bus_message_buffering_cb (GstBus *bus,
0.0,
1.0);
+ CLUTTER_GST_NOTE (MEDIA, "buffer-fill: %.02f", priv->buffer_fill);
+
g_object_notify (G_OBJECT (audio), "buffer-fill");
}
}
@@ -533,6 +557,8 @@ bus_message_duration_cb (GstBus *bus,
priv->duration = (gdouble) duration / GST_SECOND;
+ CLUTTER_GST_NOTE (MEDIA, "duration: %.02f", priv->duration);
+
g_object_notify (G_OBJECT (audio), "duration");
}
@@ -582,6 +608,8 @@ bus_message_state_change_cb (GstBus *bus,
gst_query_unref (query);
+ CLUTTER_GST_NOTE (MEDIA, "can-seek: %d", priv->can_seek);
+
g_object_notify (G_OBJECT (audio), "can-seek");
/* Determine the duration */
@@ -594,6 +622,8 @@ bus_message_state_change_cb (GstBus *bus,
gst_query_parse_duration (query, NULL, &duration);
priv->duration = (gdouble) duration / GST_SECOND;
+ CLUTTER_GST_NOTE (MEDIA, "duration: %.02f", priv->duration);
+
g_object_notify (G_OBJECT (audio), "duration");
}