Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/FFmpeg/FFmpeg.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrey Turkin <andrey.turkin@gmail.com>2016-05-29 15:23:26 +0300
committerTimo Rothenpieler <timo@rothenpieler.org>2016-05-31 17:04:53 +0300
commit0d021cc8b30a6f81c27fbeca7f99f1ee7a20acf8 (patch)
tree98ff47c1f0a27f999e2b6979b6ed9da88c8bea73 /libavcodec/nvenc.h
parentf052ef30ef6534c811b9f349e8f17e32afbc9148 (diff)
avcodec/nvenc: rework library load and GPU selection
Use explicit nvenc capability checks instead to determine usable devices instead of SM versions. Signed-off-by: Timo Rothenpieler <timo@rothenpieler.org>
Diffstat (limited to 'libavcodec/nvenc.h')
-rw-r--r--libavcodec/nvenc.h23
1 files changed, 9 insertions, 14 deletions
diff --git a/libavcodec/nvenc.h b/libavcodec/nvenc.h
index 2c1d8d49d5..7abaf33756 100644
--- a/libavcodec/nvenc.h
+++ b/libavcodec/nvenc.h
@@ -29,7 +29,7 @@
#include "avcodec.h"
#if CONFIG_CUDA
-#include <cuda.h>
+#include "libavutil/hwcontext_cuda.h"
#else
#if defined(_WIN32)
@@ -77,17 +77,9 @@ typedef NVENCSTATUS (NVENCAPI *PNVENCODEAPICREATEINSTANCE)(NV_ENCODE_API_FUNCTIO
typedef struct NvencDynLoadFunctions
{
#if !CONFIG_CUDA
-#if defined(_WIN32)
- HMODULE cuda_lib;
-#else
- void* cuda_lib;
-#endif
-#endif
-#if defined(_WIN32)
- HMODULE nvenc_lib;
-#else
- void* nvenc_lib;
+ void *cuda;
#endif
+ void *nvenc;
PCUINIT cu_init;
PCUDEVICEGETCOUNT cu_device_get_count;
@@ -100,8 +92,6 @@ typedef struct NvencDynLoadFunctions
NV_ENCODE_API_FUNCTION_LIST nvenc_funcs;
int nvenc_device_count;
- CUdevice nvenc_devices[16];
-
} NvencDynLoadFunctions;
enum {
@@ -133,6 +123,11 @@ enum {
NVENC_TWO_PASSES = 8,
};
+enum {
+ LIST_DEVICES = -2,
+ ANY_DEVICE,
+};
+
typedef struct NvencContext
{
AVClass *avclass;
@@ -173,7 +168,7 @@ typedef struct NvencContext
int rc;
int cbr;
int twopass;
- int gpu;
+ int device;
int flags;
int async_depth;
} NvencContext;