Commit c434950c55895607021860db9b7f8d5a69bf5497

Authored by Hu Chunming
1 parent 80317d07

删除无用代码

src/decoder/dvpp/DvppSourceManager.cpp
@@ -7,43 +7,11 @@ using namespace std; @@ -7,43 +7,11 @@ using namespace std;
7 7
8 DvppSourceManager::~DvppSourceManager() 8 DvppSourceManager::~DvppSourceManager()
9 { 9 {
10 - for(auto iter = ctxMap.begin(); iter != ctxMap.end(); iter++){  
11 - aclError ret = aclrtDestroyContext(iter->second);  
12 - if(ret != ACL_ERROR_NONE){  
13 - LOG_ERROR("aclrtDestroyContext failed !");  
14 - continue;  
15 - }  
16 - }  
17 - ctxMap.clear();  
18 channelMap.clear(); 10 channelMap.clear();
19 11
20 // aclFinalize(); 12 // aclFinalize();
21 } 13 }
22 14
23 -aclrtContext DvppSourceManager::getContext(int devId)  
24 -{  
25 - aclrtContext ctx = ctxMap[devId];  
26 - if (ctx == nullptr)  
27 - {  
28 - // 初始化硬件解码器  
29 - aclError ret = aclrtSetDevice(devId);  
30 - if(ret != ACL_ERROR_NONE){  
31 - // cout << "aclrtSetDevice failed" << endl;  
32 - LOG_ERROR("aclrtSetDevice failed !");  
33 - return nullptr;  
34 - }  
35 -  
36 - ret = aclrtCreateContext(&ctx, devId);  
37 - if (ret != ACL_ERROR_NONE) {  
38 - // cout << "aclrtCreateContext failed " << endl;  
39 - LOG_ERROR("aclrtCreateContext failed !");  
40 - return nullptr;  
41 - }  
42 - ctxMap[devId] = ctx;  
43 - }  
44 - return ctx;  
45 -}  
46 -  
47 int DvppSourceManager::getChannel(int devId){ 15 int DvppSourceManager::getChannel(int devId){
48 // channel 最大值暂定为32, 华为没有接口获取最大channel,只有文档说明 16 // channel 最大值暂定为32, 华为没有接口获取最大channel,只有文档说明
49 for(int iChannel = 0; iChannel < 32; iChannel++){ 17 for(int iChannel = 0; iChannel < 32; iChannel++){
src/decoder/dvpp/DvppSourceManager.h
@@ -16,8 +16,6 @@ public: @@ -16,8 +16,6 @@ public:
16 return singleton; 16 return singleton;
17 } 17 }
18 18
19 - aclrtContext getContext(int devId);  
20 -  
21 int getChannel(int devId); 19 int getChannel(int devId);
22 void releaseChannel(int devId, int channel); 20 void releaseChannel(int devId, int channel);
23 21
@@ -26,6 +24,5 @@ private: @@ -26,6 +24,5 @@ private:
26 ~DvppSourceManager(); 24 ~DvppSourceManager();
27 25
28 private: 26 private:
29 - map<int, aclrtContext> ctxMap;  
30 map<string, int> channelMap; 27 map<string, int> channelMap;
31 }; 28 };
32 \ No newline at end of file 29 \ No newline at end of file