Shunkai Yao | c23916b | 2022-07-13 04:59:37 +0000 | [diff] [blame] | 1 | /* |
| 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 | |
Shunkai Yao | 4590517 | 2022-08-24 18:14:02 +0000 | [diff] [blame] | 19 | #include <aidl/android/hardware/audio/effect/BnEffect.h> |
Shunkai Yao | c23916b | 2022-07-13 04:59:37 +0000 | [diff] [blame] | 20 | #include <cstdlib> |
| 21 | |
| 22 | namespace aidl::android::hardware::audio::effect { |
| 23 | |
Shunkai Yao | 121c6dd | 2022-09-21 23:42:08 +0000 | [diff] [blame] | 24 | // Equalizer type UUID. |
| 25 | static const ::aidl::android::media::audio::common::AudioUuid EqualizerTypeUUID = { |
Shunkai Yao | 4590517 | 2022-08-24 18:14:02 +0000 | [diff] [blame] | 26 | static_cast<int32_t>(0x0bed4300), |
| 27 | 0xddd6, |
| 28 | 0x11db, |
| 29 | 0x8f34, |
Shunkai Yao | c23916b | 2022-07-13 04:59:37 +0000 | [diff] [blame] | 30 | {0x00, 0x02, 0xa5, 0xd5, 0xc5, 0x1b}}; |
| 31 | |
Shunkai Yao | 121c6dd | 2022-09-21 23:42:08 +0000 | [diff] [blame] | 32 | // Equalizer implementation UUID. |
| 33 | static const ::aidl::android::media::audio::common::AudioUuid EqualizerSwImplUUID = { |
| 34 | static_cast<int32_t>(0x0bed4300), |
| 35 | 0x847d, |
| 36 | 0x11df, |
| 37 | 0xbb17, |
| 38 | {0x00, 0x02, 0xa5, 0xd5, 0xc5, 0x1b}}; |
| 39 | |
Shunkai Yao | 4590517 | 2022-08-24 18:14:02 +0000 | [diff] [blame] | 40 | class Equalizer : public BnEffect { |
| 41 | public: |
Shunkai Yao | 121c6dd | 2022-09-21 23:42:08 +0000 | [diff] [blame] | 42 | Equalizer() = default; |
Shunkai Yao | 4590517 | 2022-08-24 18:14:02 +0000 | [diff] [blame] | 43 | ndk::ScopedAStatus open() override; |
| 44 | ndk::ScopedAStatus close() override; |
| 45 | ndk::ScopedAStatus getDescriptor(Descriptor* _aidl_return) override; |
| 46 | |
| 47 | private: |
| 48 | // Effect descriptor. |
Shunkai Yao | 121c6dd | 2022-09-21 23:42:08 +0000 | [diff] [blame] | 49 | Descriptor mDesc = {.common = {.id = {.type = EqualizerTypeUUID, .uuid = EqualizerSwImplUUID}}}; |
Shunkai Yao | 4590517 | 2022-08-24 18:14:02 +0000 | [diff] [blame] | 50 | }; |
| 51 | } // namespace aidl::android::hardware::audio::effect |