Shunkai Yao | a03533e | 2023-01-25 06:38:10 +0000 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (C) 2023 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 | #include <utility> |
| 18 | |
| 19 | #define LOG_TAG "AidlConversionEffect" |
| 20 | //#define LOG_NDEBUG 0 |
| 21 | #include <utils/Log.h> |
| 22 | |
| 23 | #include <media/AidlConversionCppNdk.h> |
| 24 | #include <media/AidlConversionEffect.h> |
| 25 | |
| 26 | //////////////////////////////////////////////////////////////////////////////////////////////////// |
| 27 | // AIDL NDK backend to legacy audio data structure conversion utilities. |
| 28 | |
| 29 | namespace aidl { |
| 30 | namespace android { |
| 31 | |
| 32 | using ::aidl::android::hardware::audio::effect::AcousticEchoCanceler; |
| 33 | using ::aidl::android::hardware::audio::effect::AutomaticGainControl; |
| 34 | using ::aidl::android::hardware::audio::effect::BassBoost; |
| 35 | using ::aidl::android::hardware::audio::effect::Descriptor; |
| 36 | using ::aidl::android::hardware::audio::effect::Downmix; |
Shunkai Yao | dba8ba3 | 2023-01-27 17:02:21 +0000 | [diff] [blame] | 37 | using ::aidl::android::hardware::audio::effect::DynamicsProcessing; |
Shunkai Yao | a03533e | 2023-01-25 06:38:10 +0000 | [diff] [blame] | 38 | using ::aidl::android::hardware::audio::effect::Flags; |
| 39 | using ::aidl::android::hardware::audio::effect::Parameter; |
Shunkai Yao | 242521c | 2023-01-29 18:08:09 +0000 | [diff] [blame^] | 40 | using ::aidl::android::hardware::audio::effect::PresetReverb; |
Shunkai Yao | a03533e | 2023-01-25 06:38:10 +0000 | [diff] [blame] | 41 | using ::aidl::android::media::audio::common::AudioDeviceDescription; |
| 42 | |
| 43 | using ::android::BAD_VALUE; |
| 44 | using ::android::base::unexpected; |
| 45 | |
| 46 | //////////////////////////////////////////////////////////////////////////////////////////////////// |
| 47 | // Converters |
| 48 | |
| 49 | ConversionResult<uint32_t> aidl2legacy_Flags_Type_uint32(Flags::Type type) { |
| 50 | switch (type) { |
| 51 | case Flags::Type::INSERT: |
| 52 | return EFFECT_FLAG_TYPE_INSERT; |
| 53 | case Flags::Type::AUXILIARY: |
| 54 | return EFFECT_FLAG_TYPE_AUXILIARY; |
| 55 | case Flags::Type::REPLACE: |
| 56 | return EFFECT_FLAG_TYPE_REPLACE; |
| 57 | case Flags::Type::PRE_PROC: |
| 58 | return EFFECT_FLAG_TYPE_PRE_PROC; |
| 59 | case Flags::Type::POST_PROC: |
| 60 | return EFFECT_FLAG_TYPE_POST_PROC; |
| 61 | } |
| 62 | return unexpected(BAD_VALUE); |
| 63 | } |
| 64 | |
| 65 | ConversionResult<Flags::Type> legacy2aidl_uint32_Flags_Type(uint32_t legacy) { |
| 66 | switch (legacy & EFFECT_FLAG_TYPE_MASK) { |
| 67 | case EFFECT_FLAG_TYPE_INSERT: |
| 68 | return Flags::Type::INSERT; |
| 69 | case EFFECT_FLAG_TYPE_AUXILIARY: |
| 70 | return Flags::Type::AUXILIARY; |
| 71 | case EFFECT_FLAG_TYPE_REPLACE: |
| 72 | return Flags::Type::REPLACE; |
| 73 | case EFFECT_FLAG_TYPE_PRE_PROC: |
| 74 | return Flags::Type::PRE_PROC; |
| 75 | case EFFECT_FLAG_TYPE_POST_PROC: |
| 76 | return Flags::Type::POST_PROC; |
| 77 | } |
| 78 | return unexpected(BAD_VALUE); |
| 79 | } |
| 80 | |
| 81 | ConversionResult<uint32_t> aidl2legacy_Flags_Insert_uint32(Flags::Insert insert) { |
| 82 | switch (insert) { |
| 83 | case Flags::Insert::ANY: |
| 84 | return EFFECT_FLAG_INSERT_ANY; |
| 85 | case Flags::Insert::FIRST: |
| 86 | return EFFECT_FLAG_INSERT_FIRST; |
| 87 | case Flags::Insert::LAST: |
| 88 | return EFFECT_FLAG_INSERT_LAST; |
| 89 | case Flags::Insert::EXCLUSIVE: |
| 90 | return EFFECT_FLAG_INSERT_EXCLUSIVE; |
| 91 | } |
| 92 | return unexpected(BAD_VALUE); |
| 93 | } |
| 94 | |
| 95 | ConversionResult<Flags::Insert> legacy2aidl_uint32_Flags_Insert(uint32_t legacy) { |
| 96 | switch (legacy & EFFECT_FLAG_INSERT_MASK) { |
| 97 | case EFFECT_FLAG_INSERT_ANY: |
| 98 | return Flags::Insert::ANY; |
| 99 | case EFFECT_FLAG_INSERT_FIRST: |
| 100 | return Flags::Insert::FIRST; |
| 101 | case EFFECT_FLAG_INSERT_LAST: |
| 102 | return Flags::Insert::LAST; |
| 103 | case EFFECT_FLAG_INSERT_EXCLUSIVE: |
| 104 | return Flags::Insert::EXCLUSIVE; |
| 105 | } |
| 106 | return unexpected(BAD_VALUE); |
| 107 | } |
| 108 | |
| 109 | ConversionResult<uint32_t> aidl2legacy_Flags_Volume_uint32(Flags::Volume volume) { |
| 110 | switch (volume) { |
| 111 | case Flags::Volume::NONE: |
| 112 | return 0; |
| 113 | case Flags::Volume::CTRL: |
| 114 | return EFFECT_FLAG_VOLUME_CTRL; |
| 115 | case Flags::Volume::IND: |
| 116 | return EFFECT_FLAG_VOLUME_IND; |
| 117 | case Flags::Volume::MONITOR: |
| 118 | return EFFECT_FLAG_VOLUME_MONITOR; |
| 119 | } |
| 120 | return unexpected(BAD_VALUE); |
| 121 | } |
| 122 | |
| 123 | ConversionResult<Flags::Volume> legacy2aidl_uint32_Flags_Volume(uint32_t legacy) { |
| 124 | switch (legacy & EFFECT_FLAG_VOLUME_MASK) { |
| 125 | case EFFECT_FLAG_VOLUME_CTRL: |
| 126 | return Flags::Volume::CTRL; |
| 127 | case EFFECT_FLAG_VOLUME_IND: |
| 128 | return Flags::Volume::IND; |
| 129 | case EFFECT_FLAG_VOLUME_MONITOR: |
| 130 | return Flags::Volume::MONITOR; |
| 131 | case EFFECT_FLAG_VOLUME_NONE: |
| 132 | return Flags::Volume::NONE; |
| 133 | } |
| 134 | return unexpected(BAD_VALUE); |
| 135 | } |
| 136 | |
| 137 | ConversionResult<uint32_t> aidl2legacy_Flags_uint32(Flags aidl) { |
| 138 | uint32_t legacy = 0; |
| 139 | legacy |= VALUE_OR_RETURN(aidl2legacy_Flags_Type_uint32(aidl.type)); |
| 140 | legacy |= VALUE_OR_RETURN(aidl2legacy_Flags_Insert_uint32(aidl.insert)); |
| 141 | legacy |= VALUE_OR_RETURN(aidl2legacy_Flags_Volume_uint32(aidl.volume)); |
| 142 | legacy |= VALUE_OR_RETURN(aidl2legacy_Flags_HardwareAccelerator_uint32(aidl.hwAcceleratorMode)); |
| 143 | |
| 144 | if (aidl.offloadIndication) { |
| 145 | legacy |= EFFECT_FLAG_OFFLOAD_SUPPORTED; |
| 146 | } |
| 147 | if (aidl.deviceIndication) { |
| 148 | legacy |= EFFECT_FLAG_DEVICE_IND; |
| 149 | } |
| 150 | if (aidl.audioModeIndication) { |
| 151 | legacy |= EFFECT_FLAG_AUDIO_MODE_IND; |
| 152 | } |
| 153 | if (aidl.audioSourceIndication) { |
| 154 | legacy |= EFFECT_FLAG_AUDIO_SOURCE_IND; |
| 155 | } |
| 156 | if (aidl.noProcessing) { |
| 157 | legacy |= EFFECT_FLAG_NO_PROCESS; |
| 158 | } |
| 159 | return legacy; |
| 160 | } |
| 161 | |
| 162 | ConversionResult<Flags> legacy2aidl_uint32_Flags(uint32_t legacy) { |
| 163 | Flags aidl; |
| 164 | |
| 165 | aidl.type = VALUE_OR_RETURN(legacy2aidl_uint32_Flags_Type(legacy)); |
| 166 | aidl.insert = VALUE_OR_RETURN(legacy2aidl_uint32_Flags_Insert(legacy)); |
| 167 | aidl.volume = VALUE_OR_RETURN(legacy2aidl_uint32_Flags_Volume(legacy)); |
| 168 | aidl.hwAcceleratorMode = VALUE_OR_RETURN(legacy2aidl_uint32_Flags_HardwareAccelerator(legacy)); |
| 169 | aidl.offloadIndication = (legacy & EFFECT_FLAG_OFFLOAD_SUPPORTED); |
| 170 | aidl.deviceIndication = (legacy & EFFECT_FLAG_DEVICE_IND); |
| 171 | aidl.audioModeIndication = (legacy & EFFECT_FLAG_AUDIO_MODE_IND); |
| 172 | aidl.audioSourceIndication = (legacy & EFFECT_FLAG_AUDIO_SOURCE_IND); |
| 173 | aidl.noProcessing = (legacy & EFFECT_FLAG_NO_PROCESS); |
| 174 | return aidl; |
| 175 | } |
| 176 | |
| 177 | ConversionResult<uint32_t> aidl2legacy_Flags_HardwareAccelerator_uint32( |
| 178 | Flags::HardwareAccelerator hwAcceleratorMode) { |
| 179 | switch (hwAcceleratorMode) { |
| 180 | case Flags::HardwareAccelerator::NONE: |
| 181 | return 0; |
| 182 | case Flags::HardwareAccelerator::SIMPLE: |
| 183 | return EFFECT_FLAG_HW_ACC_SIMPLE; |
| 184 | case Flags::HardwareAccelerator::TUNNEL: |
| 185 | return EFFECT_FLAG_HW_ACC_TUNNEL; |
| 186 | } |
| 187 | return unexpected(BAD_VALUE); |
| 188 | } |
| 189 | |
| 190 | ConversionResult<Flags::HardwareAccelerator> legacy2aidl_uint32_Flags_HardwareAccelerator( |
| 191 | uint32_t legacy) { |
| 192 | switch (legacy & EFFECT_FLAG_HW_ACC_MASK) { |
| 193 | case EFFECT_FLAG_HW_ACC_SIMPLE: |
| 194 | return Flags::HardwareAccelerator::SIMPLE; |
| 195 | case EFFECT_FLAG_HW_ACC_TUNNEL: |
| 196 | return Flags::HardwareAccelerator::TUNNEL; |
| 197 | case 0: |
| 198 | return Flags::HardwareAccelerator::NONE; |
| 199 | } |
| 200 | return unexpected(BAD_VALUE); |
| 201 | } |
| 202 | |
| 203 | ConversionResult<effect_descriptor_t> |
| 204 | aidl2legacy_Descriptor_effect_descriptor(const Descriptor& aidl) { |
| 205 | effect_descriptor_t legacy; |
| 206 | legacy.type = VALUE_OR_RETURN(aidl2legacy_AudioUuid_audio_uuid_t(aidl.common.id.type)); |
| 207 | legacy.uuid = VALUE_OR_RETURN(aidl2legacy_AudioUuid_audio_uuid_t(aidl.common.id.uuid)); |
| 208 | // legacy descriptor doesn't have proxy information |
| 209 | // proxy = VALUE_OR_RETURN(aidl2legacy_AudioUuid_audio_uuid_t(aidl.proxy)); |
| 210 | legacy.apiVersion = EFFECT_CONTROL_API_VERSION; |
| 211 | legacy.flags = VALUE_OR_RETURN(aidl2legacy_Flags_uint32(aidl.common.flags)); |
| 212 | legacy.cpuLoad = VALUE_OR_RETURN(convertIntegral<uint16_t>(aidl.common.cpuLoad)); |
| 213 | legacy.memoryUsage = VALUE_OR_RETURN(convertIntegral<uint16_t>(aidl.common.memoryUsage)); |
| 214 | RETURN_IF_ERROR(aidl2legacy_string(aidl.common.name, legacy.name, sizeof(legacy.name))); |
| 215 | RETURN_IF_ERROR(aidl2legacy_string(aidl.common.implementor, legacy.implementor, |
| 216 | sizeof(legacy.implementor))); |
| 217 | return legacy; |
| 218 | } |
| 219 | |
| 220 | ConversionResult<Descriptor> |
| 221 | legacy2aidl_effect_descriptor_Descriptor(const effect_descriptor_t& legacy) { |
| 222 | Descriptor aidl; |
| 223 | aidl.common.id.type = VALUE_OR_RETURN(legacy2aidl_audio_uuid_t_AudioUuid(legacy.type)); |
| 224 | aidl.common.id.uuid = VALUE_OR_RETURN(legacy2aidl_audio_uuid_t_AudioUuid(legacy.uuid)); |
| 225 | // legacy descriptor doesn't have proxy information |
| 226 | // aidl.common.id.proxy |
| 227 | aidl.common.flags = VALUE_OR_RETURN(legacy2aidl_uint32_Flags(legacy.flags)); |
| 228 | aidl.common.cpuLoad = VALUE_OR_RETURN(convertIntegral<int32_t>(legacy.cpuLoad)); |
| 229 | aidl.common.memoryUsage = VALUE_OR_RETURN(convertIntegral<int32_t>(legacy.memoryUsage)); |
| 230 | aidl.common.name = VALUE_OR_RETURN(legacy2aidl_string(legacy.name, sizeof(legacy.name))); |
| 231 | aidl.common.implementor = |
| 232 | VALUE_OR_RETURN(legacy2aidl_string(legacy.implementor, sizeof(legacy.implementor))); |
| 233 | return aidl; |
| 234 | } |
| 235 | |
| 236 | ConversionResult<uint32_t> aidl2legacy_Parameter_aec_uint32_echoDelay(const Parameter& aidl) { |
Shunkai Yao | dba8ba3 | 2023-01-27 17:02:21 +0000 | [diff] [blame] | 237 | int echoDelay = VALUE_OR_RETURN( |
| 238 | GET_PARAMETER_SPECIFIC_FIELD(aidl, AcousticEchoCanceler, acousticEchoCanceler, |
| 239 | AcousticEchoCanceler::echoDelayUs, int)); |
Shunkai Yao | a03533e | 2023-01-25 06:38:10 +0000 | [diff] [blame] | 240 | return VALUE_OR_RETURN(convertReinterpret<uint32_t>(echoDelay)); |
| 241 | } |
| 242 | |
| 243 | ConversionResult<Parameter> legacy2aidl_uint32_echoDelay_Parameter_aec(uint32_t legacy) { |
| 244 | int delay = VALUE_OR_RETURN(convertReinterpret<int32_t>(legacy)); |
| 245 | return MAKE_SPECIFIC_PARAMETER(AcousticEchoCanceler, acousticEchoCanceler, echoDelayUs, delay); |
| 246 | } |
| 247 | |
| 248 | ConversionResult<uint32_t> aidl2legacy_Parameter_aec_uint32_mobileMode(const Parameter& aidl) { |
Shunkai Yao | dba8ba3 | 2023-01-27 17:02:21 +0000 | [diff] [blame] | 249 | bool mobileMode = VALUE_OR_RETURN( |
| 250 | GET_PARAMETER_SPECIFIC_FIELD(aidl, AcousticEchoCanceler, acousticEchoCanceler, |
| 251 | AcousticEchoCanceler::mobileMode, bool)); |
Shunkai Yao | a03533e | 2023-01-25 06:38:10 +0000 | [diff] [blame] | 252 | return VALUE_OR_RETURN(convertIntegral<uint32_t>(mobileMode)); |
| 253 | } |
| 254 | |
| 255 | ConversionResult<Parameter> legacy2aidl_uint32_mobileMode_Parameter_aec(uint32_t legacy) { |
| 256 | bool mode = VALUE_OR_RETURN(convertIntegral<bool>(legacy)); |
| 257 | return MAKE_SPECIFIC_PARAMETER(AcousticEchoCanceler, acousticEchoCanceler, mobileMode, mode); |
| 258 | } |
| 259 | |
| 260 | ConversionResult<uint32_t> aidl2legacy_Parameter_agc_uint32_fixedDigitalGain( |
| 261 | const Parameter& aidl) { |
Shunkai Yao | dba8ba3 | 2023-01-27 17:02:21 +0000 | [diff] [blame] | 262 | int gain = VALUE_OR_RETURN( |
| 263 | GET_PARAMETER_SPECIFIC_FIELD(aidl, AutomaticGainControl, automaticGainControl, |
| 264 | AutomaticGainControl::fixedDigitalGainMb, int)); |
Shunkai Yao | a03533e | 2023-01-25 06:38:10 +0000 | [diff] [blame] | 265 | return VALUE_OR_RETURN(convertReinterpret<uint32_t>(gain)); |
| 266 | } |
| 267 | |
| 268 | ConversionResult<Parameter> legacy2aidl_uint32_fixedDigitalGain_Parameter_agc(uint32_t legacy) { |
| 269 | int gain = VALUE_OR_RETURN(convertReinterpret<int>(legacy)); |
| 270 | return MAKE_SPECIFIC_PARAMETER(AutomaticGainControl, automaticGainControl, fixedDigitalGainMb, |
| 271 | gain); |
| 272 | } |
| 273 | |
| 274 | ConversionResult<uint32_t> aidl2legacy_Parameter_agc_uint32_levelEstimator( |
| 275 | const Parameter& aidl) { |
Shunkai Yao | dba8ba3 | 2023-01-27 17:02:21 +0000 | [diff] [blame] | 276 | const auto& le = VALUE_OR_RETURN(GET_PARAMETER_SPECIFIC_FIELD( |
| 277 | aidl, AutomaticGainControl, automaticGainControl, AutomaticGainControl::levelEstimator, |
| 278 | AutomaticGainControl::LevelEstimator)); |
Shunkai Yao | a03533e | 2023-01-25 06:38:10 +0000 | [diff] [blame] | 279 | return static_cast<uint32_t>(le); |
| 280 | } |
| 281 | |
| 282 | ConversionResult<Parameter> legacy2aidl_uint32_levelEstimator_Parameter_agc(uint32_t legacy) { |
| 283 | if (legacy > (uint32_t) AutomaticGainControl::LevelEstimator::PEAK) { |
| 284 | return unexpected(BAD_VALUE); |
| 285 | } |
| 286 | AutomaticGainControl::LevelEstimator le = |
| 287 | static_cast<AutomaticGainControl::LevelEstimator>(legacy); |
| 288 | return MAKE_SPECIFIC_PARAMETER(AutomaticGainControl, automaticGainControl, levelEstimator, le); |
| 289 | } |
| 290 | |
| 291 | ConversionResult<uint32_t> aidl2legacy_Parameter_agc_uint32_saturationMargin( |
| 292 | const Parameter& aidl) { |
Shunkai Yao | dba8ba3 | 2023-01-27 17:02:21 +0000 | [diff] [blame] | 293 | int saturationMargin = VALUE_OR_RETURN( |
| 294 | GET_PARAMETER_SPECIFIC_FIELD(aidl, AutomaticGainControl, automaticGainControl, |
| 295 | AutomaticGainControl::saturationMarginMb, int)); |
Shunkai Yao | a03533e | 2023-01-25 06:38:10 +0000 | [diff] [blame] | 296 | return VALUE_OR_RETURN(convertIntegral<uint32_t>(saturationMargin)); |
| 297 | } |
| 298 | |
| 299 | ConversionResult<Parameter> legacy2aidl_uint32_saturationMargin_Parameter_agc(uint32_t legacy) { |
| 300 | int saturationMargin = VALUE_OR_RETURN(convertIntegral<int>(legacy)); |
| 301 | return MAKE_SPECIFIC_PARAMETER(AutomaticGainControl, automaticGainControl, saturationMarginMb, |
| 302 | saturationMargin); |
| 303 | } |
| 304 | |
| 305 | ConversionResult<uint16_t> aidl2legacy_Parameter_BassBoost_uint16_strengthPm( |
| 306 | const Parameter& aidl) { |
| 307 | int strength = VALUE_OR_RETURN( |
Shunkai Yao | dba8ba3 | 2023-01-27 17:02:21 +0000 | [diff] [blame] | 308 | GET_PARAMETER_SPECIFIC_FIELD(aidl, BassBoost, bassBoost, BassBoost::strengthPm, int)); |
Shunkai Yao | a03533e | 2023-01-25 06:38:10 +0000 | [diff] [blame] | 309 | return VALUE_OR_RETURN(convertIntegral<uint16_t>(strength)); |
| 310 | } |
| 311 | |
| 312 | ConversionResult<Parameter> legacy2aidl_uint16_strengthPm_Parameter_BassBoost(uint16_t legacy) { |
| 313 | int strength = VALUE_OR_RETURN(convertIntegral<int>(legacy)); |
| 314 | return MAKE_SPECIFIC_PARAMETER(BassBoost, bassBoost, strengthPm, strength); |
| 315 | } |
| 316 | |
| 317 | ConversionResult<int16_t> aidl2legacy_Parameter_Downmix_int16_type(const Parameter& aidl) { |
| 318 | Downmix::Type aidlType = VALUE_OR_RETURN( |
Shunkai Yao | dba8ba3 | 2023-01-27 17:02:21 +0000 | [diff] [blame] | 319 | GET_PARAMETER_SPECIFIC_FIELD(aidl, Downmix, downmix, Downmix::type, Downmix::Type)); |
Shunkai Yao | a03533e | 2023-01-25 06:38:10 +0000 | [diff] [blame] | 320 | return VALUE_OR_RETURN(convertIntegral<int16_t>(static_cast<uint32_t>(aidlType))); |
| 321 | } |
| 322 | |
| 323 | ConversionResult<Parameter> legacy2aidl_int16_type_Parameter_Downmix(int16_t legacy) { |
| 324 | if (legacy > (uint32_t) Downmix::Type::FOLD) { |
| 325 | return unexpected(BAD_VALUE); |
| 326 | } |
| 327 | Downmix::Type aidlType = static_cast<Downmix::Type>(legacy); |
| 328 | return MAKE_SPECIFIC_PARAMETER(Downmix, downmix, type, aidlType); |
| 329 | } |
| 330 | |
Shunkai Yao | dba8ba3 | 2023-01-27 17:02:21 +0000 | [diff] [blame] | 331 | ConversionResult<int16_t> aidl2legacy_DynamicsProcessing_ResolutionPreference_uint32_( |
| 332 | const Parameter& aidl) { |
| 333 | Downmix::Type aidlType = VALUE_OR_RETURN( |
| 334 | GET_PARAMETER_SPECIFIC_FIELD(aidl, Downmix, downmix, Downmix::type, Downmix::Type)); |
| 335 | return VALUE_OR_RETURN(convertIntegral<int16_t>(static_cast<uint32_t>(aidlType))); |
| 336 | } |
| 337 | |
| 338 | ConversionResult<DynamicsProcessing::ResolutionPreference> |
| 339 | legacy2aidl_int32_DynamicsProcessing_ResolutionPreference(int32_t legacy) { |
| 340 | if (legacy > (int32_t)DynamicsProcessing::ResolutionPreference::FAVOR_TIME_RESOLUTION) { |
| 341 | return unexpected(BAD_VALUE); |
| 342 | } |
| 343 | return static_cast<DynamicsProcessing::ResolutionPreference>(legacy); |
| 344 | } |
| 345 | |
| 346 | ConversionResult<int32_t> aidl2legacy_DynamicsProcessing_ResolutionPreference_int32( |
| 347 | DynamicsProcessing::ResolutionPreference aidl) { |
| 348 | return static_cast<int32_t>(aidl); |
| 349 | } |
| 350 | |
Shunkai Yao | a03533e | 2023-01-25 06:38:10 +0000 | [diff] [blame] | 351 | } // namespace android |
| 352 | } // aidl |