Blame view

src/dvpp/DvppSourceManager.h 685 Bytes
63e6f7bc   Hu Chunming   完成dvpp。但是nv和gb281...
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
  
  #include<map>
  #include<string>
  
  #include "dvpp_headers.h"
  
  using namespace std;
  
  class DvppSourceManager{
  public:
      static DvppSourceManager* getInstance(){
  		static DvppSourceManager* singleton = nullptr;
  		if (singleton == nullptr){
  			singleton = new DvppSourceManager();
  			int ret = aclInit(nullptr);
  			if (ret != ACL_ERROR_NONE) { 
  				cout << "aclInit failed" << endl; 
  				return nullptr;
  			}
  		}
  		return singleton;
  	}
  
      aclrtContext getContext(int devId);
  
  	int getChannel(int devId);
  	void releaseChannel(int devId, int channel);
  
  private:
      DvppSourceManager(){}
  	~DvppSourceManager();
  
  private:
      map<int, aclrtContext> ctxMap;
  	map<string, int> channelMap;
  };