gstreamer/sys
Nirbheek Chauhan 1a8610f8f8 directsoundsrc: Use latency-time and buffer-time settings
Earlier, the plugin was ignoring those settings and blindly setting
buffer-time to 2 seconds and latency-time to 200ms, which forced all
pipelines to have a minimum latency of 200ms + sink latency.

The values of segsize and segtotal were also not derived correctly.
Now we obey these values, and you can get close to the previous
behaviour by setting buffer-time and latency-time manually. Note that
they are set in microseconds.

As a consequence, when we haven't received enough data from the
device, we now sleep for a time proportional to the data remaining.
However, Directsound is a deprecated API so it maintains its own
software ringbuffer which updates at arbitrary intervals. Hence we
might have to wait a full segsize to get the last 10% of data. To
avoid tight loops, we clamp our sleep floor at 10ms.

In my testing, this keeps the wakeups not-too-high (proportional to
the latency-time set on the source). Further improvements should be
made by fixing the WASAPI audio source plugin instead of this.
Directsound is deprecated and as the comments explain, it is
impossible to get low latency, decent quality, or good performance
from it.

Based on a patch by Sebastian Dröge <sebastian@centricular.com>

https://bugzilla.gnome.org/show_bug.cgi?id=781249
2017-05-08 16:13:20 +02:00
..
acmenc bad: use new gst_element_class_add_static_pad_template() 2016-03-24 14:56:51 +02:00
acmmp3dec bad: use new gst_element_class_add_static_pad_template() 2016-03-24 14:56:51 +02:00
androidmedia amcvideodec/enc: Correctly check for no PTS on input buffers 2017-04-26 13:40:28 +03:00
applemedia qtkit: drop the qtkitvideosrc element 2017-05-03 13:21:42 +02:00
bluez bluez: Chain up to basesrc query instead of override pad query function 2017-02-23 00:36:33 +05:30
d3dvideosink docs: Port all docstring to gtk-doc markdown 2017-04-12 12:57:57 -03:00
decklink Revert "decklink: Fix debug logging warnings on Windows" 2017-05-05 18:52:24 +05:30
directsound directsoundsrc: Use latency-time and buffer-time settings 2017-05-08 16:13:20 +02:00
dshowdecwrapper sys: Fix caps memory leak from pad template creation 2016-12-14 10:21:39 +02:00
dshowsrcwrapper dshowsrcwrapper: fix DirectShow caps negotiation and set capture pin caps 2016-04-23 15:21:44 +01:00
dshowvideosink bad: use new gst_element_class_add_static_pad_template() 2016-03-24 14:56:51 +02:00
dvb docs: Port all docstring to gtk-doc markdown 2017-04-12 12:57:57 -03:00
fbdev fbdevsink: Add to meson build 2016-11-14 23:15:34 +05:30
kms kmssink: Add msm to the list of drivers 2017-04-21 21:30:10 -04:00
msdk msdk: Propagate GstFlowReturn values 2017-01-20 11:11:50 -08:00
nvenc nvenc: Stop bitstream thread in ::stop() 2017-04-19 11:51:57 +01:00
opensles docs: Port all docstring to gtk-doc markdown 2017-04-12 12:57:57 -03:00
shm docs: Port all docstring to gtk-doc markdown 2017-04-12 12:57:57 -03:00
tinyalsa docs: Port all docstring to gtk-doc markdown 2017-04-12 12:57:57 -03:00
uvch264 docs: Port all docstring to gtk-doc markdown 2017-04-12 12:57:57 -03:00
vcd bad: use new gst_element_class_add_static_pad_template() 2016-03-24 14:56:51 +02:00
vdpau docs: Port all docstring to gtk-doc markdown 2017-04-12 12:57:57 -03:00
wasapi docs: Port all docstring to gtk-doc markdown 2017-04-12 12:57:57 -03:00
winks docs: Port all docstring to gtk-doc markdown 2017-04-12 12:57:57 -03:00
winscreencap docs: Port all docstring to gtk-doc markdown 2017-04-12 12:57:57 -03:00
Makefile.am Remove various unported plugins 2016-12-21 11:17:11 +02:00
meson.build meson: build decklink plugin 2017-01-05 20:34:14 +00:00