Shunkai Yao | ea24c1a | 2022-09-28 17:39:23 +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 |
Shunkai Yao | 52abf0a | 2022-11-08 02:44:03 +0000 | [diff] [blame^] | 18 | #include <map> |
| 19 | |
Shunkai Yao | ea24c1a | 2022-09-28 17:39:23 +0000 | [diff] [blame] | 20 | #include <aidl/android/media/audio/common/AudioUuid.h> |
| 21 | |
| 22 | namespace aidl::android::hardware::audio::effect { |
| 23 | |
| 24 | using ::aidl::android::media::audio::common::AudioUuid; |
| 25 | |
Shunkai Yao | a4ab38c | 2022-10-14 01:07:47 +0000 | [diff] [blame] | 26 | // Null UUID |
| 27 | static const AudioUuid EffectNullUuid = {static_cast<int32_t>(0xec7178ec), |
| 28 | 0xe5e1, |
| 29 | 0x4432, |
| 30 | 0xa3f4, |
| 31 | {0x46, 0x57, 0xe6, 0x79, 0x52, 0x10}}; |
| 32 | |
| 33 | // Zero UUID |
| 34 | static const AudioUuid EffectZeroUuid = { |
| 35 | static_cast<int32_t>(0x0), 0x0, 0x0, 0x0, {0x0, 0x0, 0x0, 0x0, 0x0, 0x0}}; |
| 36 | |
Shunkai Yao | ea24c1a | 2022-09-28 17:39:23 +0000 | [diff] [blame] | 37 | // Equalizer type UUID. |
| 38 | static const AudioUuid EqualizerTypeUUID = {static_cast<int32_t>(0x0bed4300), |
| 39 | 0xddd6, |
| 40 | 0x11db, |
| 41 | 0x8f34, |
| 42 | {0x00, 0x02, 0xa5, 0xd5, 0xc5, 0x1b}}; |
| 43 | |
Shunkai Yao | 52abf0a | 2022-11-08 02:44:03 +0000 | [diff] [blame^] | 44 | // 0bed4300-847d-11df-bb17-0002a5d5c51b |
Shunkai Yao | ea24c1a | 2022-09-28 17:39:23 +0000 | [diff] [blame] | 45 | static const AudioUuid EqualizerSwImplUUID = {static_cast<int32_t>(0x0bed4300), |
| 46 | 0x847d, |
| 47 | 0x11df, |
| 48 | 0xbb17, |
| 49 | {0x00, 0x02, 0xa5, 0xd5, 0xc5, 0x1b}}; |
| 50 | |
Shunkai Yao | 52abf0a | 2022-11-08 02:44:03 +0000 | [diff] [blame^] | 51 | // ce772f20-847d-11df-bb17-0002a5d5c51b |
Shunkai Yao | 6afc855 | 2022-10-26 22:47:20 +0000 | [diff] [blame] | 52 | static const AudioUuid EqualizerBundleImplUUID = {static_cast<int32_t>(0xce772f20), |
| 53 | 0x847d, |
| 54 | 0x11df, |
| 55 | 0xbb17, |
| 56 | {0x00, 0x02, 0xa5, 0xd5, 0xc5, 0x1b}}; |
| 57 | |
| 58 | // fa8184a4-588b-11ed-9b6a-0242ac120002 |
| 59 | static const AudioUuid BassBoostTypeUUID = {static_cast<int32_t>(0xfa8184a4), |
| 60 | 0x588b, |
| 61 | 0x11ed, |
| 62 | 0x9b6a, |
| 63 | {0x02, 0x42, 0xac, 0x12, 0x00, 0x02}}; |
| 64 | // fa8181f2-588b-11ed-9b6a-0242ac120002 |
| 65 | static const AudioUuid BassBoostSwImplUUID = {static_cast<int32_t>(0xfa8181f2), |
| 66 | 0x588b, |
| 67 | 0x11ed, |
| 68 | 0x9b6a, |
| 69 | {0x02, 0x42, 0xac, 0x12, 0x00, 0x02}}; |
| 70 | // fa81862a-588b-11ed-9b6a-0242ac120002 |
| 71 | static const AudioUuid DownmixTypeUUID = {static_cast<int32_t>(0xfa81862a), |
| 72 | 0x588b, |
| 73 | 0x11ed, |
| 74 | 0x9b6a, |
| 75 | {0x02, 0x42, 0xac, 0x12, 0x00, 0x02}}; |
| 76 | // fa8187ba-588b-11ed-9b6a-0242ac120002 |
| 77 | static const AudioUuid DownmixSwImplUUID = {static_cast<int32_t>(0xfa8187ba), |
| 78 | 0x588b, |
| 79 | 0x11ed, |
| 80 | 0x9b6a, |
| 81 | {0x02, 0x42, 0xac, 0x12, 0x00, 0x02}}; |
| 82 | // fa818954-588b-11ed-9b6a-0242ac120002 |
| 83 | static const AudioUuid DynamicsProcessingTypeUUID = {static_cast<int32_t>(0xfa818954), |
| 84 | 0x588b, |
| 85 | 0x11ed, |
| 86 | 0x9b6a, |
| 87 | {0x02, 0x42, 0xac, 0x12, 0x00, 0x02}}; |
| 88 | // fa818d78-588b-11ed-9b6a-0242ac120002 |
| 89 | static const AudioUuid DynamicsProcessingSwImplUUID = {static_cast<int32_t>(0xfa818d78), |
| 90 | 0x588b, |
| 91 | 0x11ed, |
| 92 | 0x9b6a, |
| 93 | {0x02, 0x42, 0xac, 0x12, 0x00, 0x02}}; |
| 94 | // fa818f62-588b-11ed-9b6a-0242ac120002 |
| 95 | static const AudioUuid HapticGeneratorTypeUUID = {static_cast<int32_t>(0xfa818f62), |
| 96 | 0x588b, |
| 97 | 0x11ed, |
| 98 | 0x9b6a, |
| 99 | {0x02, 0x42, 0xac, 0x12, 0x00, 0x02}}; |
| 100 | // fa819110-588b-11ed-9b6a-0242ac120002 |
| 101 | static const AudioUuid HapticGeneratorSwImplUUID = {static_cast<int32_t>(0xfa819110), |
| 102 | 0x588b, |
| 103 | 0x11ed, |
| 104 | 0x9b6a, |
| 105 | {0x02, 0x42, 0xac, 0x12, 0x00, 0x02}}; |
| 106 | |
| 107 | // fa8194a8-588b-11ed-9b6a-0242ac120002 |
| 108 | static const AudioUuid LoudnessEnhancerTypeUUID = {static_cast<int32_t>(0xfa8194a8), |
| 109 | 0x588b, |
| 110 | 0x11ed, |
| 111 | 0x9b6a, |
| 112 | {0x02, 0x42, 0xac, 0x12, 0x00, 0x02}}; |
| 113 | // fa819610-588b-11ed-9b6a-0242ac120002 |
| 114 | static const AudioUuid LoudnessEnhancerSwImplUUID = {static_cast<int32_t>(0xfa819610), |
| 115 | 0x588b, |
| 116 | 0x11ed, |
| 117 | 0x9b6a, |
| 118 | {0x02, 0x42, 0xac, 0x12, 0x00, 0x02}}; |
| 119 | // fa819886-588b-11ed-9b6a-0242ac120002 |
| 120 | static const AudioUuid ReverbTypeUUID = {static_cast<int32_t>(0xfa819886), |
| 121 | 0x588b, |
| 122 | 0x11ed, |
| 123 | 0x9b6a, |
| 124 | {0x02, 0x42, 0xac, 0x12, 0x00, 0x02}}; |
| 125 | // fa8199c6-588b-11ed-9b6a-0242ac120002 |
| 126 | static const AudioUuid ReverbSwImplUUID = {static_cast<int32_t>(0xfa8199c6), |
| 127 | 0x588b, |
| 128 | 0x11ed, |
| 129 | 0x9b6a, |
| 130 | {0x02, 0x42, 0xac, 0x12, 0x00, 0x02}}; |
| 131 | |
| 132 | // fa819af2-588b-11ed-9b6a-0242ac120002 |
| 133 | static const AudioUuid VirtualizerTypeUUID = {static_cast<int32_t>(0xfa819af2), |
| 134 | 0x588b, |
| 135 | 0x11ed, |
| 136 | 0x9b6a, |
| 137 | {0x02, 0x42, 0xac, 0x12, 0x00, 0x02}}; |
| 138 | // fa819d86-588b-11ed-9b6a-0242ac120002 |
| 139 | static const AudioUuid VirtualizerSwImplUUID = {static_cast<int32_t>(0xfa819d86), |
| 140 | 0x588b, |
| 141 | 0x11ed, |
| 142 | 0x9b6a, |
| 143 | {0x02, 0x42, 0xac, 0x12, 0x00, 0x02}}; |
| 144 | |
| 145 | // fa819f3e-588b-11ed-9b6a-0242ac120002 |
| 146 | static const AudioUuid VisualizerTypeUUID = {static_cast<int32_t>(0xfa819f3e), |
| 147 | 0x588b, |
| 148 | 0x11ed, |
| 149 | 0x9b6a, |
| 150 | {0x02, 0x42, 0xac, 0x12, 0x00, 0x02}}; |
| 151 | // fa81a0f6-588b-11ed-9b6a-0242ac120002 |
| 152 | static const AudioUuid VisualizerSwImplUUID = {static_cast<int32_t>(0xfa81a0f6), |
| 153 | 0x588b, |
| 154 | 0x11ed, |
| 155 | 0x9b6a, |
| 156 | {0x02, 0x42, 0xac, 0x12, 0x00, 0x02}}; |
| 157 | |
| 158 | // fa81a2b8-588b-11ed-9b6a-0242ac120002 |
| 159 | static const AudioUuid VolumeTypeUUID = {static_cast<int32_t>(0xfa81a2b8), |
| 160 | 0x588b, |
| 161 | 0x11ed, |
| 162 | 0x9b6a, |
| 163 | {0x02, 0x42, 0xac, 0x12, 0x00, 0x02}}; |
| 164 | // fa81a718-588b-11ed-9b6a-0242ac120002 |
| 165 | static const AudioUuid VolumeSwImplUUID = {static_cast<int32_t>(0xfa81a718), |
| 166 | 0x588b, |
| 167 | 0x11ed, |
| 168 | 0x9b6a, |
| 169 | {0x02, 0x42, 0xac, 0x12, 0x00, 0x02}}; |
Shunkai Yao | ea24c1a | 2022-09-28 17:39:23 +0000 | [diff] [blame] | 170 | |
Shunkai Yao | 52abf0a | 2022-11-08 02:44:03 +0000 | [diff] [blame^] | 171 | /** |
| 172 | * @brief A map between effect name and effect type UUID. |
| 173 | * All <name> attribution in effect/effectProxy of audio_effects.xml should be listed in this map. |
| 174 | * We need this map is because existing audio_effects.xml don't have a type UUID defined. |
| 175 | */ |
| 176 | static const std::map<const std::string /* effect type */, const AudioUuid&> kUuidNameTypeMap = { |
| 177 | {"bassboost", BassBoostTypeUUID}, |
| 178 | {"downmix", DownmixTypeUUID}, |
| 179 | {"dynamics_processing", DynamicsProcessingTypeUUID}, |
| 180 | {"equalizer", EqualizerTypeUUID}, |
| 181 | {"haptic_generator", HapticGeneratorTypeUUID}, |
| 182 | {"loudness_enhancer", LoudnessEnhancerTypeUUID}, |
| 183 | {"reverb", ReverbTypeUUID}, |
| 184 | {"reverb_env_aux", ReverbTypeUUID}, |
| 185 | {"reverb_env_ins", ReverbTypeUUID}, |
| 186 | {"reverb_pre_aux", ReverbTypeUUID}, |
| 187 | {"reverb_pre_ins", ReverbTypeUUID}, |
| 188 | {"virtualizer", VirtualizerTypeUUID}, |
| 189 | {"visualizer", VisualizerTypeUUID}, |
| 190 | {"volume", VolumeTypeUUID}, |
| 191 | }; |
| 192 | |
Shunkai Yao | ea24c1a | 2022-09-28 17:39:23 +0000 | [diff] [blame] | 193 | } // namespace aidl::android::hardware::audio::effect |