nvcodec: Fix crash on 32-bit Windows
[platform/upstream/gstreamer.git] / sys / nvcodec / gstcudaloader.h
1 /* GStreamer
2  * Copyright (C) 2019 Seungha Yang <seungha.yang@navercorp.com>
3  *
4  * This library is free software; you can redistribute it and/or
5  * modify it under the terms of the GNU Library General Public
6  * License as published by the Free Software Foundation; either
7  * version 2 of the License, or (at your option) any later version.
8  *
9  * This library is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
12  * Library General Public License for more details.
13  *
14  * You should have received a copy of the GNU Library General Public
15  * License along with this library; if not, write to the
16  * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
17  * Boston, MA 02110-1301, USA.
18  */
19
20 #ifndef __GST_CUDA_LOADER_H__
21 #define __GST_CUDA_LOADER_H__
22
23 #include "stub/cuda.h"
24
25 #include <gst/gst.h>
26
27 G_BEGIN_DECLS
28
29 G_GNUC_INTERNAL
30 gboolean gst_cuda_load_library (void);
31
32 /* cuda.h */
33 G_GNUC_INTERNAL
34 CUresult CUDAAPI CuInit             (unsigned int Flags);
35
36 G_GNUC_INTERNAL
37 CUresult CUDAAPI CuGetErrorName     (CUresult error,
38                                      const char **pStr);
39
40 G_GNUC_INTERNAL
41 CUresult CUDAAPI CuGetErrorString   (CUresult error,
42                                      const char **pStr);
43
44 G_GNUC_INTERNAL
45 CUresult CUDAAPI CuCtxCreate        (CUcontext * pctx,
46                                      unsigned int flags,
47                                      CUdevice dev);
48
49 G_GNUC_INTERNAL
50 CUresult CUDAAPI CuCtxDestroy       (CUcontext ctx);
51
52 G_GNUC_INTERNAL
53 CUresult CUDAAPI CuCtxPopCurrent    (CUcontext * pctx);
54
55 G_GNUC_INTERNAL
56 CUresult CUDAAPI CuCtxPushCurrent   (CUcontext ctx);
57
58 G_GNUC_INTERNAL
59 CUresult CUDAAPI CuGraphicsMapResources     (unsigned int count,
60                                              CUgraphicsResource * resources,
61                                              CUstream hStream);
62
63 G_GNUC_INTERNAL
64 CUresult CUDAAPI CuGraphicsUnmapResources   (unsigned int count,
65                                              CUgraphicsResource * resources,
66                                              CUstream hStream);
67
68 G_GNUC_INTERNAL
69 CUresult CUDAAPI CuGraphicsSubResourceGetMappedArray    (CUarray * pArray,
70                                                          CUgraphicsResource resource,
71                                                          unsigned int arrayIndex,
72                                                          unsigned int mipLevel);
73
74 G_GNUC_INTERNAL
75 CUresult CUDAAPI CuGraphicsResourceGetMappedPointer     (CUdeviceptr * pDevPtr,
76                                                          size_t * pSize,
77                                                          CUgraphicsResource resource);
78
79 G_GNUC_INTERNAL
80 CUresult CUDAAPI CuGraphicsUnregisterResource           (CUgraphicsResource resource);
81
82 G_GNUC_INTERNAL
83 CUresult CUDAAPI CuMemAlloc         (CUdeviceptr * dptr,
84                                      unsigned int bytesize);
85
86 G_GNUC_INTERNAL
87 CUresult CUDAAPI CuMemAllocPitch    (CUdeviceptr * dptr,
88                                      size_t * pPitch,
89                                      size_t WidthInBytes,
90                                      size_t Height,
91                                      unsigned int ElementSizeBytes);
92
93 G_GNUC_INTERNAL
94 CUresult CUDAAPI CuMemcpy2D         (const CUDA_MEMCPY2D * pCopy);
95
96 G_GNUC_INTERNAL
97 CUresult CUDAAPI CuMemcpy2DAsync    (const CUDA_MEMCPY2D *pCopy, CUstream hStream);
98
99 G_GNUC_INTERNAL
100 CUresult CUDAAPI CuMemFree          (CUdeviceptr dptr);
101
102 G_GNUC_INTERNAL
103 CUresult CUDAAPI CuStreamCreate     (CUstream *phStream,
104                                      unsigned int Flags);
105
106 G_GNUC_INTERNAL
107 CUresult CUDAAPI CuStreamDestroy    (CUstream hStream);
108
109 G_GNUC_INTERNAL
110 CUresult CUDAAPI CuStreamSynchronize (CUstream hStream);
111
112 G_GNUC_INTERNAL
113 CUresult CUDAAPI CuDeviceGet        (CUdevice * device,
114                                      int ordinal);
115
116 G_GNUC_INTERNAL
117 CUresult CUDAAPI CuDeviceGetCount   (int *count);
118
119 G_GNUC_INTERNAL
120 CUresult CUDAAPI CuDeviceGetName    (char *name,
121                                      int len,
122                                      CUdevice dev);
123
124 G_GNUC_INTERNAL
125 CUresult CUDAAPI CuDeviceGetAttribute (int *pi,
126                                        CUdevice_attribute attrib,
127                                        CUdevice dev);
128
129 /* cudaGL.h */
130 G_GNUC_INTERNAL
131 CUresult CUDAAPI CuGraphicsGLRegisterImage  (CUgraphicsResource * pCudaResource,
132                                              unsigned int image,
133                                              unsigned int target,
134                                              unsigned int Flags);
135
136 G_GNUC_INTERNAL
137 CUresult CUDAAPI CuGraphicsGLRegisterBuffer (CUgraphicsResource * pCudaResource,
138                                              unsigned int buffer,
139                                              unsigned int Flags);
140
141 G_GNUC_INTERNAL
142 CUresult CUDAAPI CuGraphicsResourceSetMapFlags (CUgraphicsResource resource,
143                                                 unsigned int flags);
144
145 G_END_DECLS
146 #endif /* __GST_CUDA_LOADER_H__ */