blob: 21957bc85e8ec831bcee08a0ba1d469187d79ee3 [file] [log] [blame]
Shunkai Yaodca65ce2022-12-02 05:35:41 +00001/*
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>
20#include <media/audiohal/DevicesFactoryHalInterface.h>
21#include <utils/RefBase.h>
22
Shunkai Yaodca65ce2022-12-02 05:35:41 +000023namespace android {
24
25class DevicesFactoryHalAidl : public DevicesFactoryHalInterface
26{
27 public:
Shunkai Yao51202502022-12-12 06:11:46 +000028 explicit DevicesFactoryHalAidl(
Mikhail Naganovf83b9742023-04-24 13:06:04 -070029 std::shared_ptr<::aidl::android::hardware::audio::core::IConfig> config);
30
31 status_t getDeviceNames(std::vector<std::string> *names) override;
Shunkai Yaodca65ce2022-12-02 05:35:41 +000032
33 // Opens a device with the specified name. To close the device, it is
34 // necessary to release references to the returned object.
35 status_t openDevice(const char *name, sp<DeviceHalInterface> *device) override;
36
37 status_t getHalPids(std::vector<pid_t> *pids) override;
38
39 status_t setCallbackOnce(sp<DevicesFactoryHalCallback> callback) override;
40
41 android::detail::AudioHalVersionInfo getHalVersion() const override;
42
Mikhail Naganovf83b9742023-04-24 13:06:04 -070043 status_t getSurroundSoundConfig(media::SurroundSoundConfig *config) override;
44
45 status_t getEngineConfig(media::audio::common::AudioHalEngineConfig *config) override;
46
Shunkai Yaodca65ce2022-12-02 05:35:41 +000047 private:
Mikhail Naganovf83b9742023-04-24 13:06:04 -070048 const std::shared_ptr<::aidl::android::hardware::audio::core::IConfig> mConfig;
Shunkai Yao51202502022-12-12 06:11:46 +000049 ~DevicesFactoryHalAidl() = default;
Shunkai Yaodca65ce2022-12-02 05:35:41 +000050};
51
52} // namespace android