| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
|
| 8 |
|
| 9 |
|
| 10 |
|
| 11 |
|
| 12 |
|
| 13 |
|
| 14 |
|
| 15 |
|
| 16 |
|
| 17 |
|
| 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 |
|
| 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 |
| 92 |
#endif |
| 93 |
|
| 94 |
#endif |
| 95 |
|