• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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 
19 #include <map>
20 #include <memory>
21 #include <vector>
22 
23 #include <aidl/android/hardware/audio/core/AudioPatch.h>
24 #include <aidl/android/hardware/audio/core/AudioRoute.h>
25 #include <aidl/android/media/audio/common/AudioPort.h>
26 #include <aidl/android/media/audio/common/AudioPortConfig.h>
27 #include <aidl/android/media/audio/common/MicrophoneInfo.h>
28 
29 namespace aidl::android::hardware::audio::core::internal {
30 
31 struct Configuration {
32     std::vector<::aidl::android::media::audio::common::MicrophoneInfo> microphones;
33     std::vector<::aidl::android::media::audio::common::AudioPort> ports;
34     std::vector<::aidl::android::media::audio::common::AudioPortConfig> portConfigs;
35     std::vector<::aidl::android::media::audio::common::AudioPortConfig> initialConfigs;
36     // Port id -> List of profiles to use when the device port state is set to 'connected'
37     // in connection simulation mode.
38     std::map<int32_t, std::vector<::aidl::android::media::audio::common::AudioProfile>>
39             connectedProfiles;
40     std::vector<AudioRoute> routes;
41     std::vector<AudioPatch> patches;
42     int32_t nextPortId = 1;
43     int32_t nextPatchId = 1;
44 };
45 
46 std::unique_ptr<Configuration> getPrimaryConfiguration();
47 std::unique_ptr<Configuration> getRSubmixConfiguration();
48 std::unique_ptr<Configuration> getStubConfiguration();
49 std::unique_ptr<Configuration> getUsbConfiguration();
50 std::unique_ptr<Configuration> getBluetoothConfiguration();
51 
52 }  // namespace aidl::android::hardware::audio::core::internal
53