PROP_DEVICE_NAME,
PROP_VOLUME,
PROP_MUTE,
+ PROP_CLIENT,
PROP_LAST
};
g_assert (!pbuf->stream);
- pbuf->context_name = g_strdup_printf ("%s@%s", gst_pulse_client_name (),
+ g_assert (psink->client_name);
+ pbuf->context_name = g_strdup_printf ("%s@%s", psink->client_name,
GST_STR_NULL (psink->server));
pa_threaded_mainloop_lock (psink->mainloop);
if (pa_context_connect (pctx->context, psink->server,
PA_CONTEXT_NOAUTOSPAWN, NULL) < 0)
goto connect_failed;
-
-
} else {
GST_LOG_OBJECT (psink, "reusing shared pulseaudio context with name %s",
GST_STR_NULL (pbuf->context_name));
"Mute state of this stream", DEFAULT_MUTE,
G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
#endif
+
+ 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));
}
/* returns the current time of the sink ringbuffer */
pulsesink->server = NULL;
pulsesink->device = NULL;
pulsesink->device_description = NULL;
+ pulsesink->client_name = gst_pulse_client_name ();
pulsesink->volume = DEFAULT_VOLUME;
pulsesink->volume_set = FALSE;
g_free (pulsesink->server);
g_free (pulsesink->device);
g_free (pulsesink->device_description);
+ g_free (pulsesink->client_name);
if (pulsesink->probe) {
gst_pulseprobe_free (pulsesink->probe);
gst_pulsesink_set_mute (pulsesink, g_value_get_boolean (value));
break;
#endif
+ case PROP_CLIENT:
+ g_free (pulsesink->client_name);
+ if (!g_value_get_string (value)) {
+ GST_WARNING_OBJECT (pulsesink,
+ "Empty PulseAudio client name not allowed. Resetting to default value");
+ pulsesink->client_name = gst_pulse_client_name ();
+ } else
+ pulsesink->client_name = g_value_dup_string (value);
+ break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
break;
g_value_set_boolean (value, gst_pulsesink_get_mute (pulsesink));
break;
#endif
+ case PROP_CLIENT:
+ g_value_set_string (value, pulsesink->client_name);
+ break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
break;