1 /*
2  * Copyright (C) 2021 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 #pragma once
18 
19 // clang-format off
20 #include PATH(android/hardware/audio/effect/FILE_VERSION/types.h)
21 // clang-format on
22 
23 #include <system/audio_effect.h>
24 
25 namespace android {
26 namespace hardware {
27 namespace audio {
28 namespace effect {
29 namespace CPP_VERSION {
30 namespace implementation {
31 
32 using namespace ::android::hardware::audio::effect::CPP_VERSION;
33 
34 struct EffectUtils {
35     static status_t effectBufferConfigFromHal(const buffer_config_t& halConfig, bool isInput,
36                                               EffectBufferConfig* config);
37     static status_t effectBufferConfigToHal(const EffectBufferConfig& config,
38                                             buffer_config_t* halConfig);
39     static status_t effectConfigFromHal(const effect_config_t& halConfig, bool isInput,
40                                         EffectConfig* config);
41     static status_t effectConfigToHal(const EffectConfig& config, effect_config_t* halConfig);
42     static status_t effectDescriptorFromHal(const effect_descriptor_t& halDescriptor,
43                                             EffectDescriptor* descriptor);
44     static status_t effectDescriptorToHal(const EffectDescriptor& descriptor,
45                                           effect_descriptor_t* halDescriptor);
46 };
47 
48 }  // namespace implementation
49 }  // namespace CPP_VERSION
50 }  // namespace effect
51 }  // namespace audio
52 }  // namespace hardware
53 }  // namespace android
54