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 26 namespace OHOS { 27 namespace HDI { 28 namespace Codec { 29 namespace V1_0 { 30 class CodecDfxService : public RefBase { 31 public: 32 ~CodecDfxService() = default; 33 static CodecDfxService &GetInstance(); 34 static HdfSBuf* GetReply(); 35 void SetComponentManager(sptr<CodecComponentManagerService> manager); 36 static void GetBuffCount(); 37 static int32_t DevCodecHostDump(struct HdfSBuf *data, struct HdfSBuf *reply); 38 static int32_t GetCodecComponentListInfo(struct HdfSBuf *reply); 39 static void GetCodecMemoryInfo(); 40 41 protected: 42 CodecDfxService() = default; 43 44 private: 45 static uint32_t inputBuffCount; 46 static uint32_t outputBuffCount; 47 sptr<CodecComponentManagerService> managerService_; 48 static std::shared_ptr<OHOS::Codec::Omx::ComponentNode> dumpNode; 49 static CodecDfxService dfxInstance_; 50 static HdfSBuf *reply_; 51 }; 52 53 } // namespace V1_0 54 } // namespace Codec 55 } // namespace HDI 56 } // namespace OHOS 57 #endif // CODEC_DFX_SERVICE_H 58