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 I_MEDIA_MONITOR_BASE_H 17 #define I_MEDIA_MONITOR_BASE_H 18 19 #include "ipc_types.h" 20 #include "iremote_broker.h" 21 #include "iremote_proxy.h" 22 #include "iremote_stub.h" 23 #include "event_bean.h" 24 #include "dump_buffer_wrap.h" 25 26 namespace OHOS { 27 namespace Media { 28 namespace MediaMonitor { 29 30 class AudioDeviceDescriptor; 31 class IMediaMonitor : public IRemoteBroker { 32 public: 33 /** 34 * Sets WriteLogMsg. 35 * 36 * @param bean EventBean 37 */ 38 virtual void WriteLogMsg(std::shared_ptr<EventBean> &bean) = 0; 39 40 /** 41 * Sets GetAudioRouteMsg. 42 * 43 * @param perferredDevices MonitorDeviceInfo map 44 */ 45 virtual int32_t GetAudioRouteMsg(std::map<PerferredType, 46 std::shared_ptr<MonitorDeviceInfo>> &perferredDevices) = 0; 47 48 virtual int32_t WriteAudioBuffer(const std::string &fileName, void *ptr, size_t size) = 0; 49 50 virtual int32_t GetInputBuffer(std::shared_ptr<DumpBuffer> &buffer, int32_t size) = 0; 51 52 virtual int32_t InputBufferFilled(const std::string &fileName, uint64_t bufferId, int32_t size) = 0; 53 54 virtual int32_t SetMediaParameters(const std::string &dumpType, const std::string &dumpEnable) = 0; 55 56 virtual int32_t ErasePreferredDeviceByType(const PerferredType preferredType) = 0; 57 58 public: 59 DECLARE_INTERFACE_DESCRIPTOR(u"IMediaMonitor"); 60 }; 61 62 } // namespace MediaMonitor 63 } // namespace Media 64 } // namespace OHOS 65 66 #endif // I_MEDIA_MONITOR_BASE_H