NVIDIA DeepStream SDK API Reference

9.2 Release
9.2/sources/gst-plugins/gst-nvblender/gstnvdsblender.h
Go to the documentation of this file.
1 /*
2  * SPDX-FileCopyrightText: Copyright (c) 2020-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
3  * SPDX-License-Identifier: Apache-2.0
4  *
5  * Licensed under the Apache License, Version 2.0 (the "License");
6  * you may not use this file except in compliance with the License.
7  * You may obtain a copy of the License at
8  *
9  * http://www.apache.org/licenses/LICENSE-2.0
10  *
11  * Unless required by applicable law or agreed to in writing, software
12  * distributed under the License is distributed on an "AS IS" BASIS,
13  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14  * See the License for the specific language governing permissions and
15  * limitations under the License.
16  */
17 
18 #ifndef __GST_NVBLENDER_H__
19 #define __GST_NVBLENDER_H__
20 
21 #include <gst/gst.h>
22 #include <gst/video/video.h>
23 #include <gst/video/gstvideoaggregator.h>
24 
25 #include <cuda_runtime.h>
26 #include "gstnvdsmeta.h"
27 #include "gstnvdsbufferpool.h"
28 #include "nvbufsurface.h"
29 #include "nvbufsurftransform.h"
30 
31 G_BEGIN_DECLS
32 
33 #define GST_CAPS_FEATURE_MEMORY_NVMM "memory:NVMM"
34 
35 #define GST_TYPE_NVBLENDER (gst_nvblender_get_type())
36 #define GST_NVBLENDER(obj) \
37  (G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_NVBLENDER, GstNvblender))
38 #define GST_NVBLENDER_CLASS(klass) \
39  (G_TYPE_CHECK_CLASS_CAST((klass),GST_TYPE_NVBLENDER, GstNvblenderClass))
40 #define GST_IS_NVBLENDER(obj) \
41  (G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_NVBLENDER))
42 #define GST_IS_NVBLENDER_CLASS(klass) \
43  (G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_NVBLENDER))
44 
45 typedef struct _GstNvblender GstNvblender;
47 
57 typedef enum
58 {
64 
70 struct _GstNvblender
71 {
72  GstVideoAggregator videoaggregator;
74 
75  //BlendFunction blend, overlay;
76  //FillCheckerFunction fill_checker;
77  //FillColorFunction fill_color;
78  GstBufferPool *pool;
79  GMutex flow_lock;
80  GstVideoInfo info;
82  gint width;
83  gint height;
84  gboolean alpha_surf_allocated=false;
86  guint batch_size;
87  gint gpu_id;
88  gboolean sinkpad0_active;
89  gboolean batched_background;
90  GstClockTime prev_pts;
92  //TODO: used Cuda stream session for composition
94  GHashTable *valid_bg_buf;
95 };
96 
97 struct _GstNvblenderClass
98 {
99  GstVideoAggregatorClass parent_class;
100 };
101 
102 GType gst_nvblender_get_type (void);
103 
104 G_END_DECLS
105 #endif /* __GST_NVBLENDER_H__ */
_GstNvblender::prev_pts
GstClockTime prev_pts
Definition: sources/gst-plugins/gst-nvblender/gstnvdsblender.h:90
_GstNvblender::width
gint width
Definition: sources/gst-plugins/gst-nvblender/gstnvdsblender.h:82
_GstNvblender::cu_nbstream
cudaStream_t cu_nbstream
Definition: sources/gst-plugins/gst-nvblender/gstnvdsblender.h:93
_GstNvblenderClass
Definition: sources/gst-plugins/gst-nvblender/gstnvdsblender.h:97
NvBufSurface
Holds information about batched buffers.
Definition: includes/nvbufsurface.h:602
_GstNvblenderClass::parent_class
GstVideoAggregatorClass parent_class
Definition: sources/gst-plugins/gst-nvblender/gstnvdsblender.h:99
cudaStream_t
struct CUstream_st * cudaStream_t
Forward declaration of cudaStream_t.
Definition: includes/nvbufsurftransform.h:40
_GstNvblender::videoaggregator
GstVideoAggregator videoaggregator
Definition: sources/gst-plugins/gst-nvblender/gstnvdsblender.h:72
_GstNvblender::alpha_surf
NvBufSurface * alpha_surf
Definition: sources/gst-plugins/gst-nvblender/gstnvdsblender.h:85
_GstNvblender::background
GstCompositorBackground background
Definition: sources/gst-plugins/gst-nvblender/gstnvdsblender.h:73
GstBuffer
struct _GstBuffer GstBuffer
Definition: includes/ds3d/common/idatatype.h:24
_GstNvblender::info
GstVideoInfo info
Definition: sources/gst-plugins/gst-nvblender/gstnvdsblender.h:80
_GstNvblender::matte_alpha_gst_buffer
GstBuffer * matte_alpha_gst_buffer
Definition: sources/gst-plugins/gst-nvblender/gstnvdsblender.h:91
_GstNvblender::batched_background
gboolean batched_background
Definition: sources/gst-plugins/gst-nvblender/gstnvdsblender.h:89
COMPOSITOR_BACKGROUND_WHITE
@ COMPOSITOR_BACKGROUND_WHITE
Definition: 9.2/sources/gst-plugins/gst-nvblender/gstnvdsblender.h:61
GstCompositorBackground
GstCompositorBackground
GstcompositorBackground: @COMPOSITOR_BACKGROUND_CHECKER: checker pattern background @COMPOSITOR_BACKG...
Definition: 9.2/sources/gst-plugins/gst-nvblender/gstnvdsblender.h:57
COMPOSITOR_BACKGROUND_CHECKER
@ COMPOSITOR_BACKGROUND_CHECKER
Definition: 9.2/sources/gst-plugins/gst-nvblender/gstnvdsblender.h:59
_GstNvblender::gpu_id
gint gpu_id
Definition: sources/gst-plugins/gst-nvblender/gstnvdsblender.h:87
GstCompositorBackground
GstCompositorBackground
GstcompositorBackground: @COMPOSITOR_BACKGROUND_CHECKER: checker pattern background @COMPOSITOR_BACKG...
Definition: sources/gst-plugins/gst-nvblender/gstnvdsblender.h:57
_GstNvblender
GstNvblender:
Definition: sources/gst-plugins/gst-nvblender/gstnvdsblender.h:70
_GstNvblender::batch_size
guint batch_size
Definition: sources/gst-plugins/gst-nvblender/gstnvdsblender.h:86
_GstNvblender::valid_bg_buf
GHashTable * valid_bg_buf
Definition: sources/gst-plugins/gst-nvblender/gstnvdsblender.h:94
_GstNvblender::flow_lock
GMutex flow_lock
Definition: sources/gst-plugins/gst-nvblender/gstnvdsblender.h:79
COMPOSITOR_BACKGROUND_BLACK
@ COMPOSITOR_BACKGROUND_BLACK
Definition: 9.2/sources/gst-plugins/gst-nvblender/gstnvdsblender.h:60
_GstNvblender::pool
GstBufferPool * pool
Definition: sources/gst-plugins/gst-nvblender/gstnvdsblender.h:78
_GstNvblender::height
gint height
Definition: sources/gst-plugins/gst-nvblender/gstnvdsblender.h:83
_GstNvblender::in_pix_fmt
NvBufSurfaceColorFormat in_pix_fmt
Definition: sources/gst-plugins/gst-nvblender/gstnvdsblender.h:81
COMPOSITOR_BACKGROUND_TRANSPARENT
@ COMPOSITOR_BACKGROUND_TRANSPARENT
Definition: 9.2/sources/gst-plugins/gst-nvblender/gstnvdsblender.h:62
gst_nvblender_get_type
GType gst_nvblender_get_type(void)
_GstNvblender::sinkpad0_active
gboolean sinkpad0_active
Definition: sources/gst-plugins/gst-nvblender/gstnvdsblender.h:88
_GstNvblender::alpha_surf_allocated
gboolean alpha_surf_allocated
Definition: sources/gst-plugins/gst-nvblender/gstnvdsblender.h:84
NvBufSurfaceColorFormat
NvBufSurfaceColorFormat
Defines color formats for NvBufSurface.
Definition: includes/nvbufsurface.h:110