audio: Add support for compressed offload
- Add compressed offload mix port into default implementation.
- Require AudioOffloadInfo to be passed to IModule.openOutputStream
for compressed offload port configs.
- Update VTS to handle compressed offload.
Bug: 205884982
Test: atest VtsHalAudioCoreTargetTest
Merged-In: I118b2c04bff12b64a7cac4dc2c88217a6a270046
Change-Id: I118b2c04bff12b64a7cac4dc2c88217a6a270046
(cherry picked from commit 975ea3ae8959b1d9502290ebd5c71fba68645c64)
diff --git a/audio/aidl/default/Module.cpp b/audio/aidl/default/Module.cpp
index 1bf7321..5b4d48a 100644
--- a/audio/aidl/default/Module.cpp
+++ b/audio/aidl/default/Module.cpp
@@ -405,6 +405,14 @@
<< " does not correspond to an output mix port";
return ndk::ScopedAStatus::fromExceptionCode(EX_ILLEGAL_ARGUMENT);
}
+ if (portConfigIt->flags.has_value() &&
+ ((portConfigIt->flags.value().get<AudioIoFlags::Tag::output>() &
+ 1 << static_cast<int32_t>(AudioOutputFlags::COMPRESS_OFFLOAD)) != 0) &&
+ !in_offloadInfo.has_value()) {
+ LOG(ERROR) << __func__ << ": port config id " << in_portConfigId
+ << " has COMPRESS_OFFLOAD flag set, requires offload info";
+ return ndk::ScopedAStatus::fromExceptionCode(EX_ILLEGAL_ARGUMENT);
+ }
if (mStreams.count(in_portConfigId) != 0) {
LOG(ERROR) << __func__ << ": port config id " << in_portConfigId
<< " already has a stream opened on it";