blob: 5b9e9245c0979fe6bc77d1fa050829ddbb590f33 [file] [log] [blame]
Shraddha Basantwani4e2a87352022-12-08 16:05:21 +05301/*
2 * Copyright (C) 2022 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#include <aidl/android/hardware/audio/effect/BnEffect.h>
20
21#include "effect-impl/EffectImpl.h"
Shraddha Basantwani4e2a87352022-12-08 16:05:21 +053022#include "LoudnessEnhancerContext.h"
23
24namespace aidl::android::hardware::audio::effect {
25
26class LoudnessEnhancerImpl final : public EffectImpl {
27 public:
28 static const std::string kEffectName;
29 static const Descriptor kDescriptor;
30 LoudnessEnhancerImpl() { LOG(DEBUG) << __func__; }
31 ~LoudnessEnhancerImpl() {
32 cleanUp();
33 LOG(DEBUG) << __func__;
34 }
35
36 ndk::ScopedAStatus commandImpl(CommandId command) override;
37 ndk::ScopedAStatus getDescriptor(Descriptor* _aidl_return) override;
38 ndk::ScopedAStatus setParameterSpecific(const Parameter::Specific& specific) override;
39 ndk::ScopedAStatus getParameterSpecific(const Parameter::Id& id,
40 Parameter::Specific* specific) override;
41 IEffect::Status effectProcessImpl(float* in, float* out, int process) override;
42 std::shared_ptr<EffectContext> createContext(const Parameter::Common& common) override;
43 RetCode releaseContext() override;
44
45 std::shared_ptr<EffectContext> getContext() override { return mContext; }
46 std::string getEffectName() override { return kEffectName; }
47
48 private:
49 std::shared_ptr<LoudnessEnhancerContext> mContext;
50 ndk::ScopedAStatus getParameterLoudnessEnhancer(const LoudnessEnhancer::Tag& tag,
51 Parameter::Specific* specific);
52};
53
54} // namespace aidl::android::hardware::audio::effect