00001 
00002 
00003 
00004 
00005 
00006 
00007 
00008 
00009 
00010 
00011 
00012 
00013 
00014 
00015 
00016 
00017 
00018 
00019 
00020 
00021 
00022 #ifndef NVENCMGR_H
00023 #define NVENCMGR_H
00024 
00025 #include "nvEncodeAPI.h" 
00026 
00027 #define NVENCMGR_SUCCESS  0
00028 #define NVENCMGR_ERROR   -1
00029 
00030 typedef NVENCSTATUS (NVENCAPI* PNVENCODEAPICREATEINSTANCE)(NV_ENCODE_API_FUNCTION_LIST *functionList);
00031 
00032 class NVENCMgr {
00033   public:
00034     NVENCMgr(void);
00035     ~NVENCMgr(void);
00036     int init(void);
00037     int open_session(void);
00038     int create_inbufs(int bufcount);
00039 
00040   private:
00041     int enc_ready;
00042     void *nvenc_lib;
00043     PNVENCODEAPICREATEINSTANCE nvEncodeAPICreateInstance;
00044     NV_ENCODE_API_FUNCTION_LIST nvenc_fctns;
00045     NV_ENC_OPEN_ENCODE_SESSION_EX_PARAMS session_parms;
00046     void *nvenc_ctx;
00047 
00048     NV_ENC_PRESET_CONFIG preset_conf;
00049     NV_ENC_INITIALIZE_PARAMS init_parms;
00050     NV_ENC_CONFIG conf;
00051     GUID enc_preset;
00052     GUID codec;
00053 
00054     NV_ENC_CREATE_INPUT_BUFFER create_inbuf;
00055     int inbuf_count;
00056 
00057     NV_ENC_CREATE_BITSTREAM_BUFFER create_outbuf;
00058 };
00059 
00060 #endif