1 /* 2 * Copyright (c) 2024 Huawei Device Co., Ltd. 3 * Licensed under the Apache License, Version 2.0 (the "License"); 4 * you may not use this file except in compliance with the License. 5 * You may obtain a copy of the License at 6 * 7 * http://www.apache.org/licenses/LICENSE-2.0 8 * 9 * Unless required by applicable law or agreed to in writing, software 10 * distributed under the License is distributed on an "AS IS" BASIS, 11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 * See the License for the specific language governing permissions and 13 * limitations under the License. 14 */ 15 16 #ifndef MEDIA_MONITOR_PROXY_H 17 #define MEDIA_MONITOR_PROXY_H 18 19 #include "iremote_proxy.h" 20 #include "media_monitor_base.h" 21 #include "media_monitor_ipc_interface_code.h" 22 23 namespace OHOS { 24 namespace Media { 25 namespace MediaMonitor { 26 27 class MediaMonitorClient : public IRemoteProxy<IMediaMonitor> { 28 public: 29 explicit MediaMonitorClient(const sptr<IRemoteObject> &impl); 30 virtual ~MediaMonitorClient() = default; 31 32 void WriteLogMsg(std::shared_ptr<EventBean> &bean) override; 33 34 int32_t GetAudioRouteMsg(std::map<PerferredType, 35 std::shared_ptr<MonitorDeviceInfo>> &perferredDevices) override; 36 37 int32_t WriteAudioBuffer(const std::string &fileName, void *ptr, size_t size) override; 38 39 int32_t GetInputBuffer(std::shared_ptr<DumpBuffer> &buffer, int32_t size) override; 40 41 int32_t InputBufferFilled(const std::string &fileName, uint64_t bufferId, int32_t size) override; 42 43 int32_t SetMediaParameters(const std::string &dumpType, const std::string &dumpEnable) override; 44 45 int32_t ErasePreferredDeviceByType(const PerferredType preferredType) override; 46 private: 47 static inline BrokerDelegator<MediaMonitorClient> delegator_; 48 std::shared_ptr<DumpBufferWrap> dumpBufferWrap_ = nullptr; 49 }; 50 } // namespace MediaMonitor 51 } // namespace Media 52 } // namespace OHOS 53 #endif // MEDIA_MONITOR_PROXY_H