summaryrefslogtreecommitdiffstats
path: root/ext/pulse/pulsemixerctrl.c
diff options
context:
space:
mode:
authorSebastian Dröge <slomo@circular-chaos.org>2008-08-13 12:34:13 +0000
committerSebastian Dröge <slomo@circular-chaos.org>2008-08-13 12:34:13 +0000
commit9e572ebf0065421567134e942d24ae26f0cee55d (patch)
tree67fee78fbaa9b24f6fc36b13446463abc9d4efcd /ext/pulse/pulsemixerctrl.c
parent256aa83574bc0f7cc666f449860570bef5f26275 (diff)
ext/pulse/: Improve debugging a bit by including the parent object in pulsemixerctrl and pulseprobe objects and using...
Original commit message from CVS: * ext/pulse/pulsemixer.c: (gst_pulsemixer_change_state): * ext/pulse/pulsemixerctrl.c: (gst_pulsemixer_ctrl_subscribe_cb), (gst_pulsemixer_ctrl_open), (gst_pulsemixer_ctrl_new), (gst_pulsemixer_ctrl_free), (gst_pulsemixer_ctrl_timeout_event): * ext/pulse/pulsemixerctrl.h: * ext/pulse/pulseprobe.c: (gst_pulseprobe_open), (gst_pulseprobe_enumerate), (gst_pulseprobe_new), (gst_pulseprobe_free), (gst_pulseprobe_needs_probe), (gst_pulseprobe_probe_property), (gst_pulseprobe_get_values): * ext/pulse/pulseprobe.h: * ext/pulse/pulsesink.c: (gst_pulsesink_init): * ext/pulse/pulsesrc.c: (gst_pulsesrc_init), (gst_pulsesrc_delay), (gst_pulsesrc_change_state): Improve debugging a bit by including the parent object in pulsemixerctrl and pulseprobe objects and using GST_WARNING_OBJECT instead of GST_WARNING. Use the parent GObject subclass instead of a random struct as GObject parameter for G_OBJECT_WARN_INVALID_PROPERTY_ID. This fixes a crash when probing for another property than "device".
Diffstat (limited to 'ext/pulse/pulsemixerctrl.c')
-rw-r--r--ext/pulse/pulsemixerctrl.c32
1 files changed, 17 insertions, 15 deletions
diff --git a/ext/pulse/pulsemixerctrl.c b/ext/pulse/pulsemixerctrl.c
index f2fb3c5d..0b605cb4 100644
--- a/ext/pulse/pulsemixerctrl.c
+++ b/ext/pulse/pulsemixerctrl.c
@@ -176,7 +176,7 @@ gst_pulsemixer_ctrl_subscribe_cb (pa_context * context,
gst_pulsemixer_ctrl_source_info_cb, c);
if (!o) {
- GST_WARNING ("Failed to get sink info: %s",
+ GST_WARNING_OBJECT (c->object, "Failed to get sink info: %s",
pa_strerror (pa_context_errno (c->context)));
return;
}
@@ -198,7 +198,7 @@ gst_pulsemixer_ctrl_success_cb (pa_context * context, int success,
#define CHECK_DEAD_GOTO(c, label) do { \
if (!(c)->context || pa_context_get_state((c)->context) != PA_CONTEXT_READY) { \
- GST_WARNING("Not connected: %s", (c)->context ? pa_strerror(pa_context_errno((c)->context)) : "NULL"); \
+ GST_WARNING_OBJECT (c->object, "Not connected: %s", (c)->context ? pa_strerror(pa_context_errno((c)->context)) : "NULL"); \
goto label; \
} \
} while(0);
@@ -224,7 +224,7 @@ gst_pulsemixer_ctrl_open (GstPulseMixerCtrl * c)
if (!(c->context =
pa_context_new (pa_threaded_mainloop_get_api (c->mainloop), name))) {
- GST_WARNING ("Failed to create context");
+ GST_WARNING_OBJECT (c->object, "Failed to create context");
goto unlock_and_fail;
}
@@ -234,7 +234,7 @@ gst_pulsemixer_ctrl_open (GstPulseMixerCtrl * c)
gst_pulsemixer_ctrl_subscribe_cb, c);
if (pa_context_connect (c->context, c->server, 0, NULL) < 0) {
- GST_WARNING ("Failed to connect context: %s",
+ GST_WARNING_OBJECT (c->object, "Failed to connect context: %s",
pa_strerror (pa_context_errno (c->context)));
goto unlock_and_fail;
}
@@ -243,7 +243,7 @@ gst_pulsemixer_ctrl_open (GstPulseMixerCtrl * c)
pa_threaded_mainloop_wait (c->mainloop);
if (pa_context_get_state (c->context) != PA_CONTEXT_READY) {
- GST_WARNING ("Failed to connect context: %s",
+ GST_WARNING_OBJECT (c->object, "Failed to connect context: %s",
pa_strerror (pa_context_errno (c->context)));
goto unlock_and_fail;
}
@@ -254,7 +254,7 @@ gst_pulsemixer_ctrl_open (GstPulseMixerCtrl * c)
pa_context_subscribe (c->context,
PA_SUBSCRIPTION_MASK_SINK | PA_SUBSCRIPTION_MASK_SOURCE,
gst_pulsemixer_ctrl_success_cb, c))) {
- GST_WARNING ("Failed to subscribe to events: %s",
+ GST_WARNING_OBJECT (c->object, "Failed to subscribe to events: %s",
pa_strerror (pa_context_errno (c->context)));
goto unlock_and_fail;
}
@@ -266,7 +266,7 @@ gst_pulsemixer_ctrl_open (GstPulseMixerCtrl * c)
}
if (!c->operation_success) {
- GST_WARNING ("Failed to subscribe to events: %s",
+ GST_WARNING_OBJECT (c->object, "Failed to subscribe to events: %s",
pa_strerror (pa_context_errno (c->context)));
goto unlock_and_fail;
}
@@ -277,7 +277,7 @@ gst_pulsemixer_ctrl_open (GstPulseMixerCtrl * c)
if (!(o =
pa_context_get_sink_info_by_name (c->context, c->device,
gst_pulsemixer_ctrl_sink_info_cb, c))) {
- GST_WARNING ("Failed to get sink info: %s",
+ GST_WARNING_OBJECT (c->object, "Failed to get sink info: %s",
pa_strerror (pa_context_errno (c->context)));
goto unlock_and_fail;
}
@@ -293,7 +293,7 @@ gst_pulsemixer_ctrl_open (GstPulseMixerCtrl * c)
if (!c->operation_success && (c->type == GST_PULSEMIXER_SINK
|| pa_context_errno (c->context) != PA_ERR_NOENTITY)) {
- GST_WARNING ("Failed to get sink info: %s",
+ GST_WARNING_OBJECT (c->object, "Failed to get sink info: %s",
pa_strerror (pa_context_errno (c->context)));
goto unlock_and_fail;
}
@@ -303,7 +303,7 @@ gst_pulsemixer_ctrl_open (GstPulseMixerCtrl * c)
if (!(o =
pa_context_get_source_info_by_name (c->context, c->device,
gst_pulsemixer_ctrl_source_info_cb, c))) {
- GST_WARNING ("Failed to get source info: %s",
+ GST_WARNING_OBJECT (c->object, "Failed to get source info: %s",
pa_strerror (pa_context_errno (c->context)));
goto unlock_and_fail;
}
@@ -318,7 +318,7 @@ gst_pulsemixer_ctrl_open (GstPulseMixerCtrl * c)
o = NULL;
if (!c->operation_success) {
- GST_WARNING ("Failed to get source info: %s",
+ GST_WARNING_OBJECT (c->object, "Failed to get source info: %s",
pa_strerror (pa_context_errno (c->context)));
goto unlock_and_fail;
}
@@ -380,12 +380,13 @@ gst_pulsemixer_ctrl_close (GstPulseMixerCtrl * c)
}
GstPulseMixerCtrl *
-gst_pulsemixer_ctrl_new (const gchar * server, const gchar * device,
- GstPulseMixerType type)
+gst_pulsemixer_ctrl_new (GObject * object, const gchar * server,
+ const gchar * device, GstPulseMixerType type)
{
GstPulseMixerCtrl *c = NULL;
c = g_new (GstPulseMixerCtrl, 1);
+ c->object = g_object_ref (object);
c->tracklist = NULL;
c->server = g_strdup (server);
c->device = g_strdup (device);
@@ -424,6 +425,7 @@ gst_pulsemixer_ctrl_free (GstPulseMixerCtrl * c)
g_free (c->device);
g_free (c->name);
g_free (c->description);
+ g_object_unref (c->object);
g_free (c);
}
@@ -452,7 +454,7 @@ gst_pulsemixer_ctrl_timeout_event (pa_mainloop_api * a, pa_time_event * e,
&c->volume, NULL, NULL);
if (!o)
- GST_WARNING ("Failed to set device volume: %s",
+ GST_WARNING_OBJECT (c->object, "Failed to set device volume: %s",
pa_strerror (pa_context_errno (c->context)));
else
pa_operation_unref (o);
@@ -469,7 +471,7 @@ gst_pulsemixer_ctrl_timeout_event (pa_mainloop_api * a, pa_time_event * e,
NULL, NULL);
if (!o)
- GST_WARNING ("Failed to set device mute: %s",
+ GST_WARNING_OBJECT (c->object, "Failed to set device mute: %s",
pa_strerror (pa_context_errno (c->context)));
else
pa_operation_unref (o);