Set Device Of DirectSoundSink not working?

Eric-Stone somedude114 at gmail.com
Fri Nov 18 00:07:20 UTC 2016


Hi,

I'm trying to set the device output of directsoundsink. Right now, I'm doing
this by listening to the element-setup and, if the element is
"directsoundsink", setting the device to the appropriate GUID. I'm also
reading the device property immediately after I write to it, to make sure
that I'm setting the device correctly. My code is:

static void element_setup(GstBin *playbin, GstElement *element, GUBPipeline
*pipeline)
{
	if (element && pipeline && gst_element_get_factory(element)) {
		if (strcmp(gst_plugin_feature_get_name(gst_element_get_factory(element)),
"directsoundsink") == 0)
		{
			gub_log_pipeline(pipeline, "Directsoundsink found");
			g_object_set(element, "device", "{927ad741-945e-46be-ac8f-0221365a2fda}",
NULL);
			g_object_set(element, "volume", 0.5, NULL);

			gchar *deviceID;
			g_object_get(element, "device", &deviceID);
			if (deviceID) {
				gub_log_pipeline(pipeline, deviceID);
				g_free(deviceID);
			}
			else {
				gub_log_pipeline(pipeline, "device ID is null");
			}
		}
	}
}

The volume seems to be set correctly, but the audio is still coming out of
the default device. This is even though the returned device property is
matching what I'm inputting. Meanwhile, the command line:

gst-launch-1.0 audiotestsrc ! directsoundsink
device="{927ad741-945e-46be-ac8f-0221365a2fda}"

Does work with the appropriate audio output device. Does anyone have any
ideas why this might not be working in my program? This is with gstreamer
1.10.0





--
View this message in context: http://gstreamer-devel.966125.n4.nabble.com/Set-Device-Of-DirectSoundSink-not-working-tp4680752.html
Sent from the GStreamer-devel mailing list archive at Nabble.com.


More information about the gstreamer-devel mailing list