NVIDIA DeepStream SDK API Reference

9.1 Release
sources/gst-plugins/gst-nvdsanalytics/gstnvdsanalytics.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_NVDSANALYTICS_H__
19 #define __GST_NVDSANALYTICS_H__
20 
21 #include <gst/base/gstbasetransform.h>
22 #include <gst/video/video.h>
23 #include <iostream>
24 #include <vector>
25 #include <unordered_map>
26 #include "nvbufsurface.h"
27 #include "gst-nvquery.h"
28 #include "gstnvdsmeta.h"
29 #include "nvds_analytics.h"
30 #include "nvds_analytics_meta.h"
31 
32 /* Package and library details required for plugin_init */
33 #define PACKAGE "nvdsanalytics"
34 #define VERSION "1.0"
35 #define LICENSE "Proprietary"
36 #define DESCRIPTION "NVIDIA dsanalytics plugin for integration with DeepStream on DGPU/Jetson"
37 #define BINARY_PACKAGE "NVIDIA DeepStream dsanalytics plugin"
38 #define URL "http://nvidia.com/"
39 
40 
41 G_BEGIN_DECLS
42 /* Standard boilerplate stuff */
45 
46 /* Standard boilerplate stuff */
47 #define GST_TYPE_DSANALYTICS (gst_nvdsanalytics_get_type())
48 #define GST_NVDSANALYTICS(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_DSANALYTICS,GstNvDsAnalytics))
49 #define GST_NVDSANALYTICS_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass),GST_TYPE_DSANALYTICS,GstNvDsAnalyticsClass))
50 #define GST_NVDSANALYTICS_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS((obj), GST_TYPE_DSANALYTICS, GstNvDsAnalyticsClass))
51 #define GST_IS_NVDSANALYTICS(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_DSANALYTICS))
52 #define GST_IS_NVDSANALYTICS_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_DSANALYTICS))
53 #define GST_NVDSANALYTICS_CAST(obj) ((GstNvDsAnalytics *)(obj))
54 
56 {
57  GstBaseTransform base_trans;
58 
59  // Context of the custom algorithm library
60  //DsExampleCtx *nvdsanalyticslib_ctx;
61 
62  // Unique ID of the element. The labels generated by the element will be
63  // updated at index `unique_id` of attr_info array in NvDsObjectParams.
64  guint unique_id;
65 
66  // Frame number of the current input buffer
67  guint64 batch_num;
68 
69  // Input video info (resolution, color format, framerate, etc)
70  GstVideoInfo video_info;
71 
72  // Resolution at which analytics algorithms were configured
75 
76  // Amount of objects processed in single call to algorithm
77  guint batch_size;
78 
79  // Config file path for dsanalytics
81 
82  // Config file parsing status for dsanalytics
84 
85  std::unordered_map<gint, StreamInfo> *stream_analytics_info;
86 
87  std::unordered_map<gint, NvDsAnalyticCtxUptr> *stream_analytics_ctx;
88 
90 
91  gboolean enable;
92 
93  gboolean reload_config;
94 
95  //Size of osd font
96  guint font_size;
97 
98  //Type of osd modes, full /partial/completely off
99  guint osd_mode;
100 
101  //Window in ms for obj count
103 
104  gboolean display_obj_cnt;
105 };
106 
107 // Boiler plate stuff
109 {
110  GstBaseTransformClass parent_class;
111 };
112 
113 GType gst_nvdsanalytics_get_type (void);
114 
115 G_END_DECLS
116 #endif /* __GST_NVDSANALYTICS_H__ */
_GstNvDsAnalytics::configuration_width
gint configuration_width
Definition: sources/gst-plugins/gst-nvdsanalytics/gstnvdsanalytics.h:73
_GstNvDsAnalytics::osd_mode
guint osd_mode
Definition: sources/gst-plugins/gst-nvdsanalytics/gstnvdsanalytics.h:99
_GstNvDsAnalyticsClass
Definition: sources/gst-plugins/gst-nvdsanalytics/gstnvdsanalytics.h:108
nvds_analytics.h
gst_nvdsanalytics_get_type
GType gst_nvdsanalytics_get_type(void)
_GstNvDsAnalytics::analytic_mutex
GMutex analytic_mutex
Definition: sources/gst-plugins/gst-nvdsanalytics/gstnvdsanalytics.h:89
_GstNvDsAnalytics::batch_num
guint64 batch_num
Definition: sources/gst-plugins/gst-nvdsanalytics/gstnvdsanalytics.h:67
_GstNvDsAnalytics::unique_id
guint unique_id
Definition: sources/gst-plugins/gst-nvdsanalytics/gstnvdsanalytics.h:64
_GstNvDsAnalytics::config_file_parse_successful
gboolean config_file_parse_successful
Definition: sources/gst-plugins/gst-nvdsanalytics/gstnvdsanalytics.h:83
_GstNvDsAnalyticsClass::parent_class
GstBaseTransformClass parent_class
Definition: sources/gst-plugins/gst-nvdsanalytics/gstnvdsanalytics.h:110
_GstNvDsAnalytics::obj_cnt_win_in_ms
guint obj_cnt_win_in_ms
Definition: sources/gst-plugins/gst-nvdsanalytics/gstnvdsanalytics.h:102
_GstNvDsAnalytics::configuration_height
gint configuration_height
Definition: sources/gst-plugins/gst-nvdsanalytics/gstnvdsanalytics.h:74
_GstNvDsAnalytics::config_file_path
gchar * config_file_path
Definition: sources/gst-plugins/gst-nvdsanalytics/gstnvdsanalytics.h:80
_GstNvDsAnalytics::video_info
GstVideoInfo video_info
Definition: sources/gst-plugins/gst-nvdsanalytics/gstnvdsanalytics.h:70
_GstNvDsAnalytics::display_obj_cnt
gboolean display_obj_cnt
Definition: sources/gst-plugins/gst-nvdsanalytics/gstnvdsanalytics.h:104
_GstNvDsAnalytics::font_size
guint font_size
Definition: sources/gst-plugins/gst-nvdsanalytics/gstnvdsanalytics.h:96
GstNvDsAnalytics
typedefG_BEGIN_DECLS struct _GstNvDsAnalytics GstNvDsAnalytics
Definition: sources/gst-plugins/gst-nvdsanalytics/gstnvdsanalytics.h:43
_GstNvDsAnalytics::reload_config
gboolean reload_config
Definition: sources/gst-plugins/gst-nvdsanalytics/gstnvdsanalytics.h:93
_GstNvDsAnalytics::batch_size
guint batch_size
Definition: sources/gst-plugins/gst-nvdsanalytics/gstnvdsanalytics.h:77
_GstNvDsAnalytics::stream_analytics_info
std::unordered_map< gint, StreamInfo > * stream_analytics_info
Definition: sources/gst-plugins/gst-nvdsanalytics/gstnvdsanalytics.h:85
_GstNvDsAnalytics
Definition: sources/gst-plugins/gst-nvdsanalytics/gstnvdsanalytics.h:55
_GstNvDsAnalytics::base_trans
GstBaseTransform base_trans
Definition: sources/gst-plugins/gst-nvdsanalytics/gstnvdsanalytics.h:57
_GstNvDsAnalytics::stream_analytics_ctx
std::unordered_map< gint, NvDsAnalyticCtxUptr > * stream_analytics_ctx
Definition: sources/gst-plugins/gst-nvdsanalytics/gstnvdsanalytics.h:87
_GstNvDsAnalytics::enable
gboolean enable
Definition: sources/gst-plugins/gst-nvdsanalytics/gstnvdsanalytics.h:91