Commit 5f1ff979 authored by Seungha Yang's avatar Seungha Yang 🐑
Browse files

nvdec: Port to dynamic CUDA/CUVID library loading

parent 6f257716
plugin_LTLIBRARIES = libgstnvcodec.la
libgstnvcodec_la_SOURCES = \
plugin.c
plugin.c \
gstcudaloader.c
if USE_NVDEC
libgstnvcodec_la_SOURCES += \
gstnvdec.c
gstnvdec.c \
gstcuvidloader.c
endif
if USE_NVENC
......@@ -21,7 +23,9 @@ noinst_HEADERS = \
gstnvenc.h \
gstnvbaseenc.h \
gstnvh264enc.h \
gstnvh265enc.h
gstnvh265enc.h \
gstcudaloader.h \
gstcuvidloader.h
libgstnvcodec_la_CFLAGS = \
$(GST_PLUGINS_BAD_CFLAGS) \
......
/* 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>
#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;
/* *INDENT-OFF* */
typedef struct _GstNvCodecCudaVTable
{
GModule *module;
CUresult (*CuInit) (unsigned int Flags);
CUresult (*CuGetErrorName) (CUresult error, const char **pStr);
CUresult (*CuGetErrorString) (CUresult error, const char **pStr);
CUresult (*CuCtxCreate) (CUcontext * pctx, unsigned int flags, CUdevice dev);
CUresult (*CuCtxDestroy) (CUcontext ctx);
CUresult (*CuCtxPopCurrent) (CUcontext * pctx);
CUresult (*CuCtxPushCurrent) (CUcontext ctx);
CUresult (*CuGraphicsMapResources) (unsigned int count, CUgraphicsResource * resources, CUstream hStream);
CUresult (*CuGraphicsUnmapResources) (unsigned int count, CUgraphicsResource * resources, CUstream hStream);
CUresult (*CuGraphicsSubResourceGetMappedArray) (CUarray * pArray, CUgraphicsResource resource, unsigned int arrayIndex, unsigned int mipLevel);
CUresult (*CuGraphicsResourceGetMappedPointer) (CUdeviceptr * pDevPtr, size_t * pSize, CUgraphicsResource resource);
CUresult (*CuGraphicsUnregisterResource) (CUgraphicsResource resource);
CUresult (*CuMemAlloc) (CUdeviceptr * dptr, unsigned int bytesize);
CUresult (*CuMemAllocPitch) (CUdeviceptr * dptr, size_t * pPitch, size_t WidthInBytes, size_t Height, unsigned int ElementSizeBytes);
CUresult (*CuMemcpy2D) (const CUDA_MEMCPY2D * pCopy);
CUresult (*CuMemFree) (CUdeviceptr dptr);
CUresult (*CuDeviceGet) (CUdevice * device, int ordinal);
CUresult (*CuDeviceGetCount) (int *count);
CUresult (*CuDeviceGetName) (char *name, int len, CUdevice dev);
CUresult (*CuDeviceGetAttribute) (int *pi, CUdevice_attribute attrib, CUdevice dev);
CUresult (*CuGraphicsGLRegisterImage) (CUgraphicsResource * pCudaResource, unsigned int image, unsigned int target, unsigned int Flags);
CUresult (*CuGraphicsGLRegisterBuffer) (CUgraphicsResource * pCudaResource, unsigned int buffer, unsigned int Flags);
} GstNvCodecCudaVTable;
/* *INDENT-ON* */
static GstNvCodecCudaVTable *gst_cuda_vtable = NULL;
gboolean
gst_cuda_load_library (void)
{
GModule *module;
const gchar *filename = CUDA_LIBNAME;
GstNvCodecCudaVTable *vtable;
if (gst_cuda_vtable)
return TRUE;
module = g_module_open (filename, G_MODULE_BIND_LAZY);
if (module == NULL) {
GST_ERROR ("Could not open library %s, %s", filename, g_module_error ());
return FALSE;
}
vtable = g_slice_new0 (GstNvCodecCudaVTable);
/* 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);
LOAD_SYMBOL (cuMemFree, CuMemFree);
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);
vtable->module = module;
gst_cuda_vtable = vtable;
return TRUE;
error:
g_module_close (module);
g_slice_free (GstNvCodecCudaVTable, vtable);
return FALSE;
}
CUresult
CuInit (unsigned int Flags)
{
g_assert (gst_cuda_vtable != NULL);
g_assert (gst_cuda_vtable->CuInit != NULL);
return gst_cuda_vtable->CuInit (Flags);
}
CUresult
CuGetErrorName (CUresult error, const char **pStr)
{
g_assert (gst_cuda_vtable != NULL);
g_assert (gst_cuda_vtable->CuGetErrorName != NULL);
return gst_cuda_vtable->CuGetErrorName (error, pStr);
}
CUresult
CuGetErrorString (CUresult error, const char **pStr)
{
g_assert (gst_cuda_vtable != NULL);
g_assert (gst_cuda_vtable->CuGetErrorString != NULL);
return gst_cuda_vtable->CuGetErrorString (error, pStr);
}
CUresult
CuCtxCreate (CUcontext * pctx, unsigned int flags, CUdevice dev)
{
g_assert (gst_cuda_vtable != NULL);
g_assert (gst_cuda_vtable->CuCtxCreate != NULL);
return gst_cuda_vtable->CuCtxCreate (pctx, flags, dev);
}
CUresult
CuCtxDestroy (CUcontext ctx)
{
g_assert (gst_cuda_vtable != NULL);
g_assert (gst_cuda_vtable->CuCtxDestroy != NULL);
return gst_cuda_vtable->CuCtxDestroy (ctx);
}
CUresult
CuCtxPopCurrent (CUcontext * pctx)
{
g_assert (gst_cuda_vtable != NULL);
g_assert (gst_cuda_vtable->CuCtxPopCurrent != NULL);
return gst_cuda_vtable->CuCtxPopCurrent (pctx);
}
CUresult
CuCtxPushCurrent (CUcontext ctx)
{
g_assert (gst_cuda_vtable != NULL);
g_assert (gst_cuda_vtable->CuCtxPushCurrent != NULL);
return gst_cuda_vtable->CuCtxPushCurrent (ctx);
}
CUresult
CuGraphicsMapResources (unsigned int count, CUgraphicsResource * resources,
CUstream hStream)
{
g_assert (gst_cuda_vtable != NULL);
g_assert (gst_cuda_vtable->CuGraphicsMapResources != NULL);
return gst_cuda_vtable->CuGraphicsMapResources (count, resources, hStream);
}
CUresult
CuGraphicsUnmapResources (unsigned int count, CUgraphicsResource * resources,
CUstream hStream)
{
g_assert (gst_cuda_vtable != NULL);
g_assert (gst_cuda_vtable->CuGraphicsUnmapResources != NULL);
return gst_cuda_vtable->CuGraphicsUnmapResources (count, resources, hStream);
}
CUresult
CuGraphicsSubResourceGetMappedArray (CUarray * pArray,
CUgraphicsResource resource, unsigned int arrayIndex, unsigned int mipLevel)
{
g_assert (gst_cuda_vtable != NULL);
g_assert (gst_cuda_vtable->CuGraphicsSubResourceGetMappedArray != NULL);
return gst_cuda_vtable->CuGraphicsSubResourceGetMappedArray (pArray, resource,
arrayIndex, mipLevel);
}
CUresult
CuGraphicsResourceGetMappedPointer (CUdeviceptr * pDevPtr, size_t * pSize,
CUgraphicsResource resource)
{
g_assert (gst_cuda_vtable != NULL);
g_assert (gst_cuda_vtable->CuGraphicsResourceGetMappedPointer != NULL);
return gst_cuda_vtable->CuGraphicsResourceGetMappedPointer (pDevPtr, pSize,
resource);
}
CUresult
CuGraphicsUnregisterResource (CUgraphicsResource resource)
{
g_assert (gst_cuda_vtable != NULL);
g_assert (gst_cuda_vtable->CuGraphicsUnregisterResource != NULL);
return gst_cuda_vtable->CuGraphicsUnregisterResource (resource);
}
CUresult
CuMemAlloc (CUdeviceptr * dptr, unsigned int bytesize)
{
g_assert (gst_cuda_vtable != NULL);
g_assert (gst_cuda_vtable->CuMemAlloc != NULL);
return gst_cuda_vtable->CuMemAlloc (dptr, bytesize);
}
CUresult
CuMemAllocPitch (CUdeviceptr * dptr, size_t * pPitch, size_t WidthInBytes,
size_t Height, unsigned int ElementSizeBytes)
{
g_assert (gst_cuda_vtable != NULL);
g_assert (gst_cuda_vtable->CuMemAllocPitch != NULL);
return gst_cuda_vtable->CuMemAllocPitch (dptr, pPitch, WidthInBytes, Height,
ElementSizeBytes);
}
CUresult
CuMemcpy2D (const CUDA_MEMCPY2D * pCopy)
{
g_assert (gst_cuda_vtable != NULL);
g_assert (gst_cuda_vtable->CuMemcpy2D != NULL);
return gst_cuda_vtable->CuMemcpy2D (pCopy);
}
CUresult
CuMemFree (CUdeviceptr dptr)
{
g_assert (gst_cuda_vtable != NULL);
g_assert (gst_cuda_vtable->CuMemFree != NULL);
return gst_cuda_vtable->CuMemFree (dptr);
}
CUresult
CuDeviceGet (CUdevice * device, int ordinal)
{
g_assert (gst_cuda_vtable != NULL);
g_assert (gst_cuda_vtable->CuDeviceGet != NULL);
return gst_cuda_vtable->CuDeviceGet (device, ordinal);
}
CUresult
CuDeviceGetCount (int *count)
{
g_assert (gst_cuda_vtable != NULL);
g_assert (gst_cuda_vtable->CuDeviceGetCount != NULL);
return gst_cuda_vtable->CuDeviceGetCount (count);
}
CUresult
CuDeviceGetName (char *name, int len, CUdevice dev)
{
g_assert (gst_cuda_vtable != NULL);
g_assert (gst_cuda_vtable->CuDeviceGetName != NULL);
return gst_cuda_vtable->CuDeviceGetName (name, len, dev);
}
CUresult
CuDeviceGetAttribute (int *pi, CUdevice_attribute attrib, CUdevice dev)
{
g_assert (gst_cuda_vtable != NULL);
g_assert (gst_cuda_vtable->CuDeviceGetAttribute != NULL);
return gst_cuda_vtable->CuDeviceGetAttribute (pi, attrib, dev);
}
/* cudaGL.h */
CUresult
CuGraphicsGLRegisterImage (CUgraphicsResource * pCudaResource,
unsigned int image, unsigned int target, unsigned int Flags)
{
g_assert (gst_cuda_vtable != NULL);
g_assert (gst_cuda_vtable->CuGraphicsGLRegisterImage != NULL);
return gst_cuda_vtable->CuGraphicsGLRegisterImage (pCudaResource, image,
target, Flags);
}
CUresult
CuGraphicsGLRegisterBuffer (CUgraphicsResource * pCudaResource,
unsigned int buffer, unsigned int Flags)
{
g_assert (gst_cuda_vtable != NULL);
g_assert (gst_cuda_vtable->CuGraphicsGLRegisterBuffer != NULL);
return gst_cuda_vtable->CuGraphicsGLRegisterBuffer (pCudaResource, buffer,
Flags);
}
/* 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.
*/
#ifndef __GST_CUDA_LOADER_H__
#define __GST_CUDA_LOADER_H__
#include <gst/gst.h>
#include <cuda.h>
G_BEGIN_DECLS
gboolean gst_cuda_load_library (void);
/* cuda.h */
CUresult CuInit (unsigned int Flags);
CUresult CuGetErrorName (CUresult error, const char **pStr);
CUresult CuGetErrorString (CUresult error, const char **pStr);
CUresult CuCtxCreate (CUcontext *pctx, unsigned int flags, CUdevice dev);
CUresult CuCtxDestroy (CUcontext ctx);
CUresult CuCtxPopCurrent (CUcontext *pctx);
CUresult CuCtxPushCurrent (CUcontext ctx);
CUresult CuGraphicsMapResources (unsigned int count, CUgraphicsResource *resources, CUstream hStream);
CUresult CuGraphicsUnmapResources (unsigned int count, CUgraphicsResource *resources, CUstream hStream);
CUresult CuGraphicsSubResourceGetMappedArray (CUarray *pArray, CUgraphicsResource resource, unsigned int arrayIndex, unsigned int mipLevel);
CUresult CuGraphicsResourceGetMappedPointer (CUdeviceptr *pDevPtr, size_t *pSize, CUgraphicsResource resource);
CUresult CuGraphicsUnregisterResource (CUgraphicsResource resource);
CUresult CuMemAlloc (CUdeviceptr *dptr, unsigned int bytesize);
CUresult CuMemAllocPitch (CUdeviceptr *dptr, size_t *pPitch, size_t WidthInBytes, size_t Height, unsigned int ElementSizeBytes);
CUresult CuMemcpy2D (const CUDA_MEMCPY2D *pCopy);
CUresult CuMemFree (CUdeviceptr dptr);
CUresult CuDeviceGet (CUdevice *device, int ordinal);
CUresult CuDeviceGetCount (int *count);
CUresult CuDeviceGetName (char *name, int len, CUdevice dev);
CUresult CuDeviceGetAttribute (int *pi, CUdevice_attribute attrib, CUdevice dev);
/* cudaGL.h */
CUresult CuGraphicsGLRegisterImage (CUgraphicsResource *pCudaResource, unsigned int image, unsigned int target, unsigned int Flags);
CUresult CuGraphicsGLRegisterBuffer (CUgraphicsResource *pCudaResource, unsigned int buffer, unsigned int Flags);
G_END_DECLS
#endif /* __GST_CUDA_LOADER_H__ */
/* 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 "gstcuvidloader.h"
#include <gmodule.h>
#ifdef G_OS_WIN32
#define NVCUVID_LIBNAME "nvcuvid.dll"
#else
#define NVCUVID_LIBNAME "libnvcuvid.so.1"
#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;
#if defined(__CUVID_DEVPTR64) && !defined(__CUVID_INTERNAL)
typedef unsigned long long cuvid_devptr_t;
#else
typedef unsigned int cuvid_devptr_t;
#endif
/* *INDENT-OFF* */
typedef struct _GstNvCodecCuvidVTable
{
GModule *module;
CUresult (*CuvidCtxLockCreate) (CUvideoctxlock * pLock, CUcontext ctx);
CUresult (*CuvidCtxLockDestroy) (CUvideoctxlock lck);
CUresult (*CuvidCtxLock) (CUvideoctxlock lck, unsigned int reserved_flags);
CUresult (*CuvidCtxUnlock) (CUvideoctxlock lck, unsigned int reserved_flags);
CUresult (*CuvidCreateDecoder) (CUvideodecoder * phDecoder, CUVIDDECODECREATEINFO * pdci);
CUresult (*CuvidDestroyDecoder) (CUvideodecoder hDecoder);
CUresult (*CuvidDecodePicture) (CUvideodecoder hDecoder, CUVIDPICPARAMS * pPicParams);
CUresult (*CuvidCreateVideoParser) (CUvideoparser * pObj, CUVIDPARSERPARAMS * pParams);
CUresult (*CuvidParseVideoData) (CUvideoparser obj, CUVIDSOURCEDATAPACKET * pPacket);
CUresult (*CuvidDestroyVideoParser) (CUvideoparser obj);
CUresult (*CuvidMapVideoFrame) (CUvideodecoder hDecoder, int nPicIdx, cuvid_devptr_t * pDevPtr, unsigned int *pPitch, CUVIDPROCPARAMS * pVPP);
CUresult (*CuvidUnmapVideoFrame) (CUvideodecoder hDecoder, cuvid_devptr_t DevPtr);
} GstNvCodecCuvidVTable;
/* *INDENT-ON* */
static GstNvCodecCuvidVTable *gst_cuvid_vtable = NULL;
gboolean
gst_cuvid_load_library (void)
{
GModule *module;
const gchar *filename = NVCUVID_LIBNAME;
GstNvCodecCuvidVTable *vtable;
if (gst_cuvid_vtable)
return TRUE;
module = g_module_open (filename, G_MODULE_BIND_LAZY);
if (module == NULL) {
GST_ERROR ("Could not open library %s, %s", filename, g_module_error ());
return FALSE;
}
vtable = g_slice_new0 (GstNvCodecCuvidVTable);
LOAD_SYMBOL (cuvidCtxLockCreate, CuvidCtxLockCreate);
LOAD_SYMBOL (cuvidCtxLockDestroy, CuvidCtxLockDestroy);
LOAD_SYMBOL (cuvidCtxLock, CuvidCtxLock);
LOAD_SYMBOL (cuvidCtxUnlock, CuvidCtxUnlock);
LOAD_SYMBOL (cuvidCreateDecoder, CuvidCreateDecoder);
LOAD_SYMBOL (cuvidDestroyDecoder, CuvidDestroyDecoder);
LOAD_SYMBOL (cuvidDecodePicture, CuvidDecodePicture);
LOAD_SYMBOL (cuvidCreateVideoParser, CuvidCreateVideoParser);
LOAD_SYMBOL (cuvidParseVideoData, CuvidParseVideoData);
LOAD_SYMBOL (cuvidDestroyVideoParser, CuvidDestroyVideoParser);
LOAD_SYMBOL (cuvidMapVideoFrame, CuvidMapVideoFrame);
LOAD_SYMBOL (cuvidUnmapVideoFrame, CuvidUnmapVideoFrame);
vtable->module = module;
gst_cuvid_vtable = vtable;
return TRUE;
error:
g_module_close (module);
g_slice_free (GstNvCodecCuvidVTable, vtable);
return FALSE;
}
CUresult
CuvidCtxLockCreate (CUvideoctxlock * pLock, CUcontext ctx)
{
g_assert (gst_cuvid_vtable != NULL);
g_assert (gst_cuvid_vtable->CuvidCtxLockCreate != NULL);
return gst_cuvid_vtable->CuvidCtxLockCreate (pLock, ctx);
}
CUresult
CuvidCtxLockDestroy (CUvideoctxlock lck)
{
g_assert (gst_cuvid_vtable != NULL);
g_assert (gst_cuvid_vtable->CuvidCtxLockDestroy != NULL);
return gst_cuvid_vtable->CuvidCtxLockDestroy (lck);
}
CUresult
CuvidCtxLock (CUvideoctxlock lck, unsigned int reserved_flags)
{
g_assert (gst_cuvid_vtable != NULL);
g_assert (gst_cuvid_vtable->CuvidCtxLock != NULL);
return gst_cuvid_vtable->CuvidCtxLock (lck, reserved_flags);
}
CUresult
CuvidCtxUnlock (CUvideoctxlock lck, unsigned int reserved_flags)
{
g_assert (gst_cuvid_vtable != NULL);
g_assert (gst_cuvid_vtable->CuvidCtxLockDestroy != NULL);
return gst_cuvid_vtable->CuvidCtxUnlock (lck, reserved_flags);
}
CUresult
CuvidCreateDecoder (CUvideodecoder * phDecoder, CUVIDDECODECREATEINFO * pdci)
{
g_assert (gst_cuvid_vtable != NULL);
g_assert (gst_cuvid_vtable->CuvidCreateDecoder != NULL);
return gst_cuvid_vtable->CuvidCreateDecoder (phDecoder, pdci);
}
CUresult
CuvidDestroyDecoder (CUvideodecoder hDecoder)
{
g_assert (gst_cuvid_vtable != NULL);
g_assert (gst_cuvid_vtable->CuvidDestroyDecoder != NULL);
return gst_cuvid_vtable->CuvidDestroyDecoder (hDecoder);
}
CUresult
CuvidDecodePicture (CUvideodecoder hDecoder, CUVIDPICPARAMS * pPicParams)
{
g_assert (gst_cuvid_vtable != NULL);
g_assert (gst_cuvid_vtable->CuvidDecodePicture != NULL);
return gst_cuvid_vtable->CuvidDecodePicture (hDecoder, pPicParams);
}
CUresult
CuvidCreateVideoParser (CUvideoparser * pObj, CUVIDPARSERPARAMS * pParams)
{
g_assert (gst_cuvid_vtable != NULL);
g_assert (gst_cuvid_vtable->CuvidCreateVideoParser != NULL);
return gst_cuvid_vtable->CuvidCreateVideoParser (pObj, pParams);
}