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_STUB_H 17 #define I_MEDIA_MONITOR_STUB_H 18 19 #include "media_monitor_base.h" 20 21 namespace OHOS { 22 namespace Media { 23 namespace MediaMonitor { 24 class MediaMonitorStub : public IRemoteStub<IMediaMonitor> { 25 public: 26 virtual int OnRemoteRequest(uint32_t code, MessageParcel &data, MessageParcel &reply, 27 MessageOption &option) override; 28 std::shared_ptr<DumpBufferWrap> dumpBufferWrap_ = nullptr; 29 30 private: 31 void HandleWriteLogMsg(MessageParcel &data, MessageParcel &reply); 32 void HandleGetAudioRouteMsg(MessageParcel &data, MessageParcel &reply); 33 void HandleSetMediaParams(MessageParcel &data, MessageParcel &reply); 34 void HandleGetInputBuffer(MessageParcel &data, MessageParcel &reply); 35 void HandleInputBufferFilled(MessageParcel &data, MessageParcel &reply); 36 void HandleErasePreferredDeviceByType(MessageParcel &data, MessageParcel &reply); 37 using HandlerFunc = void (MediaMonitorStub::*)(MessageParcel &data, MessageParcel &reply); 38 static inline HandlerFunc handlers[] = { 39 &MediaMonitorStub::HandleWriteLogMsg, 40 &MediaMonitorStub::HandleGetAudioRouteMsg, 41 &MediaMonitorStub::HandleSetMediaParams, 42 &MediaMonitorStub::HandleGetInputBuffer, 43 &MediaMonitorStub::HandleInputBufferFilled, 44 &MediaMonitorStub::HandleErasePreferredDeviceByType, 45 }; 46 static constexpr size_t handlersNums = sizeof(handlers) / sizeof(HandlerFunc); 47 }; 48 } // namespace MediaMonitor 49 } // namespace Media 50 } // namespace OHOS 51 52 #endif // I_MEDIA_MONITOR_STUB_H