PROP_SERVER,
PROP_DEVICE,
PROP_DEVICE_NAME,
+ PROP_CLIENT,
PROP_STREAM_PROPERTIES,
PROP_LAST
};
G_PARAM_READABLE | G_PARAM_STATIC_STRINGS));
/**
+ * GstPulseSink:client
+ *
+ * The PulseAudio client name to use.
+ *
+ * Since: 0.10.27
+ */
+ g_object_class_install_property (gobject_class,
+ PROP_CLIENT,
+ g_param_spec_string ("client", "Client",
+ "The PulseAudio client_name_to_use", gst_pulse_client_name (),
+ G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS |
+ GST_PARAM_MUTABLE_READY));
+
+ /**
* GstPulseSrc:stream-properties
*
* List of pulseaudio stream properties. A list of defined properties can be
{
pulsesrc->server = NULL;
pulsesrc->device = NULL;
+ pulsesrc->client_name = gst_pulse_client_name ();
pulsesrc->device_description = NULL;
pulsesrc->context = NULL;
g_free (pulsesrc->server);
g_free (pulsesrc->device);
+ g_free (pulsesrc->client_name);
if (pulsesrc->properties)
gst_structure_free (pulsesrc->properties);
g_free (pulsesrc->device);
pulsesrc->device = g_value_dup_string (value);
break;
+ case PROP_CLIENT:
+ g_free (pulsesrc->client_name);
+ if (!g_value_get_string (value)) {
+ GST_WARNING_OBJECT (pulsesrc,
+ "Empty PulseAudio client name not allowed. Resetting to default value");
+ pulsesrc->client_name = gst_pulse_client_name ();
+ } else
+ pulsesrc->client_name = g_value_dup_string (value);
+ break;
case PROP_STREAM_PROPERTIES:
if (pulsesrc->properties)
gst_structure_free (pulsesrc->properties);
case PROP_DEVICE_NAME:
g_value_take_string (value, gst_pulsesrc_device_description (pulsesrc));
break;
+ case PROP_CLIENT:
+ g_value_set_string (value, pulsesrc->client_name);
+ break;
case PROP_STREAM_PROPERTIES:
gst_value_set_structure (value, pulsesrc->properties);
break;
gst_pulsesrc_open (GstAudioSrc * asrc)
{
GstPulseSrc *pulsesrc = GST_PULSESRC_CAST (asrc);
- gchar *name = gst_pulse_client_name ();
pa_threaded_mainloop_lock (pulsesrc->mainloop);
if (!(pulsesrc->context =
pa_context_new (pa_threaded_mainloop_get_api (pulsesrc->mainloop),
- name))) {
+ pulsesrc->client_name))) {
GST_ELEMENT_ERROR (pulsesrc, RESOURCE, FAILED, ("Failed to create context"),
(NULL));
goto unlock_and_fail;
pa_threaded_mainloop_unlock (pulsesrc->mainloop);
- g_free (name);
return TRUE;
/* ERRORS */
pa_threaded_mainloop_unlock (pulsesrc->mainloop);
- g_free (name);
return FALSE;
}
}