Skip to content

Commit

Permalink
OboeTester: Add HW getters to data paths test (#2164)
Browse files Browse the repository at this point in the history
  • Loading branch information
robertwu1 authored Feb 18, 2025
1 parent a231d4b commit 6147923
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -221,6 +221,18 @@ public int getFramesPerBurst() {
return mActualStreamConfiguration.getFramesPerBurst();
}

public int getHardwareChannelCount() {
return mActualStreamConfiguration.getHardwareChannelCount();
}

public int getHardwareSampleRate() {
return mActualStreamConfiguration.getHardwareSampleRate();
}

public int getHardwareFormat() {
return mActualStreamConfiguration.getHardwareFormat();
}

public int getBufferCapacityInFrames() {
return mBufferSizeInFrames;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -251,6 +251,10 @@ protected String getStreamText(AudioStreamBase stream) {
return ("burst=" + stream.getFramesPerBurst()
+ ", size=" + stream.getBufferSizeInFrames()
+ ", cap=" + stream.getBufferCapacityInFrames()
+ "\n HW: sr=" + stream.getHardwareSampleRate()
+ ", ch=" + stream.getHardwareChannelCount()
+ ", fmt=" + (stream.getHardwareFormat() == StreamConfiguration.UNSPECIFIED ?
"?" : StreamConfiguration.convertFormatToText(stream.getHardwareFormat()))
);
}

Expand Down Expand Up @@ -295,9 +299,9 @@ protected TestResult testCurrentConfigurations() throws InterruptedException {
outStream.setBufferSizeInFrames(sizeFrames);
AudioStreamBase inStream = mAudioInputTester.getCurrentAudioStream();
log(" " + getConfigText(actualInConfig));
log(" " + getStreamText(inStream));
log(" " + getStreamText(inStream));
log(" " + getConfigText(actualOutConfig));
log(" " + getStreamText(outStream));
log(" " + getStreamText(outStream));
} catch (Exception e) {
openFailed = true;
log(e.getMessage());
Expand Down

0 comments on commit 6147923

Please sign in to comment.