diff --git a/src/decoder/dvpp/DvppSourceManager.cpp b/src/decoder/dvpp/DvppSourceManager.cpp index c928e42..405d90f 100644 --- a/src/decoder/dvpp/DvppSourceManager.cpp +++ b/src/decoder/dvpp/DvppSourceManager.cpp @@ -7,43 +7,11 @@ using namespace std; DvppSourceManager::~DvppSourceManager() { - for(auto iter = ctxMap.begin(); iter != ctxMap.end(); iter++){ - aclError ret = aclrtDestroyContext(iter->second); - if(ret != ACL_ERROR_NONE){ - LOG_ERROR("aclrtDestroyContext failed !"); - continue; - } - } - ctxMap.clear(); channelMap.clear(); // aclFinalize(); } -aclrtContext DvppSourceManager::getContext(int devId) -{ - aclrtContext ctx = ctxMap[devId]; - if (ctx == nullptr) - { - // 初始化硬件解码器 - aclError ret = aclrtSetDevice(devId); - if(ret != ACL_ERROR_NONE){ - // cout << "aclrtSetDevice failed" << endl; - LOG_ERROR("aclrtSetDevice failed !"); - return nullptr; - } - - ret = aclrtCreateContext(&ctx, devId); - if (ret != ACL_ERROR_NONE) { - // cout << "aclrtCreateContext failed " << endl; - LOG_ERROR("aclrtCreateContext failed !"); - return nullptr; - } - ctxMap[devId] = ctx; - } - return ctx; -} - int DvppSourceManager::getChannel(int devId){ // channel 最大值暂定为32, 华为没有接口获取最大channel,只有文档说明 for(int iChannel = 0; iChannel < 32; iChannel++){ diff --git a/src/decoder/dvpp/DvppSourceManager.h b/src/decoder/dvpp/DvppSourceManager.h index 6320a46..9679f16 100644 --- a/src/decoder/dvpp/DvppSourceManager.h +++ b/src/decoder/dvpp/DvppSourceManager.h @@ -16,8 +16,6 @@ public: return singleton; } - aclrtContext getContext(int devId); - int getChannel(int devId); void releaseChannel(int devId, int channel); @@ -26,6 +24,5 @@ private: ~DvppSourceManager(); private: - map ctxMap; map channelMap; }; \ No newline at end of file