X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=libavcodec%2Fnvenc.h;h=ab48cf759afdb21cf40aa6cfabd81bc79ec49213;hb=2c5839254daa069fedcd4355987776b836889af7;hp=bad659aece1b7de737d02feb29b6a928e7dd448d;hpb=711b7b77763cd55d5584ae82ce5cae6d4718092d;p=ffmpeg diff --git a/libavcodec/nvenc.h b/libavcodec/nvenc.h index bad659aece1..ab48cf759af 100644 --- a/libavcodec/nvenc.h +++ b/libavcodec/nvenc.h @@ -23,29 +23,12 @@ #include "config.h" +#include "compat/cuda/dynlink_loader.h" #include "libavutil/fifo.h" #include "libavutil/opt.h" #include "avcodec.h" -#if CONFIG_CUDA -#include "libavutil/hwcontext_cuda.h" -#else - -#if defined(_WIN32) -#define CUDAAPI __stdcall -#else -#define CUDAAPI -#endif - -typedef enum cudaError_enum { - CUDA_SUCCESS = 0 -} CUresult; -typedef int CUdevice; -typedef void* CUcontext; -typedef void* CUdeviceptr; -#endif - #define MAX_REGISTERED_FRAMES 64 typedef struct NvencSurface @@ -64,33 +47,10 @@ typedef struct NvencSurface int lockCount; } NvencSurface; -typedef CUresult(CUDAAPI *PCUINIT)(unsigned int Flags); -typedef CUresult(CUDAAPI *PCUDEVICEGETCOUNT)(int *count); -typedef CUresult(CUDAAPI *PCUDEVICEGET)(CUdevice *device, int ordinal); -typedef CUresult(CUDAAPI *PCUDEVICEGETNAME)(char *name, int len, CUdevice dev); -typedef CUresult(CUDAAPI *PCUDEVICECOMPUTECAPABILITY)(int *major, int *minor, CUdevice dev); -typedef CUresult(CUDAAPI *PCUCTXCREATE)(CUcontext *pctx, unsigned int flags, CUdevice dev); -typedef CUresult(CUDAAPI *PCUCTXPOPCURRENT)(CUcontext *pctx); -typedef CUresult(CUDAAPI *PCUCTXDESTROY)(CUcontext ctx); - -typedef NVENCSTATUS (NVENCAPI *PNVENCODEAPIGETMAXSUPPORTEDVERSION)(uint32_t* version); -typedef NVENCSTATUS (NVENCAPI *PNVENCODEAPICREATEINSTANCE)(NV_ENCODE_API_FUNCTION_LIST *functionList); - typedef struct NvencDynLoadFunctions { -#if !CONFIG_CUDA - void *cuda; -#endif - void *nvenc; - - PCUINIT cu_init; - PCUDEVICEGETCOUNT cu_device_get_count; - PCUDEVICEGET cu_device_get; - PCUDEVICEGETNAME cu_device_get_name; - PCUDEVICECOMPUTECAPABILITY cu_device_compute_capability; - PCUCTXCREATE cu_ctx_create; - PCUCTXPOPCURRENT cu_ctx_pop_current; - PCUCTXDESTROY cu_ctx_destroy; + CudaFunctions *cuda_dl; + NvencFunctions *nvenc_dl; NV_ENCODE_API_FUNCTION_LIST nvenc_funcs; int nvenc_device_count; @@ -193,6 +153,8 @@ typedef struct NvencContext int strict_gop; int aq_strength; int quality; + int aud; + int bluray_compat; } NvencContext; int ff_nvenc_encode_init(AVCodecContext *avctx);