wasapi: Clarify usage of low-latency property, add myself as author
authorNirbheek Chauhan <nirbheek@centricular.com>
Mon, 26 Feb 2018 10:38:28 +0000 (16:08 +0530)
committerNirbheek Chauhan <nirbheek@centricular.com>
Mon, 26 Feb 2018 10:53:11 +0000 (16:23 +0530)
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
sys/wasapi/gstwasapisrc.c

index e6a0e82..c0f775a 100644 (file)
  * 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);
index f1fd641..7060e78 100644 (file)
  * 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);