1 /*
2  * Copyright (C) 2023 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 "core-impl/Module.h"
20 
21 namespace aidl::android::hardware::audio::core {
22 
23 class ModuleRemoteSubmix : public Module {
24   public:
ModuleRemoteSubmix(std::unique_ptr<Configuration> && config)25     ModuleRemoteSubmix(std::unique_ptr<Configuration>&& config)
26         : Module(Type::R_SUBMIX, std::move(config)) {}
27 
28   private:
29     // IModule interfaces
30     ndk::ScopedAStatus getMicMute(bool* _aidl_return) override;
31     ndk::ScopedAStatus setMicMute(bool in_mute) override;
32     ndk::ScopedAStatus setAudioPortConfig(
33             const ::aidl::android::media::audio::common::AudioPortConfig& in_requested,
34             ::aidl::android::media::audio::common::AudioPortConfig* out_suggested,
35             bool* _aidl_return) override;
36 
37     // Module interfaces
38     ndk::ScopedAStatus createInputStream(
39             StreamContext&& context,
40             const ::aidl::android::hardware::audio::common::SinkMetadata& sinkMetadata,
41             const std::vector<::aidl::android::media::audio::common::MicrophoneInfo>& microphones,
42             std::shared_ptr<StreamIn>* result) override;
43     ndk::ScopedAStatus createOutputStream(
44             StreamContext&& context,
45             const ::aidl::android::hardware::audio::common::SourceMetadata& sourceMetadata,
46             const std::optional<::aidl::android::media::audio::common::AudioOffloadInfo>&
47                     offloadInfo,
48             std::shared_ptr<StreamOut>* result) override;
49     ndk::ScopedAStatus populateConnectedDevicePort(
50             ::aidl::android::media::audio::common::AudioPort* audioPort,
51             int32_t nextPortId) override;
52     ndk::ScopedAStatus checkAudioPatchEndpointsMatch(
53             const std::vector<::aidl::android::media::audio::common::AudioPortConfig*>& sources,
54             const std::vector<::aidl::android::media::audio::common::AudioPortConfig*>& sinks)
55             override;
56     ndk::ScopedAStatus onMasterMuteChanged(bool mute) override;
57     ndk::ScopedAStatus onMasterVolumeChanged(float volume) override;
58     int32_t getNominalLatencyMs(
59             const ::aidl::android::media::audio::common::AudioPortConfig& portConfig) override;
60     binder_status_t dump(int fd, const char** args, uint32_t numArgs) override;
61 };
62 
63 }  // namespace aidl::android::hardware::audio::core
64