mirror of
https://github.com/Evolution-X/hardware_interfaces
synced 2026-02-01 16:50:18 +00:00
Merge "Audio AIDL : Rename AutomaticGainControl to AutomaticGainControlV2"
This commit is contained in:
@@ -225,8 +225,8 @@ aidl_interface {
|
||||
],
|
||||
srcs: [
|
||||
"android/hardware/audio/effect/AcousticEchoCanceler.aidl",
|
||||
"android/hardware/audio/effect/AutomaticGainControl.aidl",
|
||||
"android/hardware/audio/effect/AutomaticGainControlV1.aidl",
|
||||
"android/hardware/audio/effect/AutomaticGainControlV2.aidl",
|
||||
"android/hardware/audio/effect/BassBoost.aidl",
|
||||
"android/hardware/audio/effect/Capability.aidl",
|
||||
"android/hardware/audio/effect/CommandId.aidl",
|
||||
|
||||
@@ -40,7 +40,7 @@
|
||||
"name": "VtsHalAECTargetTest"
|
||||
},
|
||||
{
|
||||
"name": "VtsHalAGCTargetTest"
|
||||
"name": "VtsHalAGC2TargetTest"
|
||||
},
|
||||
{
|
||||
"name": "VtsHalNSTargetTest"
|
||||
|
||||
@@ -33,15 +33,15 @@
|
||||
|
||||
package android.hardware.audio.effect;
|
||||
@VintfStability
|
||||
union AutomaticGainControl {
|
||||
union AutomaticGainControlV2 {
|
||||
android.hardware.audio.effect.VendorExtension vendor;
|
||||
int fixedDigitalGainMb;
|
||||
android.hardware.audio.effect.AutomaticGainControl.LevelEstimator levelEstimator;
|
||||
android.hardware.audio.effect.AutomaticGainControlV2.LevelEstimator levelEstimator;
|
||||
int saturationMarginMb;
|
||||
@VintfStability
|
||||
union Id {
|
||||
int vendorExtensionTag;
|
||||
android.hardware.audio.effect.AutomaticGainControl.Tag commonTag;
|
||||
android.hardware.audio.effect.AutomaticGainControlV2.Tag commonTag;
|
||||
}
|
||||
@Backing(type="int") @VintfStability
|
||||
enum LevelEstimator {
|
||||
@@ -41,7 +41,7 @@ parcelable Descriptor {
|
||||
const String EFFECT_TYPE_UUID_EQUALIZER = "0bed4300-ddd6-11db-8f34-0002a5d5c51b";
|
||||
const String EFFECT_TYPE_UUID_BASS_BOOST = "0634f220-ddd4-11db-a0fc-0002a5d5c51b";
|
||||
const String EFFECT_TYPE_UUID_VIRTUALIZER = "37cc2c00-dddd-11db-8577-0002a5d5c51b";
|
||||
const String EFFECT_TYPE_UUID_AGC = "0a8abfe0-654c-11e0-ba26-0002a5d5c51b";
|
||||
const String EFFECT_TYPE_UUID_AGC2 = "ae3c653b-be18-4ab8-8938-418f0a7f06ac";
|
||||
const String EFFECT_TYPE_UUID_AEC = "7b491460-8d4d-11e0-bd61-0002a5d5c51b";
|
||||
const String EFFECT_TYPE_UUID_NS = "58b4b260-8e06-11e0-aa8e-0002a5d5c51b";
|
||||
const String EFFECT_TYPE_UUID_LOUDNESS_ENHANCER = "fe3199be-aed0-413f-87bb-11260eb63cf1";
|
||||
|
||||
@@ -44,7 +44,7 @@ union Parameter {
|
||||
union Id {
|
||||
int vendorEffectTag;
|
||||
android.hardware.audio.effect.AcousticEchoCanceler.Id acousticEchoCancelerTag;
|
||||
android.hardware.audio.effect.AutomaticGainControl.Id automaticGainControlTag;
|
||||
android.hardware.audio.effect.AutomaticGainControlV2.Id automaticGainControlV2Tag;
|
||||
android.hardware.audio.effect.BassBoost.Id bassBoostTag;
|
||||
android.hardware.audio.effect.Downmix.Id downmixTag;
|
||||
android.hardware.audio.effect.DynamicsProcessing.Id dynamicsProcessingTag;
|
||||
@@ -75,7 +75,7 @@ union Parameter {
|
||||
union Specific {
|
||||
android.hardware.audio.effect.VendorExtension vendorEffect;
|
||||
android.hardware.audio.effect.AcousticEchoCanceler acousticEchoCanceler;
|
||||
android.hardware.audio.effect.AutomaticGainControl automaticGainControl;
|
||||
android.hardware.audio.effect.AutomaticGainControlV2 automaticGainControlV2;
|
||||
android.hardware.audio.effect.BassBoost bassBoost;
|
||||
android.hardware.audio.effect.Downmix downmix;
|
||||
android.hardware.audio.effect.DynamicsProcessing dynamicsProcessing;
|
||||
|
||||
@@ -36,8 +36,8 @@ package android.hardware.audio.effect;
|
||||
union Range {
|
||||
android.hardware.audio.effect.Range.VendorExtensionRange[] vendorExtension = {};
|
||||
android.hardware.audio.effect.Range.AcousticEchoCancelerRange[] acousticEchoCanceler;
|
||||
android.hardware.audio.effect.Range.AutomaticGainControlRange[] automaticGainControl;
|
||||
android.hardware.audio.effect.Range.AutomaticGainControlV1Range[] automaticGainControlV1;
|
||||
android.hardware.audio.effect.Range.AutomaticGainControlV2Range[] automaticGainControlV2;
|
||||
android.hardware.audio.effect.Range.BassBoostRange[] bassBoost;
|
||||
android.hardware.audio.effect.Range.DownmixRange[] downmix;
|
||||
android.hardware.audio.effect.Range.DynamicsProcessingRange[] dynamicsProcessing;
|
||||
@@ -56,16 +56,16 @@ union Range {
|
||||
android.hardware.audio.effect.AcousticEchoCanceler max;
|
||||
}
|
||||
@VintfStability
|
||||
parcelable AutomaticGainControlRange {
|
||||
android.hardware.audio.effect.AutomaticGainControl min;
|
||||
android.hardware.audio.effect.AutomaticGainControl max;
|
||||
}
|
||||
@VintfStability
|
||||
parcelable AutomaticGainControlV1Range {
|
||||
android.hardware.audio.effect.AutomaticGainControlV1 min;
|
||||
android.hardware.audio.effect.AutomaticGainControlV1 max;
|
||||
}
|
||||
@VintfStability
|
||||
parcelable AutomaticGainControlV2Range {
|
||||
android.hardware.audio.effect.AutomaticGainControlV2 min;
|
||||
android.hardware.audio.effect.AutomaticGainControlV2 max;
|
||||
}
|
||||
@VintfStability
|
||||
parcelable BassBoostRange {
|
||||
android.hardware.audio.effect.BassBoost min;
|
||||
android.hardware.audio.effect.BassBoost max;
|
||||
|
||||
@@ -19,28 +19,29 @@ package android.hardware.audio.effect;
|
||||
import android.hardware.audio.effect.VendorExtension;
|
||||
|
||||
/**
|
||||
* Automatic Gain Control (AGC) is an audio pre-processor which automatically normalizes the output
|
||||
* of the captured signal by boosting or lowering input from the microphone to match a preset level
|
||||
* so that the output signal level is virtually constant. AGC can be used by applications where the
|
||||
* input signal dynamic range is not important but where a constant strong capture level is desired.
|
||||
* Automatic Gain Control V2 (AGC2) is an audio pre-processor which automatically normalizes the
|
||||
* output of the captured signal by boosting or lowering input from the microphone to match a preset
|
||||
* level so that the output signal level is virtually constant. AGC can be used by applications
|
||||
* where the input signal dynamic range is not important but where a constant strong capture level
|
||||
* is desired.
|
||||
*
|
||||
* All parameter settings must be inside the range of Capability.Range.automaticGainControl
|
||||
* All parameter settings must be inside the range of Capability.Range.automaticGainControlV2
|
||||
* definition if the definition for the corresponding parameter tag exist. See more detals about
|
||||
* Range in Range.aidl.
|
||||
*/
|
||||
@VintfStability
|
||||
union AutomaticGainControl {
|
||||
union AutomaticGainControlV2 {
|
||||
/**
|
||||
* Effect parameter tag to identify the parameters for getParameter().
|
||||
*/
|
||||
@VintfStability
|
||||
union Id {
|
||||
int vendorExtensionTag;
|
||||
AutomaticGainControl.Tag commonTag;
|
||||
AutomaticGainControlV2.Tag commonTag;
|
||||
}
|
||||
|
||||
/**
|
||||
* Vendor AutomaticGainControl implementation definition for additional parameters.
|
||||
* Vendor AutomaticGainControlV2 implementation definition for additional parameters.
|
||||
*/
|
||||
VendorExtension vendor;
|
||||
|
||||
@@ -57,9 +57,9 @@ parcelable Descriptor {
|
||||
*/
|
||||
const String EFFECT_TYPE_UUID_VIRTUALIZER = "37cc2c00-dddd-11db-8577-0002a5d5c51b";
|
||||
/**
|
||||
* UUID for Automatic Gain Control (AGC) type.
|
||||
* UUID for Automatic Gain Control V2 (AGC2) type.
|
||||
*/
|
||||
const String EFFECT_TYPE_UUID_AGC = "0a8abfe0-654c-11e0-ba26-0002a5d5c51b";
|
||||
const String EFFECT_TYPE_UUID_AGC2 = "ae3c653b-be18-4ab8-8938-418f0a7f06ac";
|
||||
/**
|
||||
* UUID for Acoustic Echo Canceler (AEC) type.
|
||||
*/
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
package android.hardware.audio.effect;
|
||||
|
||||
import android.hardware.audio.effect.AcousticEchoCanceler;
|
||||
import android.hardware.audio.effect.AutomaticGainControl;
|
||||
import android.hardware.audio.effect.AutomaticGainControlV2;
|
||||
import android.hardware.audio.effect.BassBoost;
|
||||
import android.hardware.audio.effect.Downmix;
|
||||
import android.hardware.audio.effect.DynamicsProcessing;
|
||||
@@ -83,7 +83,7 @@ union Parameter {
|
||||
*
|
||||
*/
|
||||
AcousticEchoCanceler.Id acousticEchoCancelerTag;
|
||||
AutomaticGainControl.Id automaticGainControlTag;
|
||||
AutomaticGainControlV2.Id automaticGainControlV2Tag;
|
||||
BassBoost.Id bassBoostTag;
|
||||
Downmix.Id downmixTag;
|
||||
DynamicsProcessing.Id dynamicsProcessingTag;
|
||||
@@ -165,7 +165,7 @@ union Parameter {
|
||||
union Specific {
|
||||
VendorExtension vendorEffect;
|
||||
AcousticEchoCanceler acousticEchoCanceler;
|
||||
AutomaticGainControl automaticGainControl;
|
||||
AutomaticGainControlV2 automaticGainControlV2;
|
||||
BassBoost bassBoost;
|
||||
Downmix downmix;
|
||||
DynamicsProcessing dynamicsProcessing;
|
||||
|
||||
@@ -17,8 +17,8 @@
|
||||
package android.hardware.audio.effect;
|
||||
|
||||
import android.hardware.audio.effect.AcousticEchoCanceler;
|
||||
import android.hardware.audio.effect.AutomaticGainControl;
|
||||
import android.hardware.audio.effect.AutomaticGainControlV1;
|
||||
import android.hardware.audio.effect.AutomaticGainControlV2;
|
||||
import android.hardware.audio.effect.BassBoost;
|
||||
import android.hardware.audio.effect.Downmix;
|
||||
import android.hardware.audio.effect.DynamicsProcessing;
|
||||
@@ -102,18 +102,18 @@ union Range {
|
||||
AcousticEchoCanceler max;
|
||||
}
|
||||
|
||||
@VintfStability
|
||||
parcelable AutomaticGainControlRange {
|
||||
AutomaticGainControl min;
|
||||
AutomaticGainControl max;
|
||||
}
|
||||
|
||||
@VintfStability
|
||||
parcelable AutomaticGainControlV1Range {
|
||||
AutomaticGainControlV1 min;
|
||||
AutomaticGainControlV1 max;
|
||||
}
|
||||
|
||||
@VintfStability
|
||||
parcelable AutomaticGainControlV2Range {
|
||||
AutomaticGainControlV2 min;
|
||||
AutomaticGainControlV2 max;
|
||||
}
|
||||
|
||||
@VintfStability
|
||||
parcelable BassBoostRange {
|
||||
BassBoost min;
|
||||
@@ -203,8 +203,8 @@ union Range {
|
||||
*/
|
||||
VendorExtensionRange[] vendorExtension = {};
|
||||
AcousticEchoCancelerRange[] acousticEchoCanceler;
|
||||
AutomaticGainControlRange[] automaticGainControl;
|
||||
AutomaticGainControlV1Range[] automaticGainControlV1;
|
||||
AutomaticGainControlV2Range[] automaticGainControlV2;
|
||||
BassBoostRange[] bassBoost;
|
||||
DownmixRange[] downmix;
|
||||
DynamicsProcessingRange[] dynamicsProcessing;
|
||||
|
||||
@@ -29,7 +29,7 @@
|
||||
-->
|
||||
<libraries>
|
||||
<library name="aecsw" path="libaecsw.so"/>
|
||||
<library name="agcsw" path="libagcsw.so"/>
|
||||
<library name="agc2sw" path="libagc2sw.so"/>
|
||||
<library name="bassboostsw" path="libbassboostsw.so"/>
|
||||
<library name="bundle" path="libbundleaidl.so"/>
|
||||
<library name="downmix" path="libdownmixaidl.so"/>
|
||||
@@ -67,7 +67,7 @@
|
||||
|
||||
<effects>
|
||||
<effect name="acoustic_echo_canceler" library="aecsw" uuid="bb392ec0-8d4d-11e0-a896-0002a5d5c51b"/>
|
||||
<effect name="automatic_gain_control" library="agcsw" uuid="89f38e65-d4d2-4d64-ad0e-2b3e799ea886"/>
|
||||
<effect name="automatic_gain_control_v2" library="agc2sw" uuid="89f38e65-d4d2-4d64-ad0e-2b3e799ea886"/>
|
||||
<effectProxy name="bassboost" uuid="14804144-a5ee-4d24-aa88-0002a5d5c51b">
|
||||
<libsw library="bassboostsw" uuid="fa8181f2-588b-11ed-9b6a-0242ac120002"/>
|
||||
<libsw library="bundle" uuid="8631f300-72e2-11df-b57e-0002a5d5c51b"/>
|
||||
|
||||
@@ -24,14 +24,14 @@ package {
|
||||
}
|
||||
|
||||
cc_library_shared {
|
||||
name: "libagcsw",
|
||||
name: "libagc2sw",
|
||||
defaults: [
|
||||
"aidlaudioeffectservice_defaults",
|
||||
"latest_android_media_audio_common_types_ndk_shared",
|
||||
"latest_android_hardware_audio_effect_ndk_shared",
|
||||
],
|
||||
srcs: [
|
||||
"AutomaticGainControlSw.cpp",
|
||||
"AutomaticGainControlV2Sw.cpp",
|
||||
":effectCommonFile",
|
||||
],
|
||||
relative_install_path: "soundfx",
|
||||
@@ -17,29 +17,29 @@
|
||||
#include <algorithm>
|
||||
#include <cstddef>
|
||||
#include <memory>
|
||||
#define LOG_TAG "AHAL_AutomaticGainControlSw"
|
||||
#define LOG_TAG "AHAL_AutomaticGainControlV2Sw"
|
||||
#include <Utils.h>
|
||||
#include <unordered_set>
|
||||
|
||||
#include <android-base/logging.h>
|
||||
#include <fmq/AidlMessageQueue.h>
|
||||
|
||||
#include "AutomaticGainControlSw.h"
|
||||
#include "AutomaticGainControlV2Sw.h"
|
||||
|
||||
using aidl::android::hardware::audio::effect::AutomaticGainControlSw;
|
||||
using aidl::android::hardware::audio::effect::AutomaticGainControlV2Sw;
|
||||
using aidl::android::hardware::audio::effect::Descriptor;
|
||||
using aidl::android::hardware::audio::effect::IEffect;
|
||||
using aidl::android::hardware::audio::effect::kAutomaticGainControlSwImplUUID;
|
||||
using aidl::android::hardware::audio::effect::kAutomaticGainControlV2SwImplUUID;
|
||||
using aidl::android::media::audio::common::AudioUuid;
|
||||
|
||||
extern "C" binder_exception_t createEffect(const AudioUuid* in_impl_uuid,
|
||||
std::shared_ptr<IEffect>* instanceSpp) {
|
||||
if (!in_impl_uuid || *in_impl_uuid != kAutomaticGainControlSwImplUUID) {
|
||||
if (!in_impl_uuid || *in_impl_uuid != kAutomaticGainControlV2SwImplUUID) {
|
||||
LOG(ERROR) << __func__ << "uuid not supported";
|
||||
return EX_ILLEGAL_ARGUMENT;
|
||||
}
|
||||
if (instanceSpp) {
|
||||
*instanceSpp = ndk::SharedRefBase::make<AutomaticGainControlSw>();
|
||||
*instanceSpp = ndk::SharedRefBase::make<AutomaticGainControlV2Sw>();
|
||||
LOG(DEBUG) << __func__ << " instance " << instanceSpp->get() << " created";
|
||||
return EX_NONE;
|
||||
} else {
|
||||
@@ -49,68 +49,69 @@ extern "C" binder_exception_t createEffect(const AudioUuid* in_impl_uuid,
|
||||
}
|
||||
|
||||
extern "C" binder_exception_t queryEffect(const AudioUuid* in_impl_uuid, Descriptor* _aidl_return) {
|
||||
if (!in_impl_uuid || *in_impl_uuid != kAutomaticGainControlSwImplUUID) {
|
||||
if (!in_impl_uuid || *in_impl_uuid != kAutomaticGainControlV2SwImplUUID) {
|
||||
LOG(ERROR) << __func__ << "uuid not supported";
|
||||
return EX_ILLEGAL_ARGUMENT;
|
||||
}
|
||||
*_aidl_return = AutomaticGainControlSw::kDescriptor;
|
||||
*_aidl_return = AutomaticGainControlV2Sw::kDescriptor;
|
||||
return EX_NONE;
|
||||
}
|
||||
|
||||
namespace aidl::android::hardware::audio::effect {
|
||||
|
||||
const std::string AutomaticGainControlSw::kEffectName = "AutomaticGainControlSw";
|
||||
const std::string AutomaticGainControlV2Sw::kEffectName = "AutomaticGainControlV2Sw";
|
||||
|
||||
const std::vector<Range::AutomaticGainControlRange> AutomaticGainControlSw::kRanges = {
|
||||
MAKE_RANGE(AutomaticGainControl, fixedDigitalGainMb, 0, 50000),
|
||||
MAKE_RANGE(AutomaticGainControl, saturationMarginMb, 0, 10000)};
|
||||
const std::vector<Range::AutomaticGainControlV2Range> AutomaticGainControlV2Sw::kRanges = {
|
||||
MAKE_RANGE(AutomaticGainControlV2, fixedDigitalGainMb, 0, 50000),
|
||||
MAKE_RANGE(AutomaticGainControlV2, saturationMarginMb, 0, 10000)};
|
||||
|
||||
const Capability AutomaticGainControlSw::kCapability = {.range = AutomaticGainControlSw::kRanges};
|
||||
const Capability AutomaticGainControlV2Sw::kCapability = {
|
||||
.range = AutomaticGainControlV2Sw::kRanges};
|
||||
|
||||
const Descriptor AutomaticGainControlSw::kDescriptor = {
|
||||
.common = {.id = {.type = kAutomaticGainControlTypeUUID,
|
||||
.uuid = kAutomaticGainControlSwImplUUID,
|
||||
const Descriptor AutomaticGainControlV2Sw::kDescriptor = {
|
||||
.common = {.id = {.type = kAutomaticGainControlV2TypeUUID,
|
||||
.uuid = kAutomaticGainControlV2SwImplUUID,
|
||||
.proxy = std::nullopt},
|
||||
.flags = {.type = Flags::Type::INSERT,
|
||||
.insert = Flags::Insert::FIRST,
|
||||
.volume = Flags::Volume::CTRL},
|
||||
.name = AutomaticGainControlSw::kEffectName,
|
||||
.name = AutomaticGainControlV2Sw::kEffectName,
|
||||
.implementor = "The Android Open Source Project"},
|
||||
.capability = AutomaticGainControlSw::kCapability};
|
||||
.capability = AutomaticGainControlV2Sw::kCapability};
|
||||
|
||||
ndk::ScopedAStatus AutomaticGainControlSw::getDescriptor(Descriptor* _aidl_return) {
|
||||
ndk::ScopedAStatus AutomaticGainControlV2Sw::getDescriptor(Descriptor* _aidl_return) {
|
||||
LOG(DEBUG) << __func__ << kDescriptor.toString();
|
||||
*_aidl_return = kDescriptor;
|
||||
return ndk::ScopedAStatus::ok();
|
||||
}
|
||||
|
||||
ndk::ScopedAStatus AutomaticGainControlSw::setParameterSpecific(
|
||||
ndk::ScopedAStatus AutomaticGainControlV2Sw::setParameterSpecific(
|
||||
const Parameter::Specific& specific) {
|
||||
RETURN_IF(Parameter::Specific::automaticGainControl != specific.getTag(), EX_ILLEGAL_ARGUMENT,
|
||||
RETURN_IF(Parameter::Specific::automaticGainControlV2 != specific.getTag(), EX_ILLEGAL_ARGUMENT,
|
||||
"EffectNotSupported");
|
||||
RETURN_IF(!mContext, EX_NULL_POINTER, "nullContext");
|
||||
|
||||
auto& param = specific.get<Parameter::Specific::automaticGainControl>();
|
||||
auto& param = specific.get<Parameter::Specific::automaticGainControlV2>();
|
||||
RETURN_IF(!inRange(param, kRanges), EX_ILLEGAL_ARGUMENT, "outOfRange");
|
||||
auto tag = param.getTag();
|
||||
switch (tag) {
|
||||
case AutomaticGainControl::fixedDigitalGainMb: {
|
||||
case AutomaticGainControlV2::fixedDigitalGainMb: {
|
||||
RETURN_IF(mContext->setDigitalGain(
|
||||
param.get<AutomaticGainControl::fixedDigitalGainMb>()) !=
|
||||
param.get<AutomaticGainControlV2::fixedDigitalGainMb>()) !=
|
||||
RetCode::SUCCESS,
|
||||
EX_ILLEGAL_ARGUMENT, "digitalGainNotSupported");
|
||||
return ndk::ScopedAStatus::ok();
|
||||
}
|
||||
case AutomaticGainControl::levelEstimator: {
|
||||
RETURN_IF(
|
||||
mContext->setLevelEstimator(
|
||||
param.get<AutomaticGainControl::levelEstimator>()) != RetCode::SUCCESS,
|
||||
EX_ILLEGAL_ARGUMENT, "levelEstimatorNotSupported");
|
||||
case AutomaticGainControlV2::levelEstimator: {
|
||||
RETURN_IF(mContext->setLevelEstimator(
|
||||
param.get<AutomaticGainControlV2::levelEstimator>()) !=
|
||||
RetCode::SUCCESS,
|
||||
EX_ILLEGAL_ARGUMENT, "levelEstimatorNotSupported");
|
||||
return ndk::ScopedAStatus::ok();
|
||||
}
|
||||
case AutomaticGainControl::saturationMarginMb: {
|
||||
case AutomaticGainControlV2::saturationMarginMb: {
|
||||
RETURN_IF(mContext->setSaturationMargin(
|
||||
param.get<AutomaticGainControl::saturationMarginMb>()) !=
|
||||
param.get<AutomaticGainControlV2::saturationMarginMb>()) !=
|
||||
RetCode::SUCCESS,
|
||||
EX_ILLEGAL_ARGUMENT, "saturationMarginNotSupported");
|
||||
return ndk::ScopedAStatus::ok();
|
||||
@@ -118,71 +119,72 @@ ndk::ScopedAStatus AutomaticGainControlSw::setParameterSpecific(
|
||||
default: {
|
||||
LOG(ERROR) << __func__ << " unsupported tag: " << toString(tag);
|
||||
return ndk::ScopedAStatus::fromExceptionCodeWithMessage(
|
||||
EX_ILLEGAL_ARGUMENT, "AutomaticGainControlTagNotSupported");
|
||||
EX_ILLEGAL_ARGUMENT, "AutomaticGainControlV2TagNotSupported");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
ndk::ScopedAStatus AutomaticGainControlSw::getParameterSpecific(const Parameter::Id& id,
|
||||
Parameter::Specific* specific) {
|
||||
ndk::ScopedAStatus AutomaticGainControlV2Sw::getParameterSpecific(const Parameter::Id& id,
|
||||
Parameter::Specific* specific) {
|
||||
auto tag = id.getTag();
|
||||
RETURN_IF(Parameter::Id::automaticGainControlTag != tag, EX_ILLEGAL_ARGUMENT, "wrongIdTag");
|
||||
auto specificId = id.get<Parameter::Id::automaticGainControlTag>();
|
||||
RETURN_IF(Parameter::Id::automaticGainControlV2Tag != tag, EX_ILLEGAL_ARGUMENT, "wrongIdTag");
|
||||
auto specificId = id.get<Parameter::Id::automaticGainControlV2Tag>();
|
||||
auto specificIdTag = specificId.getTag();
|
||||
switch (specificIdTag) {
|
||||
case AutomaticGainControl::Id::commonTag:
|
||||
return getParameterAutomaticGainControl(
|
||||
specificId.get<AutomaticGainControl::Id::commonTag>(), specific);
|
||||
case AutomaticGainControlV2::Id::commonTag:
|
||||
return getParameterAutomaticGainControlV2(
|
||||
specificId.get<AutomaticGainControlV2::Id::commonTag>(), specific);
|
||||
default:
|
||||
LOG(ERROR) << __func__ << " unsupported tag: " << toString(tag);
|
||||
return ndk::ScopedAStatus::fromExceptionCodeWithMessage(
|
||||
EX_ILLEGAL_ARGUMENT, "AutomaticGainControlTagNotSupported");
|
||||
EX_ILLEGAL_ARGUMENT, "AutomaticGainControlV2TagNotSupported");
|
||||
}
|
||||
}
|
||||
|
||||
ndk::ScopedAStatus AutomaticGainControlSw::getParameterAutomaticGainControl(
|
||||
const AutomaticGainControl::Tag& tag, Parameter::Specific* specific) {
|
||||
ndk::ScopedAStatus AutomaticGainControlV2Sw::getParameterAutomaticGainControlV2(
|
||||
const AutomaticGainControlV2::Tag& tag, Parameter::Specific* specific) {
|
||||
RETURN_IF(!mContext, EX_NULL_POINTER, "nullContext");
|
||||
AutomaticGainControl param;
|
||||
AutomaticGainControlV2 param;
|
||||
switch (tag) {
|
||||
case AutomaticGainControl::fixedDigitalGainMb: {
|
||||
param.set<AutomaticGainControl::fixedDigitalGainMb>(mContext->getDigitalGain());
|
||||
case AutomaticGainControlV2::fixedDigitalGainMb: {
|
||||
param.set<AutomaticGainControlV2::fixedDigitalGainMb>(mContext->getDigitalGain());
|
||||
break;
|
||||
}
|
||||
case AutomaticGainControl::levelEstimator: {
|
||||
param.set<AutomaticGainControl::levelEstimator>(mContext->getLevelEstimator());
|
||||
case AutomaticGainControlV2::levelEstimator: {
|
||||
param.set<AutomaticGainControlV2::levelEstimator>(mContext->getLevelEstimator());
|
||||
break;
|
||||
}
|
||||
case AutomaticGainControl::saturationMarginMb: {
|
||||
param.set<AutomaticGainControl::saturationMarginMb>(mContext->getSaturationMargin());
|
||||
case AutomaticGainControlV2::saturationMarginMb: {
|
||||
param.set<AutomaticGainControlV2::saturationMarginMb>(mContext->getSaturationMargin());
|
||||
break;
|
||||
}
|
||||
default: {
|
||||
LOG(ERROR) << __func__ << " unsupported tag: " << toString(tag);
|
||||
return ndk::ScopedAStatus::fromExceptionCodeWithMessage(
|
||||
EX_ILLEGAL_ARGUMENT, "AutomaticGainControlTagNotSupported");
|
||||
EX_ILLEGAL_ARGUMENT, "AutomaticGainControlV2TagNotSupported");
|
||||
}
|
||||
}
|
||||
|
||||
specific->set<Parameter::Specific::automaticGainControl>(param);
|
||||
specific->set<Parameter::Specific::automaticGainControlV2>(param);
|
||||
return ndk::ScopedAStatus::ok();
|
||||
}
|
||||
|
||||
std::shared_ptr<EffectContext> AutomaticGainControlSw::createContext(
|
||||
std::shared_ptr<EffectContext> AutomaticGainControlV2Sw::createContext(
|
||||
const Parameter::Common& common) {
|
||||
if (mContext) {
|
||||
LOG(DEBUG) << __func__ << " context already exist";
|
||||
} else {
|
||||
mContext = std::make_shared<AutomaticGainControlSwContext>(1 /* statusFmqDepth */, common);
|
||||
mContext =
|
||||
std::make_shared<AutomaticGainControlV2SwContext>(1 /* statusFmqDepth */, common);
|
||||
}
|
||||
return mContext;
|
||||
}
|
||||
|
||||
std::shared_ptr<EffectContext> AutomaticGainControlSw::getContext() {
|
||||
std::shared_ptr<EffectContext> AutomaticGainControlV2Sw::getContext() {
|
||||
return mContext;
|
||||
}
|
||||
|
||||
RetCode AutomaticGainControlSw::releaseContext() {
|
||||
RetCode AutomaticGainControlV2Sw::releaseContext() {
|
||||
if (mContext) {
|
||||
mContext.reset();
|
||||
}
|
||||
@@ -190,7 +192,7 @@ RetCode AutomaticGainControlSw::releaseContext() {
|
||||
}
|
||||
|
||||
// Processing method running in EffectWorker thread.
|
||||
IEffect::Status AutomaticGainControlSw::effectProcessImpl(float* in, float* out, int samples) {
|
||||
IEffect::Status AutomaticGainControlV2Sw::effectProcessImpl(float* in, float* out, int samples) {
|
||||
// TODO: get data buffer and process.
|
||||
LOG(DEBUG) << __func__ << " in " << in << " out " << out << " samples " << samples;
|
||||
for (int i = 0; i < samples; i++) {
|
||||
@@ -199,31 +201,31 @@ IEffect::Status AutomaticGainControlSw::effectProcessImpl(float* in, float* out,
|
||||
return {STATUS_OK, samples, samples};
|
||||
}
|
||||
|
||||
RetCode AutomaticGainControlSwContext::setDigitalGain(int gain) {
|
||||
RetCode AutomaticGainControlV2SwContext::setDigitalGain(int gain) {
|
||||
mDigitalGain = gain;
|
||||
return RetCode::SUCCESS;
|
||||
}
|
||||
|
||||
int AutomaticGainControlSwContext::getDigitalGain() {
|
||||
int AutomaticGainControlV2SwContext::getDigitalGain() {
|
||||
return mDigitalGain;
|
||||
}
|
||||
|
||||
RetCode AutomaticGainControlSwContext::setLevelEstimator(
|
||||
AutomaticGainControl::LevelEstimator levelEstimator) {
|
||||
RetCode AutomaticGainControlV2SwContext::setLevelEstimator(
|
||||
AutomaticGainControlV2::LevelEstimator levelEstimator) {
|
||||
mLevelEstimator = levelEstimator;
|
||||
return RetCode::SUCCESS;
|
||||
}
|
||||
|
||||
AutomaticGainControl::LevelEstimator AutomaticGainControlSwContext::getLevelEstimator() {
|
||||
AutomaticGainControlV2::LevelEstimator AutomaticGainControlV2SwContext::getLevelEstimator() {
|
||||
return mLevelEstimator;
|
||||
}
|
||||
|
||||
RetCode AutomaticGainControlSwContext::setSaturationMargin(int margin) {
|
||||
RetCode AutomaticGainControlV2SwContext::setSaturationMargin(int margin) {
|
||||
mSaturationMargin = margin;
|
||||
return RetCode::SUCCESS;
|
||||
}
|
||||
|
||||
int AutomaticGainControlSwContext::getSaturationMargin() {
|
||||
int AutomaticGainControlV2SwContext::getSaturationMargin() {
|
||||
return mSaturationMargin;
|
||||
}
|
||||
|
||||
@@ -26,35 +26,35 @@
|
||||
|
||||
namespace aidl::android::hardware::audio::effect {
|
||||
|
||||
class AutomaticGainControlSwContext final : public EffectContext {
|
||||
class AutomaticGainControlV2SwContext final : public EffectContext {
|
||||
public:
|
||||
AutomaticGainControlSwContext(int statusDepth, const Parameter::Common& common)
|
||||
AutomaticGainControlV2SwContext(int statusDepth, const Parameter::Common& common)
|
||||
: EffectContext(statusDepth, common) {
|
||||
LOG(DEBUG) << __func__;
|
||||
}
|
||||
|
||||
RetCode setDigitalGain(int gain);
|
||||
int getDigitalGain();
|
||||
RetCode setLevelEstimator(AutomaticGainControl::LevelEstimator levelEstimator);
|
||||
AutomaticGainControl::LevelEstimator getLevelEstimator();
|
||||
RetCode setLevelEstimator(AutomaticGainControlV2::LevelEstimator levelEstimator);
|
||||
AutomaticGainControlV2::LevelEstimator getLevelEstimator();
|
||||
RetCode setSaturationMargin(int margin);
|
||||
int getSaturationMargin();
|
||||
|
||||
private:
|
||||
int mDigitalGain = 0;
|
||||
AutomaticGainControl::LevelEstimator mLevelEstimator =
|
||||
AutomaticGainControl::LevelEstimator::RMS;
|
||||
AutomaticGainControlV2::LevelEstimator mLevelEstimator =
|
||||
AutomaticGainControlV2::LevelEstimator::RMS;
|
||||
int mSaturationMargin = 0;
|
||||
};
|
||||
|
||||
class AutomaticGainControlSw final : public EffectImpl {
|
||||
class AutomaticGainControlV2Sw final : public EffectImpl {
|
||||
public:
|
||||
static const std::string kEffectName;
|
||||
static const bool kStrengthSupported;
|
||||
static const Capability kCapability;
|
||||
static const Descriptor kDescriptor;
|
||||
AutomaticGainControlSw() { LOG(DEBUG) << __func__; }
|
||||
~AutomaticGainControlSw() {
|
||||
AutomaticGainControlV2Sw() { LOG(DEBUG) << __func__; }
|
||||
~AutomaticGainControlV2Sw() {
|
||||
cleanUp();
|
||||
LOG(DEBUG) << __func__;
|
||||
}
|
||||
@@ -72,9 +72,9 @@ class AutomaticGainControlSw final : public EffectImpl {
|
||||
IEffect::Status effectProcessImpl(float* in, float* out, int samples) override;
|
||||
|
||||
private:
|
||||
static const std::vector<Range::AutomaticGainControlRange> kRanges;
|
||||
std::shared_ptr<AutomaticGainControlSwContext> mContext;
|
||||
ndk::ScopedAStatus getParameterAutomaticGainControl(const AutomaticGainControl::Tag& tag,
|
||||
Parameter::Specific* specific);
|
||||
static const std::vector<Range::AutomaticGainControlV2Range> kRanges;
|
||||
std::shared_ptr<AutomaticGainControlV2SwContext> mContext;
|
||||
ndk::ScopedAStatus getParameterAutomaticGainControlV2(const AutomaticGainControlV2::Tag& tag,
|
||||
Parameter::Specific* specific);
|
||||
};
|
||||
} // namespace aidl::android::hardware::audio::effect
|
||||
@@ -45,18 +45,18 @@ static const AudioUuid kAcousticEchoCancelerSwImplUUID = {static_cast<int32_t>(0
|
||||
0x11e0,
|
||||
0xa896,
|
||||
{0x00, 0x02, 0xa5, 0xd5, 0xc5, 0x1b}};
|
||||
// 0xae3c653b-be18-4ab8-8938-418f0a7f06ac
|
||||
static const AudioUuid kAutomaticGainControlTypeUUID = {static_cast<int32_t>(0xae3c653b),
|
||||
0xbe18,
|
||||
0x4ab8,
|
||||
0x8938,
|
||||
{0x41, 0x8f, 0x0a, 0x7f, 0x06, 0xac}};
|
||||
// ae3c653b-be18-4ab8-8938-418f0a7f06ac
|
||||
static const AudioUuid kAutomaticGainControlV2TypeUUID = {static_cast<int32_t>(0xae3c653b),
|
||||
0xbe18,
|
||||
0x4ab8,
|
||||
0x8938,
|
||||
{0x41, 0x8f, 0x0a, 0x7f, 0x06, 0xac}};
|
||||
// 89f38e65-d4d2-4d64-ad0e-2b3e799ea886
|
||||
static const AudioUuid kAutomaticGainControlSwImplUUID = {static_cast<int32_t>(0x89f38e65),
|
||||
0xd4d2,
|
||||
0x4d64,
|
||||
0xad0e,
|
||||
{0x2b, 0x3e, 0x79, 0x9e, 0xa8, 0x86}};
|
||||
static const AudioUuid kAutomaticGainControlV2SwImplUUID = {static_cast<int32_t>(0x89f38e65),
|
||||
0xd4d2,
|
||||
0x4d64,
|
||||
0xad0e,
|
||||
{0x2b, 0x3e, 0x79, 0x9e, 0xa8, 0x86}};
|
||||
// 0634f220-ddd4-11db-a0fc-0002a5d5c51b
|
||||
static const AudioUuid kBassBoostTypeUUID = {static_cast<int32_t>(0x0634f220),
|
||||
0xddd4,
|
||||
@@ -306,7 +306,7 @@ static const AudioUuid kVolumeBundleImplUUID = {static_cast<int32_t>(0x119341a0)
|
||||
*/
|
||||
static const std::map<const std::string /* effect type */, const AudioUuid&> kUuidNameTypeMap = {
|
||||
{"acoustic_echo_canceler", kAcousticEchoCancelerTypeUUID},
|
||||
{"automatic_gain_control", kAutomaticGainControlTypeUUID},
|
||||
{"automatic_gain_control_v2", kAutomaticGainControlV2TypeUUID},
|
||||
{"bassboost", kBassBoostTypeUUID},
|
||||
{"downmix", kDownmixTypeUUID},
|
||||
{"dynamics_processing", kDynamicsProcessingTypeUUID},
|
||||
|
||||
@@ -141,9 +141,9 @@ cc_test {
|
||||
}
|
||||
|
||||
cc_test {
|
||||
name: "VtsHalAGCTargetTest",
|
||||
name: "VtsHalAGC2TargetTest",
|
||||
defaults: ["VtsHalAudioTargetTestDefaults"],
|
||||
srcs: ["VtsHalAGCTargetTest.cpp"],
|
||||
srcs: ["VtsHalAGC2TargetTest.cpp"],
|
||||
}
|
||||
|
||||
cc_test {
|
||||
|
||||
@@ -19,17 +19,17 @@
|
||||
#include <android/binder_enums.h>
|
||||
#include <unordered_set>
|
||||
|
||||
#define LOG_TAG "VtsHalAGCParamTest"
|
||||
#define LOG_TAG "VtsHalAGC2ParamTest"
|
||||
|
||||
#include "EffectHelper.h"
|
||||
|
||||
using namespace android;
|
||||
|
||||
using aidl::android::hardware::audio::effect::AutomaticGainControl;
|
||||
using aidl::android::hardware::audio::effect::AutomaticGainControlV2;
|
||||
using aidl::android::hardware::audio::effect::Descriptor;
|
||||
using aidl::android::hardware::audio::effect::IEffect;
|
||||
using aidl::android::hardware::audio::effect::IFactory;
|
||||
using aidl::android::hardware::audio::effect::kAutomaticGainControlTypeUUID;
|
||||
using aidl::android::hardware::audio::effect::kAutomaticGainControlV2TypeUUID;
|
||||
using aidl::android::hardware::audio::effect::Parameter;
|
||||
|
||||
enum ParamName {
|
||||
@@ -38,13 +38,13 @@ enum ParamName {
|
||||
PARAM_SATURATION_MARGIN,
|
||||
PARAM_LEVEL_ESTIMATOR
|
||||
};
|
||||
using AGCParamTestParam =
|
||||
using AGC2ParamTestParam =
|
||||
std::tuple<std::pair<std::shared_ptr<IFactory>, Descriptor>, int /* gain */,
|
||||
int /* margin */, AutomaticGainControl::LevelEstimator>;
|
||||
int /* margin */, AutomaticGainControlV2::LevelEstimator>;
|
||||
|
||||
class AGCParamTest : public ::testing::TestWithParam<AGCParamTestParam>, public EffectHelper {
|
||||
class AGC2ParamTest : public ::testing::TestWithParam<AGC2ParamTestParam>, public EffectHelper {
|
||||
public:
|
||||
AGCParamTest()
|
||||
AGC2ParamTest()
|
||||
: mGain(std::get<PARAM_DIGITAL_GAIN>(GetParam())),
|
||||
mMargin(std::get<PARAM_SATURATION_MARGIN>(GetParam())),
|
||||
mLevelEstimator(std::get<PARAM_LEVEL_ESTIMATOR>(GetParam())) {
|
||||
@@ -70,10 +70,10 @@ class AGCParamTest : public ::testing::TestWithParam<AGCParamTestParam>, public
|
||||
}
|
||||
|
||||
Parameter::Specific getDefaultParamSpecific() {
|
||||
AutomaticGainControl AGC =
|
||||
AutomaticGainControl::make<AutomaticGainControl::fixedDigitalGainMb>(0);
|
||||
AutomaticGainControlV2 AGC2 =
|
||||
AutomaticGainControlV2::make<AutomaticGainControlV2::fixedDigitalGainMb>(0);
|
||||
Parameter::Specific specific =
|
||||
Parameter::Specific::make<Parameter::Specific::automaticGainControl>(AGC);
|
||||
Parameter::Specific::make<Parameter::Specific::automaticGainControlV2>(AGC2);
|
||||
return specific;
|
||||
}
|
||||
|
||||
@@ -83,24 +83,25 @@ class AGCParamTest : public ::testing::TestWithParam<AGCParamTestParam>, public
|
||||
Descriptor mDescriptor;
|
||||
int mGain;
|
||||
int mMargin;
|
||||
AutomaticGainControl::LevelEstimator mLevelEstimator;
|
||||
AutomaticGainControlV2::LevelEstimator mLevelEstimator;
|
||||
|
||||
void SetAndGetParameters() {
|
||||
for (auto& it : mTags) {
|
||||
auto& tag = it.first;
|
||||
auto& AGC = it.second;
|
||||
auto& AGC2 = it.second;
|
||||
|
||||
// validate parameter
|
||||
Descriptor desc;
|
||||
ASSERT_STATUS(EX_NONE, mEffect->getDescriptor(&desc));
|
||||
const bool valid =
|
||||
isParameterValid<AutomaticGainControl, Range::automaticGainControl>(AGC, desc);
|
||||
isParameterValid<AutomaticGainControlV2, Range::automaticGainControlV2>(AGC2,
|
||||
desc);
|
||||
const binder_exception_t expected = valid ? EX_NONE : EX_ILLEGAL_ARGUMENT;
|
||||
|
||||
// set parameter
|
||||
Parameter expectParam;
|
||||
Parameter::Specific specific;
|
||||
specific.set<Parameter::Specific::automaticGainControl>(AGC);
|
||||
specific.set<Parameter::Specific::automaticGainControlV2>(AGC2);
|
||||
expectParam.set<Parameter::specific>(specific);
|
||||
EXPECT_STATUS(expected, mEffect->setParameter(expectParam)) << expectParam.toString();
|
||||
|
||||
@@ -108,9 +109,9 @@ class AGCParamTest : public ::testing::TestWithParam<AGCParamTestParam>, public
|
||||
if (expected == EX_NONE) {
|
||||
Parameter getParam;
|
||||
Parameter::Id id;
|
||||
AutomaticGainControl::Id specificId;
|
||||
specificId.set<AutomaticGainControl::Id::commonTag>(tag);
|
||||
id.set<Parameter::Id::automaticGainControlTag>(specificId);
|
||||
AutomaticGainControlV2::Id specificId;
|
||||
specificId.set<AutomaticGainControlV2::Id::commonTag>(tag);
|
||||
id.set<Parameter::Id::automaticGainControlV2Tag>(specificId);
|
||||
EXPECT_STATUS(EX_NONE, mEffect->getParameter(id, &getParam));
|
||||
|
||||
EXPECT_EQ(expectParam, getParam) << "\nexpect:" << expectParam.toString()
|
||||
@@ -120,62 +121,62 @@ class AGCParamTest : public ::testing::TestWithParam<AGCParamTestParam>, public
|
||||
}
|
||||
|
||||
void addDigitalGainParam(int gain) {
|
||||
AutomaticGainControl AGC;
|
||||
AGC.set<AutomaticGainControl::fixedDigitalGainMb>(gain);
|
||||
mTags.push_back({AutomaticGainControl::fixedDigitalGainMb, AGC});
|
||||
AutomaticGainControlV2 AGC2;
|
||||
AGC2.set<AutomaticGainControlV2::fixedDigitalGainMb>(gain);
|
||||
mTags.push_back({AutomaticGainControlV2::fixedDigitalGainMb, AGC2});
|
||||
}
|
||||
void addSaturationMarginParam(int margin) {
|
||||
AutomaticGainControl AGC;
|
||||
AGC.set<AutomaticGainControl::saturationMarginMb>(margin);
|
||||
mTags.push_back({AutomaticGainControl::saturationMarginMb, AGC});
|
||||
AutomaticGainControlV2 AGC2;
|
||||
AGC2.set<AutomaticGainControlV2::saturationMarginMb>(margin);
|
||||
mTags.push_back({AutomaticGainControlV2::saturationMarginMb, AGC2});
|
||||
}
|
||||
void addLevelEstimatorParam(AutomaticGainControl::LevelEstimator levelEstimator) {
|
||||
AutomaticGainControl AGC;
|
||||
AGC.set<AutomaticGainControl::levelEstimator>(levelEstimator);
|
||||
mTags.push_back({AutomaticGainControl::levelEstimator, AGC});
|
||||
void addLevelEstimatorParam(AutomaticGainControlV2::LevelEstimator levelEstimator) {
|
||||
AutomaticGainControlV2 AGC2;
|
||||
AGC2.set<AutomaticGainControlV2::levelEstimator>(levelEstimator);
|
||||
mTags.push_back({AutomaticGainControlV2::levelEstimator, AGC2});
|
||||
}
|
||||
|
||||
static std::set<AutomaticGainControl::LevelEstimator> getLevelEstimatorValues() {
|
||||
return {ndk::enum_range<AutomaticGainControl::LevelEstimator>().begin(),
|
||||
ndk::enum_range<AutomaticGainControl::LevelEstimator>().end()};
|
||||
static std::set<AutomaticGainControlV2::LevelEstimator> getLevelEstimatorValues() {
|
||||
return {ndk::enum_range<AutomaticGainControlV2::LevelEstimator>().begin(),
|
||||
ndk::enum_range<AutomaticGainControlV2::LevelEstimator>().end()};
|
||||
}
|
||||
|
||||
private:
|
||||
std::vector<std::pair<AutomaticGainControl::Tag, AutomaticGainControl>> mTags;
|
||||
std::vector<std::pair<AutomaticGainControlV2::Tag, AutomaticGainControlV2>> mTags;
|
||||
void CleanUp() { mTags.clear(); }
|
||||
};
|
||||
|
||||
TEST_P(AGCParamTest, SetAndGetDigitalGainParam) {
|
||||
TEST_P(AGC2ParamTest, SetAndGetDigitalGainParam) {
|
||||
EXPECT_NO_FATAL_FAILURE(addDigitalGainParam(mGain));
|
||||
SetAndGetParameters();
|
||||
}
|
||||
|
||||
TEST_P(AGCParamTest, SetAndGetSaturationMargin) {
|
||||
TEST_P(AGC2ParamTest, SetAndGetSaturationMargin) {
|
||||
EXPECT_NO_FATAL_FAILURE(addSaturationMarginParam(mMargin));
|
||||
SetAndGetParameters();
|
||||
}
|
||||
|
||||
TEST_P(AGCParamTest, SetAndGetLevelEstimator) {
|
||||
TEST_P(AGC2ParamTest, SetAndGetLevelEstimator) {
|
||||
EXPECT_NO_FATAL_FAILURE(addLevelEstimatorParam(mLevelEstimator));
|
||||
SetAndGetParameters();
|
||||
}
|
||||
|
||||
std::vector<std::pair<std::shared_ptr<IFactory>, Descriptor>> kDescPair;
|
||||
INSTANTIATE_TEST_SUITE_P(
|
||||
AGCParamTest, AGCParamTest,
|
||||
AGC2ParamTest, AGC2ParamTest,
|
||||
::testing::Combine(
|
||||
testing::ValuesIn(kDescPair = EffectFactoryHelper::getAllEffectDescriptors(
|
||||
IFactory::descriptor, kAutomaticGainControlTypeUUID)),
|
||||
IFactory::descriptor, kAutomaticGainControlV2TypeUUID)),
|
||||
testing::ValuesIn(EffectHelper::getTestValueSet<
|
||||
AutomaticGainControl, int, Range::automaticGainControl,
|
||||
AutomaticGainControl::fixedDigitalGainMb>(
|
||||
AutomaticGainControlV2, int, Range::automaticGainControlV2,
|
||||
AutomaticGainControlV2::fixedDigitalGainMb>(
|
||||
kDescPair, EffectHelper::expandTestValueBasic<int>)),
|
||||
testing::ValuesIn(EffectHelper::getTestValueSet<
|
||||
AutomaticGainControl, int, Range::automaticGainControl,
|
||||
AutomaticGainControl::saturationMarginMb>(
|
||||
AutomaticGainControlV2, int, Range::automaticGainControlV2,
|
||||
AutomaticGainControlV2::saturationMarginMb>(
|
||||
kDescPair, EffectHelper::expandTestValueBasic<int>)),
|
||||
testing::ValuesIn(AGCParamTest::getLevelEstimatorValues())),
|
||||
[](const testing::TestParamInfo<AGCParamTest::ParamType>& info) {
|
||||
testing::ValuesIn(AGC2ParamTest::getLevelEstimatorValues())),
|
||||
[](const testing::TestParamInfo<AGC2ParamTest::ParamType>& info) {
|
||||
auto descriptor = std::get<PARAM_INSTANCE_NAME>(info.param).second;
|
||||
std::string gain = std::to_string(std::get<PARAM_DIGITAL_GAIN>(info.param));
|
||||
std::string estimator = aidl::android::hardware::audio::effect::toString(
|
||||
@@ -192,7 +193,7 @@ INSTANTIATE_TEST_SUITE_P(
|
||||
return name;
|
||||
});
|
||||
|
||||
GTEST_ALLOW_UNINSTANTIATED_PARAMETERIZED_TEST(AGCParamTest);
|
||||
GTEST_ALLOW_UNINSTANTIATED_PARAMETERIZED_TEST(AGC2ParamTest);
|
||||
|
||||
int main(int argc, char** argv) {
|
||||
::testing::InitGoogleTest(&argc, argv);
|
||||
Reference in New Issue
Block a user