Debian Codegraph @

gst-libs/gst/cuda/gstcuda-private.h

raw symbols SCIP
1 /* GStreamer
2 * Copyright (C) 2022 Seungha Yang <[email protected]>
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 #pragma once
21
22 #include <gst/cuda/cuda-prelude.h>
23 #include <gst/cuda/cuda-gst.h>
24 #include <gst/cuda/gstcudacontext.h>
25 #include <gst/cuda/gstcudastream.h>
26
27 #include <gst/video/video.h>
28
29 G_BEGIN_DECLS
30
31 typedef enum
32 {
33 GST_CUDA_BUFFER_COPY_SYSTEM,
34 GST_CUDA_BUFFER_COPY_CUDA,
35 GST_CUDA_BUFFER_COPY_GL,
36 GST_CUDA_BUFFER_COPY_D3D11,
37 GST_CUDA_BUFFER_COPY_NVMM,
38 } GstCudaBufferCopyType;
39
40 GST_CUDA_API
41 const gchar * gst_cuda_buffer_copy_type_to_string (GstCudaBufferCopyType type);
42
43 GST_CUDA_API
44 gboolean gst_cuda_buffer_copy (GstBuffer * dst,
45 GstCudaBufferCopyType dst_type,
46 const GstVideoInfo * dst_info,
47 GstBuffer * src,
48 GstCudaBufferCopyType src_type,
49 const GstVideoInfo * src_info,
50 GstCudaContext * context,
51 GstCudaStream * stream);
52
53 GST_CUDA_API
54 void gst_cuda_memory_set_from_fixed_pool (GstMemory * mem);
55
56 GST_CUDA_API
57 gboolean gst_cuda_memory_is_from_fixed_pool (GstMemory * mem);
58
59 GST_CUDA_API
60 gboolean gst_cuda_memory_is_stream_ordered (GstMemory * mem);
61
62 gpointer gst_cuda_get_win32_handle_metadata (void);
63
64 G_END_DECLS
65
66 #ifdef __cplusplus
67 #include <mutex>
68
69 #define GST_CUDA_CALL_ONCE_BEGIN \
70 static std::once_flag __once_flag; \
71 std::call_once (__once_flag, [&]()
72
73 #define GST_CUDA_CALL_ONCE_END )
74
75 /* cudaEGL.h */
76 #if defined(HAVE_CUDA_NVMM_JETSON) && defined(HAVE_CUDA_GST_GL)
77 #include <gst/gl/gstglconfig.h>
78 #if GST_GL_HAVE_PLATFORM_EGL
79 #include <cudaEGL.h>
80 #include <gst/gl/egl/egl.h>
81 GST_CUDA_API
82 CUresult CUDAAPI CuGraphicsEGLRegisterImage (CUgraphicsResource *pCudaResource,
83 EGLImageKHR image,
84 unsigned int flags);
85
86 GST_CUDA_API
87 CUresult CUDAAPI CuGraphicsResourceGetMappedEglFrame(CUeglFrame* eglFrame,
88 CUgraphicsResource resource,
89 unsigned int index,
90 unsigned int mipLevel);
91 #endif /* HAVE_CUDA_GST_GL */
92 #endif /* HAVE_CUDA_NVMM_JETSON */
93
94 #endif /* __cplusplus */
95