summaryrefslogtreecommitdiffstats
path: root/ext
diff options
context:
space:
mode:
authorWim Taymans <wim.taymans@collabora.co.uk>2009-09-08 19:34:09 +0200
committerWim Taymans <wim.taymans@collabora.co.uk>2009-09-08 19:34:09 +0200
commitca7bec0d650327afa67fa5ffefe973565b252b3e (patch)
tree57b6439b49d5e7c52262245afd413f3cc8b12a19 /ext
parentfe2d8bdc64da24ce2a702bf32c1a68e8b32aef58 (diff)
pulse: small cleanups
Add some debug info Fix the state changes
Diffstat (limited to 'ext')
-rw-r--r--ext/pulse/pulsemixer.c14
-rw-r--r--ext/pulse/pulsemixerctrl.c6
-rw-r--r--ext/pulse/pulseprobe.c6
3 files changed, 21 insertions, 5 deletions
diff --git a/ext/pulse/pulsemixer.c b/ext/pulse/pulsemixer.c
index 99d33aee..ab99c552 100644
--- a/ext/pulse/pulsemixer.c
+++ b/ext/pulse/pulsemixer.c
@@ -252,6 +252,7 @@ static GstStateChangeReturn
gst_pulsemixer_change_state (GstElement * element, GstStateChange transition)
{
GstPulseMixer *this = GST_PULSEMIXER (element);
+ GstStateChangeReturn res;
switch (transition) {
case GST_STATE_CHANGE_NULL_TO_READY:
@@ -260,19 +261,22 @@ gst_pulsemixer_change_state (GstElement * element, GstStateChange transition)
gst_pulsemixer_ctrl_new (G_OBJECT (this), this->server,
this->device, GST_PULSEMIXER_UNKNOWN);
break;
+ default:
+ ;
+ }
+
+ res = GST_ELEMENT_CLASS (parent_class)->change_state (element, transition);
+
+ switch (transition) {
case GST_STATE_CHANGE_READY_TO_NULL:
if (this->mixer) {
gst_pulsemixer_ctrl_free (this->mixer);
this->mixer = NULL;
}
break;
-
default:
;
}
- if (GST_ELEMENT_CLASS (parent_class)->change_state)
- return GST_ELEMENT_CLASS (parent_class)->change_state (element, transition);
-
- return GST_STATE_CHANGE_SUCCESS;
+ return res;
}
diff --git a/ext/pulse/pulsemixerctrl.c b/ext/pulse/pulsemixerctrl.c
index ae807c66..f0bc6463 100644
--- a/ext/pulse/pulsemixerctrl.c
+++ b/ext/pulse/pulsemixerctrl.c
@@ -213,6 +213,8 @@ gst_pulsemixer_ctrl_open (GstPulseMixerCtrl * c)
g_assert (c);
+ GST_DEBUG_OBJECT (c->object, "ctrl open");
+
c->mainloop = pa_threaded_mainloop_new ();
g_assert (c->mainloop);
@@ -275,6 +277,7 @@ gst_pulsemixer_ctrl_open (GstPulseMixerCtrl * c)
/* Get sink info */
if (c->type == GST_PULSEMIXER_UNKNOWN || c->type == GST_PULSEMIXER_SINK) {
+ GST_WARNING_OBJECT (c->object, "Get info for '%s'", c->device);
if (!(o =
pa_context_get_sink_info_by_name (c->context, c->device,
gst_pulsemixer_ctrl_sink_info_cb, c))) {
@@ -353,6 +356,8 @@ gst_pulsemixer_ctrl_close (GstPulseMixerCtrl * c)
{
g_assert (c);
+ GST_DEBUG_OBJECT (c->object, "ctrl close");
+
if (c->mainloop)
pa_threaded_mainloop_stop (c->mainloop);
@@ -386,6 +391,7 @@ gst_pulsemixer_ctrl_new (GObject * object, const gchar * server,
{
GstPulseMixerCtrl *c = NULL;
+ GST_DEBUG_OBJECT (object, "new mixer ctrl for %s", device);
c = g_new (GstPulseMixerCtrl, 1);
c->object = g_object_ref (object);
c->tracklist = NULL;
diff --git a/ext/pulse/pulseprobe.c b/ext/pulse/pulseprobe.c
index 588a9c39..3c601c2f 100644
--- a/ext/pulse/pulseprobe.c
+++ b/ext/pulse/pulseprobe.c
@@ -103,6 +103,8 @@ gst_pulseprobe_open (GstPulseProbe * c)
g_assert (c);
+ GST_DEBUG_OBJECT (c->object, "probe open");
+
c->mainloop = pa_threaded_mainloop_new ();
g_assert (c->mainloop);
@@ -184,6 +186,8 @@ gst_pulseprobe_enumerate (GstPulseProbe * c)
{
pa_operation *o = NULL;
+ GST_DEBUG_OBJECT (c->object, "probe enumerate");
+
pa_threaded_mainloop_lock (c->mainloop);
if (c->enumerate_sinks) {
@@ -268,6 +272,8 @@ gst_pulseprobe_close (GstPulseProbe * c)
{
g_assert (c);
+ GST_DEBUG_OBJECT (c->object, "probe close");
+
if (c->mainloop)
pa_threaded_mainloop_stop (c->mainloop);