Commit graph

6 commits

Author SHA1 Message Date
Silvio Lazzeretti
aa4bea913b audioutilsprivate: restore thread priority before ending
The priority of the thread that executes audioringbuffer_thread_func
is incremented on Windows by the usage of the AvSetMmThreadCharacteristics
API. This change has to be restored, as described on the documentation
of the API (https://docs.microsoft.com/en-us/windows/win32/api/avrt/nf-avrt-avsetmmthreadcharacteristicsw#remarks),
with a call to the AvRevertMmThreadCharacteristics. If this is not done,
a handle will be leaked.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/-/merge_requests/760>
2020-07-18 13:00:00 +02:00
Nirbheek Chauhan
d002cd33d3 gstaudioutilsprivate: Fix warnings while setting thread priority
Also use G_OS_WIN32 instead of _WIN32 for clarity.
2018-09-24 19:44:28 +05:30
Nirbheek Chauhan
1733233060 gstaudiosrc/sink: Set audio ringbuffer thread priority
On Windows, the ringbuffer thread function must have the "Pro Audio"
priority set, otherwise it sometimes doesn't get scheduled for
200-300ms, which will immediately cause an underrun unless you set
a very high latency-time and buffer-time.

This has no compile-time deps since it tries to load avrt.dll at
runtime to set the thread priority.
2018-09-11 00:41:59 +05:30
Sebastian Dröge
8d8262a00c audioencoder/decoder: Move encoded audio conversion function to a common place
No need to duplicate this non-trivial function.
2016-07-04 11:12:55 +02:00
Sebastian Dröge
0da2709d0c audio/video: Use G_GNUC_INTERNAL for internal functions 2016-01-08 17:50:50 +02:00
Thiago Santos
5e3405bd08 audioencoder: refactor getcaps proxy function to be reusable
Makes the audioencoder's getcaps function that proxies downstream
restriction available to other elements in the audio module to use it
2014-12-17 19:15:23 -03:00