Shunkai Yao | dca65ce | 2022-12-02 05:35:41 +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 | |
| 19 | #include <aidl/android/hardware/audio/core/IConfig.h> |
Mikhail Naganov | e7a26ad | 2023-05-25 17:36:48 -0700 | [diff] [blame] | 20 | #include <aidl/android/media/audio/IHalAdapterVendorExtension.h> |
Shunkai Yao | dca65ce | 2022-12-02 05:35:41 +0000 | [diff] [blame] | 21 | #include <media/audiohal/DevicesFactoryHalInterface.h> |
| 22 | #include <utils/RefBase.h> |
| 23 | |
Shunkai Yao | dca65ce | 2022-12-02 05:35:41 +0000 | [diff] [blame] | 24 | namespace android { |
| 25 | |
| 26 | class DevicesFactoryHalAidl : public DevicesFactoryHalInterface |
| 27 | { |
| 28 | public: |
Shunkai Yao | 5120250 | 2022-12-12 06:11:46 +0000 | [diff] [blame] | 29 | explicit DevicesFactoryHalAidl( |
Mikhail Naganov | f83b974 | 2023-04-24 13:06:04 -0700 | [diff] [blame] | 30 | std::shared_ptr<::aidl::android::hardware::audio::core::IConfig> config); |
| 31 | |
| 32 | status_t getDeviceNames(std::vector<std::string> *names) override; |
Shunkai Yao | dca65ce | 2022-12-02 05:35:41 +0000 | [diff] [blame] | 33 | |
| 34 | // Opens a device with the specified name. To close the device, it is |
| 35 | // necessary to release references to the returned object. |
| 36 | status_t openDevice(const char *name, sp<DeviceHalInterface> *device) override; |
| 37 | |
Shunkai Yao | dca65ce | 2022-12-02 05:35:41 +0000 | [diff] [blame] | 38 | status_t setCallbackOnce(sp<DevicesFactoryHalCallback> callback) override; |
| 39 | |
| 40 | android::detail::AudioHalVersionInfo getHalVersion() const override; |
| 41 | |
Mikhail Naganov | f83b974 | 2023-04-24 13:06:04 -0700 | [diff] [blame] | 42 | status_t getSurroundSoundConfig(media::SurroundSoundConfig *config) override; |
| 43 | |
| 44 | status_t getEngineConfig(media::audio::common::AudioHalEngineConfig *config) override; |
| 45 | |
Shunkai Yao | dca65ce | 2022-12-02 05:35:41 +0000 | [diff] [blame] | 46 | private: |
Mikhail Naganov | f83b974 | 2023-04-24 13:06:04 -0700 | [diff] [blame] | 47 | const std::shared_ptr<::aidl::android::hardware::audio::core::IConfig> mConfig; |
Mikhail Naganov | c77d184 | 2024-01-26 10:57:19 -0800 | [diff] [blame^] | 48 | const std::shared_ptr<::aidl::android::media::audio::IHalAdapterVendorExtension> mVendorExt; |
Mikhail Naganov | e7a26ad | 2023-05-25 17:36:48 -0700 | [diff] [blame] | 49 | |
Shunkai Yao | 5120250 | 2022-12-12 06:11:46 +0000 | [diff] [blame] | 50 | ~DevicesFactoryHalAidl() = default; |
Shunkai Yao | dca65ce | 2022-12-02 05:35:41 +0000 | [diff] [blame] | 51 | }; |
| 52 | |
| 53 | } // namespace android |