2022-12-07 20:58:48 +00:00
|
|
|
/* GStreamer
|
|
|
|
* Copyright (C) 2022 Seungha Yang <seungha@centricular.com>
|
|
|
|
*
|
|
|
|
* This library is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU Library General Public
|
|
|
|
* License as published by the Free Software Foundation; either
|
|
|
|
* version 2 of the License, or (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This library is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
|
* Library General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU Library General Public
|
|
|
|
* License along with this library; if not, write to the
|
|
|
|
* Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
|
|
|
|
* Boston, MA 02110-1301, USA.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
2022-12-21 14:57:15 +00:00
|
|
|
#include <gst/cuda/cuda-prelude.h>
|
|
|
|
#include <gst/cuda/cuda-gst.h>
|
|
|
|
#include <gst/cuda/gstcudacontext.h>
|
2022-12-21 17:27:36 +00:00
|
|
|
#include <gst/cuda/gstcudastream.h>
|
2022-12-07 20:58:48 +00:00
|
|
|
|
|
|
|
#include <gst/video/video.h>
|
|
|
|
|
|
|
|
G_BEGIN_DECLS
|
|
|
|
|
|
|
|
typedef enum
|
|
|
|
{
|
|
|
|
GST_CUDA_BUFFER_COPY_SYSTEM,
|
|
|
|
GST_CUDA_BUFFER_COPY_CUDA,
|
|
|
|
GST_CUDA_BUFFER_COPY_GL,
|
|
|
|
GST_CUDA_BUFFER_COPY_D3D11,
|
|
|
|
GST_CUDA_BUFFER_COPY_NVMM,
|
|
|
|
} GstCudaBufferCopyType;
|
|
|
|
|
|
|
|
GST_CUDA_API
|
|
|
|
const gchar * gst_cuda_buffer_copy_type_to_string (GstCudaBufferCopyType type);
|
|
|
|
|
|
|
|
GST_CUDA_API
|
|
|
|
gboolean gst_cuda_buffer_copy (GstBuffer * dst,
|
|
|
|
GstCudaBufferCopyType dst_type,
|
|
|
|
const GstVideoInfo * dst_info,
|
|
|
|
GstBuffer * src,
|
|
|
|
GstCudaBufferCopyType src_type,
|
|
|
|
const GstVideoInfo * src_info,
|
|
|
|
GstCudaContext * context,
|
2022-12-21 17:27:36 +00:00
|
|
|
GstCudaStream * stream);
|
2022-12-07 20:58:48 +00:00
|
|
|
|
2023-06-08 12:29:32 +00:00
|
|
|
GST_CUDA_API
|
|
|
|
void gst_cuda_memory_set_from_fixed_pool (GstMemory * mem);
|
|
|
|
|
|
|
|
GST_CUDA_API
|
|
|
|
gboolean gst_cuda_memory_is_from_fixed_pool (GstMemory * mem);
|
|
|
|
|
2023-08-09 16:58:57 +00:00
|
|
|
gboolean gst_cuda_virtual_memory_symbol_loaded (void);
|
|
|
|
|
2023-08-09 16:37:59 +00:00
|
|
|
gpointer gst_cuda_get_win32_handle_metadata (void);
|
|
|
|
|
2022-12-07 20:58:48 +00:00
|
|
|
G_END_DECLS
|
|
|
|
|
2023-02-05 10:50:36 +00:00
|
|
|
#ifdef __cplusplus
|
|
|
|
#include <mutex>
|
|
|
|
|
|
|
|
#define GST_CUDA_CALL_ONCE_BEGIN \
|
|
|
|
static std::once_flag __once_flag; \
|
|
|
|
std::call_once (__once_flag, [&]()
|
|
|
|
|
|
|
|
#define GST_CUDA_CALL_ONCE_END )
|
|
|
|
|
|
|
|
#endif /* __cplusplus */
|
|
|
|
|