Skip to content

Commit e1acd08

Browse files
authored
Support buffer capacity for automation test. (#2295)
Fixes #2294.
1 parent 360ddf6 commit e1acd08

2 files changed

Lines changed: 9 additions & 0 deletions

File tree

apps/OboeTester/app/src/main/java/com/mobileer/oboetester/IntentBasedTestSupport.java

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,8 @@ public class IntentBasedTestSupport {
128128
public static final String VALUE_FORMAT_IEC61937 = "iec61937";
129129
public static final String VALUE_FORMAT_MP3 = "mp3";
130130

131+
public static final String KEY_BUFFER_CAPACITY = "buffer_capacity";
132+
131133
public static int getApiFromText(String text) {
132134
if (VALUE_API_AAUDIO.equals(text)) {
133135
return StreamConfiguration.NATIVE_API_AAUDIO;
@@ -338,6 +340,9 @@ public static void configureOutputStreamFromBundle(Bundle bundle,
338340

339341
text = bundle.getString(KEY_OUT_FORMAT, "");
340342
requestedOutConfig.setFormat(getFormatFromText(text));
343+
344+
int bufferCapacity = bundle.getInt(KEY_BUFFER_CAPACITY, 0);
345+
requestedOutConfig.setBufferCapacityInFrames(bufferCapacity);
341346
}
342347

343348
public static void configureInputStreamFromBundle(Bundle bundle,
@@ -383,6 +388,9 @@ public static void configureInputStreamFromBundle(Bundle bundle,
383388

384389
text = bundle.getString(KEY_IN_FORMAT, "");
385390
requestedInConfig.setFormat(getFormatFromText(text));
391+
392+
int bufferCapacity = bundle.getInt(KEY_BUFFER_CAPACITY, 0);
393+
requestedInConfig.setBufferCapacityInFrames(bufferCapacity);
386394
}
387395

388396
public static int getSignalTypeFromBundle(Bundle bundle) {

apps/OboeTester/docs/AutomatedTesting.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,7 @@ There are some optional parameter in common for all tests:
8383

8484
There are several optional parameters in common for glitch, latency, input, and output tests:
8585

86+
--ei buffer_capacity {capacity} // number of frames in the buffer, default is UNSPECIFIED.
8687
--ei buffer_bursts {bursts} // number of bursts in the buffer, 2 for "double buffered". Do not use together with buffer_frames to avoid conflict. When both set, buffer_bursts will be ignored.
8788
--ei buffer_frames {frames} // number of frames in the buffer, do not use together with buffer_bursts to avoid conflict. When both set, buffer_bursts will be ignored.
8889
--es in_api {"unspecified", "opensles", "aaudio"} // native input API, default is "unspecified"

0 commit comments

Comments
 (0)