NVIDIA DeepStream SDK API Reference

9.1 Release
sources/gst-plugins/gst-nvdsosd/gstnvdsosd.h
Go to the documentation of this file.
1 /*
2  * SPDX-FileCopyrightText: Copyright (c) 2016-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_NVDSOSD_H__
19 #define __GST_NVDSOSD_H__
20 
21 #include <gst/gst.h>
22 #include <gst/video/video.h>
23 #include <gst/video/gstvideofilter.h>
24 #include <stdlib.h>
25 #include "nvll_osd_api.h"
26 #include "gstnvdsmeta.h"
27 
28 #define MAX_BG_CLR 20
29 
30 G_BEGIN_DECLS
31 /* Standard GStreamer boilerplate */
32 #define GST_TYPE_NVDSOSD \
33  (gst_nvds_osd_get_type())
34 #define GST_NVDSOSD(obj) \
35  (G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_NVDSOSD,GstNvDsOsd))
36 #define GST_NVDSOSD_CLASS(klass) \
37  (G_TYPE_CHECK_CLASS_CAST((klass),GST_TYPE_NVDSOSD,GstNvDsOsdClass))
38 #define GST_IS_NVDSOSD(obj) \
39  (G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_NVDSOSD))
40 #define GST_IS_NVDSOSD_CLASS(klass) \
41  (G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_NVDSOSD))
42 /* Version number of package */
43 #define VERSION "1.8.2"
44 #define PACKAGE_DESCRIPTION "Gstreamer plugin to draw rectangles and text"
45 /* Define under which licence the package has been released */
46 #define PACKAGE_LICENSE "Proprietary"
47 #define PACKAGE_NAME "GStreamer nvosd Plugin"
48 /* Define to the home page for this package. */
49 #define PACKAGE_URL "http://nvidia.com/"
50 #define GST_CAPS_FEATURE_MEMORY_NVMM "memory:NVMM"
51 typedef struct _GstNvDsOsd GstNvDsOsd;
53 
58 {
60  GstBaseTransform parent_instance;
61 
62  /* Width of buffer. */
63  gint width;
64  /* Height of buffer. */
65  gint height;
66 
72 
74  gboolean show_clock;
77 
94 
96  guint num_rect;
98  guint num_segments;
100  guint num_strings;
102  guint num_lines;
104  guint num_arrows;
106  guint num_circles;
108  guint num_blurs;
109 
110 
125 
127  gchar *font;
129  guint clock_color;
135  guint frame_num;
137  gboolean draw_text;
139  gboolean draw_bbox;
141  gboolean draw_mask;
144 
148  guint gpu_id;
150  void *conv_buf;
151 
153  guint blur_bbox;
158 };
159 
160 /* GStreamer boilerplate. */
162 {
163  GstBaseTransformClass parent_class;
164 };
165 
166 GType gst_nvds_osd_get_type (void);
167 
168 G_END_DECLS
169 #endif /* __GST_NVDSOSD_H__ */
_NvOSD_LineParams
Holds the box parameters of a line to be overlayed.
Definition: sources/includes/nvll_osd_struct.h:188
_GstNvDsOsd::num_lines
guint num_lines
Number of lines to be drawn for a frame.
Definition: sources/gst-plugins/gst-nvdsosd/gstnvdsosd.h:102
_GstNvDsOsd::draw_bbox
gboolean draw_bbox
Boolean indicating whether bounding is to be drawn.
Definition: sources/gst-plugins/gst-nvdsosd/gstnvdsosd.h:139
_NvOSD_RectParams
Holds the box parameters of the box to be overlayed.
Definition: sources/includes/nvll_osd_struct.h:145
_NvOSD_MaskParams
Holds the mask parameters of the segment to be overlayed.
Definition: sources/includes/nvll_osd_struct.h:177
_NvOSD_Color_info
Definition: sources/includes/nvll_osd_struct.h:137
_GstNvDsOsd::arrow_params
NvOSD_ArrowParams * arrow_params
List of arrows to be drawn.
Definition: sources/gst-plugins/gst-nvdsosd/gstnvdsosd.h:91
_GstNvDsOsd::blur_bbox
guint blur_bbox
Integer indicating how object is to be blurred.
Definition: sources/gst-plugins/gst-nvdsosd/gstnvdsosd.h:153
_GstNvDsOsd::num_rect
guint num_rect
Number of rectangles to be drawn for a frame.
Definition: sources/gst-plugins/gst-nvdsosd/gstnvdsosd.h:96
_GstNvDsOsd::num_blurs
guint num_blurs
Number of blurs to be drawn for a frame.
Definition: sources/gst-plugins/gst-nvdsosd/gstnvdsosd.h:108
_GstNvDsOsd::show_clock
gboolean show_clock
Boolean value indicating whether clock is enabled.
Definition: sources/gst-plugins/gst-nvdsosd/gstnvdsosd.h:74
_GstNvDsOsd::num_strings
guint num_strings
Number of strings to be drawn for a frame.
Definition: sources/gst-plugins/gst-nvdsosd/gstnvdsosd.h:100
_GstNvDsOsd::frame_num
guint frame_num
Integer indicating the frame number.
Definition: sources/gst-plugins/gst-nvdsosd/gstnvdsosd.h:135
_GstNvDsOsd::parent_instance
GstBaseTransform parent_instance
Should be the first member when extending from GstBaseTransform.
Definition: sources/gst-plugins/gst-nvdsosd/gstnvdsosd.h:60
_GstNvDsOsdClass::parent_class
GstBaseTransformClass parent_class
Definition: sources/gst-plugins/gst-nvdsosd/gstnvdsosd.h:163
_GstNvDsOsd::border_width
guint border_width
Border width of object.
Definition: sources/gst-plugins/gst-nvdsosd/gstnvdsosd.h:133
_NvOSD_CircleParams
Holds circle parameters to be overlayed.
Definition: sources/includes/nvll_osd_struct.h:231
_NvOSD_FrameRectParams
Holds information about the rectangles in a frame.
Definition: sources/includes/nvll_osd_api.h:76
_GstNvDsOsd::conv_buf
void * conv_buf
Pointer to the converted buffer.
Definition: sources/gst-plugins/gst-nvdsosd/gstnvdsosd.h:150
_GstNvDsOsd::mask_params
NvOSD_MaskParams * mask_params
List of segment masks to be drawn.
Definition: sources/gst-plugins/gst-nvdsosd/gstnvdsosd.h:87
_GstNvDsOsd::clock_text_params
NvOSD_TextParams clock_text_params
Structure containing text params for clock.
Definition: sources/gst-plugins/gst-nvdsosd/gstnvdsosd.h:76
_GstNvDsOsd::text_params
NvOSD_TextParams * text_params
List of strings to be drawn.
Definition: sources/gst-plugins/gst-nvdsosd/gstnvdsosd.h:79
_GstNvDsOsd::circle_params
NvOSD_CircleParams * circle_params
List of circles to be drawn.
Definition: sources/gst-plugins/gst-nvdsosd/gstnvdsosd.h:93
_GstNvDsOsd::rect_params
NvOSD_RectParams * rect_params
List of rectangles to be drawn.
Definition: sources/gst-plugins/gst-nvdsosd/gstnvdsosd.h:81
_GstNvDsOsd::num_circles
guint num_circles
Number of circles to be drawn for a frame.
Definition: sources/gst-plugins/gst-nvdsosd/gstnvdsosd.h:106
_NvOSD_ArrowParams
Holds arrow parameters to be overlaid.
Definition: sources/includes/nvll_osd_struct.h:207
_GstNvDsOsd::frame_arrow_params
NvOSD_FrameArrowParams * frame_arrow_params
Structure containing details of arrows to be drawn for a frame.
Definition: sources/gst-plugins/gst-nvdsosd/gstnvdsosd.h:120
_GstNvDsOsd::nvdsosd_context
void * nvdsosd_context
Pointer to the nvdsosd context.
Definition: sources/gst-plugins/gst-nvdsosd/gstnvdsosd.h:68
_GstNvDsOsd::font
gchar * font
Font of the text to be displayed.
Definition: sources/gst-plugins/gst-nvdsosd/gstnvdsosd.h:127
_GstNvDsOsd::gpu_id
guint gpu_id
Integer indicating gpu id to be used.
Definition: sources/gst-plugins/gst-nvdsosd/gstnvdsosd.h:148
_GstNvDsOsd
GstNvDsOsd element structure.
Definition: sources/gst-plugins/gst-nvdsosd/gstnvdsosd.h:57
_NvOSD_FrameCircleParams
Holds information about the circles in a frame.
Definition: sources/includes/nvll_osd_api.h:144
NvOSD_Mode
NvOSD_Mode
Defines modes used to overlay boxes and text.
Definition: sources/includes/nvll_osd_struct.h:47
_GstNvDsOsd::num_arrows
guint num_arrows
Number of arrows to be drawn for a frame.
Definition: sources/gst-plugins/gst-nvdsosd/gstnvdsosd.h:104
_GstNvDsOsd::height
gint height
Definition: sources/gst-plugins/gst-nvdsosd/gstnvdsosd.h:65
_GstNvDsOsd::nvdsosd_mode
NvOSD_Mode nvdsosd_mode
Enum indicating how the objects are drawn, i.e., CPU, GPU or VIC (for Jetson only).
Definition: sources/gst-plugins/gst-nvdsosd/gstnvdsosd.h:71
_NvOSD_FrameTextParams
Holds information about the text in a frame.
Definition: sources/includes/nvll_osd_api.h:60
_NvOSD_FrameArrowParams
Holds information about the arrows in a frame.
Definition: sources/includes/nvll_osd_api.h:128
_GstNvDsOsdClass
Definition: sources/gst-plugins/gst-nvdsosd/gstnvdsosd.h:161
_GstNvDsOsd::blur_gie_class_list
GList * blur_gie_class_list
The gie id and class id needed to be blurred.
Definition: sources/gst-plugins/gst-nvdsosd/gstnvdsosd.h:157
gst_nvds_osd_get_type
GType gst_nvds_osd_get_type(void)
_GstNvDsOsd::num_class_entries
int num_class_entries
Integer indicating number of detected classes.
Definition: sources/gst-plugins/gst-nvdsosd/gstnvdsosd.h:146
_GstNvDsOsd::frame_blur_params
NvOSD_FrameRectParams * frame_blur_params
Structure containing details of blurs to be overlayed for a frame.
Definition: sources/gst-plugins/gst-nvdsosd/gstnvdsosd.h:124
_NvOSD_FrameSegmentMaskParams
Holds information about the rectangles in a frame.
Definition: sources/includes/nvll_osd_api.h:94
_GstNvDsOsd::line_params
NvOSD_LineParams * line_params
List of lines to be drawn.
Definition: sources/gst-plugins/gst-nvdsosd/gstnvdsosd.h:89
_NvOSD_TextParams
Holds parameters of text to be overlayed.
Definition: sources/includes/nvll_osd_struct.h:120
_GstNvDsOsd::color_info
NvOSD_Color_info color_info[MAX_BG_CLR]
Array containing color info for blending.
Definition: sources/gst-plugins/gst-nvdsosd/gstnvdsosd.h:143
_GstNvDsOsd::frame_line_params
NvOSD_FrameLineParams * frame_line_params
Structure containing details of lines to be drawn for a frame.
Definition: sources/gst-plugins/gst-nvdsosd/gstnvdsosd.h:118
_GstNvDsOsd::mask_rect_params
NvOSD_RectParams * mask_rect_params
List of rectangles for segment masks to be drawn.
Definition: sources/gst-plugins/gst-nvdsosd/gstnvdsosd.h:85
_GstNvDsOsd::frame_circle_params
NvOSD_FrameCircleParams * frame_circle_params
Structure containing details of circles to be drawn for a frame.
Definition: sources/gst-plugins/gst-nvdsosd/gstnvdsosd.h:122
_GstNvDsOsd::blur_rect_params
NvOSD_RectParams * blur_rect_params
List of rectangles to be blurred.
Definition: sources/gst-plugins/gst-nvdsosd/gstnvdsosd.h:83
_GstNvDsOsd::num_segments
guint num_segments
Number of segment masks to be drawn for a frame.
Definition: sources/gst-plugins/gst-nvdsosd/gstnvdsosd.h:98
_GstNvDsOsd::frame_rect_params
NvOSD_FrameRectParams * frame_rect_params
Structure containing details of rectangles to be drawn for a frame.
Definition: sources/gst-plugins/gst-nvdsosd/gstnvdsosd.h:112
MAX_BG_CLR
#define MAX_BG_CLR
Definition: sources/gst-plugins/gst-nvdsosd/gstnvdsosd.h:28
_GstNvDsOsd::draw_mask
gboolean draw_mask
Boolean indicating whether instance mask is to be drawn.
Definition: sources/gst-plugins/gst-nvdsosd/gstnvdsosd.h:141
_GstNvDsOsd::draw_text
gboolean draw_text
Boolean indicating whether text is to be drawn.
Definition: sources/gst-plugins/gst-nvdsosd/gstnvdsosd.h:137
_GstNvDsOsd::width
gint width
Definition: sources/gst-plugins/gst-nvdsosd/gstnvdsosd.h:63
_GstNvDsOsd::frame_text_params
NvOSD_FrameTextParams * frame_text_params
Structure containing details of text to be overlayed for a frame.
Definition: sources/gst-plugins/gst-nvdsosd/gstnvdsosd.h:116
_GstNvDsOsd::blur_gie_class_ids
gchar * blur_gie_class_ids
The gie id and class id needed to be blurred.
Definition: sources/gst-plugins/gst-nvdsosd/gstnvdsosd.h:155
_GstNvDsOsd::frame_mask_params
NvOSD_FrameSegmentMaskParams * frame_mask_params
Structure containing details of segment masks to be drawn for a frame.
Definition: sources/gst-plugins/gst-nvdsosd/gstnvdsosd.h:114
_GstNvDsOsd::clock_color
guint clock_color
Color of the clock, if enabled.
Definition: sources/gst-plugins/gst-nvdsosd/gstnvdsosd.h:129
_NvOSD_FrameLineParams
Holds information about the lines in a frame.
Definition: sources/includes/nvll_osd_api.h:112
_GstNvDsOsd::clock_font_size
guint clock_font_size
Font size of the clock, if enabled.
Definition: sources/gst-plugins/gst-nvdsosd/gstnvdsosd.h:131