mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-02-17 03:35:21 +00:00
nvcodec: Fix crash on 32-bit Windows
We weren't using the correct calling convention when calling CUDA and CUVID APIs. `CUDAAPI` is `__stdcall` on Windows. This was working fine on x64 because `__stdcall` is ignored and there's no special calling convention. However, on x86, we need to use `__stdcall`.
This commit is contained in:
parent
7e93ae0638
commit
1a7ea45ffd
5 changed files with 182 additions and 166 deletions
|
@ -44,48 +44,53 @@ typedef struct _GstNvCodecCudaVTable
|
||||||
{
|
{
|
||||||
gboolean loaded;
|
gboolean loaded;
|
||||||
|
|
||||||
CUresult (*CuInit) (unsigned int Flags);
|
CUresult (CUDAAPI * CuInit) (unsigned int Flags);
|
||||||
CUresult (*CuGetErrorName) (CUresult error, const char **pStr);
|
CUresult (CUDAAPI * CuGetErrorName) (CUresult error, const char **pStr);
|
||||||
CUresult (*CuGetErrorString) (CUresult error, const char **pStr);
|
CUresult (CUDAAPI * CuGetErrorString) (CUresult error, const char **pStr);
|
||||||
|
|
||||||
CUresult (*CuCtxCreate) (CUcontext * pctx, unsigned int flags,
|
CUresult (CUDAAPI * CuCtxCreate) (CUcontext * pctx, unsigned int flags,
|
||||||
CUdevice dev);
|
CUdevice dev);
|
||||||
CUresult (*CuCtxDestroy) (CUcontext ctx);
|
CUresult (CUDAAPI * CuCtxDestroy) (CUcontext ctx);
|
||||||
CUresult (*CuCtxPopCurrent) (CUcontext * pctx);
|
CUresult (CUDAAPI * CuCtxPopCurrent) (CUcontext * pctx);
|
||||||
CUresult (*CuCtxPushCurrent) (CUcontext ctx);
|
CUresult (CUDAAPI * CuCtxPushCurrent) (CUcontext ctx);
|
||||||
|
|
||||||
CUresult (*CuGraphicsMapResources) (unsigned int count,
|
CUresult (CUDAAPI * CuGraphicsMapResources) (unsigned int count,
|
||||||
CUgraphicsResource * resources, CUstream hStream);
|
CUgraphicsResource * resources, CUstream hStream);
|
||||||
CUresult (*CuGraphicsUnmapResources) (unsigned int count,
|
CUresult (CUDAAPI * CuGraphicsUnmapResources) (unsigned int count,
|
||||||
CUgraphicsResource * resources, CUstream hStream);
|
CUgraphicsResource * resources, CUstream hStream);
|
||||||
CUresult (*CuGraphicsSubResourceGetMappedArray) (CUarray * pArray,
|
CUresult (CUDAAPI * CuGraphicsSubResourceGetMappedArray) (CUarray * pArray,
|
||||||
CUgraphicsResource resource, unsigned int arrayIndex,
|
CUgraphicsResource resource, unsigned int arrayIndex,
|
||||||
unsigned int mipLevel);
|
unsigned int mipLevel);
|
||||||
CUresult (*CuGraphicsResourceGetMappedPointer) (CUdeviceptr * pDevPtr,
|
CUresult (CUDAAPI * CuGraphicsResourceGetMappedPointer) (CUdeviceptr *
|
||||||
size_t * pSize, CUgraphicsResource resource);
|
pDevPtr, size_t * pSize, CUgraphicsResource resource);
|
||||||
CUresult (*CuGraphicsUnregisterResource) (CUgraphicsResource resource);
|
CUresult (CUDAAPI *
|
||||||
|
CuGraphicsUnregisterResource) (CUgraphicsResource resource);
|
||||||
|
|
||||||
CUresult (*CuMemAlloc) (CUdeviceptr * dptr, unsigned int bytesize);
|
CUresult (CUDAAPI * CuMemAlloc) (CUdeviceptr * dptr, unsigned int bytesize);
|
||||||
CUresult (*CuMemAllocPitch) (CUdeviceptr * dptr, size_t * pPitch,
|
CUresult (CUDAAPI * CuMemAllocPitch) (CUdeviceptr * dptr, size_t * pPitch,
|
||||||
size_t WidthInBytes, size_t Height, unsigned int ElementSizeBytes);
|
size_t WidthInBytes, size_t Height, unsigned int ElementSizeBytes);
|
||||||
CUresult (*CuMemcpy2D) (const CUDA_MEMCPY2D * pCopy);
|
CUresult (CUDAAPI * CuMemcpy2D) (const CUDA_MEMCPY2D * pCopy);
|
||||||
CUresult (*CuMemcpy2DAsync) (const CUDA_MEMCPY2D * pCopy, CUstream hStream);
|
CUresult (CUDAAPI * CuMemcpy2DAsync) (const CUDA_MEMCPY2D * pCopy,
|
||||||
CUresult (*CuMemFree) (CUdeviceptr dptr);
|
CUstream hStream);
|
||||||
CUresult (*CuStreamCreate) (CUstream * phStream, unsigned int Flags);
|
CUresult (CUDAAPI * CuMemFree) (CUdeviceptr dptr);
|
||||||
CUresult (*CuStreamDestroy) (CUstream hStream);
|
CUresult (CUDAAPI * CuStreamCreate) (CUstream * phStream,
|
||||||
CUresult (*CuStreamSynchronize) (CUstream hStream);
|
unsigned int Flags);
|
||||||
|
CUresult (CUDAAPI * CuStreamDestroy) (CUstream hStream);
|
||||||
|
CUresult (CUDAAPI * CuStreamSynchronize) (CUstream hStream);
|
||||||
|
|
||||||
CUresult (*CuDeviceGet) (CUdevice * device, int ordinal);
|
CUresult (CUDAAPI * CuDeviceGet) (CUdevice * device, int ordinal);
|
||||||
CUresult (*CuDeviceGetCount) (int *count);
|
CUresult (CUDAAPI * CuDeviceGetCount) (int *count);
|
||||||
CUresult (*CuDeviceGetName) (char *name, int len, CUdevice dev);
|
CUresult (CUDAAPI * CuDeviceGetName) (char *name, int len, CUdevice dev);
|
||||||
CUresult (*CuDeviceGetAttribute) (int *pi, CUdevice_attribute attrib,
|
CUresult (CUDAAPI * CuDeviceGetAttribute) (int *pi,
|
||||||
CUdevice dev);
|
CUdevice_attribute attrib, CUdevice dev);
|
||||||
|
|
||||||
CUresult (*CuGraphicsGLRegisterImage) (CUgraphicsResource * pCudaResource,
|
CUresult (CUDAAPI * CuGraphicsGLRegisterImage) (CUgraphicsResource *
|
||||||
unsigned int image, unsigned int target, unsigned int Flags);
|
pCudaResource, unsigned int image, unsigned int target,
|
||||||
CUresult (*CuGraphicsGLRegisterBuffer) (CUgraphicsResource * pCudaResource,
|
unsigned int Flags);
|
||||||
unsigned int buffer, unsigned int Flags);
|
CUresult (CUDAAPI * CuGraphicsGLRegisterBuffer) (CUgraphicsResource *
|
||||||
CUresult (*CuGraphicsResourceSetMapFlags) (CUgraphicsResource resource,
|
pCudaResource, unsigned int buffer, unsigned int Flags);
|
||||||
|
CUresult (CUDAAPI *
|
||||||
|
CuGraphicsResourceSetMapFlags) (CUgraphicsResource resource,
|
||||||
unsigned int flags);
|
unsigned int flags);
|
||||||
} GstNvCodecCudaVTable;
|
} GstNvCodecCudaVTable;
|
||||||
|
|
||||||
|
@ -156,7 +161,7 @@ error:
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
CUresult
|
CUresult CUDAAPI
|
||||||
CuInit (unsigned int Flags)
|
CuInit (unsigned int Flags)
|
||||||
{
|
{
|
||||||
g_assert (gst_cuda_vtable.CuInit != NULL);
|
g_assert (gst_cuda_vtable.CuInit != NULL);
|
||||||
|
@ -164,7 +169,7 @@ CuInit (unsigned int Flags)
|
||||||
return gst_cuda_vtable.CuInit (Flags);
|
return gst_cuda_vtable.CuInit (Flags);
|
||||||
}
|
}
|
||||||
|
|
||||||
CUresult
|
CUresult CUDAAPI
|
||||||
CuGetErrorName (CUresult error, const char **pStr)
|
CuGetErrorName (CUresult error, const char **pStr)
|
||||||
{
|
{
|
||||||
g_assert (gst_cuda_vtable.CuGetErrorName != NULL);
|
g_assert (gst_cuda_vtable.CuGetErrorName != NULL);
|
||||||
|
@ -172,7 +177,7 @@ CuGetErrorName (CUresult error, const char **pStr)
|
||||||
return gst_cuda_vtable.CuGetErrorName (error, pStr);
|
return gst_cuda_vtable.CuGetErrorName (error, pStr);
|
||||||
}
|
}
|
||||||
|
|
||||||
CUresult
|
CUresult CUDAAPI
|
||||||
CuGetErrorString (CUresult error, const char **pStr)
|
CuGetErrorString (CUresult error, const char **pStr)
|
||||||
{
|
{
|
||||||
g_assert (gst_cuda_vtable.CuGetErrorString != NULL);
|
g_assert (gst_cuda_vtable.CuGetErrorString != NULL);
|
||||||
|
@ -180,7 +185,7 @@ CuGetErrorString (CUresult error, const char **pStr)
|
||||||
return gst_cuda_vtable.CuGetErrorString (error, pStr);
|
return gst_cuda_vtable.CuGetErrorString (error, pStr);
|
||||||
}
|
}
|
||||||
|
|
||||||
CUresult
|
CUresult CUDAAPI
|
||||||
CuCtxCreate (CUcontext * pctx, unsigned int flags, CUdevice dev)
|
CuCtxCreate (CUcontext * pctx, unsigned int flags, CUdevice dev)
|
||||||
{
|
{
|
||||||
g_assert (gst_cuda_vtable.CuCtxCreate != NULL);
|
g_assert (gst_cuda_vtable.CuCtxCreate != NULL);
|
||||||
|
@ -188,7 +193,7 @@ CuCtxCreate (CUcontext * pctx, unsigned int flags, CUdevice dev)
|
||||||
return gst_cuda_vtable.CuCtxCreate (pctx, flags, dev);
|
return gst_cuda_vtable.CuCtxCreate (pctx, flags, dev);
|
||||||
}
|
}
|
||||||
|
|
||||||
CUresult
|
CUresult CUDAAPI
|
||||||
CuCtxDestroy (CUcontext ctx)
|
CuCtxDestroy (CUcontext ctx)
|
||||||
{
|
{
|
||||||
g_assert (gst_cuda_vtable.CuCtxDestroy != NULL);
|
g_assert (gst_cuda_vtable.CuCtxDestroy != NULL);
|
||||||
|
@ -196,7 +201,7 @@ CuCtxDestroy (CUcontext ctx)
|
||||||
return gst_cuda_vtable.CuCtxDestroy (ctx);
|
return gst_cuda_vtable.CuCtxDestroy (ctx);
|
||||||
}
|
}
|
||||||
|
|
||||||
CUresult
|
CUresult CUDAAPI
|
||||||
CuCtxPopCurrent (CUcontext * pctx)
|
CuCtxPopCurrent (CUcontext * pctx)
|
||||||
{
|
{
|
||||||
g_assert (gst_cuda_vtable.CuCtxPopCurrent != NULL);
|
g_assert (gst_cuda_vtable.CuCtxPopCurrent != NULL);
|
||||||
|
@ -204,7 +209,7 @@ CuCtxPopCurrent (CUcontext * pctx)
|
||||||
return gst_cuda_vtable.CuCtxPopCurrent (pctx);
|
return gst_cuda_vtable.CuCtxPopCurrent (pctx);
|
||||||
}
|
}
|
||||||
|
|
||||||
CUresult
|
CUresult CUDAAPI
|
||||||
CuCtxPushCurrent (CUcontext ctx)
|
CuCtxPushCurrent (CUcontext ctx)
|
||||||
{
|
{
|
||||||
g_assert (gst_cuda_vtable.CuCtxPushCurrent != NULL);
|
g_assert (gst_cuda_vtable.CuCtxPushCurrent != NULL);
|
||||||
|
@ -212,7 +217,7 @@ CuCtxPushCurrent (CUcontext ctx)
|
||||||
return gst_cuda_vtable.CuCtxPushCurrent (ctx);
|
return gst_cuda_vtable.CuCtxPushCurrent (ctx);
|
||||||
}
|
}
|
||||||
|
|
||||||
CUresult
|
CUresult CUDAAPI
|
||||||
CuGraphicsMapResources (unsigned int count, CUgraphicsResource * resources,
|
CuGraphicsMapResources (unsigned int count, CUgraphicsResource * resources,
|
||||||
CUstream hStream)
|
CUstream hStream)
|
||||||
{
|
{
|
||||||
|
@ -221,7 +226,7 @@ CuGraphicsMapResources (unsigned int count, CUgraphicsResource * resources,
|
||||||
return gst_cuda_vtable.CuGraphicsMapResources (count, resources, hStream);
|
return gst_cuda_vtable.CuGraphicsMapResources (count, resources, hStream);
|
||||||
}
|
}
|
||||||
|
|
||||||
CUresult
|
CUresult CUDAAPI
|
||||||
CuGraphicsUnmapResources (unsigned int count, CUgraphicsResource * resources,
|
CuGraphicsUnmapResources (unsigned int count, CUgraphicsResource * resources,
|
||||||
CUstream hStream)
|
CUstream hStream)
|
||||||
{
|
{
|
||||||
|
@ -230,7 +235,7 @@ CuGraphicsUnmapResources (unsigned int count, CUgraphicsResource * resources,
|
||||||
return gst_cuda_vtable.CuGraphicsUnmapResources (count, resources, hStream);
|
return gst_cuda_vtable.CuGraphicsUnmapResources (count, resources, hStream);
|
||||||
}
|
}
|
||||||
|
|
||||||
CUresult
|
CUresult CUDAAPI
|
||||||
CuGraphicsSubResourceGetMappedArray (CUarray * pArray,
|
CuGraphicsSubResourceGetMappedArray (CUarray * pArray,
|
||||||
CUgraphicsResource resource, unsigned int arrayIndex, unsigned int mipLevel)
|
CUgraphicsResource resource, unsigned int arrayIndex, unsigned int mipLevel)
|
||||||
{
|
{
|
||||||
|
@ -240,7 +245,7 @@ CuGraphicsSubResourceGetMappedArray (CUarray * pArray,
|
||||||
arrayIndex, mipLevel);
|
arrayIndex, mipLevel);
|
||||||
}
|
}
|
||||||
|
|
||||||
CUresult
|
CUresult CUDAAPI
|
||||||
CuGraphicsResourceGetMappedPointer (CUdeviceptr * pDevPtr, size_t * pSize,
|
CuGraphicsResourceGetMappedPointer (CUdeviceptr * pDevPtr, size_t * pSize,
|
||||||
CUgraphicsResource resource)
|
CUgraphicsResource resource)
|
||||||
{
|
{
|
||||||
|
@ -250,7 +255,7 @@ CuGraphicsResourceGetMappedPointer (CUdeviceptr * pDevPtr, size_t * pSize,
|
||||||
resource);
|
resource);
|
||||||
}
|
}
|
||||||
|
|
||||||
CUresult
|
CUresult CUDAAPI
|
||||||
CuGraphicsUnregisterResource (CUgraphicsResource resource)
|
CuGraphicsUnregisterResource (CUgraphicsResource resource)
|
||||||
{
|
{
|
||||||
g_assert (gst_cuda_vtable.CuGraphicsUnregisterResource != NULL);
|
g_assert (gst_cuda_vtable.CuGraphicsUnregisterResource != NULL);
|
||||||
|
@ -258,7 +263,7 @@ CuGraphicsUnregisterResource (CUgraphicsResource resource)
|
||||||
return gst_cuda_vtable.CuGraphicsUnregisterResource (resource);
|
return gst_cuda_vtable.CuGraphicsUnregisterResource (resource);
|
||||||
}
|
}
|
||||||
|
|
||||||
CUresult
|
CUresult CUDAAPI
|
||||||
CuMemAlloc (CUdeviceptr * dptr, unsigned int bytesize)
|
CuMemAlloc (CUdeviceptr * dptr, unsigned int bytesize)
|
||||||
{
|
{
|
||||||
g_assert (gst_cuda_vtable.CuMemAlloc != NULL);
|
g_assert (gst_cuda_vtable.CuMemAlloc != NULL);
|
||||||
|
@ -266,7 +271,7 @@ CuMemAlloc (CUdeviceptr * dptr, unsigned int bytesize)
|
||||||
return gst_cuda_vtable.CuMemAlloc (dptr, bytesize);
|
return gst_cuda_vtable.CuMemAlloc (dptr, bytesize);
|
||||||
}
|
}
|
||||||
|
|
||||||
CUresult
|
CUresult CUDAAPI
|
||||||
CuMemAllocPitch (CUdeviceptr * dptr, size_t * pPitch, size_t WidthInBytes,
|
CuMemAllocPitch (CUdeviceptr * dptr, size_t * pPitch, size_t WidthInBytes,
|
||||||
size_t Height, unsigned int ElementSizeBytes)
|
size_t Height, unsigned int ElementSizeBytes)
|
||||||
{
|
{
|
||||||
|
@ -276,7 +281,7 @@ CuMemAllocPitch (CUdeviceptr * dptr, size_t * pPitch, size_t WidthInBytes,
|
||||||
ElementSizeBytes);
|
ElementSizeBytes);
|
||||||
}
|
}
|
||||||
|
|
||||||
CUresult
|
CUresult CUDAAPI
|
||||||
CuMemcpy2D (const CUDA_MEMCPY2D * pCopy)
|
CuMemcpy2D (const CUDA_MEMCPY2D * pCopy)
|
||||||
{
|
{
|
||||||
g_assert (gst_cuda_vtable.CuMemcpy2D != NULL);
|
g_assert (gst_cuda_vtable.CuMemcpy2D != NULL);
|
||||||
|
@ -284,7 +289,7 @@ CuMemcpy2D (const CUDA_MEMCPY2D * pCopy)
|
||||||
return gst_cuda_vtable.CuMemcpy2D (pCopy);
|
return gst_cuda_vtable.CuMemcpy2D (pCopy);
|
||||||
}
|
}
|
||||||
|
|
||||||
CUresult
|
CUresult CUDAAPI
|
||||||
CuMemcpy2DAsync (const CUDA_MEMCPY2D * pCopy, CUstream hStream)
|
CuMemcpy2DAsync (const CUDA_MEMCPY2D * pCopy, CUstream hStream)
|
||||||
{
|
{
|
||||||
g_assert (gst_cuda_vtable.CuMemcpy2DAsync != NULL);
|
g_assert (gst_cuda_vtable.CuMemcpy2DAsync != NULL);
|
||||||
|
@ -292,7 +297,7 @@ CuMemcpy2DAsync (const CUDA_MEMCPY2D * pCopy, CUstream hStream)
|
||||||
return gst_cuda_vtable.CuMemcpy2DAsync (pCopy, hStream);
|
return gst_cuda_vtable.CuMemcpy2DAsync (pCopy, hStream);
|
||||||
}
|
}
|
||||||
|
|
||||||
CUresult
|
CUresult CUDAAPI
|
||||||
CuMemFree (CUdeviceptr dptr)
|
CuMemFree (CUdeviceptr dptr)
|
||||||
{
|
{
|
||||||
g_assert (gst_cuda_vtable.CuMemFree != NULL);
|
g_assert (gst_cuda_vtable.CuMemFree != NULL);
|
||||||
|
@ -300,7 +305,7 @@ CuMemFree (CUdeviceptr dptr)
|
||||||
return gst_cuda_vtable.CuMemFree (dptr);
|
return gst_cuda_vtable.CuMemFree (dptr);
|
||||||
}
|
}
|
||||||
|
|
||||||
CUresult
|
CUresult CUDAAPI
|
||||||
CuStreamCreate (CUstream * phStream, unsigned int Flags)
|
CuStreamCreate (CUstream * phStream, unsigned int Flags)
|
||||||
{
|
{
|
||||||
g_assert (gst_cuda_vtable.CuStreamCreate != NULL);
|
g_assert (gst_cuda_vtable.CuStreamCreate != NULL);
|
||||||
|
@ -308,7 +313,7 @@ CuStreamCreate (CUstream * phStream, unsigned int Flags)
|
||||||
return gst_cuda_vtable.CuStreamCreate (phStream, Flags);
|
return gst_cuda_vtable.CuStreamCreate (phStream, Flags);
|
||||||
}
|
}
|
||||||
|
|
||||||
CUresult
|
CUresult CUDAAPI
|
||||||
CuStreamDestroy (CUstream hStream)
|
CuStreamDestroy (CUstream hStream)
|
||||||
{
|
{
|
||||||
g_assert (gst_cuda_vtable.CuStreamDestroy != NULL);
|
g_assert (gst_cuda_vtable.CuStreamDestroy != NULL);
|
||||||
|
@ -316,7 +321,7 @@ CuStreamDestroy (CUstream hStream)
|
||||||
return gst_cuda_vtable.CuStreamDestroy (hStream);
|
return gst_cuda_vtable.CuStreamDestroy (hStream);
|
||||||
}
|
}
|
||||||
|
|
||||||
CUresult
|
CUresult CUDAAPI
|
||||||
CuStreamSynchronize (CUstream hStream)
|
CuStreamSynchronize (CUstream hStream)
|
||||||
{
|
{
|
||||||
g_assert (gst_cuda_vtable.CuStreamSynchronize != NULL);
|
g_assert (gst_cuda_vtable.CuStreamSynchronize != NULL);
|
||||||
|
@ -324,7 +329,7 @@ CuStreamSynchronize (CUstream hStream)
|
||||||
return gst_cuda_vtable.CuStreamSynchronize (hStream);
|
return gst_cuda_vtable.CuStreamSynchronize (hStream);
|
||||||
}
|
}
|
||||||
|
|
||||||
CUresult
|
CUresult CUDAAPI
|
||||||
CuDeviceGet (CUdevice * device, int ordinal)
|
CuDeviceGet (CUdevice * device, int ordinal)
|
||||||
{
|
{
|
||||||
g_assert (gst_cuda_vtable.CuDeviceGet != NULL);
|
g_assert (gst_cuda_vtable.CuDeviceGet != NULL);
|
||||||
|
@ -332,7 +337,7 @@ CuDeviceGet (CUdevice * device, int ordinal)
|
||||||
return gst_cuda_vtable.CuDeviceGet (device, ordinal);
|
return gst_cuda_vtable.CuDeviceGet (device, ordinal);
|
||||||
}
|
}
|
||||||
|
|
||||||
CUresult
|
CUresult CUDAAPI
|
||||||
CuDeviceGetCount (int *count)
|
CuDeviceGetCount (int *count)
|
||||||
{
|
{
|
||||||
g_assert (gst_cuda_vtable.CuDeviceGetCount != NULL);
|
g_assert (gst_cuda_vtable.CuDeviceGetCount != NULL);
|
||||||
|
@ -340,7 +345,7 @@ CuDeviceGetCount (int *count)
|
||||||
return gst_cuda_vtable.CuDeviceGetCount (count);
|
return gst_cuda_vtable.CuDeviceGetCount (count);
|
||||||
}
|
}
|
||||||
|
|
||||||
CUresult
|
CUresult CUDAAPI
|
||||||
CuDeviceGetName (char *name, int len, CUdevice dev)
|
CuDeviceGetName (char *name, int len, CUdevice dev)
|
||||||
{
|
{
|
||||||
g_assert (gst_cuda_vtable.CuDeviceGetName != NULL);
|
g_assert (gst_cuda_vtable.CuDeviceGetName != NULL);
|
||||||
|
@ -348,7 +353,7 @@ CuDeviceGetName (char *name, int len, CUdevice dev)
|
||||||
return gst_cuda_vtable.CuDeviceGetName (name, len, dev);
|
return gst_cuda_vtable.CuDeviceGetName (name, len, dev);
|
||||||
}
|
}
|
||||||
|
|
||||||
CUresult
|
CUresult CUDAAPI
|
||||||
CuDeviceGetAttribute (int *pi, CUdevice_attribute attrib, CUdevice dev)
|
CuDeviceGetAttribute (int *pi, CUdevice_attribute attrib, CUdevice dev)
|
||||||
{
|
{
|
||||||
g_assert (gst_cuda_vtable.CuDeviceGetAttribute != NULL);
|
g_assert (gst_cuda_vtable.CuDeviceGetAttribute != NULL);
|
||||||
|
@ -357,7 +362,7 @@ CuDeviceGetAttribute (int *pi, CUdevice_attribute attrib, CUdevice dev)
|
||||||
}
|
}
|
||||||
|
|
||||||
/* cudaGL.h */
|
/* cudaGL.h */
|
||||||
CUresult
|
CUresult CUDAAPI
|
||||||
CuGraphicsGLRegisterImage (CUgraphicsResource * pCudaResource,
|
CuGraphicsGLRegisterImage (CUgraphicsResource * pCudaResource,
|
||||||
unsigned int image, unsigned int target, unsigned int Flags)
|
unsigned int image, unsigned int target, unsigned int Flags)
|
||||||
{
|
{
|
||||||
|
@ -367,7 +372,7 @@ CuGraphicsGLRegisterImage (CUgraphicsResource * pCudaResource,
|
||||||
target, Flags);
|
target, Flags);
|
||||||
}
|
}
|
||||||
|
|
||||||
CUresult
|
CUresult CUDAAPI
|
||||||
CuGraphicsGLRegisterBuffer (CUgraphicsResource * pCudaResource,
|
CuGraphicsGLRegisterBuffer (CUgraphicsResource * pCudaResource,
|
||||||
unsigned int buffer, unsigned int Flags)
|
unsigned int buffer, unsigned int Flags)
|
||||||
{
|
{
|
||||||
|
@ -377,7 +382,7 @@ CuGraphicsGLRegisterBuffer (CUgraphicsResource * pCudaResource,
|
||||||
Flags);
|
Flags);
|
||||||
}
|
}
|
||||||
|
|
||||||
CUresult
|
CUresult CUDAAPI
|
||||||
CuGraphicsResourceSetMapFlags (CUgraphicsResource resource, unsigned int flags)
|
CuGraphicsResourceSetMapFlags (CUgraphicsResource resource, unsigned int flags)
|
||||||
{
|
{
|
||||||
g_assert (gst_cuda_vtable.CuGraphicsResourceSetMapFlags != NULL);
|
g_assert (gst_cuda_vtable.CuGraphicsResourceSetMapFlags != NULL);
|
||||||
|
|
|
@ -31,116 +31,116 @@ gboolean gst_cuda_load_library (void);
|
||||||
|
|
||||||
/* cuda.h */
|
/* cuda.h */
|
||||||
G_GNUC_INTERNAL
|
G_GNUC_INTERNAL
|
||||||
CUresult CuInit (unsigned int Flags);
|
CUresult CUDAAPI CuInit (unsigned int Flags);
|
||||||
|
|
||||||
G_GNUC_INTERNAL
|
G_GNUC_INTERNAL
|
||||||
CUresult CuGetErrorName (CUresult error,
|
CUresult CUDAAPI CuGetErrorName (CUresult error,
|
||||||
const char **pStr);
|
const char **pStr);
|
||||||
|
|
||||||
G_GNUC_INTERNAL
|
G_GNUC_INTERNAL
|
||||||
CUresult CuGetErrorString (CUresult error,
|
CUresult CUDAAPI CuGetErrorString (CUresult error,
|
||||||
const char **pStr);
|
const char **pStr);
|
||||||
|
|
||||||
G_GNUC_INTERNAL
|
G_GNUC_INTERNAL
|
||||||
CUresult CuCtxCreate (CUcontext * pctx,
|
CUresult CUDAAPI CuCtxCreate (CUcontext * pctx,
|
||||||
unsigned int flags,
|
unsigned int flags,
|
||||||
CUdevice dev);
|
CUdevice dev);
|
||||||
|
|
||||||
G_GNUC_INTERNAL
|
G_GNUC_INTERNAL
|
||||||
CUresult CuCtxDestroy (CUcontext ctx);
|
CUresult CUDAAPI CuCtxDestroy (CUcontext ctx);
|
||||||
|
|
||||||
G_GNUC_INTERNAL
|
G_GNUC_INTERNAL
|
||||||
CUresult CuCtxPopCurrent (CUcontext * pctx);
|
CUresult CUDAAPI CuCtxPopCurrent (CUcontext * pctx);
|
||||||
|
|
||||||
G_GNUC_INTERNAL
|
G_GNUC_INTERNAL
|
||||||
CUresult CuCtxPushCurrent (CUcontext ctx);
|
CUresult CUDAAPI CuCtxPushCurrent (CUcontext ctx);
|
||||||
|
|
||||||
G_GNUC_INTERNAL
|
G_GNUC_INTERNAL
|
||||||
CUresult CuGraphicsMapResources (unsigned int count,
|
CUresult CUDAAPI CuGraphicsMapResources (unsigned int count,
|
||||||
CUgraphicsResource * resources,
|
CUgraphicsResource * resources,
|
||||||
CUstream hStream);
|
CUstream hStream);
|
||||||
|
|
||||||
G_GNUC_INTERNAL
|
G_GNUC_INTERNAL
|
||||||
CUresult CuGraphicsUnmapResources (unsigned int count,
|
CUresult CUDAAPI CuGraphicsUnmapResources (unsigned int count,
|
||||||
CUgraphicsResource * resources,
|
CUgraphicsResource * resources,
|
||||||
CUstream hStream);
|
CUstream hStream);
|
||||||
|
|
||||||
G_GNUC_INTERNAL
|
G_GNUC_INTERNAL
|
||||||
CUresult CuGraphicsSubResourceGetMappedArray (CUarray * pArray,
|
CUresult CUDAAPI CuGraphicsSubResourceGetMappedArray (CUarray * pArray,
|
||||||
CUgraphicsResource resource,
|
CUgraphicsResource resource,
|
||||||
unsigned int arrayIndex,
|
unsigned int arrayIndex,
|
||||||
unsigned int mipLevel);
|
unsigned int mipLevel);
|
||||||
|
|
||||||
G_GNUC_INTERNAL
|
G_GNUC_INTERNAL
|
||||||
CUresult CuGraphicsResourceGetMappedPointer (CUdeviceptr * pDevPtr,
|
CUresult CUDAAPI CuGraphicsResourceGetMappedPointer (CUdeviceptr * pDevPtr,
|
||||||
size_t * pSize,
|
size_t * pSize,
|
||||||
CUgraphicsResource resource);
|
CUgraphicsResource resource);
|
||||||
|
|
||||||
G_GNUC_INTERNAL
|
G_GNUC_INTERNAL
|
||||||
CUresult CuGraphicsUnregisterResource (CUgraphicsResource resource);
|
CUresult CUDAAPI CuGraphicsUnregisterResource (CUgraphicsResource resource);
|
||||||
|
|
||||||
G_GNUC_INTERNAL
|
G_GNUC_INTERNAL
|
||||||
CUresult CuMemAlloc (CUdeviceptr * dptr,
|
CUresult CUDAAPI CuMemAlloc (CUdeviceptr * dptr,
|
||||||
unsigned int bytesize);
|
unsigned int bytesize);
|
||||||
|
|
||||||
G_GNUC_INTERNAL
|
G_GNUC_INTERNAL
|
||||||
CUresult CuMemAllocPitch (CUdeviceptr * dptr,
|
CUresult CUDAAPI CuMemAllocPitch (CUdeviceptr * dptr,
|
||||||
size_t * pPitch,
|
size_t * pPitch,
|
||||||
size_t WidthInBytes,
|
size_t WidthInBytes,
|
||||||
size_t Height,
|
size_t Height,
|
||||||
unsigned int ElementSizeBytes);
|
unsigned int ElementSizeBytes);
|
||||||
|
|
||||||
G_GNUC_INTERNAL
|
G_GNUC_INTERNAL
|
||||||
CUresult CuMemcpy2D (const CUDA_MEMCPY2D * pCopy);
|
CUresult CUDAAPI CuMemcpy2D (const CUDA_MEMCPY2D * pCopy);
|
||||||
|
|
||||||
G_GNUC_INTERNAL
|
G_GNUC_INTERNAL
|
||||||
CUresult CuMemcpy2DAsync (const CUDA_MEMCPY2D *pCopy, CUstream hStream);
|
CUresult CUDAAPI CuMemcpy2DAsync (const CUDA_MEMCPY2D *pCopy, CUstream hStream);
|
||||||
|
|
||||||
G_GNUC_INTERNAL
|
G_GNUC_INTERNAL
|
||||||
CUresult CuMemFree (CUdeviceptr dptr);
|
CUresult CUDAAPI CuMemFree (CUdeviceptr dptr);
|
||||||
|
|
||||||
G_GNUC_INTERNAL
|
G_GNUC_INTERNAL
|
||||||
CUresult CuStreamCreate (CUstream *phStream,
|
CUresult CUDAAPI CuStreamCreate (CUstream *phStream,
|
||||||
unsigned int Flags);
|
unsigned int Flags);
|
||||||
|
|
||||||
G_GNUC_INTERNAL
|
G_GNUC_INTERNAL
|
||||||
CUresult CuStreamDestroy (CUstream hStream);
|
CUresult CUDAAPI CuStreamDestroy (CUstream hStream);
|
||||||
|
|
||||||
G_GNUC_INTERNAL
|
G_GNUC_INTERNAL
|
||||||
CUresult CuStreamSynchronize (CUstream hStream);
|
CUresult CUDAAPI CuStreamSynchronize (CUstream hStream);
|
||||||
|
|
||||||
G_GNUC_INTERNAL
|
G_GNUC_INTERNAL
|
||||||
CUresult CuDeviceGet (CUdevice * device,
|
CUresult CUDAAPI CuDeviceGet (CUdevice * device,
|
||||||
int ordinal);
|
int ordinal);
|
||||||
|
|
||||||
G_GNUC_INTERNAL
|
G_GNUC_INTERNAL
|
||||||
CUresult CuDeviceGetCount (int *count);
|
CUresult CUDAAPI CuDeviceGetCount (int *count);
|
||||||
|
|
||||||
G_GNUC_INTERNAL
|
G_GNUC_INTERNAL
|
||||||
CUresult CuDeviceGetName (char *name,
|
CUresult CUDAAPI CuDeviceGetName (char *name,
|
||||||
int len,
|
int len,
|
||||||
CUdevice dev);
|
CUdevice dev);
|
||||||
|
|
||||||
G_GNUC_INTERNAL
|
G_GNUC_INTERNAL
|
||||||
CUresult CuDeviceGetAttribute (int *pi,
|
CUresult CUDAAPI CuDeviceGetAttribute (int *pi,
|
||||||
CUdevice_attribute attrib,
|
CUdevice_attribute attrib,
|
||||||
CUdevice dev);
|
CUdevice dev);
|
||||||
|
|
||||||
/* cudaGL.h */
|
/* cudaGL.h */
|
||||||
G_GNUC_INTERNAL
|
G_GNUC_INTERNAL
|
||||||
CUresult CuGraphicsGLRegisterImage (CUgraphicsResource * pCudaResource,
|
CUresult CUDAAPI CuGraphicsGLRegisterImage (CUgraphicsResource * pCudaResource,
|
||||||
unsigned int image,
|
unsigned int image,
|
||||||
unsigned int target,
|
unsigned int target,
|
||||||
unsigned int Flags);
|
unsigned int Flags);
|
||||||
|
|
||||||
G_GNUC_INTERNAL
|
G_GNUC_INTERNAL
|
||||||
CUresult CuGraphicsGLRegisterBuffer (CUgraphicsResource * pCudaResource,
|
CUresult CUDAAPI CuGraphicsGLRegisterBuffer (CUgraphicsResource * pCudaResource,
|
||||||
unsigned int buffer,
|
unsigned int buffer,
|
||||||
unsigned int Flags);
|
unsigned int Flags);
|
||||||
|
|
||||||
G_GNUC_INTERNAL
|
G_GNUC_INTERNAL
|
||||||
CUresult CuGraphicsResourceSetMapFlags (CUgraphicsResource resource,
|
CUresult CUDAAPI CuGraphicsResourceSetMapFlags (CUgraphicsResource resource,
|
||||||
unsigned int flags);
|
unsigned int flags);
|
||||||
|
|
||||||
G_END_DECLS
|
G_END_DECLS
|
||||||
#endif /* __GST_CUDA_LOADER_H__ */
|
#endif /* __GST_CUDA_LOADER_H__ */
|
||||||
|
|
|
@ -44,25 +44,29 @@ typedef struct _GstnvdecCuvidVTable
|
||||||
{
|
{
|
||||||
gboolean loaded;
|
gboolean loaded;
|
||||||
|
|
||||||
CUresult (*CuvidCtxLockCreate) (CUvideoctxlock * pLock, CUcontext ctx);
|
CUresult (CUDAAPI * CuvidCtxLockCreate) (CUvideoctxlock * pLock,
|
||||||
CUresult (*CuvidCtxLockDestroy) (CUvideoctxlock lck);
|
CUcontext ctx);
|
||||||
CUresult (*CuvidCtxLock) (CUvideoctxlock lck, unsigned int reserved_flags);
|
CUresult (CUDAAPI * CuvidCtxLockDestroy) (CUvideoctxlock lck);
|
||||||
CUresult (*CuvidCtxUnlock) (CUvideoctxlock lck,
|
CUresult (CUDAAPI * CuvidCtxLock) (CUvideoctxlock lck,
|
||||||
unsigned int reserved_flags);
|
unsigned int reserved_flags);
|
||||||
CUresult (*CuvidCreateDecoder) (CUvideodecoder * phDecoder,
|
CUresult (CUDAAPI * CuvidCtxUnlock) (CUvideoctxlock lck,
|
||||||
|
unsigned int reserved_flags);
|
||||||
|
CUresult (CUDAAPI * CuvidCreateDecoder) (CUvideodecoder * phDecoder,
|
||||||
CUVIDDECODECREATEINFO * pdci);
|
CUVIDDECODECREATEINFO * pdci);
|
||||||
CUresult (*CuvidDestroyDecoder) (CUvideodecoder hDecoder);
|
CUresult (CUDAAPI * CuvidDestroyDecoder) (CUvideodecoder hDecoder);
|
||||||
CUresult (*CuvidDecodePicture) (CUvideodecoder hDecoder,
|
CUresult (CUDAAPI * CuvidDecodePicture) (CUvideodecoder hDecoder,
|
||||||
CUVIDPICPARAMS * pPicParams);
|
CUVIDPICPARAMS * pPicParams);
|
||||||
CUresult (*CuvidCreateVideoParser) (CUvideoparser * pObj,
|
CUresult (CUDAAPI * CuvidCreateVideoParser) (CUvideoparser * pObj,
|
||||||
CUVIDPARSERPARAMS * pParams);
|
CUVIDPARSERPARAMS * pParams);
|
||||||
CUresult (*CuvidParseVideoData) (CUvideoparser obj,
|
CUresult (CUDAAPI * CuvidParseVideoData) (CUvideoparser obj,
|
||||||
CUVIDSOURCEDATAPACKET * pPacket);
|
CUVIDSOURCEDATAPACKET * pPacket);
|
||||||
CUresult (*CuvidDestroyVideoParser) (CUvideoparser obj);
|
CUresult (CUDAAPI * CuvidDestroyVideoParser) (CUvideoparser obj);
|
||||||
CUresult (*CuvidMapVideoFrame) (CUvideodecoder hDecoder, int nPicIdx,
|
CUresult (CUDAAPI * CuvidMapVideoFrame) (CUvideodecoder hDecoder,
|
||||||
guintptr * pDevPtr, unsigned int *pPitch, CUVIDPROCPARAMS * pVPP);
|
int nPicIdx, guintptr * pDevPtr, unsigned int *pPitch,
|
||||||
CUresult (*CuvidUnmapVideoFrame) (CUvideodecoder hDecoder, guintptr DevPtr);
|
CUVIDPROCPARAMS * pVPP);
|
||||||
CUresult (*CuvidGetDecoderCaps) (CUVIDDECODECAPS * pdc);
|
CUresult (CUDAAPI * CuvidUnmapVideoFrame) (CUvideodecoder hDecoder,
|
||||||
|
guintptr DevPtr);
|
||||||
|
CUresult (CUDAAPI * CuvidGetDecoderCaps) (CUVIDDECODECAPS * pdc);
|
||||||
} GstnvdecCuvidVTable;
|
} GstnvdecCuvidVTable;
|
||||||
|
|
||||||
static GstnvdecCuvidVTable gst_cuvid_vtable = { 0, };
|
static GstnvdecCuvidVTable gst_cuvid_vtable = { 0, };
|
||||||
|
@ -115,7 +119,7 @@ gst_cuvid_can_get_decoder_caps (void)
|
||||||
return ! !gst_cuvid_vtable.CuvidGetDecoderCaps;
|
return ! !gst_cuvid_vtable.CuvidGetDecoderCaps;
|
||||||
}
|
}
|
||||||
|
|
||||||
CUresult
|
CUresult CUDAAPI
|
||||||
CuvidCtxLockCreate (CUvideoctxlock * pLock, CUcontext ctx)
|
CuvidCtxLockCreate (CUvideoctxlock * pLock, CUcontext ctx)
|
||||||
{
|
{
|
||||||
g_assert (gst_cuvid_vtable.CuvidCtxLockCreate != NULL);
|
g_assert (gst_cuvid_vtable.CuvidCtxLockCreate != NULL);
|
||||||
|
@ -123,7 +127,7 @@ CuvidCtxLockCreate (CUvideoctxlock * pLock, CUcontext ctx)
|
||||||
return gst_cuvid_vtable.CuvidCtxLockCreate (pLock, ctx);
|
return gst_cuvid_vtable.CuvidCtxLockCreate (pLock, ctx);
|
||||||
}
|
}
|
||||||
|
|
||||||
CUresult
|
CUresult CUDAAPI
|
||||||
CuvidCtxLockDestroy (CUvideoctxlock lck)
|
CuvidCtxLockDestroy (CUvideoctxlock lck)
|
||||||
{
|
{
|
||||||
g_assert (gst_cuvid_vtable.CuvidCtxLockDestroy != NULL);
|
g_assert (gst_cuvid_vtable.CuvidCtxLockDestroy != NULL);
|
||||||
|
@ -131,7 +135,7 @@ CuvidCtxLockDestroy (CUvideoctxlock lck)
|
||||||
return gst_cuvid_vtable.CuvidCtxLockDestroy (lck);
|
return gst_cuvid_vtable.CuvidCtxLockDestroy (lck);
|
||||||
}
|
}
|
||||||
|
|
||||||
CUresult
|
CUresult CUDAAPI
|
||||||
CuvidCtxLock (CUvideoctxlock lck, unsigned int reserved_flags)
|
CuvidCtxLock (CUvideoctxlock lck, unsigned int reserved_flags)
|
||||||
{
|
{
|
||||||
g_assert (gst_cuvid_vtable.CuvidCtxLock != NULL);
|
g_assert (gst_cuvid_vtable.CuvidCtxLock != NULL);
|
||||||
|
@ -139,7 +143,7 @@ CuvidCtxLock (CUvideoctxlock lck, unsigned int reserved_flags)
|
||||||
return gst_cuvid_vtable.CuvidCtxLock (lck, reserved_flags);
|
return gst_cuvid_vtable.CuvidCtxLock (lck, reserved_flags);
|
||||||
}
|
}
|
||||||
|
|
||||||
CUresult
|
CUresult CUDAAPI
|
||||||
CuvidCtxUnlock (CUvideoctxlock lck, unsigned int reserved_flags)
|
CuvidCtxUnlock (CUvideoctxlock lck, unsigned int reserved_flags)
|
||||||
{
|
{
|
||||||
g_assert (gst_cuvid_vtable.CuvidCtxLockDestroy != NULL);
|
g_assert (gst_cuvid_vtable.CuvidCtxLockDestroy != NULL);
|
||||||
|
@ -147,7 +151,7 @@ CuvidCtxUnlock (CUvideoctxlock lck, unsigned int reserved_flags)
|
||||||
return gst_cuvid_vtable.CuvidCtxUnlock (lck, reserved_flags);
|
return gst_cuvid_vtable.CuvidCtxUnlock (lck, reserved_flags);
|
||||||
}
|
}
|
||||||
|
|
||||||
CUresult
|
CUresult CUDAAPI
|
||||||
CuvidCreateDecoder (CUvideodecoder * phDecoder, CUVIDDECODECREATEINFO * pdci)
|
CuvidCreateDecoder (CUvideodecoder * phDecoder, CUVIDDECODECREATEINFO * pdci)
|
||||||
{
|
{
|
||||||
g_assert (gst_cuvid_vtable.CuvidCreateDecoder != NULL);
|
g_assert (gst_cuvid_vtable.CuvidCreateDecoder != NULL);
|
||||||
|
@ -155,7 +159,7 @@ CuvidCreateDecoder (CUvideodecoder * phDecoder, CUVIDDECODECREATEINFO * pdci)
|
||||||
return gst_cuvid_vtable.CuvidCreateDecoder (phDecoder, pdci);
|
return gst_cuvid_vtable.CuvidCreateDecoder (phDecoder, pdci);
|
||||||
}
|
}
|
||||||
|
|
||||||
CUresult
|
CUresult CUDAAPI
|
||||||
CuvidDestroyDecoder (CUvideodecoder hDecoder)
|
CuvidDestroyDecoder (CUvideodecoder hDecoder)
|
||||||
{
|
{
|
||||||
g_assert (gst_cuvid_vtable.CuvidDestroyDecoder != NULL);
|
g_assert (gst_cuvid_vtable.CuvidDestroyDecoder != NULL);
|
||||||
|
@ -163,7 +167,7 @@ CuvidDestroyDecoder (CUvideodecoder hDecoder)
|
||||||
return gst_cuvid_vtable.CuvidDestroyDecoder (hDecoder);
|
return gst_cuvid_vtable.CuvidDestroyDecoder (hDecoder);
|
||||||
}
|
}
|
||||||
|
|
||||||
CUresult
|
CUresult CUDAAPI
|
||||||
CuvidDecodePicture (CUvideodecoder hDecoder, CUVIDPICPARAMS * pPicParams)
|
CuvidDecodePicture (CUvideodecoder hDecoder, CUVIDPICPARAMS * pPicParams)
|
||||||
{
|
{
|
||||||
g_assert (gst_cuvid_vtable.CuvidDecodePicture != NULL);
|
g_assert (gst_cuvid_vtable.CuvidDecodePicture != NULL);
|
||||||
|
@ -171,7 +175,7 @@ CuvidDecodePicture (CUvideodecoder hDecoder, CUVIDPICPARAMS * pPicParams)
|
||||||
return gst_cuvid_vtable.CuvidDecodePicture (hDecoder, pPicParams);
|
return gst_cuvid_vtable.CuvidDecodePicture (hDecoder, pPicParams);
|
||||||
}
|
}
|
||||||
|
|
||||||
CUresult
|
CUresult CUDAAPI
|
||||||
CuvidCreateVideoParser (CUvideoparser * pObj, CUVIDPARSERPARAMS * pParams)
|
CuvidCreateVideoParser (CUvideoparser * pObj, CUVIDPARSERPARAMS * pParams)
|
||||||
{
|
{
|
||||||
g_assert (gst_cuvid_vtable.CuvidCreateVideoParser != NULL);
|
g_assert (gst_cuvid_vtable.CuvidCreateVideoParser != NULL);
|
||||||
|
@ -179,7 +183,7 @@ CuvidCreateVideoParser (CUvideoparser * pObj, CUVIDPARSERPARAMS * pParams)
|
||||||
return gst_cuvid_vtable.CuvidCreateVideoParser (pObj, pParams);
|
return gst_cuvid_vtable.CuvidCreateVideoParser (pObj, pParams);
|
||||||
}
|
}
|
||||||
|
|
||||||
CUresult
|
CUresult CUDAAPI
|
||||||
CuvidParseVideoData (CUvideoparser obj, CUVIDSOURCEDATAPACKET * pPacket)
|
CuvidParseVideoData (CUvideoparser obj, CUVIDSOURCEDATAPACKET * pPacket)
|
||||||
{
|
{
|
||||||
g_assert (gst_cuvid_vtable.CuvidParseVideoData != NULL);
|
g_assert (gst_cuvid_vtable.CuvidParseVideoData != NULL);
|
||||||
|
@ -187,7 +191,7 @@ CuvidParseVideoData (CUvideoparser obj, CUVIDSOURCEDATAPACKET * pPacket)
|
||||||
return gst_cuvid_vtable.CuvidParseVideoData (obj, pPacket);
|
return gst_cuvid_vtable.CuvidParseVideoData (obj, pPacket);
|
||||||
}
|
}
|
||||||
|
|
||||||
CUresult
|
CUresult CUDAAPI
|
||||||
CuvidDestroyVideoParser (CUvideoparser obj)
|
CuvidDestroyVideoParser (CUvideoparser obj)
|
||||||
{
|
{
|
||||||
g_assert (gst_cuvid_vtable.CuvidDestroyVideoParser != NULL);
|
g_assert (gst_cuvid_vtable.CuvidDestroyVideoParser != NULL);
|
||||||
|
@ -195,7 +199,7 @@ CuvidDestroyVideoParser (CUvideoparser obj)
|
||||||
return gst_cuvid_vtable.CuvidDestroyVideoParser (obj);
|
return gst_cuvid_vtable.CuvidDestroyVideoParser (obj);
|
||||||
}
|
}
|
||||||
|
|
||||||
CUresult
|
CUresult CUDAAPI
|
||||||
CuvidMapVideoFrame (CUvideodecoder hDecoder, int nPicIdx,
|
CuvidMapVideoFrame (CUvideodecoder hDecoder, int nPicIdx,
|
||||||
guintptr * pDevPtr, unsigned int *pPitch, CUVIDPROCPARAMS * pVPP)
|
guintptr * pDevPtr, unsigned int *pPitch, CUVIDPROCPARAMS * pVPP)
|
||||||
{
|
{
|
||||||
|
@ -205,7 +209,7 @@ CuvidMapVideoFrame (CUvideodecoder hDecoder, int nPicIdx,
|
||||||
pPitch, pVPP);
|
pPitch, pVPP);
|
||||||
}
|
}
|
||||||
|
|
||||||
CUresult
|
CUresult CUDAAPI
|
||||||
CuvidUnmapVideoFrame (CUvideodecoder hDecoder, guintptr DevPtr)
|
CuvidUnmapVideoFrame (CUvideodecoder hDecoder, guintptr DevPtr)
|
||||||
{
|
{
|
||||||
g_assert (gst_cuvid_vtable.CuvidUnmapVideoFrame != NULL);
|
g_assert (gst_cuvid_vtable.CuvidUnmapVideoFrame != NULL);
|
||||||
|
@ -213,7 +217,7 @@ CuvidUnmapVideoFrame (CUvideodecoder hDecoder, guintptr DevPtr)
|
||||||
return gst_cuvid_vtable.CuvidUnmapVideoFrame (hDecoder, DevPtr);
|
return gst_cuvid_vtable.CuvidUnmapVideoFrame (hDecoder, DevPtr);
|
||||||
}
|
}
|
||||||
|
|
||||||
CUresult
|
CUresult CUDAAPI
|
||||||
CuvidGetDecoderCaps (CUVIDDECODECAPS * pdc)
|
CuvidGetDecoderCaps (CUVIDDECODECAPS * pdc)
|
||||||
{
|
{
|
||||||
g_assert (gst_cuvid_vtable.CuvidGetDecoderCaps != NULL);
|
g_assert (gst_cuvid_vtable.CuvidGetDecoderCaps != NULL);
|
||||||
|
|
|
@ -21,6 +21,7 @@
|
||||||
#define __GST_CUVID_LOADER_H__
|
#define __GST_CUVID_LOADER_H__
|
||||||
|
|
||||||
#include <gst/gst.h>
|
#include <gst/gst.h>
|
||||||
|
#include "stub/cuda.h"
|
||||||
#include "nvcuvid.h"
|
#include "nvcuvid.h"
|
||||||
|
|
||||||
G_BEGIN_DECLS
|
G_BEGIN_DECLS
|
||||||
|
@ -33,53 +34,54 @@ G_GNUC_INTERNAL
|
||||||
gboolean gst_cuvid_can_get_decoder_caps (void);
|
gboolean gst_cuvid_can_get_decoder_caps (void);
|
||||||
|
|
||||||
G_GNUC_INTERNAL
|
G_GNUC_INTERNAL
|
||||||
CUresult CuvidCtxLockCreate (CUvideoctxlock * pLock, CUcontext ctx);
|
CUresult CUDAAPI CuvidCtxLockCreate (CUvideoctxlock * pLock,
|
||||||
|
CUcontext ctx);
|
||||||
|
|
||||||
G_GNUC_INTERNAL
|
G_GNUC_INTERNAL
|
||||||
CUresult CuvidCtxLockDestroy (CUvideoctxlock lck);
|
CUresult CUDAAPI CuvidCtxLockDestroy (CUvideoctxlock lck);
|
||||||
|
|
||||||
G_GNUC_INTERNAL
|
G_GNUC_INTERNAL
|
||||||
CUresult CuvidCtxLock (CUvideoctxlock lck,
|
CUresult CUDAAPI CuvidCtxLock (CUvideoctxlock lck,
|
||||||
unsigned int reserved_flags);
|
unsigned int reserved_flags);
|
||||||
|
|
||||||
G_GNUC_INTERNAL
|
G_GNUC_INTERNAL
|
||||||
CUresult CuvidCtxUnlock (CUvideoctxlock lck,
|
CUresult CUDAAPI CuvidCtxUnlock (CUvideoctxlock lck,
|
||||||
unsigned int reserved_flags);
|
unsigned int reserved_flags);
|
||||||
|
|
||||||
G_GNUC_INTERNAL
|
G_GNUC_INTERNAL
|
||||||
CUresult CuvidCreateDecoder (CUvideodecoder * phDecoder,
|
CUresult CUDAAPI CuvidCreateDecoder (CUvideodecoder * phDecoder,
|
||||||
CUVIDDECODECREATEINFO * pdci);
|
CUVIDDECODECREATEINFO * pdci);
|
||||||
|
|
||||||
G_GNUC_INTERNAL
|
G_GNUC_INTERNAL
|
||||||
CUresult CuvidDestroyDecoder (CUvideodecoder hDecoder);
|
CUresult CUDAAPI CuvidDestroyDecoder (CUvideodecoder hDecoder);
|
||||||
|
|
||||||
G_GNUC_INTERNAL
|
G_GNUC_INTERNAL
|
||||||
CUresult CuvidDecodePicture (CUvideodecoder hDecoder,
|
CUresult CUDAAPI CuvidDecodePicture (CUvideodecoder hDecoder,
|
||||||
CUVIDPICPARAMS * pPicParams);
|
CUVIDPICPARAMS * pPicParams);
|
||||||
|
|
||||||
G_GNUC_INTERNAL
|
G_GNUC_INTERNAL
|
||||||
CUresult CuvidCreateVideoParser (CUvideoparser * pObj,
|
CUresult CUDAAPI CuvidCreateVideoParser (CUvideoparser * pObj,
|
||||||
CUVIDPARSERPARAMS * pParams);
|
CUVIDPARSERPARAMS * pParams);
|
||||||
|
|
||||||
G_GNUC_INTERNAL
|
G_GNUC_INTERNAL
|
||||||
CUresult CuvidParseVideoData (CUvideoparser obj,
|
CUresult CUDAAPI CuvidParseVideoData (CUvideoparser obj,
|
||||||
CUVIDSOURCEDATAPACKET * pPacket);
|
CUVIDSOURCEDATAPACKET * pPacket);
|
||||||
|
|
||||||
G_GNUC_INTERNAL
|
G_GNUC_INTERNAL
|
||||||
CUresult CuvidDestroyVideoParser (CUvideoparser obj);
|
CUresult CUDAAPI CuvidDestroyVideoParser (CUvideoparser obj);
|
||||||
|
|
||||||
G_GNUC_INTERNAL
|
G_GNUC_INTERNAL
|
||||||
CUresult CuvidMapVideoFrame (CUvideodecoder hDecoder,
|
CUresult CUDAAPI CuvidMapVideoFrame (CUvideodecoder hDecoder,
|
||||||
int nPicIdx,
|
int nPicIdx,
|
||||||
guintptr * pDevPtr,
|
guintptr * pDevPtr,
|
||||||
unsigned int *pPitch,
|
unsigned int *pPitch,
|
||||||
CUVIDPROCPARAMS * pVPP);
|
CUVIDPROCPARAMS * pVPP);
|
||||||
|
|
||||||
G_GNUC_INTERNAL
|
G_GNUC_INTERNAL
|
||||||
CUresult CuvidUnmapVideoFrame (CUvideodecoder hDecoder,
|
CUresult CUDAAPI CuvidUnmapVideoFrame (CUvideodecoder hDecoder,
|
||||||
guintptr DevPtr);
|
guintptr DevPtr);
|
||||||
G_GNUC_INTERNAL
|
G_GNUC_INTERNAL
|
||||||
CUresult CuvidGetDecoderCaps (CUVIDDECODECAPS * pdc);
|
CUresult CUDAAPI CuvidGetDecoderCaps (CUVIDDECODECAPS * pdc);
|
||||||
|
|
||||||
G_END_DECLS
|
G_END_DECLS
|
||||||
#endif /* __GST_CUVID_LOADER_H__ */
|
#endif /* __GST_CUVID_LOADER_H__ */
|
||||||
|
|
|
@ -93,7 +93,12 @@ typedef struct
|
||||||
} CUDA_MEMCPY2D;
|
} CUDA_MEMCPY2D;
|
||||||
|
|
||||||
#define CUDA_VERSION 10000
|
#define CUDA_VERSION 10000
|
||||||
|
|
||||||
|
#ifdef _WIN32
|
||||||
|
#define CUDAAPI __stdcall
|
||||||
|
#else
|
||||||
#define CUDAAPI
|
#define CUDAAPI
|
||||||
|
#endif
|
||||||
|
|
||||||
#define cuCtxCreate cuCtxCreate_v2
|
#define cuCtxCreate cuCtxCreate_v2
|
||||||
#define cuCtxDestroy cuCtxDestroy_v2
|
#define cuCtxDestroy cuCtxDestroy_v2
|
||||||
|
|
Loading…
Reference in a new issue