AAudio: add setBufferCapacity()
This is needed so that an app can request a larger buffer.
Also fix a bug related to passing configuration data to the service.
Test: test_aaudio.cpp
Change-Id: Idd3066c84f6bac76a5d545b12081bc311025a6c3
Signed-off-by: Phil Burk <philburk@google.com>
diff --git a/media/liboboe/src/client/AudioStreamInternal.cpp b/media/liboboe/src/client/AudioStreamInternal.cpp
index 8d7e93f..19f2300 100644
--- a/media/liboboe/src/client/AudioStreamInternal.cpp
+++ b/media/liboboe/src/client/AudioStreamInternal.cpp
@@ -33,6 +33,7 @@
#include "binding/IAAudioService.h"
#include "binding/AAudioServiceMessage.h"
+#include "core/AudioStreamBuilder.h"
#include "AudioStreamInternal.h"
#define LOG_TIMESTAMPS 0
@@ -110,6 +111,7 @@
request.getConfiguration().setSampleRate(getSampleRate());
request.getConfiguration().setSamplesPerFrame(getSamplesPerFrame());
request.getConfiguration().setAudioFormat(getFormat());
+ request.getConfiguration().setBufferCapacity(builder.getBufferCapacity());
request.dump();
mServiceStreamHandle = service->openStream(request, configuration);
@@ -142,7 +144,6 @@
// Configure endpoint based on descriptor.
mAudioEndpoint.configure(&mEndpointDescriptor);
-
mFramesPerBurst = mEndpointDescriptor.downDataQueueDescriptor.framesPerBurst;
assert(mFramesPerBurst >= 16);
assert(mEndpointDescriptor.downDataQueueDescriptor.capacityInFrames < 10 * 1024);