1 /*
2  * Copyright (C) 2020 The Android Open Source Project
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  *      http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16 
17 #ifndef ANDROID_EFFECT_AGC2_CORE_H_
18 #define ANDROID_EFFECT_AGC2_CORE_H_
19 
20 #include <system/audio_effect.h>
21 
22 #if __cplusplus
23 extern "C" {
24 #endif
25 
26 // The AGC type UUID is not defined by OpenSL ES and has been generated from
27 // http://www.itu.int/ITU-T/asn1/uuid.html
28 static const effect_uuid_t FX_IID_AGC2_ =
29     { 0xae3c653b, 0xbe18, 0x4ab8, 0x8938, { 0x41, 0x8f, 0x0a, 0x7f, 0x06, 0xac } };
30 const effect_uuid_t * const FX_IID_AGC2 = &FX_IID_AGC2_;
31 
32 typedef enum
33 {
34     AGC2_PARAM_FIXED_DIGITAL_GAIN,                 // fixed digital gain in millibel
35     AGC2_PARAM_ADAPT_DIGI_LEVEL_ESTIMATOR,         // adaptive digital level estimator
36     AGC2_PARAM_ADAPT_DIGI_EXTRA_SATURATION_MARGIN, // saturation margin in millibel
37     AGC2_PARAM_PROPERTIES
38 } agc2_params_t;
39 
40 
41 //t_agc2_settings groups all current agc2 settings for backup and restore.
42 typedef struct {
43     float          fixedDigitalGain;
44     uint32_t       level_estimator;
45     float          extraSaturationMargin;
46 } agc2_settings_t;
47 
48 #if __cplusplus
49 }  // extern "C"
50 #endif
51 
52 #endif /*ANDROID_EFFECT_AGC2_CORE_H_*/
53