Blame view

src/nvdecoder/FFCuContextManager.h 457 Bytes
f40cc409   Hu Chunming   优化显存占用。当前在3080显卡上...
1
2
3
4
  
  #include<map>
  #include<string>
  
f40cc409   Hu Chunming   优化显存占用。当前在3080显卡上...
5
6
  using namespace std;
  
00b0fbdb   Hu Chunming   编译nvdec
7
8
  struct AVBufferRef;
  
f40cc409   Hu Chunming   优化显存占用。当前在3080显卡上...
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
  class FFCuContextManager{
  public:
      static FFCuContextManager* getInstance(){
  		static FFCuContextManager* singleton = nullptr;
  		if (singleton == nullptr){
  			singleton = new FFCuContextManager();
  		}
  		return singleton;
  	}
  
      AVBufferRef *getCuCtx(string gpuid);
  
  private:
      FFCuContextManager(){}
  	~FFCuContextManager();
  
  private:
      map<string,AVBufferRef *> ctxMap;
  
  };