mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-19 23:06:49 +00:00
nvcodec: Indent update
... to prevent gnu indent version dependent diffs. Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1834>
This commit is contained in:
parent
cec7ac2a1b
commit
1b9274307a
5 changed files with 69 additions and 51 deletions
|
@ -40,87 +40,89 @@ GST_DEBUG_CATEGORY_EXTERN (gst_nvcodec_debug);
|
||||||
} \
|
} \
|
||||||
} G_STMT_END;
|
} G_STMT_END;
|
||||||
|
|
||||||
|
/* *INDENT-OFF* */
|
||||||
typedef struct _GstNvCodecCudaVTable
|
typedef struct _GstNvCodecCudaVTable
|
||||||
{
|
{
|
||||||
gboolean loaded;
|
gboolean loaded;
|
||||||
|
|
||||||
CUresult (CUDAAPI * CuInit) (unsigned int Flags);
|
CUresult (CUDAAPI * CuInit) (unsigned int Flags);
|
||||||
CUresult (CUDAAPI * CuGetErrorName) (CUresult error, const char **pStr);
|
CUresult (CUDAAPI * CuGetErrorName) (CUresult error, const char **pStr);
|
||||||
CUresult (CUDAAPI * CuGetErrorString) (CUresult error, const char **pStr);
|
CUresult (CUDAAPI * CuGetErrorString) (CUresult error, const char **pStr);
|
||||||
|
|
||||||
CUresult (CUDAAPI * CuCtxCreate) (CUcontext * pctx, unsigned int flags,
|
CUresult (CUDAAPI * CuCtxCreate) (CUcontext * pctx, unsigned int flags,
|
||||||
CUdevice dev);
|
CUdevice dev);
|
||||||
CUresult (CUDAAPI * CuCtxDestroy) (CUcontext ctx);
|
CUresult (CUDAAPI * CuCtxDestroy) (CUcontext ctx);
|
||||||
CUresult (CUDAAPI * CuCtxPopCurrent) (CUcontext * pctx);
|
CUresult (CUDAAPI * CuCtxPopCurrent) (CUcontext * pctx);
|
||||||
CUresult (CUDAAPI * CuCtxPushCurrent) (CUcontext ctx);
|
CUresult (CUDAAPI * CuCtxPushCurrent) (CUcontext ctx);
|
||||||
|
|
||||||
CUresult (CUDAAPI * CuCtxEnablePeerAccess) (CUcontext peerContext,
|
CUresult (CUDAAPI * CuCtxEnablePeerAccess) (CUcontext peerContext,
|
||||||
unsigned int Flags);
|
unsigned int Flags);
|
||||||
CUresult (CUDAAPI * CuCtxDisablePeerAccess) (CUcontext peerContext);
|
CUresult (CUDAAPI * CuCtxDisablePeerAccess) (CUcontext peerContext);
|
||||||
CUresult (CUDAAPI * CuGraphicsMapResources) (unsigned int count,
|
CUresult (CUDAAPI * CuGraphicsMapResources) (unsigned int count,
|
||||||
CUgraphicsResource * resources, CUstream hStream);
|
CUgraphicsResource * resources, CUstream hStream);
|
||||||
CUresult (CUDAAPI * CuGraphicsUnmapResources) (unsigned int count,
|
CUresult (CUDAAPI * CuGraphicsUnmapResources) (unsigned int count,
|
||||||
CUgraphicsResource * resources, CUstream hStream);
|
CUgraphicsResource * resources, CUstream hStream);
|
||||||
CUresult (CUDAAPI * 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 (CUDAAPI * CuGraphicsResourceGetMappedPointer) (CUdeviceptr *
|
CUresult (CUDAAPI * CuGraphicsResourceGetMappedPointer) (CUdeviceptr *
|
||||||
pDevPtr, size_t * pSize, CUgraphicsResource resource);
|
pDevPtr, size_t * pSize, CUgraphicsResource resource);
|
||||||
CUresult (CUDAAPI *
|
CUresult (CUDAAPI *
|
||||||
CuGraphicsUnregisterResource) (CUgraphicsResource resource);
|
CuGraphicsUnregisterResource) (CUgraphicsResource resource);
|
||||||
|
|
||||||
CUresult (CUDAAPI * CuMemAlloc) (CUdeviceptr * dptr, unsigned int bytesize);
|
CUresult (CUDAAPI * CuMemAlloc) (CUdeviceptr * dptr, unsigned int bytesize);
|
||||||
CUresult (CUDAAPI * 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 (CUDAAPI * CuMemAllocHost) (void **pp, unsigned int bytesize);
|
CUresult (CUDAAPI * CuMemAllocHost) (void **pp, unsigned int bytesize);
|
||||||
CUresult (CUDAAPI * CuMemcpy2D) (const CUDA_MEMCPY2D * pCopy);
|
CUresult (CUDAAPI * CuMemcpy2D) (const CUDA_MEMCPY2D * pCopy);
|
||||||
CUresult (CUDAAPI * CuMemcpy2DAsync) (const CUDA_MEMCPY2D * pCopy,
|
CUresult (CUDAAPI * CuMemcpy2DAsync) (const CUDA_MEMCPY2D * pCopy,
|
||||||
CUstream hStream);
|
CUstream hStream);
|
||||||
|
|
||||||
CUresult (CUDAAPI * CuMemFree) (CUdeviceptr dptr);
|
CUresult (CUDAAPI * CuMemFree) (CUdeviceptr dptr);
|
||||||
CUresult (CUDAAPI * CuMemFreeHost) (void *p);
|
CUresult (CUDAAPI * CuMemFreeHost) (void *p);
|
||||||
|
|
||||||
CUresult (CUDAAPI * CuStreamCreate) (CUstream * phStream,
|
CUresult (CUDAAPI * CuStreamCreate) (CUstream * phStream,
|
||||||
unsigned int Flags);
|
unsigned int Flags);
|
||||||
CUresult (CUDAAPI * CuStreamDestroy) (CUstream hStream);
|
CUresult (CUDAAPI * CuStreamDestroy) (CUstream hStream);
|
||||||
CUresult (CUDAAPI * CuStreamSynchronize) (CUstream hStream);
|
CUresult (CUDAAPI * CuStreamSynchronize) (CUstream hStream);
|
||||||
|
|
||||||
CUresult (CUDAAPI * CuDeviceGet) (CUdevice * device, int ordinal);
|
CUresult (CUDAAPI * CuDeviceGet) (CUdevice * device, int ordinal);
|
||||||
CUresult (CUDAAPI * CuDeviceGetCount) (int *count);
|
CUresult (CUDAAPI * CuDeviceGetCount) (int *count);
|
||||||
CUresult (CUDAAPI * CuDeviceGetName) (char *name, int len, CUdevice dev);
|
CUresult (CUDAAPI * CuDeviceGetName) (char *name, int len, CUdevice dev);
|
||||||
CUresult (CUDAAPI * CuDeviceGetAttribute) (int *pi,
|
CUresult (CUDAAPI * CuDeviceGetAttribute) (int *pi,
|
||||||
CUdevice_attribute attrib, CUdevice dev);
|
CUdevice_attribute attrib, CUdevice dev);
|
||||||
CUresult (CUDAAPI * CuDeviceCanAccessPeer) (int *canAccessPeer,
|
CUresult (CUDAAPI * CuDeviceCanAccessPeer) (int *canAccessPeer,
|
||||||
CUdevice dev, CUdevice peerDev);
|
CUdevice dev, CUdevice peerDev);
|
||||||
CUresult (CUDAAPI * CuDriverGetVersion) (int *driverVersion);
|
CUresult (CUDAAPI * CuDriverGetVersion) (int *driverVersion);
|
||||||
|
|
||||||
CUresult (CUDAAPI * CuModuleLoadData) (CUmodule * module,
|
CUresult (CUDAAPI * CuModuleLoadData) (CUmodule * module,
|
||||||
const void *image);
|
const void *image);
|
||||||
CUresult (CUDAAPI * CuModuleUnload) (CUmodule module);
|
CUresult (CUDAAPI * CuModuleUnload) (CUmodule module);
|
||||||
CUresult (CUDAAPI * CuModuleGetFunction) (CUfunction * hfunc,
|
CUresult (CUDAAPI * CuModuleGetFunction) (CUfunction * hfunc,
|
||||||
CUmodule hmod, const char *name);
|
CUmodule hmod, const char *name);
|
||||||
CUresult (CUDAAPI * CuTexObjectCreate) (CUtexObject * pTexObject,
|
CUresult (CUDAAPI * CuTexObjectCreate) (CUtexObject * pTexObject,
|
||||||
const CUDA_RESOURCE_DESC * pResDesc, const CUDA_TEXTURE_DESC * pTexDesc,
|
const CUDA_RESOURCE_DESC * pResDesc, const CUDA_TEXTURE_DESC * pTexDesc,
|
||||||
const CUDA_RESOURCE_VIEW_DESC * pResViewDesc);
|
const CUDA_RESOURCE_VIEW_DESC * pResViewDesc);
|
||||||
CUresult (CUDAAPI * CuTexObjectDestroy) (CUtexObject texObject);
|
CUresult (CUDAAPI * CuTexObjectDestroy) (CUtexObject texObject);
|
||||||
CUresult (CUDAAPI * CuLaunchKernel) (CUfunction f, unsigned int gridDimX,
|
CUresult (CUDAAPI * CuLaunchKernel) (CUfunction f, unsigned int gridDimX,
|
||||||
unsigned int gridDimY, unsigned int gridDimZ,
|
unsigned int gridDimY, unsigned int gridDimZ,
|
||||||
unsigned int blockDimX, unsigned int blockDimY, unsigned int blockDimZ,
|
unsigned int blockDimX, unsigned int blockDimY, unsigned int blockDimZ,
|
||||||
unsigned int sharedMemBytes, CUstream hStream, void **kernelParams,
|
unsigned int sharedMemBytes, CUstream hStream, void **kernelParams,
|
||||||
void **extra);
|
void **extra);
|
||||||
|
|
||||||
CUresult (CUDAAPI * CuGraphicsGLRegisterImage) (CUgraphicsResource *
|
CUresult (CUDAAPI * CuGraphicsGLRegisterImage) (CUgraphicsResource *
|
||||||
pCudaResource, unsigned int image, unsigned int target,
|
pCudaResource, unsigned int image, unsigned int target,
|
||||||
unsigned int Flags);
|
unsigned int Flags);
|
||||||
CUresult (CUDAAPI * CuGraphicsGLRegisterBuffer) (CUgraphicsResource *
|
CUresult (CUDAAPI * CuGraphicsGLRegisterBuffer) (CUgraphicsResource *
|
||||||
pCudaResource, unsigned int buffer, unsigned int Flags);
|
pCudaResource, unsigned int buffer, unsigned int Flags);
|
||||||
CUresult (CUDAAPI *
|
CUresult (CUDAAPI *
|
||||||
CuGraphicsResourceSetMapFlags) (CUgraphicsResource resource,
|
CuGraphicsResourceSetMapFlags) (CUgraphicsResource resource,
|
||||||
unsigned int flags);
|
unsigned int flags);
|
||||||
CUresult (CUDAAPI * CuGLGetDevices) (unsigned int *pCudaDeviceCount,
|
CUresult (CUDAAPI * CuGLGetDevices) (unsigned int *pCudaDeviceCount,
|
||||||
CUdevice * pCudaDevices, unsigned int cudaDeviceCount,
|
CUdevice * pCudaDevices, unsigned int cudaDeviceCount,
|
||||||
CUGLDeviceList deviceList);
|
CUGLDeviceList deviceList);
|
||||||
} GstNvCodecCudaVTable;
|
} GstNvCodecCudaVTable;
|
||||||
|
/* *INDENT-ON* */
|
||||||
|
|
||||||
static GstNvCodecCudaVTable gst_cuda_vtable = { 0, };
|
static GstNvCodecCudaVTable gst_cuda_vtable = { 0, };
|
||||||
|
|
||||||
|
@ -305,6 +307,7 @@ CuGraphicsSubResourceGetMappedArray (CUarray * pArray,
|
||||||
arrayIndex, mipLevel);
|
arrayIndex, mipLevel);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* *INDENT-OFF* */
|
||||||
CUresult CUDAAPI
|
CUresult CUDAAPI
|
||||||
CuGraphicsResourceGetMappedPointer (CUdeviceptr * pDevPtr, size_t * pSize,
|
CuGraphicsResourceGetMappedPointer (CUdeviceptr * pDevPtr, size_t * pSize,
|
||||||
CUgraphicsResource resource)
|
CUgraphicsResource resource)
|
||||||
|
@ -314,6 +317,7 @@ CuGraphicsResourceGetMappedPointer (CUdeviceptr * pDevPtr, size_t * pSize,
|
||||||
return gst_cuda_vtable.CuGraphicsResourceGetMappedPointer (pDevPtr, pSize,
|
return gst_cuda_vtable.CuGraphicsResourceGetMappedPointer (pDevPtr, pSize,
|
||||||
resource);
|
resource);
|
||||||
}
|
}
|
||||||
|
/* *INDENT-ON* */
|
||||||
|
|
||||||
CUresult CUDAAPI
|
CUresult CUDAAPI
|
||||||
CuGraphicsUnregisterResource (CUgraphicsResource resource)
|
CuGraphicsUnregisterResource (CUgraphicsResource resource)
|
||||||
|
@ -331,6 +335,7 @@ CuMemAlloc (CUdeviceptr * dptr, unsigned int bytesize)
|
||||||
return gst_cuda_vtable.CuMemAlloc (dptr, bytesize);
|
return gst_cuda_vtable.CuMemAlloc (dptr, bytesize);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* *INDENT-OFF* */
|
||||||
CUresult CUDAAPI
|
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)
|
||||||
|
@ -340,6 +345,7 @@ CuMemAllocPitch (CUdeviceptr * dptr, size_t * pPitch, size_t WidthInBytes,
|
||||||
return gst_cuda_vtable.CuMemAllocPitch (dptr, pPitch, WidthInBytes, Height,
|
return gst_cuda_vtable.CuMemAllocPitch (dptr, pPitch, WidthInBytes, Height,
|
||||||
ElementSizeBytes);
|
ElementSizeBytes);
|
||||||
}
|
}
|
||||||
|
/* *INDENT-ON* */
|
||||||
|
|
||||||
CUresult CUDAAPI
|
CUresult CUDAAPI
|
||||||
CuMemAllocHost (void **pp, unsigned int bytesize)
|
CuMemAllocHost (void **pp, unsigned int bytesize)
|
||||||
|
|
|
@ -251,7 +251,10 @@ gst_cuda_memory_download_transfer (GstCudaMemory * mem)
|
||||||
}
|
}
|
||||||
gst_cuda_result (CuStreamSynchronize (NULL));
|
gst_cuda_result (CuStreamSynchronize (NULL));
|
||||||
|
|
||||||
return ! !mem->map_data;
|
if (!mem->map_data)
|
||||||
|
return FALSE;
|
||||||
|
|
||||||
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
static gpointer
|
static gpointer
|
||||||
|
|
|
@ -156,8 +156,8 @@ gst_cuda_scale_fixate_caps (GstBaseTransform * base, GstPadDirection direction,
|
||||||
{
|
{
|
||||||
GstStructure *ins, *outs;
|
GstStructure *ins, *outs;
|
||||||
const GValue *from_par, *to_par;
|
const GValue *from_par, *to_par;
|
||||||
GValue fpar = { 0, }, tpar = {
|
GValue fpar = G_VALUE_INIT;
|
||||||
0,};
|
GValue tpar = G_VALUE_INIT;
|
||||||
|
|
||||||
othercaps = gst_caps_truncate (othercaps);
|
othercaps = gst_caps_truncate (othercaps);
|
||||||
othercaps = gst_caps_make_writable (othercaps);
|
othercaps = gst_caps_make_writable (othercaps);
|
||||||
|
|
|
@ -136,7 +136,10 @@ gst_cuvid_get_api_version (guint * api_major_ver, guint * api_minor_ver)
|
||||||
gboolean
|
gboolean
|
||||||
gst_cuvid_can_get_decoder_caps (void)
|
gst_cuvid_can_get_decoder_caps (void)
|
||||||
{
|
{
|
||||||
return ! !gst_cuvid_vtable.CuvidGetDecoderCaps;
|
if (gst_cuvid_vtable.CuvidGetDecoderCaps)
|
||||||
|
return TRUE;
|
||||||
|
|
||||||
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
CUresult CUDAAPI
|
CUresult CUDAAPI
|
||||||
|
|
|
@ -42,22 +42,24 @@ GST_DEBUG_CATEGORY_EXTERN (gst_nvcodec_debug);
|
||||||
} \
|
} \
|
||||||
} G_STMT_END;
|
} G_STMT_END;
|
||||||
|
|
||||||
|
/* *INDENT-OFF* */
|
||||||
typedef struct _GstNvCodecNvrtcVtahle
|
typedef struct _GstNvCodecNvrtcVtahle
|
||||||
{
|
{
|
||||||
gboolean loaded;
|
gboolean loaded;
|
||||||
|
|
||||||
nvrtcResult (*NvrtcCompileProgram) (nvrtcProgram prog, int numOptions,
|
nvrtcResult (*NvrtcCompileProgram) (nvrtcProgram prog, int numOptions,
|
||||||
const char **options);
|
const char **options);
|
||||||
nvrtcResult (*NvrtcCreateProgram) (nvrtcProgram * prog, const char *src,
|
nvrtcResult (*NvrtcCreateProgram) (nvrtcProgram * prog, const char *src,
|
||||||
const char *name, int numHeaders, const char **headers,
|
const char *name, int numHeaders, const char **headers,
|
||||||
const char **includeNames);
|
const char **includeNames);
|
||||||
nvrtcResult (*NvrtcDestroyProgram) (nvrtcProgram * prog);
|
nvrtcResult (*NvrtcDestroyProgram) (nvrtcProgram * prog);
|
||||||
nvrtcResult (*NvrtcGetPTX) (nvrtcProgram prog, char *ptx);
|
nvrtcResult (*NvrtcGetPTX) (nvrtcProgram prog, char *ptx);
|
||||||
nvrtcResult (*NvrtcGetPTXSize) (nvrtcProgram prog, size_t * ptxSizeRet);
|
nvrtcResult (*NvrtcGetPTXSize) (nvrtcProgram prog, size_t * ptxSizeRet);
|
||||||
nvrtcResult (*NvrtcGetProgramLog) (nvrtcProgram prog, char *log);
|
nvrtcResult (*NvrtcGetProgramLog) (nvrtcProgram prog, char *log);
|
||||||
nvrtcResult (*NvrtcGetProgramLogSize) (nvrtcProgram prog,
|
nvrtcResult (*NvrtcGetProgramLogSize) (nvrtcProgram prog,
|
||||||
size_t * logSizeRet);
|
size_t * logSizeRet);
|
||||||
} GstNvCodecNvrtcVtahle;
|
} GstNvCodecNvrtcVtahle;
|
||||||
|
/* *INDENT-ON* */
|
||||||
|
|
||||||
static GstNvCodecNvrtcVtahle gst_nvrtc_vtable = { 0, };
|
static GstNvCodecNvrtcVtahle gst_nvrtc_vtable = { 0, };
|
||||||
|
|
||||||
|
@ -174,6 +176,7 @@ NvrtcGetPTX (nvrtcProgram prog, char *ptx)
|
||||||
return gst_nvrtc_vtable.NvrtcGetPTX (prog, ptx);
|
return gst_nvrtc_vtable.NvrtcGetPTX (prog, ptx);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* *INDENT-OFF* */
|
||||||
nvrtcResult
|
nvrtcResult
|
||||||
NvrtcGetPTXSize (nvrtcProgram prog, size_t * ptxSizeRet)
|
NvrtcGetPTXSize (nvrtcProgram prog, size_t * ptxSizeRet)
|
||||||
{
|
{
|
||||||
|
@ -181,6 +184,7 @@ NvrtcGetPTXSize (nvrtcProgram prog, size_t * ptxSizeRet)
|
||||||
|
|
||||||
return gst_nvrtc_vtable.NvrtcGetPTXSize (prog, ptxSizeRet);
|
return gst_nvrtc_vtable.NvrtcGetPTXSize (prog, ptxSizeRet);
|
||||||
}
|
}
|
||||||
|
/* *INDENT-ON* */
|
||||||
|
|
||||||
nvrtcResult
|
nvrtcResult
|
||||||
NvrtcGetProgramLog (nvrtcProgram prog, char *log)
|
NvrtcGetProgramLog (nvrtcProgram prog, char *log)
|
||||||
|
@ -190,6 +194,7 @@ NvrtcGetProgramLog (nvrtcProgram prog, char *log)
|
||||||
return gst_nvrtc_vtable.NvrtcGetProgramLog (prog, log);
|
return gst_nvrtc_vtable.NvrtcGetProgramLog (prog, log);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* *INDENT-OFF* */
|
||||||
nvrtcResult
|
nvrtcResult
|
||||||
NvrtcGetProgramLogSize (nvrtcProgram prog, size_t * logSizeRet)
|
NvrtcGetProgramLogSize (nvrtcProgram prog, size_t * logSizeRet)
|
||||||
{
|
{
|
||||||
|
@ -197,3 +202,4 @@ NvrtcGetProgramLogSize (nvrtcProgram prog, size_t * logSizeRet)
|
||||||
|
|
||||||
return gst_nvrtc_vtable.NvrtcGetProgramLogSize (prog, logSizeRet);
|
return gst_nvrtc_vtable.NvrtcGetProgramLogSize (prog, logSizeRet);
|
||||||
}
|
}
|
||||||
|
/* *INDENT-ON* */
|
||||||
|
|
Loading…
Reference in a new issue