diff options
author | Sebastian Dröge <sebastian@centricular.com> | 2015-02-05 12:22:46 +0100 |
---|---|---|
committer | Sebastian Dröge <sebastian@centricular.com> | 2015-02-05 12:28:13 +0100 |
commit | 141fb455e8d354f268a58472631dec1aad600f86 (patch) | |
tree | fd4ba373698caa2963aa270456ca1808265069e3 /sys/opensles | |
parent | 616cb1bdc67369bb71bdb5019ff1502d9f3599b8 (diff) | |
download | gstreamer-plugins-bad-141fb455e8d354f268a58472631dec1aad600f86.tar.gz |
openslesringbuffer: Allocate at most 4 internal buffers
4 is the "typical" number of buffers defined by Android's OpenSL ES
implementation, and its code is optimized for this. Also because we
have our own ringbuffer around this, we will always have enough
buffering on our side already.
Allows for more efficient processing.
Diffstat (limited to 'sys/opensles')
-rw-r--r-- | sys/opensles/openslesringbuffer.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/sys/opensles/openslesringbuffer.c b/sys/opensles/openslesringbuffer.c index 56fdccfa4..a853a1d80 100644 --- a/sys/opensles/openslesringbuffer.c +++ b/sys/opensles/openslesringbuffer.c @@ -355,10 +355,12 @@ _opensles_player_acquire (GstAudioRingBuffer * rb, SLresult result; SLDataFormat_PCM format; - /* Configure audio source */ + /* Configure audio source + * 4 buffers is the "typical" size as optimized inside Android's + * OpenSL ES, see frameworks/wilhelm/src/itfstruct.h BUFFER_HEADER_TYPICAL + */ SLDataLocator_AndroidSimpleBufferQueue loc_bufq = { - SL_DATALOCATOR_ANDROIDSIMPLEBUFFERQUEUE, - MIN (32, (spec->segtotal >> 1)) + SL_DATALOCATOR_ANDROIDSIMPLEBUFFERQUEUE, MIN (4, spec->segtotal) }; SLDataSource audioSrc = { &loc_bufq, &format }; |