audio: Add StreamDescriptor.frameSizeBytes
This field indicates the frame size and is filled by
the HAL module, so that the client does not have
to calculate it.
As a side effect, in the VTS code, a StreamContext can
now be created solely from a StreamDescriptor.
Added unit tests for the functions from Utils.
Bug: 205884982
Test: atest libaudioaidlcommon_test
Test: atest VtsHalAudioCoreTargetTest
Merged-In: Ief836b8b2d35bacb1f9778e2462d540554149d7f
Change-Id: Ief836b8b2d35bacb1f9778e2462d540554149d7f
(cherry picked from commit 5862c1e3bca8d66b11ef7f0d041171bce79a3104)
diff --git a/audio/aidl/default/Stream.cpp b/audio/aidl/default/Stream.cpp
index 24e46db..312df72 100644
--- a/audio/aidl/default/Stream.cpp
+++ b/audio/aidl/default/Stream.cpp
@@ -35,6 +35,7 @@
desc->reply = mReplyMQ->dupeDesc();
}
if (mDataMQ) {
+ desc->frameSizeBytes = mFrameSize;
desc->bufferSizeFrames =
mDataMQ->getQuantumCount() * mDataMQ->getQuantumSize() / mFrameSize;
desc->audio.set<StreamDescriptor::AudioBuffer::Tag::fmq>(mDataMQ->dupeDesc());