NVIDIA DeepStream SDK API Reference

9.1 Release
9.1/sources/gst-plugins/gst-nvdsvideotemplate/gstnvdsvideotemplate.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_NVDSVIDEOTEMPLATE_H__
19 #define __GST_NVDSVIDEOTEMPLATE_H__
20 
21 #include <gst/base/gstbasetransform.h>
22 #include <gst/video/video.h>
23 #include <glib-object.h>
24 #include <vector>
25 
26 #include <cuda_runtime.h>
27 #include "gstnvdsmeta.h"
28 #include "nvtx3/nvToolsExt.h"
29 
30 #include "nvdscustomlib_factory.hpp"
31 #include "nvdscustomlib_interface.hpp"
32 #include "nvbufsurftransform.h"
33 
34 /* Package and library details required for plugin_init */
35 #define PACKAGE "nvdsvideotemplate"
36 #define VERSION "1.0"
37 #define LICENSE "Proprietary"
38 #define DESCRIPTION "NVIDIA nvdsvideotemplate plugin for integration with DeepStream on DGPU/Jetson"
39 #define BINARY_PACKAGE "NVIDIA DeepStream Template Plugin"
40 #define URL "http://nvidia.com/"
41 
42 G_BEGIN_DECLS
43 /* Standard boilerplate stuff */
46 
47 /* Standard boilerplate stuff */
48 #define GST_TYPE_NVDSVIDEOTEMPLATE (gst_nvdsvideotemplate_get_type())
49 #define GST_NVDSVIDEOTEMPLATE(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_NVDSVIDEOTEMPLATE,GstNvDsVideoTemplate))
50 #define GST_NVDSVIDEOTEMPLATE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass),GST_TYPE_NVDSVIDEOTEMPLATE,GstNvDsVideoTemplateClass))
51 #define GST_NVDSVIDEOTEMPLATE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS((obj), GST_TYPE_NVDSVIDEOTEMPLATE, GstNvDsVideoTemplateClass))
52 #define GST_IS_NVDSVIDEOTEMPLATE(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_NVDSVIDEOTEMPLATE))
53 #define GST_IS_NVDSVIDEOTEMPLATE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_NVDSVIDEOTEMPLATE))
54 #define GST_NVDSVIDEOTEMPLATE_CAST(obj) ((GstNvDsVideoTemplate *)(obj))
55 
57 {
58  GstBaseTransform base_trans;
59 
63 
65  gchar* custom_lib_name;
66 
67  /* Store custom lib property values */
68  std::vector<Property> *vecProp;
69  gchar *custom_prop_string;
70 
72  gboolean stop;
73 
75  GstVideoInfo in_video_info;
76  GstVideoInfo out_video_info;
77 
79  guint gpu_id;
80 
81  gboolean dummy_meta_insert;
82 
83  gboolean fill_dummy_batch_meta;
84 
86  nvtxDomainHandle_t nvtx_domain;
87 
88  GstCaps *sinkcaps;
89  GstCaps *srccaps;
90  guint num_batch_buffers;
92  gint compute_hw;
94 
95  // NVIDIA Video Memory
96  void *inter_buf;
97 
98  // OpenCV related
99  void *cvmat;
100 
101  // Config file path
102  gchar *config_file_path;
103 
104  // Input caps width and height
105  gint in_width;
106  gint in_height;
107 
108  // Output caps width and height
109  gint out_width;
110  gint out_height;
111 };
112 
113 
116 {
117  GstBaseTransformClass parent_class;
118 };
119 
120 GType gst_nvdsvideotemplate_get_type (void);
121 
122 G_END_DECLS
123 #endif /* __GST_NVDSVIDEOTEMPLATE_H__ */
cudaStream_t
struct CUstream_st * cudaStream_t
Forward declaration of cudaStream_t.
Definition: sources/includes/nvbufsurftransform.h:35
_GstNvDsVideoTemplate::cu_nbstream
cudaStream_t cu_nbstream
Definition: sources/gst-plugins/gst-nvdsvideotemplate/gstnvdsvideotemplate.h:93
DSCustomLibrary_Factory
Definition: sources/gst-plugins/gst-nvdsvideotemplate/includes/nvdscustomlib_factory.hpp:34
_GstNvDsVideoTemplateClass
Boiler plate stuff.
Definition: sources/gst-plugins/gst-nvdsvideotemplate/gstnvdsvideotemplate.h:115
_GstNvDsVideoTemplate::custom_prop_string
gchar * custom_prop_string
Definition: sources/gst-plugins/gst-nvdsvideotemplate/gstnvdsvideotemplate.h:69
_GstNvDsVideoTemplate::config_file_path
gchar * config_file_path
Definition: sources/gst-plugins/gst-nvdsvideotemplate/gstnvdsvideotemplate.h:102
_GstNvDsVideoTemplate::algo_ctx
IDSCustomLibrary * algo_ctx
Definition: sources/gst-plugins/gst-nvdsvideotemplate/gstnvdsvideotemplate.h:62
_GstNvDsVideoTemplate::inter_buf
void * inter_buf
Definition: sources/gst-plugins/gst-nvdsvideotemplate/gstnvdsvideotemplate.h:96
_GstNvDsVideoTemplate::stop
gboolean stop
Boolean to signal output thread to stop.
Definition: sources/gst-plugins/gst-nvdsvideotemplate/gstnvdsvideotemplate.h:72
_GstNvDsVideoTemplate::in_video_info
GstVideoInfo in_video_info
Input and Output video info (resolution, color format, framerate, etc)
Definition: sources/gst-plugins/gst-nvdsvideotemplate/gstnvdsvideotemplate.h:75
_GstNvDsVideoTemplate::gpu_id
guint gpu_id
GPU ID on which we expect to execute the task.
Definition: sources/gst-plugins/gst-nvdsvideotemplate/gstnvdsvideotemplate.h:79
_GstNvDsVideoTemplate::fill_dummy_batch_meta
gboolean fill_dummy_batch_meta
Definition: sources/gst-plugins/gst-nvdsvideotemplate/gstnvdsvideotemplate.h:83
IDSCustomLibrary
Definition: sources/gst-plugins/gst-nvdsvideotemplate/includes/nvdscustomlib_interface.hpp:51
_GstNvDsVideoTemplate::sinkcaps
GstCaps * sinkcaps
Definition: sources/gst-plugins/gst-nvdsvideotemplate/gstnvdsvideotemplate.h:88
_GstNvDsVideoTemplate::in_height
gint in_height
Definition: sources/gst-plugins/gst-nvdsvideotemplate/gstnvdsvideotemplate.h:106
_GstNvDsVideoTemplate::base_trans
GstBaseTransform base_trans
Definition: sources/gst-plugins/gst-nvdsvideotemplate/gstnvdsvideotemplate.h:58
_NvBufSurfTransformConfigParams
Holds configuration parameters for a transform/composite session.
Definition: sources/includes/nvbufsurftransform.h:175
_GstNvDsVideoTemplate::custom_lib_name
gchar * custom_lib_name
Custom Library Name and output caps string.
Definition: sources/gst-plugins/gst-nvdsvideotemplate/gstnvdsvideotemplate.h:65
_GstNvDsVideoTemplate::srccaps
GstCaps * srccaps
Definition: sources/gst-plugins/gst-nvdsvideotemplate/gstnvdsvideotemplate.h:89
_GstNvDsVideoTemplate::config_params
NvBufSurfTransformConfigParams config_params
Definition: sources/gst-plugins/gst-nvdsvideotemplate/gstnvdsvideotemplate.h:91
_GstNvDsVideoTemplate::in_width
gint in_width
Definition: sources/gst-plugins/gst-nvdsvideotemplate/gstnvdsvideotemplate.h:105
_GstNvDsVideoTemplate::dummy_meta_insert
gboolean dummy_meta_insert
Definition: sources/gst-plugins/gst-nvdsvideotemplate/gstnvdsvideotemplate.h:81
GstNvDsVideoTemplate
typedefG_BEGIN_DECLS struct _GstNvDsVideoTemplate GstNvDsVideoTemplate
Definition: sources/gst-plugins/gst-nvdsvideotemplate/gstnvdsvideotemplate.h:44
_GstNvDsVideoTemplateClass::parent_class
GstBaseTransformClass parent_class
Definition: sources/gst-plugins/gst-nvdsvideotemplate/gstnvdsvideotemplate.h:117
_GstNvDsVideoTemplate::compute_hw
gint compute_hw
Definition: sources/gst-plugins/gst-nvdsvideotemplate/gstnvdsvideotemplate.h:92
_GstNvDsVideoTemplate::out_height
gint out_height
Definition: sources/gst-plugins/gst-nvdsvideotemplate/gstnvdsvideotemplate.h:110
_GstNvDsVideoTemplate::nvtx_domain
nvtxDomainHandle_t nvtx_domain
NVTX Domain.
Definition: sources/gst-plugins/gst-nvdsvideotemplate/gstnvdsvideotemplate.h:86
_GstNvDsVideoTemplate
Definition: sources/gst-plugins/gst-nvdsvideotemplate/gstnvdsvideotemplate.h:56
_GstNvDsVideoTemplate::cvmat
void * cvmat
Definition: sources/gst-plugins/gst-nvdsvideotemplate/gstnvdsvideotemplate.h:99
_GstNvDsVideoTemplate::algo_factory
DSCustomLibrary_Factory * algo_factory
Custom Library Factory and Interface.
Definition: sources/gst-plugins/gst-nvdsvideotemplate/gstnvdsvideotemplate.h:61
gst_nvdsvideotemplate_get_type
GType gst_nvdsvideotemplate_get_type(void)
_GstNvDsVideoTemplate::num_batch_buffers
guint num_batch_buffers
Definition: sources/gst-plugins/gst-nvdsvideotemplate/gstnvdsvideotemplate.h:90
_GstNvDsVideoTemplate::out_width
gint out_width
Definition: sources/gst-plugins/gst-nvdsvideotemplate/gstnvdsvideotemplate.h:109
_GstNvDsVideoTemplate::vecProp
std::vector< Property > * vecProp
Definition: sources/gst-plugins/gst-nvdsvideotemplate/gstnvdsvideotemplate.h:68
_GstNvDsVideoTemplate::out_video_info
GstVideoInfo out_video_info
Definition: sources/gst-plugins/gst-nvdsvideotemplate/gstnvdsvideotemplate.h:76