From 05a37d3791aeb85d1d86e70f4576fbb6e3b21306 Mon Sep 17 00:00:00 2001 From: Nirbheek Chauhan Date: Mon, 26 Feb 2018 16:08:28 +0530 Subject: [PATCH] wasapi: Clarify usage of low-latency property, add myself as author The low-latency property is *always* safe to enable, so applications that do realtime communication should set it, and the elements will automatically configure WASAPI to use the lowest possible device period, and the audioringbuffer in audiobasesink will also be configured accordingly. Applications can also use exclusive mode during capture and playback for the lowest possible latency if they know that the device will not be used by any other application. In this mode, the latency-time and buffer-time properties will be completely ignored. --- sys/wasapi/gstwasapisink.c | 7 ++++++- sys/wasapi/gstwasapisrc.c | 7 ++++++- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/sys/wasapi/gstwasapisink.c b/sys/wasapi/gstwasapisink.c index e6a0e82..c0f775a 100644 --- a/sys/wasapi/gstwasapisink.c +++ b/sys/wasapi/gstwasapisink.c @@ -33,6 +33,10 @@ * gst-launch-1.0 -v audiotestsrc samplesperbuffer=160 ! wasapisink * ]| Generate 20 ms buffers and render to the default audio device. * + * |[ + * gst-launch-1.0 -v audiotestsrc samplesperbuffer=160 ! wasapisink low-latency=true + * ]| Same as above, but with the minimum possible latency + * */ #ifdef HAVE_CONFIG_H # include @@ -131,7 +135,7 @@ gst_wasapi_sink_class_init (GstWasapiSinkClass * klass) g_object_class_install_property (gobject_class, PROP_LOW_LATENCY, g_param_spec_boolean ("low-latency", "Low latency", - "Optimize all settings for lowest latency", + "Optimize all settings for lowest latency. Always safe to enable.", DEFAULT_LOW_LATENCY, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); g_object_class_install_property (gobject_class, @@ -144,6 +148,7 @@ gst_wasapi_sink_class_init (GstWasapiSinkClass * klass) gst_element_class_set_static_metadata (gstelement_class, "WasapiSrc", "Sink/Audio", "Stream audio to an audio capture device through WASAPI", + "Nirbheek Chauhan , " "Ole André Vadla Ravnås "); gstbasesink_class->get_caps = GST_DEBUG_FUNCPTR (gst_wasapi_sink_get_caps); diff --git a/sys/wasapi/gstwasapisrc.c b/sys/wasapi/gstwasapisrc.c index f1fd641..7060e78 100644 --- a/sys/wasapi/gstwasapisrc.c +++ b/sys/wasapi/gstwasapisrc.c @@ -31,6 +31,10 @@ * gst-launch-1.0 -v wasapisrc ! fakesink * ]| Capture from the default audio device and render to fakesink. * + * |[ + * gst-launch-1.0 -v wasapisrc low-latency=true ! fakesink + * ]| Capture from the default audio device with the minimum possible latency and render to fakesink. + * */ #ifdef HAVE_CONFIG_H # include @@ -123,7 +127,7 @@ gst_wasapi_src_class_init (GstWasapiSrcClass * klass) g_object_class_install_property (gobject_class, PROP_LOW_LATENCY, g_param_spec_boolean ("low-latency", "Low latency", - "Optimize all settings for lowest latency", + "Optimize all settings for lowest latency. Always safe to enable.", DEFAULT_LOW_LATENCY, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); g_object_class_install_property (gobject_class, @@ -136,6 +140,7 @@ gst_wasapi_src_class_init (GstWasapiSrcClass * klass) gst_element_class_set_static_metadata (gstelement_class, "WasapiSrc", "Source/Audio", "Stream audio from an audio capture device through WASAPI", + "Nirbheek Chauhan , " "Ole André Vadla Ravnås "); gstbasesrc_class->get_caps = GST_DEBUG_FUNCPTR (gst_wasapi_src_get_caps); -- 2.7.4