nvcodec: Add cudacompositor element

Adding CUDA based compositor element

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/8170>
This commit is contained in:
Seungha Yang 2024-12-18 01:45:28 +09:00
parent 875e137f4f
commit 289f63b6e7
4 changed files with 1684 additions and 0 deletions

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,38 @@
/* GStreamer
* Copyright (C) 2024 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
#include <gst/gst.h>
#include <gst/video/video.h>
#include <gst/video/gstvideoaggregator.h>
#include <gst/cuda/gstcuda.h>
G_BEGIN_DECLS
#define GST_TYPE_CUDA_COMPOSITOR_PAD (gst_cuda_compositor_pad_get_type())
G_DECLARE_FINAL_TYPE (GstCudaCompositorPad, gst_cuda_compositor_pad,
GST, CUDA_COMPOSITOR_PAD, GstVideoAggregatorPad)
#define GST_TYPE_CUDA_COMPOSITOR (gst_cuda_compositor_get_type())
G_DECLARE_FINAL_TYPE (GstCudaCompositor, gst_cuda_compositor,
GST, CUDA_COMPOSITOR, GstVideoAggregator)
G_END_DECLS

View file

@ -1,5 +1,6 @@
nvcodec_sources = [
'gstcudabasetransform.c',
'gstcudacompositor.cpp',
'gstcudaconverter.cpp',
'gstcudaconvertscale.c',
'gstcudaipc.cpp',

View file

@ -57,6 +57,7 @@
#include "gstcudaipcsink.h"
#include "gstcudaipcsrc.h"
#include "gstnvcodecutils.h"
#include "gstcudacompositor.h"
#include <glib/gi18n-lib.h>
@ -350,6 +351,8 @@ plugin_init (GstPlugin * plugin)
GST_TYPE_CUDA_SCALE);
gst_element_register (plugin, "cudaconvertscale", GST_RANK_NONE,
GST_TYPE_CUDA_CONVERT_SCALE);
gst_element_register (plugin, "cudacompositor", GST_RANK_NONE,
GST_TYPE_CUDA_COMPOSITOR);
}
gst_element_register (plugin,
"cudaipcsink", GST_RANK_NONE, GST_TYPE_CUDA_IPC_SINK);