GNOME Bugzilla – Bug 630317
Getting pulsesink device names doesn't work like for alsasink
Last modified: 2010-09-22 17:03:21 UTC
I'm trying to list human-readable names for devices with pulsesink, just like I do for alsasink where it works ok, using : void GST::AudioOutputManager::detect_pulsesink_devices () { GstElement* elt = NULL; elt = gst_element_factory_make ("pulsesink", "pulsesinkpresencetest"); if (elt != NULL) { GstPropertyProbe* probe = NULL; const GParamSpec* pspec = NULL; GValueArray* array = NULL; gst_element_set_state (elt, GST_STATE_PAUSED); probe = GST_PROPERTY_PROBE (elt); pspec = gst_property_probe_get_property (probe, "device"); array = gst_property_probe_probe_and_get_values (probe, pspec); if (array != NULL) { for (guint index = 0; index < array->n_values; index++) { GValue* device = NULL; gchar* name = NULL; gchar* descr = NULL; device = g_value_array_get_nth (array, index); g_object_set_property (G_OBJECT (elt), "device", device); g_object_get (G_OBJECT (elt), "device-name", &name, NULL); descr = g_strdup_printf ("volume name=ekiga_volume ! pulsesink device=%s", g_value_get_string (device)); if (name != 0) { devices_by_name[std::pair<std::string,std::string>("PULSEAUDIO", name)] = descr; g_free (name); } g_free (descr); } g_value_array_free (array); } gst_element_set_state (elt, GST_STATE_NULL); gst_object_unref (GST_OBJECT (elt)); } } Unfortunately, for pulsesink 'name' always ends up NULL... The fact that the behaviour is different for alsasink and pulsesink makes me think it's a bug.
commit 0236b2efc3be6e954c4bbc647c87d870a2d7e0e9 Author: Wim Taymans <wim.taymans@collabora.co.uk> Date: Wed Sep 22 19:01:40 2010 +0200 pulse: add test app for pulse device probe commit 7f48fb37e97f0af6c3f6d026a47f05852aa0be3a Author: Wim Taymans <wim.taymans@collabora.co.uk> Date: Wed Sep 22 18:50:44 2010 +0200 pulse: fix device_description in READY Make the is_dead check more clear and add an option to check for the status of the stream in addition to the context. We don't need a stream to get the device_description string. Fixes #630317