1/* 2 * Copyright (c) 2023 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#ifndef CODEC_DFX_SERVICE_H 16#define CODEC_DFX_SERVICE_H 17 18#include <map> 19#include <string> 20#include <hdf_sbuf.h> 21#include <hdf_base.h> 22#include <securec.h> 23#include "codec_component_manager_service.h" 24#include "codec_component_service.h" 25 26namespace OHOS { 27namespace HDI { 28namespace Codec { 29namespace V3_0 { 30class CodecDfxService : public RefBase { 31public: 32 ~CodecDfxService() = default; 33 static CodecDfxService &GetInstance(); 34 static HdfSBuf* GetReply(); 35 void SetComponentManager(sptr<CodecComponentManagerService> manager); 36 static int32_t DevCodecHostDump(struct HdfSBuf *data, struct HdfSBuf *reply); 37 static int32_t GetCodecComponentListInfo(struct HdfSBuf *reply); 38 static void GetCodecMemoryInfo(); 39 40protected: 41 CodecDfxService() = default; 42 43private: 44 sptr<CodecComponentManagerService> managerService_; 45 static CodecDfxService dfxInstance_; 46 static HdfSBuf *reply_; 47}; 48 49} // namespace V3_0 50} // namespace Codec 51} // namespace HDI 52} // namespace OHOS 53#endif // CODEC_DFX_SERVICE_H 54