nvdec,nvenc: Port to dynamic library loading
... and put them into new nvcodec plugin.
* nvcodec plugin
Now each nvenc and nvdec element is moved to be a part of nvcodec plugin
for better interoperability.
Additionally, cuda runtime API header dependencies
(i.e., cuda_runtime_api.h and cuda_gl_interop.h) are removed.
Note that cuda runtime APIs have prefix "cuda". Since 1.16 release with
Windows support, only "cuda.h" and "cudaGL.h" dependent symbols have
been used except for some defined types. However, those types could be
replaced with other types which were defined by "cuda.h".
* dynamic library loading
CUDA library will be opened with g_module_open() instead of build-time linking.
On Windows, nvcuda.dll is installed to system path by CUDA Toolkit
installer, and on *nix, user should ensure that libcuda.so.1 can be
loadable (i.e., via LD_LIBRARY_PATH or default dlopen path)
Therefore, NVIDIA_VIDEO_CODEC_SDK_PATH env build time dependency for Windows
is removed.
2019-05-17 13:27:50 +00:00
|
|
|
/* GStreamer
|
|
|
|
* Copyright (C) 2019 Seungha Yang <seungha.yang@navercorp.com>
|
|
|
|
*
|
|
|
|
* This library is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU Library General Public
|
|
|
|
* License as published by the Free Software Foundation; either
|
|
|
|
* version 2 of the License, or (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This library is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
|
* Library General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU Library General Public
|
|
|
|
* License along with this library; if not, write to the
|
|
|
|
* Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
|
|
|
|
* Boston, MA 02110-1301, USA.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifdef HAVE_CONFIG_H
|
|
|
|
#include "config.h"
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#include "gstcudaloader.h"
|
|
|
|
#include <gmodule.h>
|
|
|
|
|
2019-11-28 09:54:31 +00:00
|
|
|
GST_DEBUG_CATEGORY_EXTERN (gst_nvcodec_debug);
|
|
|
|
#define GST_CAT_DEFAULT gst_nvcodec_debug
|
|
|
|
|
nvdec,nvenc: Port to dynamic library loading
... and put them into new nvcodec plugin.
* nvcodec plugin
Now each nvenc and nvdec element is moved to be a part of nvcodec plugin
for better interoperability.
Additionally, cuda runtime API header dependencies
(i.e., cuda_runtime_api.h and cuda_gl_interop.h) are removed.
Note that cuda runtime APIs have prefix "cuda". Since 1.16 release with
Windows support, only "cuda.h" and "cudaGL.h" dependent symbols have
been used except for some defined types. However, those types could be
replaced with other types which were defined by "cuda.h".
* dynamic library loading
CUDA library will be opened with g_module_open() instead of build-time linking.
On Windows, nvcuda.dll is installed to system path by CUDA Toolkit
installer, and on *nix, user should ensure that libcuda.so.1 can be
loadable (i.e., via LD_LIBRARY_PATH or default dlopen path)
Therefore, NVIDIA_VIDEO_CODEC_SDK_PATH env build time dependency for Windows
is removed.
2019-05-17 13:27:50 +00:00
|
|
|
#ifndef G_OS_WIN32
|
|
|
|
#define CUDA_LIBNAME "libcuda.so.1"
|
|
|
|
#else
|
|
|
|
#define CUDA_LIBNAME "nvcuda.dll"
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#define LOAD_SYMBOL(name,func) G_STMT_START { \
|
|
|
|
if (!g_module_symbol (module, G_STRINGIFY (name), (gpointer *) &vtable->func)) { \
|
|
|
|
GST_ERROR ("Failed to load '%s' from %s, %s", G_STRINGIFY (name), filename, g_module_error()); \
|
|
|
|
goto error; \
|
|
|
|
} \
|
|
|
|
} G_STMT_END;
|
|
|
|
|
|
|
|
typedef struct _GstNvCodecCudaVTable
|
|
|
|
{
|
|
|
|
gboolean loaded;
|
|
|
|
|
2020-01-20 09:52:26 +00:00
|
|
|
CUresult (CUDAAPI * CuInit) (unsigned int Flags);
|
|
|
|
CUresult (CUDAAPI * CuGetErrorName) (CUresult error, const char **pStr);
|
|
|
|
CUresult (CUDAAPI * CuGetErrorString) (CUresult error, const char **pStr);
|
nvdec,nvenc: Port to dynamic library loading
... and put them into new nvcodec plugin.
* nvcodec plugin
Now each nvenc and nvdec element is moved to be a part of nvcodec plugin
for better interoperability.
Additionally, cuda runtime API header dependencies
(i.e., cuda_runtime_api.h and cuda_gl_interop.h) are removed.
Note that cuda runtime APIs have prefix "cuda". Since 1.16 release with
Windows support, only "cuda.h" and "cudaGL.h" dependent symbols have
been used except for some defined types. However, those types could be
replaced with other types which were defined by "cuda.h".
* dynamic library loading
CUDA library will be opened with g_module_open() instead of build-time linking.
On Windows, nvcuda.dll is installed to system path by CUDA Toolkit
installer, and on *nix, user should ensure that libcuda.so.1 can be
loadable (i.e., via LD_LIBRARY_PATH or default dlopen path)
Therefore, NVIDIA_VIDEO_CODEC_SDK_PATH env build time dependency for Windows
is removed.
2019-05-17 13:27:50 +00:00
|
|
|
|
2020-01-20 09:52:26 +00:00
|
|
|
CUresult (CUDAAPI * CuCtxCreate) (CUcontext * pctx, unsigned int flags,
|
nvdec,nvenc: Port to dynamic library loading
... and put them into new nvcodec plugin.
* nvcodec plugin
Now each nvenc and nvdec element is moved to be a part of nvcodec plugin
for better interoperability.
Additionally, cuda runtime API header dependencies
(i.e., cuda_runtime_api.h and cuda_gl_interop.h) are removed.
Note that cuda runtime APIs have prefix "cuda". Since 1.16 release with
Windows support, only "cuda.h" and "cudaGL.h" dependent symbols have
been used except for some defined types. However, those types could be
replaced with other types which were defined by "cuda.h".
* dynamic library loading
CUDA library will be opened with g_module_open() instead of build-time linking.
On Windows, nvcuda.dll is installed to system path by CUDA Toolkit
installer, and on *nix, user should ensure that libcuda.so.1 can be
loadable (i.e., via LD_LIBRARY_PATH or default dlopen path)
Therefore, NVIDIA_VIDEO_CODEC_SDK_PATH env build time dependency for Windows
is removed.
2019-05-17 13:27:50 +00:00
|
|
|
CUdevice dev);
|
2020-01-20 09:52:26 +00:00
|
|
|
CUresult (CUDAAPI * CuCtxDestroy) (CUcontext ctx);
|
|
|
|
CUresult (CUDAAPI * CuCtxPopCurrent) (CUcontext * pctx);
|
|
|
|
CUresult (CUDAAPI * CuCtxPushCurrent) (CUcontext ctx);
|
nvdec,nvenc: Port to dynamic library loading
... and put them into new nvcodec plugin.
* nvcodec plugin
Now each nvenc and nvdec element is moved to be a part of nvcodec plugin
for better interoperability.
Additionally, cuda runtime API header dependencies
(i.e., cuda_runtime_api.h and cuda_gl_interop.h) are removed.
Note that cuda runtime APIs have prefix "cuda". Since 1.16 release with
Windows support, only "cuda.h" and "cudaGL.h" dependent symbols have
been used except for some defined types. However, those types could be
replaced with other types which were defined by "cuda.h".
* dynamic library loading
CUDA library will be opened with g_module_open() instead of build-time linking.
On Windows, nvcuda.dll is installed to system path by CUDA Toolkit
installer, and on *nix, user should ensure that libcuda.so.1 can be
loadable (i.e., via LD_LIBRARY_PATH or default dlopen path)
Therefore, NVIDIA_VIDEO_CODEC_SDK_PATH env build time dependency for Windows
is removed.
2019-05-17 13:27:50 +00:00
|
|
|
|
2020-01-20 09:52:26 +00:00
|
|
|
CUresult (CUDAAPI * CuGraphicsMapResources) (unsigned int count,
|
nvdec,nvenc: Port to dynamic library loading
... and put them into new nvcodec plugin.
* nvcodec plugin
Now each nvenc and nvdec element is moved to be a part of nvcodec plugin
for better interoperability.
Additionally, cuda runtime API header dependencies
(i.e., cuda_runtime_api.h and cuda_gl_interop.h) are removed.
Note that cuda runtime APIs have prefix "cuda". Since 1.16 release with
Windows support, only "cuda.h" and "cudaGL.h" dependent symbols have
been used except for some defined types. However, those types could be
replaced with other types which were defined by "cuda.h".
* dynamic library loading
CUDA library will be opened with g_module_open() instead of build-time linking.
On Windows, nvcuda.dll is installed to system path by CUDA Toolkit
installer, and on *nix, user should ensure that libcuda.so.1 can be
loadable (i.e., via LD_LIBRARY_PATH or default dlopen path)
Therefore, NVIDIA_VIDEO_CODEC_SDK_PATH env build time dependency for Windows
is removed.
2019-05-17 13:27:50 +00:00
|
|
|
CUgraphicsResource * resources, CUstream hStream);
|
2020-01-20 09:52:26 +00:00
|
|
|
CUresult (CUDAAPI * CuGraphicsUnmapResources) (unsigned int count,
|
nvdec,nvenc: Port to dynamic library loading
... and put them into new nvcodec plugin.
* nvcodec plugin
Now each nvenc and nvdec element is moved to be a part of nvcodec plugin
for better interoperability.
Additionally, cuda runtime API header dependencies
(i.e., cuda_runtime_api.h and cuda_gl_interop.h) are removed.
Note that cuda runtime APIs have prefix "cuda". Since 1.16 release with
Windows support, only "cuda.h" and "cudaGL.h" dependent symbols have
been used except for some defined types. However, those types could be
replaced with other types which were defined by "cuda.h".
* dynamic library loading
CUDA library will be opened with g_module_open() instead of build-time linking.
On Windows, nvcuda.dll is installed to system path by CUDA Toolkit
installer, and on *nix, user should ensure that libcuda.so.1 can be
loadable (i.e., via LD_LIBRARY_PATH or default dlopen path)
Therefore, NVIDIA_VIDEO_CODEC_SDK_PATH env build time dependency for Windows
is removed.
2019-05-17 13:27:50 +00:00
|
|
|
CUgraphicsResource * resources, CUstream hStream);
|
2020-01-20 09:52:26 +00:00
|
|
|
CUresult (CUDAAPI * CuGraphicsSubResourceGetMappedArray) (CUarray * pArray,
|
nvdec,nvenc: Port to dynamic library loading
... and put them into new nvcodec plugin.
* nvcodec plugin
Now each nvenc and nvdec element is moved to be a part of nvcodec plugin
for better interoperability.
Additionally, cuda runtime API header dependencies
(i.e., cuda_runtime_api.h and cuda_gl_interop.h) are removed.
Note that cuda runtime APIs have prefix "cuda". Since 1.16 release with
Windows support, only "cuda.h" and "cudaGL.h" dependent symbols have
been used except for some defined types. However, those types could be
replaced with other types which were defined by "cuda.h".
* dynamic library loading
CUDA library will be opened with g_module_open() instead of build-time linking.
On Windows, nvcuda.dll is installed to system path by CUDA Toolkit
installer, and on *nix, user should ensure that libcuda.so.1 can be
loadable (i.e., via LD_LIBRARY_PATH or default dlopen path)
Therefore, NVIDIA_VIDEO_CODEC_SDK_PATH env build time dependency for Windows
is removed.
2019-05-17 13:27:50 +00:00
|
|
|
CUgraphicsResource resource, unsigned int arrayIndex,
|
|
|
|
unsigned int mipLevel);
|
2020-01-20 09:52:26 +00:00
|
|
|
CUresult (CUDAAPI * CuGraphicsResourceGetMappedPointer) (CUdeviceptr *
|
|
|
|
pDevPtr, size_t * pSize, CUgraphicsResource resource);
|
|
|
|
CUresult (CUDAAPI *
|
|
|
|
CuGraphicsUnregisterResource) (CUgraphicsResource resource);
|
nvdec,nvenc: Port to dynamic library loading
... and put them into new nvcodec plugin.
* nvcodec plugin
Now each nvenc and nvdec element is moved to be a part of nvcodec plugin
for better interoperability.
Additionally, cuda runtime API header dependencies
(i.e., cuda_runtime_api.h and cuda_gl_interop.h) are removed.
Note that cuda runtime APIs have prefix "cuda". Since 1.16 release with
Windows support, only "cuda.h" and "cudaGL.h" dependent symbols have
been used except for some defined types. However, those types could be
replaced with other types which were defined by "cuda.h".
* dynamic library loading
CUDA library will be opened with g_module_open() instead of build-time linking.
On Windows, nvcuda.dll is installed to system path by CUDA Toolkit
installer, and on *nix, user should ensure that libcuda.so.1 can be
loadable (i.e., via LD_LIBRARY_PATH or default dlopen path)
Therefore, NVIDIA_VIDEO_CODEC_SDK_PATH env build time dependency for Windows
is removed.
2019-05-17 13:27:50 +00:00
|
|
|
|
2020-01-20 09:52:26 +00:00
|
|
|
CUresult (CUDAAPI * CuMemAlloc) (CUdeviceptr * dptr, unsigned int bytesize);
|
|
|
|
CUresult (CUDAAPI * CuMemAllocPitch) (CUdeviceptr * dptr, size_t * pPitch,
|
nvdec,nvenc: Port to dynamic library loading
... and put them into new nvcodec plugin.
* nvcodec plugin
Now each nvenc and nvdec element is moved to be a part of nvcodec plugin
for better interoperability.
Additionally, cuda runtime API header dependencies
(i.e., cuda_runtime_api.h and cuda_gl_interop.h) are removed.
Note that cuda runtime APIs have prefix "cuda". Since 1.16 release with
Windows support, only "cuda.h" and "cudaGL.h" dependent symbols have
been used except for some defined types. However, those types could be
replaced with other types which were defined by "cuda.h".
* dynamic library loading
CUDA library will be opened with g_module_open() instead of build-time linking.
On Windows, nvcuda.dll is installed to system path by CUDA Toolkit
installer, and on *nix, user should ensure that libcuda.so.1 can be
loadable (i.e., via LD_LIBRARY_PATH or default dlopen path)
Therefore, NVIDIA_VIDEO_CODEC_SDK_PATH env build time dependency for Windows
is removed.
2019-05-17 13:27:50 +00:00
|
|
|
size_t WidthInBytes, size_t Height, unsigned int ElementSizeBytes);
|
2020-01-20 09:52:26 +00:00
|
|
|
CUresult (CUDAAPI * CuMemcpy2D) (const CUDA_MEMCPY2D * pCopy);
|
|
|
|
CUresult (CUDAAPI * CuMemcpy2DAsync) (const CUDA_MEMCPY2D * pCopy,
|
|
|
|
CUstream hStream);
|
|
|
|
CUresult (CUDAAPI * CuMemFree) (CUdeviceptr dptr);
|
|
|
|
CUresult (CUDAAPI * CuStreamCreate) (CUstream * phStream,
|
|
|
|
unsigned int Flags);
|
|
|
|
CUresult (CUDAAPI * CuStreamDestroy) (CUstream hStream);
|
|
|
|
CUresult (CUDAAPI * CuStreamSynchronize) (CUstream hStream);
|
|
|
|
|
|
|
|
CUresult (CUDAAPI * CuDeviceGet) (CUdevice * device, int ordinal);
|
|
|
|
CUresult (CUDAAPI * CuDeviceGetCount) (int *count);
|
|
|
|
CUresult (CUDAAPI * CuDeviceGetName) (char *name, int len, CUdevice dev);
|
|
|
|
CUresult (CUDAAPI * CuDeviceGetAttribute) (int *pi,
|
|
|
|
CUdevice_attribute attrib, CUdevice dev);
|
|
|
|
|
|
|
|
CUresult (CUDAAPI * CuGraphicsGLRegisterImage) (CUgraphicsResource *
|
|
|
|
pCudaResource, unsigned int image, unsigned int target,
|
|
|
|
unsigned int Flags);
|
|
|
|
CUresult (CUDAAPI * CuGraphicsGLRegisterBuffer) (CUgraphicsResource *
|
|
|
|
pCudaResource, unsigned int buffer, unsigned int Flags);
|
|
|
|
CUresult (CUDAAPI *
|
|
|
|
CuGraphicsResourceSetMapFlags) (CUgraphicsResource resource,
|
2019-08-17 08:45:44 +00:00
|
|
|
unsigned int flags);
|
2020-03-15 10:20:47 +00:00
|
|
|
CUresult (CUDAAPI * CuGLGetDevices) (unsigned int *pCudaDeviceCount,
|
|
|
|
CUdevice * pCudaDevices, unsigned int cudaDeviceCount,
|
|
|
|
CUGLDeviceList deviceList);
|
nvdec,nvenc: Port to dynamic library loading
... and put them into new nvcodec plugin.
* nvcodec plugin
Now each nvenc and nvdec element is moved to be a part of nvcodec plugin
for better interoperability.
Additionally, cuda runtime API header dependencies
(i.e., cuda_runtime_api.h and cuda_gl_interop.h) are removed.
Note that cuda runtime APIs have prefix "cuda". Since 1.16 release with
Windows support, only "cuda.h" and "cudaGL.h" dependent symbols have
been used except for some defined types. However, those types could be
replaced with other types which were defined by "cuda.h".
* dynamic library loading
CUDA library will be opened with g_module_open() instead of build-time linking.
On Windows, nvcuda.dll is installed to system path by CUDA Toolkit
installer, and on *nix, user should ensure that libcuda.so.1 can be
loadable (i.e., via LD_LIBRARY_PATH or default dlopen path)
Therefore, NVIDIA_VIDEO_CODEC_SDK_PATH env build time dependency for Windows
is removed.
2019-05-17 13:27:50 +00:00
|
|
|
} GstNvCodecCudaVTable;
|
|
|
|
|
|
|
|
static GstNvCodecCudaVTable gst_cuda_vtable = { 0, };
|
|
|
|
|
|
|
|
gboolean
|
|
|
|
gst_cuda_load_library (void)
|
|
|
|
{
|
|
|
|
GModule *module;
|
|
|
|
const gchar *filename = CUDA_LIBNAME;
|
|
|
|
GstNvCodecCudaVTable *vtable;
|
|
|
|
|
|
|
|
if (gst_cuda_vtable.loaded)
|
|
|
|
return TRUE;
|
|
|
|
|
|
|
|
module = g_module_open (filename, G_MODULE_BIND_LAZY);
|
|
|
|
if (module == NULL) {
|
2019-07-24 04:06:16 +00:00
|
|
|
GST_WARNING ("Could not open library %s, %s", filename, g_module_error ());
|
nvdec,nvenc: Port to dynamic library loading
... and put them into new nvcodec plugin.
* nvcodec plugin
Now each nvenc and nvdec element is moved to be a part of nvcodec plugin
for better interoperability.
Additionally, cuda runtime API header dependencies
(i.e., cuda_runtime_api.h and cuda_gl_interop.h) are removed.
Note that cuda runtime APIs have prefix "cuda". Since 1.16 release with
Windows support, only "cuda.h" and "cudaGL.h" dependent symbols have
been used except for some defined types. However, those types could be
replaced with other types which were defined by "cuda.h".
* dynamic library loading
CUDA library will be opened with g_module_open() instead of build-time linking.
On Windows, nvcuda.dll is installed to system path by CUDA Toolkit
installer, and on *nix, user should ensure that libcuda.so.1 can be
loadable (i.e., via LD_LIBRARY_PATH or default dlopen path)
Therefore, NVIDIA_VIDEO_CODEC_SDK_PATH env build time dependency for Windows
is removed.
2019-05-17 13:27:50 +00:00
|
|
|
return FALSE;
|
|
|
|
}
|
|
|
|
|
|
|
|
vtable = &gst_cuda_vtable;
|
|
|
|
|
|
|
|
/* cuda.h */
|
|
|
|
LOAD_SYMBOL (cuInit, CuInit);
|
|
|
|
LOAD_SYMBOL (cuGetErrorName, CuGetErrorName);
|
|
|
|
LOAD_SYMBOL (cuGetErrorString, CuGetErrorString);
|
|
|
|
LOAD_SYMBOL (cuCtxCreate, CuCtxCreate);
|
|
|
|
LOAD_SYMBOL (cuCtxDestroy, CuCtxDestroy);
|
|
|
|
LOAD_SYMBOL (cuCtxPopCurrent, CuCtxPopCurrent);
|
|
|
|
LOAD_SYMBOL (cuCtxPushCurrent, CuCtxPushCurrent);
|
|
|
|
|
|
|
|
LOAD_SYMBOL (cuGraphicsMapResources, CuGraphicsMapResources);
|
|
|
|
LOAD_SYMBOL (cuGraphicsUnmapResources, CuGraphicsUnmapResources);
|
|
|
|
LOAD_SYMBOL (cuGraphicsSubResourceGetMappedArray,
|
|
|
|
CuGraphicsSubResourceGetMappedArray);
|
|
|
|
LOAD_SYMBOL (cuGraphicsResourceGetMappedPointer,
|
|
|
|
CuGraphicsResourceGetMappedPointer);
|
|
|
|
LOAD_SYMBOL (cuGraphicsUnregisterResource, CuGraphicsUnregisterResource);
|
|
|
|
|
|
|
|
LOAD_SYMBOL (cuMemAlloc, CuMemAlloc);
|
|
|
|
LOAD_SYMBOL (cuMemAllocPitch, CuMemAllocPitch);
|
|
|
|
LOAD_SYMBOL (cuMemcpy2D, CuMemcpy2D);
|
2019-07-19 13:46:01 +00:00
|
|
|
LOAD_SYMBOL (cuMemcpy2DAsync, CuMemcpy2DAsync);
|
nvdec,nvenc: Port to dynamic library loading
... and put them into new nvcodec plugin.
* nvcodec plugin
Now each nvenc and nvdec element is moved to be a part of nvcodec plugin
for better interoperability.
Additionally, cuda runtime API header dependencies
(i.e., cuda_runtime_api.h and cuda_gl_interop.h) are removed.
Note that cuda runtime APIs have prefix "cuda". Since 1.16 release with
Windows support, only "cuda.h" and "cudaGL.h" dependent symbols have
been used except for some defined types. However, those types could be
replaced with other types which were defined by "cuda.h".
* dynamic library loading
CUDA library will be opened with g_module_open() instead of build-time linking.
On Windows, nvcuda.dll is installed to system path by CUDA Toolkit
installer, and on *nix, user should ensure that libcuda.so.1 can be
loadable (i.e., via LD_LIBRARY_PATH or default dlopen path)
Therefore, NVIDIA_VIDEO_CODEC_SDK_PATH env build time dependency for Windows
is removed.
2019-05-17 13:27:50 +00:00
|
|
|
LOAD_SYMBOL (cuMemFree, CuMemFree);
|
|
|
|
|
2019-08-18 13:07:38 +00:00
|
|
|
LOAD_SYMBOL (cuStreamCreate, CuStreamCreate);
|
|
|
|
LOAD_SYMBOL (cuStreamDestroy, CuStreamDestroy);
|
2019-07-19 13:46:01 +00:00
|
|
|
LOAD_SYMBOL (cuStreamSynchronize, CuStreamSynchronize);
|
|
|
|
|
nvdec,nvenc: Port to dynamic library loading
... and put them into new nvcodec plugin.
* nvcodec plugin
Now each nvenc and nvdec element is moved to be a part of nvcodec plugin
for better interoperability.
Additionally, cuda runtime API header dependencies
(i.e., cuda_runtime_api.h and cuda_gl_interop.h) are removed.
Note that cuda runtime APIs have prefix "cuda". Since 1.16 release with
Windows support, only "cuda.h" and "cudaGL.h" dependent symbols have
been used except for some defined types. However, those types could be
replaced with other types which were defined by "cuda.h".
* dynamic library loading
CUDA library will be opened with g_module_open() instead of build-time linking.
On Windows, nvcuda.dll is installed to system path by CUDA Toolkit
installer, and on *nix, user should ensure that libcuda.so.1 can be
loadable (i.e., via LD_LIBRARY_PATH or default dlopen path)
Therefore, NVIDIA_VIDEO_CODEC_SDK_PATH env build time dependency for Windows
is removed.
2019-05-17 13:27:50 +00:00
|
|
|
LOAD_SYMBOL (cuDeviceGet, CuDeviceGet);
|
|
|
|
LOAD_SYMBOL (cuDeviceGetCount, CuDeviceGetCount);
|
|
|
|
LOAD_SYMBOL (cuDeviceGetName, CuDeviceGetName);
|
|
|
|
LOAD_SYMBOL (cuDeviceGetAttribute, CuDeviceGetAttribute);
|
|
|
|
|
|
|
|
/* cudaGL.h */
|
|
|
|
LOAD_SYMBOL (cuGraphicsGLRegisterImage, CuGraphicsGLRegisterImage);
|
|
|
|
LOAD_SYMBOL (cuGraphicsGLRegisterBuffer, CuGraphicsGLRegisterBuffer);
|
2019-08-17 08:45:44 +00:00
|
|
|
LOAD_SYMBOL (cuGraphicsResourceSetMapFlags, CuGraphicsResourceSetMapFlags);
|
2020-03-15 10:20:47 +00:00
|
|
|
LOAD_SYMBOL (cuGLGetDevices, CuGLGetDevices);
|
nvdec,nvenc: Port to dynamic library loading
... and put them into new nvcodec plugin.
* nvcodec plugin
Now each nvenc and nvdec element is moved to be a part of nvcodec plugin
for better interoperability.
Additionally, cuda runtime API header dependencies
(i.e., cuda_runtime_api.h and cuda_gl_interop.h) are removed.
Note that cuda runtime APIs have prefix "cuda". Since 1.16 release with
Windows support, only "cuda.h" and "cudaGL.h" dependent symbols have
been used except for some defined types. However, those types could be
replaced with other types which were defined by "cuda.h".
* dynamic library loading
CUDA library will be opened with g_module_open() instead of build-time linking.
On Windows, nvcuda.dll is installed to system path by CUDA Toolkit
installer, and on *nix, user should ensure that libcuda.so.1 can be
loadable (i.e., via LD_LIBRARY_PATH or default dlopen path)
Therefore, NVIDIA_VIDEO_CODEC_SDK_PATH env build time dependency for Windows
is removed.
2019-05-17 13:27:50 +00:00
|
|
|
|
|
|
|
vtable->loaded = TRUE;
|
|
|
|
|
|
|
|
return TRUE;
|
|
|
|
|
|
|
|
error:
|
|
|
|
g_module_close (module);
|
|
|
|
|
|
|
|
return FALSE;
|
|
|
|
}
|
|
|
|
|
2020-01-20 09:52:26 +00:00
|
|
|
CUresult CUDAAPI
|
nvdec,nvenc: Port to dynamic library loading
... and put them into new nvcodec plugin.
* nvcodec plugin
Now each nvenc and nvdec element is moved to be a part of nvcodec plugin
for better interoperability.
Additionally, cuda runtime API header dependencies
(i.e., cuda_runtime_api.h and cuda_gl_interop.h) are removed.
Note that cuda runtime APIs have prefix "cuda". Since 1.16 release with
Windows support, only "cuda.h" and "cudaGL.h" dependent symbols have
been used except for some defined types. However, those types could be
replaced with other types which were defined by "cuda.h".
* dynamic library loading
CUDA library will be opened with g_module_open() instead of build-time linking.
On Windows, nvcuda.dll is installed to system path by CUDA Toolkit
installer, and on *nix, user should ensure that libcuda.so.1 can be
loadable (i.e., via LD_LIBRARY_PATH or default dlopen path)
Therefore, NVIDIA_VIDEO_CODEC_SDK_PATH env build time dependency for Windows
is removed.
2019-05-17 13:27:50 +00:00
|
|
|
CuInit (unsigned int Flags)
|
|
|
|
{
|
|
|
|
g_assert (gst_cuda_vtable.CuInit != NULL);
|
|
|
|
|
|
|
|
return gst_cuda_vtable.CuInit (Flags);
|
|
|
|
}
|
|
|
|
|
2020-01-20 09:52:26 +00:00
|
|
|
CUresult CUDAAPI
|
nvdec,nvenc: Port to dynamic library loading
... and put them into new nvcodec plugin.
* nvcodec plugin
Now each nvenc and nvdec element is moved to be a part of nvcodec plugin
for better interoperability.
Additionally, cuda runtime API header dependencies
(i.e., cuda_runtime_api.h and cuda_gl_interop.h) are removed.
Note that cuda runtime APIs have prefix "cuda". Since 1.16 release with
Windows support, only "cuda.h" and "cudaGL.h" dependent symbols have
been used except for some defined types. However, those types could be
replaced with other types which were defined by "cuda.h".
* dynamic library loading
CUDA library will be opened with g_module_open() instead of build-time linking.
On Windows, nvcuda.dll is installed to system path by CUDA Toolkit
installer, and on *nix, user should ensure that libcuda.so.1 can be
loadable (i.e., via LD_LIBRARY_PATH or default dlopen path)
Therefore, NVIDIA_VIDEO_CODEC_SDK_PATH env build time dependency for Windows
is removed.
2019-05-17 13:27:50 +00:00
|
|
|
CuGetErrorName (CUresult error, const char **pStr)
|
|
|
|
{
|
|
|
|
g_assert (gst_cuda_vtable.CuGetErrorName != NULL);
|
|
|
|
|
|
|
|
return gst_cuda_vtable.CuGetErrorName (error, pStr);
|
|
|
|
}
|
|
|
|
|
2020-01-20 09:52:26 +00:00
|
|
|
CUresult CUDAAPI
|
nvdec,nvenc: Port to dynamic library loading
... and put them into new nvcodec plugin.
* nvcodec plugin
Now each nvenc and nvdec element is moved to be a part of nvcodec plugin
for better interoperability.
Additionally, cuda runtime API header dependencies
(i.e., cuda_runtime_api.h and cuda_gl_interop.h) are removed.
Note that cuda runtime APIs have prefix "cuda". Since 1.16 release with
Windows support, only "cuda.h" and "cudaGL.h" dependent symbols have
been used except for some defined types. However, those types could be
replaced with other types which were defined by "cuda.h".
* dynamic library loading
CUDA library will be opened with g_module_open() instead of build-time linking.
On Windows, nvcuda.dll is installed to system path by CUDA Toolkit
installer, and on *nix, user should ensure that libcuda.so.1 can be
loadable (i.e., via LD_LIBRARY_PATH or default dlopen path)
Therefore, NVIDIA_VIDEO_CODEC_SDK_PATH env build time dependency for Windows
is removed.
2019-05-17 13:27:50 +00:00
|
|
|
CuGetErrorString (CUresult error, const char **pStr)
|
|
|
|
{
|
|
|
|
g_assert (gst_cuda_vtable.CuGetErrorString != NULL);
|
|
|
|
|
|
|
|
return gst_cuda_vtable.CuGetErrorString (error, pStr);
|
|
|
|
}
|
|
|
|
|
2020-01-20 09:52:26 +00:00
|
|
|
CUresult CUDAAPI
|
nvdec,nvenc: Port to dynamic library loading
... and put them into new nvcodec plugin.
* nvcodec plugin
Now each nvenc and nvdec element is moved to be a part of nvcodec plugin
for better interoperability.
Additionally, cuda runtime API header dependencies
(i.e., cuda_runtime_api.h and cuda_gl_interop.h) are removed.
Note that cuda runtime APIs have prefix "cuda". Since 1.16 release with
Windows support, only "cuda.h" and "cudaGL.h" dependent symbols have
been used except for some defined types. However, those types could be
replaced with other types which were defined by "cuda.h".
* dynamic library loading
CUDA library will be opened with g_module_open() instead of build-time linking.
On Windows, nvcuda.dll is installed to system path by CUDA Toolkit
installer, and on *nix, user should ensure that libcuda.so.1 can be
loadable (i.e., via LD_LIBRARY_PATH or default dlopen path)
Therefore, NVIDIA_VIDEO_CODEC_SDK_PATH env build time dependency for Windows
is removed.
2019-05-17 13:27:50 +00:00
|
|
|
CuCtxCreate (CUcontext * pctx, unsigned int flags, CUdevice dev)
|
|
|
|
{
|
|
|
|
g_assert (gst_cuda_vtable.CuCtxCreate != NULL);
|
|
|
|
|
|
|
|
return gst_cuda_vtable.CuCtxCreate (pctx, flags, dev);
|
|
|
|
}
|
|
|
|
|
2020-01-20 09:52:26 +00:00
|
|
|
CUresult CUDAAPI
|
nvdec,nvenc: Port to dynamic library loading
... and put them into new nvcodec plugin.
* nvcodec plugin
Now each nvenc and nvdec element is moved to be a part of nvcodec plugin
for better interoperability.
Additionally, cuda runtime API header dependencies
(i.e., cuda_runtime_api.h and cuda_gl_interop.h) are removed.
Note that cuda runtime APIs have prefix "cuda". Since 1.16 release with
Windows support, only "cuda.h" and "cudaGL.h" dependent symbols have
been used except for some defined types. However, those types could be
replaced with other types which were defined by "cuda.h".
* dynamic library loading
CUDA library will be opened with g_module_open() instead of build-time linking.
On Windows, nvcuda.dll is installed to system path by CUDA Toolkit
installer, and on *nix, user should ensure that libcuda.so.1 can be
loadable (i.e., via LD_LIBRARY_PATH or default dlopen path)
Therefore, NVIDIA_VIDEO_CODEC_SDK_PATH env build time dependency for Windows
is removed.
2019-05-17 13:27:50 +00:00
|
|
|
CuCtxDestroy (CUcontext ctx)
|
|
|
|
{
|
|
|
|
g_assert (gst_cuda_vtable.CuCtxDestroy != NULL);
|
|
|
|
|
|
|
|
return gst_cuda_vtable.CuCtxDestroy (ctx);
|
|
|
|
}
|
|
|
|
|
2020-01-20 09:52:26 +00:00
|
|
|
CUresult CUDAAPI
|
nvdec,nvenc: Port to dynamic library loading
... and put them into new nvcodec plugin.
* nvcodec plugin
Now each nvenc and nvdec element is moved to be a part of nvcodec plugin
for better interoperability.
Additionally, cuda runtime API header dependencies
(i.e., cuda_runtime_api.h and cuda_gl_interop.h) are removed.
Note that cuda runtime APIs have prefix "cuda". Since 1.16 release with
Windows support, only "cuda.h" and "cudaGL.h" dependent symbols have
been used except for some defined types. However, those types could be
replaced with other types which were defined by "cuda.h".
* dynamic library loading
CUDA library will be opened with g_module_open() instead of build-time linking.
On Windows, nvcuda.dll is installed to system path by CUDA Toolkit
installer, and on *nix, user should ensure that libcuda.so.1 can be
loadable (i.e., via LD_LIBRARY_PATH or default dlopen path)
Therefore, NVIDIA_VIDEO_CODEC_SDK_PATH env build time dependency for Windows
is removed.
2019-05-17 13:27:50 +00:00
|
|
|
CuCtxPopCurrent (CUcontext * pctx)
|
|
|
|
{
|
|
|
|
g_assert (gst_cuda_vtable.CuCtxPopCurrent != NULL);
|
|
|
|
|
|
|
|
return gst_cuda_vtable.CuCtxPopCurrent (pctx);
|
|
|
|
}
|
|
|
|
|
2020-01-20 09:52:26 +00:00
|
|
|
CUresult CUDAAPI
|
nvdec,nvenc: Port to dynamic library loading
... and put them into new nvcodec plugin.
* nvcodec plugin
Now each nvenc and nvdec element is moved to be a part of nvcodec plugin
for better interoperability.
Additionally, cuda runtime API header dependencies
(i.e., cuda_runtime_api.h and cuda_gl_interop.h) are removed.
Note that cuda runtime APIs have prefix "cuda". Since 1.16 release with
Windows support, only "cuda.h" and "cudaGL.h" dependent symbols have
been used except for some defined types. However, those types could be
replaced with other types which were defined by "cuda.h".
* dynamic library loading
CUDA library will be opened with g_module_open() instead of build-time linking.
On Windows, nvcuda.dll is installed to system path by CUDA Toolkit
installer, and on *nix, user should ensure that libcuda.so.1 can be
loadable (i.e., via LD_LIBRARY_PATH or default dlopen path)
Therefore, NVIDIA_VIDEO_CODEC_SDK_PATH env build time dependency for Windows
is removed.
2019-05-17 13:27:50 +00:00
|
|
|
CuCtxPushCurrent (CUcontext ctx)
|
|
|
|
{
|
|
|
|
g_assert (gst_cuda_vtable.CuCtxPushCurrent != NULL);
|
|
|
|
|
|
|
|
return gst_cuda_vtable.CuCtxPushCurrent (ctx);
|
|
|
|
}
|
|
|
|
|
2020-01-20 09:52:26 +00:00
|
|
|
CUresult CUDAAPI
|
nvdec,nvenc: Port to dynamic library loading
... and put them into new nvcodec plugin.
* nvcodec plugin
Now each nvenc and nvdec element is moved to be a part of nvcodec plugin
for better interoperability.
Additionally, cuda runtime API header dependencies
(i.e., cuda_runtime_api.h and cuda_gl_interop.h) are removed.
Note that cuda runtime APIs have prefix "cuda". Since 1.16 release with
Windows support, only "cuda.h" and "cudaGL.h" dependent symbols have
been used except for some defined types. However, those types could be
replaced with other types which were defined by "cuda.h".
* dynamic library loading
CUDA library will be opened with g_module_open() instead of build-time linking.
On Windows, nvcuda.dll is installed to system path by CUDA Toolkit
installer, and on *nix, user should ensure that libcuda.so.1 can be
loadable (i.e., via LD_LIBRARY_PATH or default dlopen path)
Therefore, NVIDIA_VIDEO_CODEC_SDK_PATH env build time dependency for Windows
is removed.
2019-05-17 13:27:50 +00:00
|
|
|
CuGraphicsMapResources (unsigned int count, CUgraphicsResource * resources,
|
|
|
|
CUstream hStream)
|
|
|
|
{
|
|
|
|
g_assert (gst_cuda_vtable.CuGraphicsMapResources != NULL);
|
|
|
|
|
|
|
|
return gst_cuda_vtable.CuGraphicsMapResources (count, resources, hStream);
|
|
|
|
}
|
|
|
|
|
2020-01-20 09:52:26 +00:00
|
|
|
CUresult CUDAAPI
|
nvdec,nvenc: Port to dynamic library loading
... and put them into new nvcodec plugin.
* nvcodec plugin
Now each nvenc and nvdec element is moved to be a part of nvcodec plugin
for better interoperability.
Additionally, cuda runtime API header dependencies
(i.e., cuda_runtime_api.h and cuda_gl_interop.h) are removed.
Note that cuda runtime APIs have prefix "cuda". Since 1.16 release with
Windows support, only "cuda.h" and "cudaGL.h" dependent symbols have
been used except for some defined types. However, those types could be
replaced with other types which were defined by "cuda.h".
* dynamic library loading
CUDA library will be opened with g_module_open() instead of build-time linking.
On Windows, nvcuda.dll is installed to system path by CUDA Toolkit
installer, and on *nix, user should ensure that libcuda.so.1 can be
loadable (i.e., via LD_LIBRARY_PATH or default dlopen path)
Therefore, NVIDIA_VIDEO_CODEC_SDK_PATH env build time dependency for Windows
is removed.
2019-05-17 13:27:50 +00:00
|
|
|
CuGraphicsUnmapResources (unsigned int count, CUgraphicsResource * resources,
|
|
|
|
CUstream hStream)
|
|
|
|
{
|
|
|
|
g_assert (gst_cuda_vtable.CuGraphicsUnmapResources != NULL);
|
|
|
|
|
|
|
|
return gst_cuda_vtable.CuGraphicsUnmapResources (count, resources, hStream);
|
|
|
|
}
|
|
|
|
|
2020-01-20 09:52:26 +00:00
|
|
|
CUresult CUDAAPI
|
nvdec,nvenc: Port to dynamic library loading
... and put them into new nvcodec plugin.
* nvcodec plugin
Now each nvenc and nvdec element is moved to be a part of nvcodec plugin
for better interoperability.
Additionally, cuda runtime API header dependencies
(i.e., cuda_runtime_api.h and cuda_gl_interop.h) are removed.
Note that cuda runtime APIs have prefix "cuda". Since 1.16 release with
Windows support, only "cuda.h" and "cudaGL.h" dependent symbols have
been used except for some defined types. However, those types could be
replaced with other types which were defined by "cuda.h".
* dynamic library loading
CUDA library will be opened with g_module_open() instead of build-time linking.
On Windows, nvcuda.dll is installed to system path by CUDA Toolkit
installer, and on *nix, user should ensure that libcuda.so.1 can be
loadable (i.e., via LD_LIBRARY_PATH or default dlopen path)
Therefore, NVIDIA_VIDEO_CODEC_SDK_PATH env build time dependency for Windows
is removed.
2019-05-17 13:27:50 +00:00
|
|
|
CuGraphicsSubResourceGetMappedArray (CUarray * pArray,
|
|
|
|
CUgraphicsResource resource, unsigned int arrayIndex, unsigned int mipLevel)
|
|
|
|
{
|
|
|
|
g_assert (gst_cuda_vtable.CuGraphicsSubResourceGetMappedArray != NULL);
|
|
|
|
|
|
|
|
return gst_cuda_vtable.CuGraphicsSubResourceGetMappedArray (pArray, resource,
|
|
|
|
arrayIndex, mipLevel);
|
|
|
|
}
|
|
|
|
|
2020-01-20 09:52:26 +00:00
|
|
|
CUresult CUDAAPI
|
nvdec,nvenc: Port to dynamic library loading
... and put them into new nvcodec plugin.
* nvcodec plugin
Now each nvenc and nvdec element is moved to be a part of nvcodec plugin
for better interoperability.
Additionally, cuda runtime API header dependencies
(i.e., cuda_runtime_api.h and cuda_gl_interop.h) are removed.
Note that cuda runtime APIs have prefix "cuda". Since 1.16 release with
Windows support, only "cuda.h" and "cudaGL.h" dependent symbols have
been used except for some defined types. However, those types could be
replaced with other types which were defined by "cuda.h".
* dynamic library loading
CUDA library will be opened with g_module_open() instead of build-time linking.
On Windows, nvcuda.dll is installed to system path by CUDA Toolkit
installer, and on *nix, user should ensure that libcuda.so.1 can be
loadable (i.e., via LD_LIBRARY_PATH or default dlopen path)
Therefore, NVIDIA_VIDEO_CODEC_SDK_PATH env build time dependency for Windows
is removed.
2019-05-17 13:27:50 +00:00
|
|
|
CuGraphicsResourceGetMappedPointer (CUdeviceptr * pDevPtr, size_t * pSize,
|
|
|
|
CUgraphicsResource resource)
|
|
|
|
{
|
|
|
|
g_assert (gst_cuda_vtable.CuGraphicsResourceGetMappedPointer != NULL);
|
|
|
|
|
|
|
|
return gst_cuda_vtable.CuGraphicsResourceGetMappedPointer (pDevPtr, pSize,
|
|
|
|
resource);
|
|
|
|
}
|
|
|
|
|
2020-01-20 09:52:26 +00:00
|
|
|
CUresult CUDAAPI
|
nvdec,nvenc: Port to dynamic library loading
... and put them into new nvcodec plugin.
* nvcodec plugin
Now each nvenc and nvdec element is moved to be a part of nvcodec plugin
for better interoperability.
Additionally, cuda runtime API header dependencies
(i.e., cuda_runtime_api.h and cuda_gl_interop.h) are removed.
Note that cuda runtime APIs have prefix "cuda". Since 1.16 release with
Windows support, only "cuda.h" and "cudaGL.h" dependent symbols have
been used except for some defined types. However, those types could be
replaced with other types which were defined by "cuda.h".
* dynamic library loading
CUDA library will be opened with g_module_open() instead of build-time linking.
On Windows, nvcuda.dll is installed to system path by CUDA Toolkit
installer, and on *nix, user should ensure that libcuda.so.1 can be
loadable (i.e., via LD_LIBRARY_PATH or default dlopen path)
Therefore, NVIDIA_VIDEO_CODEC_SDK_PATH env build time dependency for Windows
is removed.
2019-05-17 13:27:50 +00:00
|
|
|
CuGraphicsUnregisterResource (CUgraphicsResource resource)
|
|
|
|
{
|
|
|
|
g_assert (gst_cuda_vtable.CuGraphicsUnregisterResource != NULL);
|
|
|
|
|
|
|
|
return gst_cuda_vtable.CuGraphicsUnregisterResource (resource);
|
|
|
|
}
|
|
|
|
|
2020-01-20 09:52:26 +00:00
|
|
|
CUresult CUDAAPI
|
nvdec,nvenc: Port to dynamic library loading
... and put them into new nvcodec plugin.
* nvcodec plugin
Now each nvenc and nvdec element is moved to be a part of nvcodec plugin
for better interoperability.
Additionally, cuda runtime API header dependencies
(i.e., cuda_runtime_api.h and cuda_gl_interop.h) are removed.
Note that cuda runtime APIs have prefix "cuda". Since 1.16 release with
Windows support, only "cuda.h" and "cudaGL.h" dependent symbols have
been used except for some defined types. However, those types could be
replaced with other types which were defined by "cuda.h".
* dynamic library loading
CUDA library will be opened with g_module_open() instead of build-time linking.
On Windows, nvcuda.dll is installed to system path by CUDA Toolkit
installer, and on *nix, user should ensure that libcuda.so.1 can be
loadable (i.e., via LD_LIBRARY_PATH or default dlopen path)
Therefore, NVIDIA_VIDEO_CODEC_SDK_PATH env build time dependency for Windows
is removed.
2019-05-17 13:27:50 +00:00
|
|
|
CuMemAlloc (CUdeviceptr * dptr, unsigned int bytesize)
|
|
|
|
{
|
|
|
|
g_assert (gst_cuda_vtable.CuMemAlloc != NULL);
|
|
|
|
|
|
|
|
return gst_cuda_vtable.CuMemAlloc (dptr, bytesize);
|
|
|
|
}
|
|
|
|
|
2020-01-20 09:52:26 +00:00
|
|
|
CUresult CUDAAPI
|
nvdec,nvenc: Port to dynamic library loading
... and put them into new nvcodec plugin.
* nvcodec plugin
Now each nvenc and nvdec element is moved to be a part of nvcodec plugin
for better interoperability.
Additionally, cuda runtime API header dependencies
(i.e., cuda_runtime_api.h and cuda_gl_interop.h) are removed.
Note that cuda runtime APIs have prefix "cuda". Since 1.16 release with
Windows support, only "cuda.h" and "cudaGL.h" dependent symbols have
been used except for some defined types. However, those types could be
replaced with other types which were defined by "cuda.h".
* dynamic library loading
CUDA library will be opened with g_module_open() instead of build-time linking.
On Windows, nvcuda.dll is installed to system path by CUDA Toolkit
installer, and on *nix, user should ensure that libcuda.so.1 can be
loadable (i.e., via LD_LIBRARY_PATH or default dlopen path)
Therefore, NVIDIA_VIDEO_CODEC_SDK_PATH env build time dependency for Windows
is removed.
2019-05-17 13:27:50 +00:00
|
|
|
CuMemAllocPitch (CUdeviceptr * dptr, size_t * pPitch, size_t WidthInBytes,
|
|
|
|
size_t Height, unsigned int ElementSizeBytes)
|
|
|
|
{
|
|
|
|
g_assert (gst_cuda_vtable.CuMemAllocPitch != NULL);
|
|
|
|
|
|
|
|
return gst_cuda_vtable.CuMemAllocPitch (dptr, pPitch, WidthInBytes, Height,
|
|
|
|
ElementSizeBytes);
|
|
|
|
}
|
|
|
|
|
2020-01-20 09:52:26 +00:00
|
|
|
CUresult CUDAAPI
|
nvdec,nvenc: Port to dynamic library loading
... and put them into new nvcodec plugin.
* nvcodec plugin
Now each nvenc and nvdec element is moved to be a part of nvcodec plugin
for better interoperability.
Additionally, cuda runtime API header dependencies
(i.e., cuda_runtime_api.h and cuda_gl_interop.h) are removed.
Note that cuda runtime APIs have prefix "cuda". Since 1.16 release with
Windows support, only "cuda.h" and "cudaGL.h" dependent symbols have
been used except for some defined types. However, those types could be
replaced with other types which were defined by "cuda.h".
* dynamic library loading
CUDA library will be opened with g_module_open() instead of build-time linking.
On Windows, nvcuda.dll is installed to system path by CUDA Toolkit
installer, and on *nix, user should ensure that libcuda.so.1 can be
loadable (i.e., via LD_LIBRARY_PATH or default dlopen path)
Therefore, NVIDIA_VIDEO_CODEC_SDK_PATH env build time dependency for Windows
is removed.
2019-05-17 13:27:50 +00:00
|
|
|
CuMemcpy2D (const CUDA_MEMCPY2D * pCopy)
|
|
|
|
{
|
|
|
|
g_assert (gst_cuda_vtable.CuMemcpy2D != NULL);
|
|
|
|
|
|
|
|
return gst_cuda_vtable.CuMemcpy2D (pCopy);
|
|
|
|
}
|
|
|
|
|
2020-01-20 09:52:26 +00:00
|
|
|
CUresult CUDAAPI
|
2019-07-19 13:46:01 +00:00
|
|
|
CuMemcpy2DAsync (const CUDA_MEMCPY2D * pCopy, CUstream hStream)
|
|
|
|
{
|
|
|
|
g_assert (gst_cuda_vtable.CuMemcpy2DAsync != NULL);
|
|
|
|
|
|
|
|
return gst_cuda_vtable.CuMemcpy2DAsync (pCopy, hStream);
|
|
|
|
}
|
|
|
|
|
2020-01-20 09:52:26 +00:00
|
|
|
CUresult CUDAAPI
|
nvdec,nvenc: Port to dynamic library loading
... and put them into new nvcodec plugin.
* nvcodec plugin
Now each nvenc and nvdec element is moved to be a part of nvcodec plugin
for better interoperability.
Additionally, cuda runtime API header dependencies
(i.e., cuda_runtime_api.h and cuda_gl_interop.h) are removed.
Note that cuda runtime APIs have prefix "cuda". Since 1.16 release with
Windows support, only "cuda.h" and "cudaGL.h" dependent symbols have
been used except for some defined types. However, those types could be
replaced with other types which were defined by "cuda.h".
* dynamic library loading
CUDA library will be opened with g_module_open() instead of build-time linking.
On Windows, nvcuda.dll is installed to system path by CUDA Toolkit
installer, and on *nix, user should ensure that libcuda.so.1 can be
loadable (i.e., via LD_LIBRARY_PATH or default dlopen path)
Therefore, NVIDIA_VIDEO_CODEC_SDK_PATH env build time dependency for Windows
is removed.
2019-05-17 13:27:50 +00:00
|
|
|
CuMemFree (CUdeviceptr dptr)
|
|
|
|
{
|
|
|
|
g_assert (gst_cuda_vtable.CuMemFree != NULL);
|
|
|
|
|
|
|
|
return gst_cuda_vtable.CuMemFree (dptr);
|
|
|
|
}
|
|
|
|
|
2020-01-20 09:52:26 +00:00
|
|
|
CUresult CUDAAPI
|
2019-08-18 13:07:38 +00:00
|
|
|
CuStreamCreate (CUstream * phStream, unsigned int Flags)
|
|
|
|
{
|
|
|
|
g_assert (gst_cuda_vtable.CuStreamCreate != NULL);
|
|
|
|
|
|
|
|
return gst_cuda_vtable.CuStreamCreate (phStream, Flags);
|
|
|
|
}
|
|
|
|
|
2020-01-20 09:52:26 +00:00
|
|
|
CUresult CUDAAPI
|
2019-08-18 13:07:38 +00:00
|
|
|
CuStreamDestroy (CUstream hStream)
|
|
|
|
{
|
|
|
|
g_assert (gst_cuda_vtable.CuStreamDestroy != NULL);
|
|
|
|
|
|
|
|
return gst_cuda_vtable.CuStreamDestroy (hStream);
|
|
|
|
}
|
|
|
|
|
2020-01-20 09:52:26 +00:00
|
|
|
CUresult CUDAAPI
|
2019-07-19 13:46:01 +00:00
|
|
|
CuStreamSynchronize (CUstream hStream)
|
|
|
|
{
|
|
|
|
g_assert (gst_cuda_vtable.CuStreamSynchronize != NULL);
|
|
|
|
|
|
|
|
return gst_cuda_vtable.CuStreamSynchronize (hStream);
|
|
|
|
}
|
|
|
|
|
2020-01-20 09:52:26 +00:00
|
|
|
CUresult CUDAAPI
|
nvdec,nvenc: Port to dynamic library loading
... and put them into new nvcodec plugin.
* nvcodec plugin
Now each nvenc and nvdec element is moved to be a part of nvcodec plugin
for better interoperability.
Additionally, cuda runtime API header dependencies
(i.e., cuda_runtime_api.h and cuda_gl_interop.h) are removed.
Note that cuda runtime APIs have prefix "cuda". Since 1.16 release with
Windows support, only "cuda.h" and "cudaGL.h" dependent symbols have
been used except for some defined types. However, those types could be
replaced with other types which were defined by "cuda.h".
* dynamic library loading
CUDA library will be opened with g_module_open() instead of build-time linking.
On Windows, nvcuda.dll is installed to system path by CUDA Toolkit
installer, and on *nix, user should ensure that libcuda.so.1 can be
loadable (i.e., via LD_LIBRARY_PATH or default dlopen path)
Therefore, NVIDIA_VIDEO_CODEC_SDK_PATH env build time dependency for Windows
is removed.
2019-05-17 13:27:50 +00:00
|
|
|
CuDeviceGet (CUdevice * device, int ordinal)
|
|
|
|
{
|
|
|
|
g_assert (gst_cuda_vtable.CuDeviceGet != NULL);
|
|
|
|
|
|
|
|
return gst_cuda_vtable.CuDeviceGet (device, ordinal);
|
|
|
|
}
|
|
|
|
|
2020-01-20 09:52:26 +00:00
|
|
|
CUresult CUDAAPI
|
nvdec,nvenc: Port to dynamic library loading
... and put them into new nvcodec plugin.
* nvcodec plugin
Now each nvenc and nvdec element is moved to be a part of nvcodec plugin
for better interoperability.
Additionally, cuda runtime API header dependencies
(i.e., cuda_runtime_api.h and cuda_gl_interop.h) are removed.
Note that cuda runtime APIs have prefix "cuda". Since 1.16 release with
Windows support, only "cuda.h" and "cudaGL.h" dependent symbols have
been used except for some defined types. However, those types could be
replaced with other types which were defined by "cuda.h".
* dynamic library loading
CUDA library will be opened with g_module_open() instead of build-time linking.
On Windows, nvcuda.dll is installed to system path by CUDA Toolkit
installer, and on *nix, user should ensure that libcuda.so.1 can be
loadable (i.e., via LD_LIBRARY_PATH or default dlopen path)
Therefore, NVIDIA_VIDEO_CODEC_SDK_PATH env build time dependency for Windows
is removed.
2019-05-17 13:27:50 +00:00
|
|
|
CuDeviceGetCount (int *count)
|
|
|
|
{
|
|
|
|
g_assert (gst_cuda_vtable.CuDeviceGetCount != NULL);
|
|
|
|
|
|
|
|
return gst_cuda_vtable.CuDeviceGetCount (count);
|
|
|
|
}
|
|
|
|
|
2020-01-20 09:52:26 +00:00
|
|
|
CUresult CUDAAPI
|
nvdec,nvenc: Port to dynamic library loading
... and put them into new nvcodec plugin.
* nvcodec plugin
Now each nvenc and nvdec element is moved to be a part of nvcodec plugin
for better interoperability.
Additionally, cuda runtime API header dependencies
(i.e., cuda_runtime_api.h and cuda_gl_interop.h) are removed.
Note that cuda runtime APIs have prefix "cuda". Since 1.16 release with
Windows support, only "cuda.h" and "cudaGL.h" dependent symbols have
been used except for some defined types. However, those types could be
replaced with other types which were defined by "cuda.h".
* dynamic library loading
CUDA library will be opened with g_module_open() instead of build-time linking.
On Windows, nvcuda.dll is installed to system path by CUDA Toolkit
installer, and on *nix, user should ensure that libcuda.so.1 can be
loadable (i.e., via LD_LIBRARY_PATH or default dlopen path)
Therefore, NVIDIA_VIDEO_CODEC_SDK_PATH env build time dependency for Windows
is removed.
2019-05-17 13:27:50 +00:00
|
|
|
CuDeviceGetName (char *name, int len, CUdevice dev)
|
|
|
|
{
|
|
|
|
g_assert (gst_cuda_vtable.CuDeviceGetName != NULL);
|
|
|
|
|
|
|
|
return gst_cuda_vtable.CuDeviceGetName (name, len, dev);
|
|
|
|
}
|
|
|
|
|
2020-01-20 09:52:26 +00:00
|
|
|
CUresult CUDAAPI
|
nvdec,nvenc: Port to dynamic library loading
... and put them into new nvcodec plugin.
* nvcodec plugin
Now each nvenc and nvdec element is moved to be a part of nvcodec plugin
for better interoperability.
Additionally, cuda runtime API header dependencies
(i.e., cuda_runtime_api.h and cuda_gl_interop.h) are removed.
Note that cuda runtime APIs have prefix "cuda". Since 1.16 release with
Windows support, only "cuda.h" and "cudaGL.h" dependent symbols have
been used except for some defined types. However, those types could be
replaced with other types which were defined by "cuda.h".
* dynamic library loading
CUDA library will be opened with g_module_open() instead of build-time linking.
On Windows, nvcuda.dll is installed to system path by CUDA Toolkit
installer, and on *nix, user should ensure that libcuda.so.1 can be
loadable (i.e., via LD_LIBRARY_PATH or default dlopen path)
Therefore, NVIDIA_VIDEO_CODEC_SDK_PATH env build time dependency for Windows
is removed.
2019-05-17 13:27:50 +00:00
|
|
|
CuDeviceGetAttribute (int *pi, CUdevice_attribute attrib, CUdevice dev)
|
|
|
|
{
|
|
|
|
g_assert (gst_cuda_vtable.CuDeviceGetAttribute != NULL);
|
|
|
|
|
|
|
|
return gst_cuda_vtable.CuDeviceGetAttribute (pi, attrib, dev);
|
|
|
|
}
|
|
|
|
|
|
|
|
/* cudaGL.h */
|
2020-01-20 09:52:26 +00:00
|
|
|
CUresult CUDAAPI
|
nvdec,nvenc: Port to dynamic library loading
... and put them into new nvcodec plugin.
* nvcodec plugin
Now each nvenc and nvdec element is moved to be a part of nvcodec plugin
for better interoperability.
Additionally, cuda runtime API header dependencies
(i.e., cuda_runtime_api.h and cuda_gl_interop.h) are removed.
Note that cuda runtime APIs have prefix "cuda". Since 1.16 release with
Windows support, only "cuda.h" and "cudaGL.h" dependent symbols have
been used except for some defined types. However, those types could be
replaced with other types which were defined by "cuda.h".
* dynamic library loading
CUDA library will be opened with g_module_open() instead of build-time linking.
On Windows, nvcuda.dll is installed to system path by CUDA Toolkit
installer, and on *nix, user should ensure that libcuda.so.1 can be
loadable (i.e., via LD_LIBRARY_PATH or default dlopen path)
Therefore, NVIDIA_VIDEO_CODEC_SDK_PATH env build time dependency for Windows
is removed.
2019-05-17 13:27:50 +00:00
|
|
|
CuGraphicsGLRegisterImage (CUgraphicsResource * pCudaResource,
|
|
|
|
unsigned int image, unsigned int target, unsigned int Flags)
|
|
|
|
{
|
|
|
|
g_assert (gst_cuda_vtable.CuGraphicsGLRegisterImage != NULL);
|
|
|
|
|
|
|
|
return gst_cuda_vtable.CuGraphicsGLRegisterImage (pCudaResource, image,
|
|
|
|
target, Flags);
|
|
|
|
}
|
|
|
|
|
2020-01-20 09:52:26 +00:00
|
|
|
CUresult CUDAAPI
|
nvdec,nvenc: Port to dynamic library loading
... and put them into new nvcodec plugin.
* nvcodec plugin
Now each nvenc and nvdec element is moved to be a part of nvcodec plugin
for better interoperability.
Additionally, cuda runtime API header dependencies
(i.e., cuda_runtime_api.h and cuda_gl_interop.h) are removed.
Note that cuda runtime APIs have prefix "cuda". Since 1.16 release with
Windows support, only "cuda.h" and "cudaGL.h" dependent symbols have
been used except for some defined types. However, those types could be
replaced with other types which were defined by "cuda.h".
* dynamic library loading
CUDA library will be opened with g_module_open() instead of build-time linking.
On Windows, nvcuda.dll is installed to system path by CUDA Toolkit
installer, and on *nix, user should ensure that libcuda.so.1 can be
loadable (i.e., via LD_LIBRARY_PATH or default dlopen path)
Therefore, NVIDIA_VIDEO_CODEC_SDK_PATH env build time dependency for Windows
is removed.
2019-05-17 13:27:50 +00:00
|
|
|
CuGraphicsGLRegisterBuffer (CUgraphicsResource * pCudaResource,
|
|
|
|
unsigned int buffer, unsigned int Flags)
|
|
|
|
{
|
|
|
|
g_assert (gst_cuda_vtable.CuGraphicsGLRegisterBuffer != NULL);
|
|
|
|
|
|
|
|
return gst_cuda_vtable.CuGraphicsGLRegisterBuffer (pCudaResource, buffer,
|
|
|
|
Flags);
|
|
|
|
}
|
2019-08-17 08:45:44 +00:00
|
|
|
|
2020-01-20 09:52:26 +00:00
|
|
|
CUresult CUDAAPI
|
2019-08-17 08:45:44 +00:00
|
|
|
CuGraphicsResourceSetMapFlags (CUgraphicsResource resource, unsigned int flags)
|
|
|
|
{
|
|
|
|
g_assert (gst_cuda_vtable.CuGraphicsResourceSetMapFlags != NULL);
|
|
|
|
|
|
|
|
return gst_cuda_vtable.CuGraphicsResourceSetMapFlags (resource, flags);
|
|
|
|
}
|
2020-03-15 10:20:47 +00:00
|
|
|
|
|
|
|
CUresult CUDAAPI
|
|
|
|
CuGLGetDevices (unsigned int *pCudaDeviceCount, CUdevice * pCudaDevices,
|
|
|
|
unsigned int cudaDeviceCount, CUGLDeviceList deviceList)
|
|
|
|
{
|
|
|
|
g_assert (gst_cuda_vtable.CuGLGetDevices != NULL);
|
|
|
|
|
|
|
|
return gst_cuda_vtable.CuGLGetDevices (pCudaDeviceCount, pCudaDevices,
|
|
|
|
cudaDeviceCount, deviceList);
|
|
|
|
}
|