mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-03-28 20:05:38 +00:00
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.
This commit is contained in:
parent
616cb1bdc6
commit
141fb455e8
1 changed files with 5 additions and 3 deletions
|
@ -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 };
|
||||
|
||||
|
|
Loading…
Reference in a new issue