mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-03-30 20:59:44 +00:00
wasapi: Only use audioclient3 when low-latency
Causes glitches on very slow CPU machines or VMs, and our out-of-the-box experience should be good. https://bugzilla.gnome.org/show_bug.cgi?id=794497
This commit is contained in:
parent
4cbcd08f9c
commit
f90613280b
1 changed files with 26 additions and 5 deletions
|
@ -141,7 +141,8 @@ gst_wasapi_sink_class_init (GstWasapiSinkClass * klass)
|
||||||
g_object_class_install_property (gobject_class,
|
g_object_class_install_property (gobject_class,
|
||||||
PROP_AUDIOCLIENT3,
|
PROP_AUDIOCLIENT3,
|
||||||
g_param_spec_boolean ("use-audioclient3", "Use the AudioClient3 API",
|
g_param_spec_boolean ("use-audioclient3", "Use the AudioClient3 API",
|
||||||
"Use the Windows 10 AudioClient3 API when available",
|
"Use the Windows 10 AudioClient3 API when available and if the "
|
||||||
|
"low-latency property is set to TRUE",
|
||||||
DEFAULT_AUDIOCLIENT3, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
|
DEFAULT_AUDIOCLIENT3, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
|
||||||
|
|
||||||
gst_element_class_add_static_pad_template (gstelement_class, &sink_template);
|
gst_element_class_add_static_pad_template (gstelement_class, &sink_template);
|
||||||
|
@ -295,10 +296,30 @@ gst_wasapi_sink_get_property (GObject * object, guint prop_id,
|
||||||
static gboolean
|
static gboolean
|
||||||
gst_wasapi_sink_can_audioclient3 (GstWasapiSink * self)
|
gst_wasapi_sink_can_audioclient3 (GstWasapiSink * self)
|
||||||
{
|
{
|
||||||
if (self->sharemode == AUDCLNT_SHAREMODE_SHARED &&
|
/* AudioClient3 API only makes sense in shared mode */
|
||||||
self->try_audioclient3 && gst_wasapi_util_have_audioclient3 ())
|
if (self->sharemode != AUDCLNT_SHAREMODE_SHARED)
|
||||||
return TRUE;
|
return FALSE;
|
||||||
return FALSE;
|
|
||||||
|
if (!self->try_audioclient3) {
|
||||||
|
GST_INFO_OBJECT (self, "AudioClient3 disabled by user");
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!gst_wasapi_util_have_audioclient3 ()) {
|
||||||
|
GST_INFO_OBJECT (self, "AudioClient3 not available on this OS");
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Only use audioclient3 when low-latency is requested because otherwise
|
||||||
|
* very slow machines and VMs with 1 CPU allocated will get glitches:
|
||||||
|
* https://bugzilla.gnome.org/show_bug.cgi?id=794497 */
|
||||||
|
if (!self->low_latency) {
|
||||||
|
GST_INFO_OBJECT (self, "AudioClient3 disabled because low-latency mode "
|
||||||
|
"was not requested");
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
static GstCaps *
|
static GstCaps *
|
||||||
|
|
Loading…
Reference in a new issue