Commit 1efdb0a4 authored by Timo Rothenpieler's avatar Timo Rothenpieler Committed by Michael Niedermayer

avcodec/nvenc: Remove special cases for cygwin

Signed-off-by: 's avatarMichael Niedermayer <michaelni@gmx.at>
parent 7dce9136
...@@ -19,25 +19,14 @@ ...@@ -19,25 +19,14 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/ */
#if defined(_WIN32) && !defined(__CYGWIN__) #if defined(_WIN32)
#include <windows.h> #include <windows.h>
#else #else
#include <dlfcn.h> #include <dlfcn.h>
#endif #endif
/* NVENC API is stdcall in cygwin, as it's still Windows */
#if defined(__CYGWIN__) && !defined(_WIN32)
#define _WIN32
#define TEMP_WIN32
#endif
#include <nvEncodeAPI.h> #include <nvEncodeAPI.h>
#if defined(TEMP_WIN32)
#undef _WIN32
#endif
#include "libavutil/internal.h" #include "libavutil/internal.h"
#include "libavutil/imgutils.h" #include "libavutil/imgutils.h"
#include "libavutil/avassert.h" #include "libavutil/avassert.h"
...@@ -47,13 +36,13 @@ ...@@ -47,13 +36,13 @@
#include "internal.h" #include "internal.h"
#include "thread.h" #include "thread.h"
#if defined(_WIN32) || defined(__CYGWIN__) #if defined(_WIN32)
#define CUDAAPI __stdcall #define CUDAAPI __stdcall
#else #else
#define CUDAAPI #define CUDAAPI
#endif #endif
#if defined(_WIN32) && !defined(__CYGWIN__) #if defined(_WIN32)
#define LOAD_FUNC(l, s) GetProcAddress(l, s) #define LOAD_FUNC(l, s) GetProcAddress(l, s)
#define DL_CLOSE_FUNC(l) FreeLibrary(l) #define DL_CLOSE_FUNC(l) FreeLibrary(l)
#else #else
...@@ -133,7 +122,7 @@ typedef struct NvencDynLoadFunctions ...@@ -133,7 +122,7 @@ typedef struct NvencDynLoadFunctions
int nvenc_device_count; int nvenc_device_count;
CUdevice nvenc_devices[16]; CUdevice nvenc_devices[16];
#if defined(_WIN32) && !defined(__CYGWIN__) #if defined(_WIN32)
HMODULE cuda_lib; HMODULE cuda_lib;
HMODULE nvenc_lib; HMODULE nvenc_lib;
#else #else
...@@ -290,8 +279,6 @@ static av_cold int nvenc_dyload_cuda(AVCodecContext *avctx) ...@@ -290,8 +279,6 @@ static av_cold int nvenc_dyload_cuda(AVCodecContext *avctx)
#if defined(_WIN32) #if defined(_WIN32)
dl_fn->cuda_lib = LoadLibrary(TEXT("nvcuda.dll")); dl_fn->cuda_lib = LoadLibrary(TEXT("nvcuda.dll"));
#elif defined(__CYGWIN__)
dl_fn->cuda_lib = dlopen("nvcuda.dll", RTLD_LAZY);
#else #else
dl_fn->cuda_lib = dlopen("libcuda.so", RTLD_LAZY); dl_fn->cuda_lib = dlopen("libcuda.so", RTLD_LAZY);
#endif #endif
...@@ -409,12 +396,6 @@ static av_cold int nvenc_dyload_nvenc(AVCodecContext *avctx) ...@@ -409,12 +396,6 @@ static av_cold int nvenc_dyload_nvenc(AVCodecContext *avctx)
} else { } else {
dl_fn->nvenc_lib = LoadLibrary(TEXT("nvEncodeAPI.dll")); dl_fn->nvenc_lib = LoadLibrary(TEXT("nvEncodeAPI.dll"));
} }
#elif defined(__CYGWIN__)
if (sizeof(void*) == 8) {
dl_fn->nvenc_lib = dlopen("nvEncodeAPI64.dll", RTLD_LAZY);
} else {
dl_fn->nvenc_lib = dlopen("nvEncodeAPI.dll", RTLD_LAZY);
}
#else #else
dl_fn->nvenc_lib = dlopen("libnvidia-encode.so.1", RTLD_LAZY); dl_fn->nvenc_lib = dlopen("libnvidia-encode.so.1", RTLD_LAZY);
#endif #endif
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment