cuda: Provide single header include entry point

Add "gstcuda.h" header file

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3629>
This commit is contained in:
Seungha Yang 2022-12-21 23:57:15 +09:00 committed by GStreamer Marge Bot
parent c0a4f41525
commit 661b5f60c6
28 changed files with 80 additions and 113 deletions

View file

@ -1,6 +1,6 @@
#pragma once #pragma once
#include "cuda-prelude.h" #include <gst/cuda/cuda-prelude.h>
#include <cuda.h> #include <cuda.h>
#include <cudaGL.h> #include <cudaGL.h>

View file

@ -19,8 +19,9 @@
#pragma once #pragma once
#include "cuda-prelude.h" #include <gst/cuda/cuda-prelude.h>
#include "cuda-gst.h" #include <gst/cuda/cuda-gst.h>
#include <gst/cuda/gstcudacontext.h>
#include <gst/video/video.h> #include <gst/video/video.h>

View file

@ -0,0 +1,36 @@
/* 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
#ifndef GST_USE_UNSTABLE_API
#pragma message ("The Cuda library from gst-plugins-bad is unstable API and may change in future.")
#pragma message ("You can define GST_USE_UNSTABLE_API to avoid this warning.")
#endif
#include <gst/gst.h>
#include <gst/cuda/cuda-prelude.h>
#include <gst/cuda/cuda-gst.h>
#include <gst/cuda/gstcudabufferpool.h>
#include <gst/cuda/gstcudacontext.h>
#include <gst/cuda/gstcudaloader.h>
#include <gst/cuda/gstcudamemory.h>
#include <gst/cuda/gstcudanvrtc.h>
#include <gst/cuda/gstcudautils.h>

View file

@ -17,19 +17,12 @@
* Boston, MA 02110-1301, USA. * Boston, MA 02110-1301, USA.
*/ */
#ifndef __GST_CUDA_BUFFER_POOL_H__ #pragma once
#define __GST_CUDA_BUFFER_POOL_H__
#ifndef GST_USE_UNSTABLE_API #include <gst/video/video.h>
#warning "The Cuda library from gst-plugins-bad is unstable API and may change in future."
#warning "You can define GST_USE_UNSTABLE_API to avoid this warning."
#endif
#include "cuda-prelude.h" #include <gst/cuda/cuda-prelude.h>
#include <gst/video/gstvideometa.h> #include <gst/cuda/gstcudamemory.h>
#include <gst/video/gstvideopool.h>
#include "gstcudamemory.h"
G_BEGIN_DECLS G_BEGIN_DECLS
@ -80,4 +73,3 @@ GstBufferPool * gst_cuda_buffer_pool_new (GstCudaContext * context);
G_END_DECLS G_END_DECLS
#endif /* __GST_CUDA_BUFFER_POOL_H__ */

View file

@ -17,17 +17,11 @@
* Boston, MA 02110-1301, USA. * Boston, MA 02110-1301, USA.
*/ */
#ifndef __GST_CUDA_CONTEXT_H__ #pragma once
#define __GST_CUDA_CONTEXT_H__
#ifndef GST_USE_UNSTABLE_API
#warning "The Cuda library from gst-plugins-bad is unstable API and may change in future."
#warning "You can define GST_USE_UNSTABLE_API to avoid this warning."
#endif
#include "cuda-prelude.h"
#include <gst/gst.h> #include <gst/gst.h>
#include "cuda.h" #include <gst/cuda/cuda-prelude.h>
#include <gst/cuda/cuda-gst.h>
G_BEGIN_DECLS G_BEGIN_DECLS
@ -101,4 +95,3 @@ gboolean gst_cuda_context_can_access_peer (GstCudaContext * ctx,
G_END_DECLS G_END_DECLS
#endif /* __GST_CUDA_CONTEXT_H__ */

View file

@ -17,19 +17,10 @@
* Boston, MA 02110-1301, USA. * Boston, MA 02110-1301, USA.
*/ */
#ifndef __GST_CUDA_LOADER_H__ #pragma once
#define __GST_CUDA_LOADER_H__
#ifndef GST_USE_UNSTABLE_API
#warning "The Cuda library from gst-plugins-bad is unstable API and may change in future."
#warning "You can define GST_USE_UNSTABLE_API to avoid this warning."
#endif
#include "cuda.h"
#include "cudaGL.h"
#include "cuda-prelude.h"
#include <gst/gst.h> #include <gst/gst.h>
#include <gst/cuda/cuda-prelude.h>
G_BEGIN_DECLS G_BEGIN_DECLS
@ -37,4 +28,3 @@ GST_CUDA_API
gboolean gst_cuda_load_library (void); gboolean gst_cuda_load_library (void);
G_END_DECLS G_END_DECLS
#endif /* __GST_CUDA_LOADER_H__ */

View file

@ -17,20 +17,13 @@
* Boston, MA 02110-1301, USA. * Boston, MA 02110-1301, USA.
*/ */
#ifndef __GST_CUDA_MEMORY_H__ #pragma once
#define __GST_CUDA_MEMORY_H__
#ifndef GST_USE_UNSTABLE_API
#warning "The Cuda library from gst-plugins-bad is unstable API and may change in future."
#warning "You can define GST_USE_UNSTABLE_API to avoid this warning."
#endif
#include "cuda-prelude.h"
#include <gst/gst.h> #include <gst/gst.h>
#include <gst/gstallocator.h> #include <gst/gstallocator.h>
#include <gst/video/video.h> #include <gst/video/video.h>
#include "gstcudaloader.h" #include <gst/cuda/cuda-prelude.h>
#include "gstcudacontext.h" #include <gst/cuda/gstcudacontext.h>
G_BEGIN_DECLS G_BEGIN_DECLS
@ -159,4 +152,3 @@ GstMemory * gst_cuda_allocator_alloc (GstCudaAllocator * allocator,
G_END_DECLS G_END_DECLS
#endif /* __GST_CUDA_MEMORY_H__ */

View file

@ -17,16 +17,10 @@
* Boston, MA 02110-1301, USA. * Boston, MA 02110-1301, USA.
*/ */
#ifndef __GST_CUDA_NVRTC_H__ #pragma once
#define __GST_CUDA_NVRTC_H__
#ifndef GST_USE_UNSTABLE_API
#warning "The Cuda library from gst-plugins-bad is unstable API and may change in future."
#warning "You can define GST_USE_UNSTABLE_API to avoid this warning."
#endif
#include "cuda-prelude.h"
#include <gst/gst.h> #include <gst/gst.h>
#include <gst/cuda/cuda-prelude.h>
G_BEGIN_DECLS G_BEGIN_DECLS
@ -38,4 +32,3 @@ gchar * gst_cuda_nvrtc_compile (const gchar * source);
G_END_DECLS G_END_DECLS
#endif /* __GST_CUDA_NVRTC_H__ */

View file

@ -17,21 +17,13 @@
* Boston, MA 02110-1301, USA. * Boston, MA 02110-1301, USA.
*/ */
#ifndef __GST_CUDA_UTILS_H__ #pragma once
#define __GST_CUDA_UTILS_H__
#ifndef GST_USE_UNSTABLE_API
#warning "The Cuda library from gst-plugins-bad is unstable API and may change in future."
#warning "You can define GST_USE_UNSTABLE_API to avoid this warning."
#endif
#include "cuda-prelude.h"
#include <gst/gst.h> #include <gst/gst.h>
#include <gst/video/video.h> #include <gst/video/video.h>
#include "cuda-gst.h" #include <gst/cuda/cuda-prelude.h>
#include "gstcudaloader.h" #include <gst/cuda/cuda-gst.h>
#include "gstcudacontext.h" #include <gst/cuda/gstcudacontext.h>
#include "gstcudamemory.h"
G_BEGIN_DECLS G_BEGIN_DECLS
@ -186,4 +178,3 @@ void gst_cuda_graphics_resource_free (GstCudaGraphicsResource * resou
G_END_DECLS G_END_DECLS
#endif /* __GST_CUDA_UTILS_H__ */

View file

@ -1,20 +1,21 @@
cuda_sources = files([ cuda_sources = files([
'gstcudaloader.c',
'gstcudacontext.c',
'gstcudautils.c',
'gstcudamemory.c',
'gstcudabufferpool.c', 'gstcudabufferpool.c',
'gstcudacontext.c',
'gstcudaloader.c',
'gstcudamemory.c',
'gstcudanvrtc.c', 'gstcudanvrtc.c',
'gstcudautils.c',
]) ])
cuda_headers = files([ cuda_headers = files([
'cuda-prelude.h', 'cuda-prelude.h',
'gstcudabufferpool.h', 'gstcuda.h',
'gstcudacontext.h', 'gstcudabufferpool.h',
'gstcudaloader.h', 'gstcudacontext.h',
'gstcudamemory.h', 'gstcudaloader.h',
'gstcudanvrtc.h', 'gstcudamemory.h',
'gstcudautils.h', 'gstcudanvrtc.h',
'gstcudautils.h',
]) ])
gstcuda_dep = dependency('', required : false) gstcuda_dep = dependency('', required : false)
@ -110,7 +111,7 @@ pkgconfig.generate(gstcuda,
description : 'Unstable library to work with CUDA inside GStreamer', description : 'Unstable library to work with CUDA inside GStreamer',
) )
install_headers(cuda_headers + ['cuda-gst.h'], subdir : 'gstreamer-1.0/gst/cuda') install_headers(cuda_headers + ['cuda-gst.h', 'gstcuda.h'], subdir : 'gstreamer-1.0/gst/cuda')
gstcuda_dep = declare_dependency(link_with : gstcuda, gstcuda_dep = declare_dependency(link_with : gstcuda,
include_directories : [libsinc], include_directories : [libsinc],
dependencies : [gstbase_dep, gmodule_dep, gstvideo_dep, gstglproto_dep], dependencies : [gstbase_dep, gmodule_dep, gstvideo_dep, gstglproto_dep],

View file

@ -29,8 +29,6 @@
# include <config.h> # include <config.h>
#endif #endif
#include <gst/cuda/gstcudautils.h>
#include "gstcudabasetransform.h" #include "gstcudabasetransform.h"
GST_DEBUG_CATEGORY_STATIC (gst_cuda_base_transform_debug); GST_DEBUG_CATEGORY_STATIC (gst_cuda_base_transform_debug);

View file

@ -23,8 +23,7 @@
#include <gst/gst.h> #include <gst/gst.h>
#include <gst/base/gstbasetransform.h> #include <gst/base/gstbasetransform.h>
#include <gst/video/video.h> #include <gst/video/video.h>
#include <gst/cuda/gstcudacontext.h> #include <gst/cuda/gstcuda.h>
#include <gst/cuda/gstcudabufferpool.h>
G_BEGIN_DECLS G_BEGIN_DECLS

View file

@ -22,9 +22,6 @@
#endif #endif
#include "gstcudaconverter.h" #include "gstcudaconverter.h"
#include <gst/cuda/gstcudautils.h>
#include <gst/cuda/gstcudaloader.h>
#include <gst/cuda/gstcudanvrtc.h>
#include <string.h> #include <string.h>
GST_DEBUG_CATEGORY_STATIC (gst_cuda_converter_debug); GST_DEBUG_CATEGORY_STATIC (gst_cuda_converter_debug);

View file

@ -20,7 +20,7 @@
#pragma once #pragma once
#include <gst/video/video.h> #include <gst/video/video.h>
#include <gst/cuda/gstcudacontext.h> #include <gst/cuda/gstcuda.h>
G_BEGIN_DECLS G_BEGIN_DECLS

View file

@ -21,8 +21,7 @@
#include "config.h" #include "config.h"
#endif #endif
#include <gst/cuda/gstcudaloader.h> #include <gst/cuda/gstcuda.h>
#include <gst/cuda/gstcudanvrtc.h>
#include "gstcudafilter.h" #include "gstcudafilter.h"
#include "gstcudaconvertscale.h" #include "gstcudaconvertscale.h"

View file

@ -41,7 +41,6 @@
#include "gstcudabasetransform.h" #include "gstcudabasetransform.h"
#include "gstcudamemorycopy.h" #include "gstcudamemorycopy.h"
#include "gstcudaformat.h" #include "gstcudaformat.h"
#include <gst/cuda/gstcudautils.h>
#include <gst/cuda/gstcuda-private.h> #include <gst/cuda/gstcuda-private.h>
#ifdef HAVE_NVCODEC_NVMM #ifdef HAVE_NVCODEC_NVMM
#include "gstcudanvmm.h" #include "gstcudanvmm.h"

View file

@ -21,7 +21,7 @@
#define __GST_CUVID_LOADER_H__ #define __GST_CUVID_LOADER_H__
#include <gst/gst.h> #include <gst/gst.h>
#include "cuda.h" #include <gst/cuda/gstcuda.h>
#include "nvcuvid.h" #include "nvcuvid.h"
G_BEGIN_DECLS G_BEGIN_DECLS

View file

@ -36,8 +36,6 @@
#include "config.h" #include "config.h"
#endif #endif
#include <gst/cuda/gstcudautils.h>
#include "gstnvav1dec.h" #include "gstnvav1dec.h"
#include "gstnvdecoder.h" #include "gstnvdecoder.h"

View file

@ -22,8 +22,6 @@
#endif #endif
#include "gstnvbaseenc.h" #include "gstnvbaseenc.h"
#include <gst/cuda/gstcudautils.h>
#include <gst/cuda/gstcudabufferpool.h>
#include <gst/pbutils/codec-utils.h> #include <gst/pbutils/codec-utils.h>

View file

@ -23,7 +23,7 @@
#include "gstnvenc.h" #include "gstnvenc.h"
#include <gst/video/gstvideoencoder.h> #include <gst/video/gstvideoencoder.h>
#include <gst/cuda/gstcudacontext.h> #include <gst/cuda/gstcuda.h>
#define GST_TYPE_NV_BASE_ENC \ #define GST_TYPE_NV_BASE_ENC \
(gst_nv_base_enc_get_type()) (gst_nv_base_enc_get_type())

View file

@ -29,9 +29,6 @@
#include "config.h" #include "config.h"
#endif #endif
#include <gst/cuda/gstcudautils.h>
#include <gst/cuda/gstcudabufferpool.h>
#include "gstcuvidloader.h" #include "gstcuvidloader.h"
#include "gstnvdec.h" #include "gstnvdec.h"

View file

@ -37,8 +37,7 @@
#include <gst/video/video.h> #include <gst/video/video.h>
#include <gst/codecparsers/gsth264parser.h> #include <gst/codecparsers/gsth264parser.h>
#include <gst/codecparsers/gsth265parser.h> #include <gst/codecparsers/gsth265parser.h>
#include <gst/cuda/gstcudaloader.h> #include <gst/cuda/gstcuda.h>
#include <gst/cuda/gstcudacontext.h>
G_BEGIN_DECLS G_BEGIN_DECLS

View file

@ -22,7 +22,7 @@
#include <gst/gst.h> #include <gst/gst.h>
#include <gst/video/video.h> #include <gst/video/video.h>
#include <gst/cuda/gstcudautils.h> #include <gst/cuda/gstcuda.h>
#include "gstcuvidloader.h" #include "gstcuvidloader.h"
G_BEGIN_DECLS G_BEGIN_DECLS

View file

@ -22,7 +22,7 @@
#include <gst/gst.h> #include <gst/gst.h>
#include <gst/video/video.h> #include <gst/video/video.h>
#include <gst/cuda/gstcudaloader.h> #include <gst/cuda/gstcuda.h>
#include "nvEncodeAPI.h" #include "nvEncodeAPI.h"

View file

@ -28,9 +28,9 @@
#include <string.h> #include <string.h>
#include <gst/cuda/gstcuda.h>
#include "nvEncodeAPI.h" #include "nvEncodeAPI.h"
#include "gstnvenc.h" #include "gstnvenc.h"
#include <gst/cuda/gstcudamemory.h>
G_BEGIN_DECLS G_BEGIN_DECLS

View file

@ -89,8 +89,6 @@
#include "config.h" #include "config.h"
#endif #endif
#include <gst/cuda/gstcudautils.h>
#include "gstnvh264dec.h" #include "gstnvh264dec.h"
#include "gstnvdecoder.h" #include "gstnvdecoder.h"

View file

@ -36,8 +36,6 @@
#include "config.h" #include "config.h"
#endif #endif
#include <gst/cuda/gstcudautils.h>
#include "gstnvvp8dec.h" #include "gstnvvp8dec.h"
#include "gstnvdecoder.h" #include "gstnvdecoder.h"

View file

@ -36,8 +36,6 @@
#include "config.h" #include "config.h"
#endif #endif
#include <gst/cuda/gstcudautils.h>
#include "gstnvvp9dec.h" #include "gstnvvp9dec.h"
#include "gstnvdecoder.h" #include "gstnvdecoder.h"