NVIDIA DeepStream SDK API Reference

7.1 Release
gstnvdsvideotemplate.h
Go to the documentation of this file.
1 /*
2  * SPDX-FileCopyrightText: Copyright (c) 2020-2022 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
3  * SPDX-License-Identifier: MIT
4  *
5  * Permission is hereby granted, free of charge, to any person obtaining a
6  * copy of this software and associated documentation files (the "Software"),
7  * to deal in the Software without restriction, including without limitation
8  * the rights to use, copy, modify, merge, publish, distribute, sublicense,
9  * and/or sell copies of the Software, and to permit persons to whom the
10  * Software is furnished to do so, subject to the following conditions:
11  *
12  * The above copyright notice and this permission notice shall be included in
13  * all copies or substantial portions of the Software.
14  *
15  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16  * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
18  * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
20  * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
21  * DEALINGS IN THE SOFTWARE.
22  */
23 
24 #ifndef __GST_NVDSVIDEOTEMPLATE_H__
25 #define __GST_NVDSVIDEOTEMPLATE_H__
26 
27 #include <gst/base/gstbasetransform.h>
28 #include <gst/video/video.h>
29 #include <glib-object.h>
30 #include <vector>
31 
32 #include <cuda_runtime.h>
33 #include "gstnvdsmeta.h"
34 #include "nvtx3/nvToolsExt.h"
35 
36 #include "nvdscustomlib_factory.hpp"
37 #include "nvdscustomlib_interface.hpp"
38 #include "nvbufsurftransform.h"
39 
40 /* Package and library details required for plugin_init */
41 #define PACKAGE "nvdsvideotemplate"
42 #define VERSION "1.0"
43 #define LICENSE "Proprietary"
44 #define DESCRIPTION "NVIDIA nvdsvideotemplate plugin for integration with DeepStream on DGPU/Jetson"
45 #define BINARY_PACKAGE "NVIDIA DeepStream Template Plugin"
46 #define URL "http://nvidia.com/"
47 
48 G_BEGIN_DECLS
49 /* Standard boilerplate stuff */
52 
53 /* Standard boilerplate stuff */
54 #define GST_TYPE_NVDSVIDEOTEMPLATE (gst_nvdsvideotemplate_get_type())
55 #define GST_NVDSVIDEOTEMPLATE(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_NVDSVIDEOTEMPLATE,GstNvDsVideoTemplate))
56 #define GST_NVDSVIDEOTEMPLATE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass),GST_TYPE_NVDSVIDEOTEMPLATE,GstNvDsVideoTemplateClass))
57 #define GST_NVDSVIDEOTEMPLATE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS((obj), GST_TYPE_NVDSVIDEOTEMPLATE, GstNvDsVideoTemplateClass))
58 #define GST_IS_NVDSVIDEOTEMPLATE(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_NVDSVIDEOTEMPLATE))
59 #define GST_IS_NVDSVIDEOTEMPLATE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_NVDSVIDEOTEMPLATE))
60 #define GST_NVDSVIDEOTEMPLATE_CAST(obj) ((GstNvDsVideoTemplate *)(obj))
61 
63 {
64  GstBaseTransform base_trans;
65 
69 
72 
73  /* Store custom lib property values */
74  std::vector<Property> *vecProp;
76 
78  gboolean stop;
79 
81  GstVideoInfo in_video_info;
82  GstVideoInfo out_video_info;
83 
85  guint gpu_id;
86 
88 
90 
92  nvtxDomainHandle_t nvtx_domain;
93 
94  GstCaps *sinkcaps;
95  GstCaps *srccaps;
98  gint compute_hw;
100 };
101 
102 
105 {
106  GstBaseTransformClass parent_class;
107 };
108 
109 GType gst_nvdsvideotemplate_get_type (void);
110 
111 G_END_DECLS
112 #endif /* __GST_NVDSVIDEOTEMPLATE_H__ */
_GstNvDsVideoTemplate::cu_nbstream
cudaStream_t cu_nbstream
Definition: gstnvdsvideotemplate.h:99
DSCustomLibrary_Factory
Definition: gst-nvdsA2Vtemplate/includes/nvdscustomlib_factory.hpp:29
_GstNvDsVideoTemplateClass
Boiler plate stuff.
Definition: gstnvdsvideotemplate.h:104
_GstNvDsVideoTemplate::srccaps
GstCaps * srccaps
Definition: gstnvdsvideotemplate.h:95
_GstNvDsVideoTemplate::algo_ctx
IDSCustomLibrary * algo_ctx
Definition: gstnvdsvideotemplate.h:68
_GstNvDsVideoTemplate::stop
gboolean stop
Boolean to signal output thread to stop.
Definition: gstnvdsvideotemplate.h:78
_GstNvDsVideoTemplate::in_video_info
GstVideoInfo in_video_info
Input and Output video info (resolution, color format, framerate, etc)
Definition: gstnvdsvideotemplate.h:81
_GstNvDsVideoTemplate::custom_lib_name
gchar * custom_lib_name
Custom Library Name and output caps string.
Definition: gstnvdsvideotemplate.h:71
_GstNvDsVideoTemplate::sinkcaps
GstCaps * sinkcaps
Definition: gstnvdsvideotemplate.h:94
_GstNvDsVideoTemplate::gpu_id
guint gpu_id
GPU ID on which we expect to execute the task.
Definition: gstnvdsvideotemplate.h:85
_GstNvDsVideoTemplate::fill_dummy_batch_meta
gboolean fill_dummy_batch_meta
Definition: gstnvdsvideotemplate.h:89
_GstNvDsVideoTemplate::algo_factory
DSCustomLibrary_Factory * algo_factory
Custom Library Factory and Interface.
Definition: gstnvdsvideotemplate.h:67
IDSCustomLibrary
Definition: gst-nvdsA2Vtemplate/includes/nvdscustomlib_interface.hpp:43
_GstNvDsVideoTemplate::vecProp
std::vector< Property > * vecProp
Definition: gstnvdsvideotemplate.h:74
_GstNvDsVideoTemplate::base_trans
GstBaseTransform base_trans
Definition: gstnvdsvideotemplate.h:64
_NvBufSurfTransformConfigParams
Holds configuration parameters for a transform/composite session.
Definition: nvbufsurftransform.h:172
cudaStream_t
struct CUstream_st * cudaStream_t
Forward declaration of cudaStream_t.
Definition: nvbufsurftransform.h:34
_GstNvDsVideoTemplate::config_params
NvBufSurfTransformConfigParams config_params
Definition: gstnvdsvideotemplate.h:97
gstnvdsmeta.h
_GstNvDsVideoTemplate::dummy_meta_insert
gboolean dummy_meta_insert
Definition: gstnvdsvideotemplate.h:87
_GstNvDsVideoTemplateClass::parent_class
GstBaseTransformClass parent_class
Definition: gstnvdsvideotemplate.h:106
_GstNvDsVideoTemplate::compute_hw
gint compute_hw
Definition: gstnvdsvideotemplate.h:98
_GstNvDsVideoTemplate::nvtx_domain
nvtxDomainHandle_t nvtx_domain
NVTX Domain.
Definition: gstnvdsvideotemplate.h:92
_GstNvDsVideoTemplate
Definition: gstnvdsvideotemplate.h:62
gst_nvdsvideotemplate_get_type
GType gst_nvdsvideotemplate_get_type(void)
_GstNvDsVideoTemplate::custom_prop_string
gchar * custom_prop_string
Definition: gstnvdsvideotemplate.h:75
_GstNvDsVideoTemplate::num_batch_buffers
guint num_batch_buffers
Definition: gstnvdsvideotemplate.h:96
nvbufsurftransform.h
GstNvDsVideoTemplate
typedefG_BEGIN_DECLS struct _GstNvDsVideoTemplate GstNvDsVideoTemplate
Definition: gstnvdsvideotemplate.h:50
_GstNvDsVideoTemplate::out_video_info
GstVideoInfo out_video_info
Definition: gstnvdsvideotemplate.h:82