diff --git a/subprojects/gst-plugins-bad/gst-libs/gst/cuda/cuda-gst.h b/subprojects/gst-plugins-bad/gst-libs/gst/cuda/cuda-gst.h index 0b60da275b..e5008d81db 100644 --- a/subprojects/gst-plugins-bad/gst-libs/gst/cuda/cuda-gst.h +++ b/subprojects/gst-plugins-bad/gst-libs/gst/cuda/cuda-gst.h @@ -399,6 +399,51 @@ CUresult CUDAAPI CuWaitExternalSemaphoresAsync (const CUexternalSemaphore *extSe unsigned int numExtSems, CUstream stream); +GST_CUDA_API +CUresult CUDAAPI CuMemsetD2D8 (CUdeviceptr dstDevice, + size_t dstPitch, + unsigned char uc, + size_t Width, + size_t Height); + +GST_CUDA_API +CUresult CUDAAPI CuMemsetD2D8Async (CUdeviceptr dstDevice, + size_t dstPitch, + unsigned char uc, + size_t Width, + size_t Height, + CUstream hStream); + +GST_CUDA_API +CUresult CUDAAPI CuMemsetD2D16 (CUdeviceptr dstDevice, + size_t dstPitch, + unsigned short us, + size_t Width, + size_t Height); + +GST_CUDA_API +CUresult CUDAAPI CuMemsetD2D16Async (CUdeviceptr dstDevice, + size_t dstPitch, + unsigned short us, + size_t Width, + size_t Height, + CUstream hStream); + +GST_CUDA_API +CUresult CUDAAPI CuMemsetD2D32 (CUdeviceptr dstDevice, + size_t dstPitch, + unsigned int ui, + size_t Width, + size_t Height); + +GST_CUDA_API +CUresult CUDAAPI CuMemsetD2D32Async (CUdeviceptr dstDevice, + size_t dstPitch, + unsigned int ui, + size_t Width, + size_t Height, + CUstream hStream); + /* cudaGL.h */ GST_CUDA_API CUresult CUDAAPI CuGraphicsGLRegisterImage (CUgraphicsResource * pCudaResource, diff --git a/subprojects/gst-plugins-bad/gst-libs/gst/cuda/gstcudaloader.cpp b/subprojects/gst-plugins-bad/gst-libs/gst/cuda/gstcudaloader.cpp index 39b0f711f2..4b9be81254 100644 --- a/subprojects/gst-plugins-bad/gst-libs/gst/cuda/gstcudaloader.cpp +++ b/subprojects/gst-plugins-bad/gst-libs/gst/cuda/gstcudaloader.cpp @@ -252,6 +252,22 @@ typedef struct _GstNvCodecCudaVTable (const CUexternalSemaphore *extSemArray, const CUDA_EXTERNAL_SEMAPHORE_WAIT_PARAMS *paramsArray, unsigned int numExtSems, CUstream stream); + + CUresult (CUDAAPI * CuMemsetD2D8) (CUdeviceptr dstDevice, size_t dstPitch, + unsigned char uc, size_t Width, size_t Height); + CUresult (CUDAAPI * CuMemsetD2D8Async) (CUdeviceptr dstDevice, + size_t dstPitch, unsigned char uc, size_t Width, size_t Height, + CUstream hStream); + CUresult (CUDAAPI * CuMemsetD2D16) (CUdeviceptr dstDevice, size_t dstPitch, + unsigned short us, size_t Width, size_t Height); + CUresult (CUDAAPI * CuMemsetD2D16Async) (CUdeviceptr dstDevice, + size_t dstPitch, unsigned short us, size_t Width, size_t Height, + CUstream hStream); + CUresult (CUDAAPI * CuMemsetD2D32) (CUdeviceptr dstDevice, size_t dstPitch, + unsigned int ui, size_t Width, size_t Height); + CUresult (CUDAAPI * CuMemsetD2D32Async) (CUdeviceptr dstDevice, + size_t dstPitch, unsigned int ui, size_t Width, size_t Height, + CUstream hStream); } GstNvCodecCudaVTable; /* *INDENT-ON* */ @@ -383,6 +399,13 @@ gst_cuda_load_library_once_func (void) LOAD_SYMBOL (cuMemFree, CuMemFree); LOAD_SYMBOL (cuMemFreeHost, CuMemFreeHost); + LOAD_SYMBOL (cuMemsetD2D8, CuMemsetD2D8); + LOAD_SYMBOL (cuMemsetD2D8Async, CuMemsetD2D8Async); + LOAD_SYMBOL (cuMemsetD2D16, CuMemsetD2D16); + LOAD_SYMBOL (cuMemsetD2D16Async, CuMemsetD2D16Async); + LOAD_SYMBOL (cuMemsetD2D32, CuMemsetD2D32); + LOAD_SYMBOL (cuMemsetD2D32Async, CuMemsetD2D32Async); + LOAD_SYMBOL (cuStreamCreate, CuStreamCreate); LOAD_SYMBOL (cuStreamDestroy, CuStreamDestroy); LOAD_SYMBOL (cuStreamSynchronize, CuStreamSynchronize); @@ -1234,6 +1257,63 @@ CuWaitExternalSemaphoresAsync (const CUexternalSemaphore * extSemArray, paramsArray, numExtSems, stream); } +CUresult CUDAAPI +CuMemsetD2D8 (CUdeviceptr dstDevice, size_t dstPitch, unsigned char uc, + size_t Width, size_t Height) +{ + g_assert (gst_cuda_vtable.CuMemsetD2D8); + + return gst_cuda_vtable.CuMemsetD2D8 (dstDevice, dstPitch, uc, Width, Height); +} + +CUresult CUDAAPI +CuMemsetD2D8Async (CUdeviceptr dstDevice, size_t dstPitch, unsigned char uc, + size_t Width, size_t Height, CUstream hStream) +{ + g_assert (gst_cuda_vtable.CuMemsetD2D8Async); + + return gst_cuda_vtable.CuMemsetD2D8Async (dstDevice, + dstPitch, uc, Width, Height, hStream); +} + +CUresult CUDAAPI +CuMemsetD2D16 (CUdeviceptr dstDevice, size_t dstPitch, unsigned short us, + size_t Width, size_t Height) +{ + g_assert (gst_cuda_vtable.CuMemsetD2D16); + + return gst_cuda_vtable.CuMemsetD2D16 (dstDevice, dstPitch, us, Width, Height); +} + +CUresult CUDAAPI +CuMemsetD2D16Async (CUdeviceptr dstDevice, size_t dstPitch, unsigned short us, + size_t Width, size_t Height, CUstream hStream) +{ + g_assert (gst_cuda_vtable.CuMemsetD2D16Async); + + return gst_cuda_vtable.CuMemsetD2D16Async (dstDevice, + dstPitch, us, Width, Height, hStream); +} + +CUresult CUDAAPI +CuMemsetD2D32 (CUdeviceptr dstDevice, size_t dstPitch, unsigned int ui, + size_t Width, size_t Height) +{ + g_assert (gst_cuda_vtable.CuMemsetD2D32); + + return gst_cuda_vtable.CuMemsetD2D32 (dstDevice, dstPitch, ui, Width, Height); +} + +CUresult CUDAAPI +CuMemsetD2D32Async (CUdeviceptr dstDevice, size_t dstPitch, unsigned int ui, + size_t Width, size_t Height, CUstream hStream) +{ + g_assert (gst_cuda_vtable.CuMemsetD2D32Async); + + return gst_cuda_vtable.CuMemsetD2D32Async (dstDevice, + dstPitch, ui, Width, Height, hStream); +} + /* cudaGL.h */ CUresult CUDAAPI CuGraphicsGLRegisterImage (CUgraphicsResource * pCudaResource, diff --git a/subprojects/gst-plugins-bad/gst-libs/gst/cuda/stub/cuda.h b/subprojects/gst-plugins-bad/gst-libs/gst/cuda/stub/cuda.h index 658147c3e2..e24274416b 100644 --- a/subprojects/gst-plugins-bad/gst-libs/gst/cuda/stub/cuda.h +++ b/subprojects/gst-plugins-bad/gst-libs/gst/cuda/stub/cuda.h @@ -495,6 +495,9 @@ typedef struct #define cuMemcpyHtoD cuMemcpyHtoD_v2 #define cuMemcpyHtoDAsync cuMemcpyHtoDAsync_v2 #define cuMemFree cuMemFree_v2 +#define cuMemsetD2D8 cuMemsetD2D8_v2 +#define cuMemsetD2D16 cuMemsetD2D16_v2 +#define cuMemsetD2D32 cuMemsetD2D32_v2 #define cuEventDestroy cuEventDestroy_v2