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.
This commit is contained in:
Nirbheek Chauhan 2018-02-26 16:08:28 +05:30
parent 995059dc87
commit 05a37d3791
2 changed files with 12 additions and 2 deletions

View file

@ -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 <config.h>
@ -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 <nirbheek@centricular.com>, "
"Ole André Vadla Ravnås <ole.andre.ravnas@tandberg.com>");
gstbasesink_class->get_caps = GST_DEBUG_FUNCPTR (gst_wasapi_sink_get_caps);

View file

@ -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 <config.h>
@ -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 <nirbheek@centricular.com>, "
"Ole André Vadla Ravnås <ole.andre.ravnas@tandberg.com>");
gstbasesrc_class->get_caps = GST_DEBUG_FUNCPTR (gst_wasapi_src_get_caps);