NVIDIA DeepStream SDK API Reference

8.0 Release
9.0/sources/includes/nvll_osd_api.h
Go to the documentation of this file.
1 /*
2  * SPDX-FileCopyrightText: Copyright (c) 2019-2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
3  * SPDX-License-Identifier: LicenseRef-NvidiaProprietary
4  *
5  * NVIDIA CORPORATION, its affiliates and licensors retain all intellectual
6  * property and proprietary rights in and to this material, related
7  * documentation and any modifications thereto. Any use, reproduction,
8  * disclosure or distribution of this material and related documentation
9  * without an express license agreement from NVIDIA CORPORATION or
10  * its affiliates is strictly prohibited.
11  */
12 
34 #ifndef __NVLL_OSD_API_DEFS__
35 #define __NVLL_OSD_API_DEFS__
36 
37 #include "nvll_osd_struct.h"
38 #include "nvbufsurface.h"
39 
40 #define NVOSD_PRINT_E(f_, ...) \
41  printf("libnvosd (%d):(ERROR) : " f_, __LINE__, ##__VA_ARGS__)
42 
43 #define MAX_IN_BUF 16
44 #define MAX_BORDER_WIDTH 32
45 
46 #ifdef __cplusplus
47 extern "C"
48 {
49 #endif
50 
51 typedef void * NvOSDCtxHandle;
55 typedef struct _NvOSD_FrameTextParams
56 {
63  int num_strings;
69 
71 typedef struct _NvOSD_FrameRectParams
72 {
79  int num_rects;
87 
89 typedef struct _NvOSD_FrameSegmentMaskParams
90 {
97  int num_segments;
105 
107 typedef struct _NvOSD_FrameLineParams
108 {
115  int num_lines;
121 
123 typedef struct _NvOSD_FrameArrowParams
124 {
131  int num_arrows;
137 
139 typedef struct _NvOSD_FrameCircleParams
140 {
147  int num_circles;
153 
160 
167 
179 void nvll_osd_set_clock_params(NvOSDCtxHandle nvosd_ctx, NvOSD_TextParams *clk_params);
180 
181 
198 int nvll_osd_put_text(NvOSDCtxHandle nvosd_ctx, NvOSD_FrameTextParams *frame_text_params);
199 
213 
226 int nvll_osd_blur_rectangles(NvOSDCtxHandle nvosd_ctx, NvOSD_FrameRectParams *frame_rect_params);
227 
253 int nvll_osd_draw_rectangles(NvOSDCtxHandle nvosd_ctx, NvOSD_FrameRectParams *frame_rect_params);
254 
270 int nvll_osd_draw_lines(NvOSDCtxHandle nvosd_ctx, NvOSD_FrameLineParams *frame_line_params);
271 
286 int nvll_osd_draw_arrows(NvOSDCtxHandle nvosd_ctx, NvOSD_FrameArrowParams *frame_arrow_params);
287 
301 int nvll_osd_draw_circles(NvOSDCtxHandle nvosd_ctx, NvOSD_FrameCircleParams *frame_circle_params);
302 
312 void *nvll_osd_set_params (NvOSDCtxHandle nvosd_ctx, int width, int height);
313 
326 int nvll_osd_init_colors_for_hw_blend(void *nvosd_ctx, NvOSD_Color_info * color_info, int num_classes);
327 
336 int nvll_osd_apply (NvOSDCtxHandle nvosd_ctx, NvBufSurfaceParams *buf_ptr, NvBufSurface *surf);
337 
338 #ifdef __cplusplus
339 }
340 #endif
341 
342 #endif
_NvOSD_FrameRectParams::num_rects
int num_rects
Holds the number of rectangles.
Definition: sources/includes/nvll_osd_api.h:79
_NvOSD_LineParams
Holds the box parameters of a line to be overlayed.
Definition: sources/includes/nvll_osd_struct.h:183
nvbufsurface.h
_NvOSD_RectParams
Holds the box parameters of the box to be overlayed.
Definition: sources/includes/nvll_osd_struct.h:140
_NvOSD_FrameTextParams::text_params_list
NvOSD_TextParams * text_params_list
Holds the strings' text parameters.
Definition: sources/includes/nvll_osd_api.h:65
nvll_osd_draw_segment_masks
int nvll_osd_draw_segment_masks(NvOSDCtxHandle nvosd_ctx, NvOSD_FrameSegmentMaskParams *frame_mask_params)
Overlays segment masks at a given location in a buffer.
_NvOSD_MaskParams
Holds the mask parameters of the segment to be overlayed.
Definition: sources/includes/nvll_osd_struct.h:172
NvOSD_FrameRectParams
struct _NvOSD_FrameRectParams NvOSD_FrameRectParams
Holds information about the rectangles in a frame.
_NvOSD_Color_info
Definition: sources/includes/nvll_osd_struct.h:132
NvOSD_FrameCircleParams
struct _NvOSD_FrameCircleParams NvOSD_FrameCircleParams
Holds information about the circles in a frame.
nvll_osd_draw_circles
int nvll_osd_draw_circles(NvOSDCtxHandle nvosd_ctx, NvOSD_FrameCircleParams *frame_circle_params)
Overlays circles on the buffer.
_NvOSD_FrameLineParams::num_lines
int num_lines
Holds the number of lines.
Definition: sources/includes/nvll_osd_api.h:115
_NvOSD_FrameRectParams::rect_params_list
NvOSD_RectParams * rect_params_list
Holds the rectangles' parameters.
Definition: sources/includes/nvll_osd_api.h:81
_NvOSD_FrameLineParams::line_params_list
NvOSD_LineParams * line_params_list
Holds the lines' parameters.
Definition: sources/includes/nvll_osd_api.h:117
_NvOSD_FrameSegmentMaskParams::buf_ptr
NvBufSurfaceParams * buf_ptr
Holds a pointer to the buffer containing the frame.
Definition: sources/includes/nvll_osd_api.h:93
_NvOSD_FrameTextParams::surf
NvBufSurface * surf
Holds information about batched buffers.
Definition: sources/includes/nvll_osd_api.h:67
_NvOSD_FrameTextParams::mode
NvOSD_Mode mode
Holds the OSD mode to be used for processing.
Definition: sources/includes/nvll_osd_api.h:61
nvll_osd_set_clock_params
void nvll_osd_set_clock_params(NvOSDCtxHandle nvosd_ctx, NvOSD_TextParams *clk_params)
Sets clock parameters for a given context.
_NvOSD_CircleParams
Holds circle parameters to be overlayed.
Definition: sources/includes/nvll_osd_struct.h:226
_NvOSD_FrameCircleParams::num_circles
int num_circles
Holds the number of circles.
Definition: sources/includes/nvll_osd_api.h:147
NvBufSurface
Holds information about batched buffers.
Definition: sources/includes/nvbufsurface.h:597
_NvOSD_FrameLineParams::mode
NvOSD_Mode mode
Holds the OSD mode to be used for processing.
Definition: sources/includes/nvll_osd_api.h:113
_NvOSD_FrameCircleParams::surf
NvBufSurface * surf
Holds information about batched buffers.
Definition: sources/includes/nvll_osd_api.h:151
_NvOSD_FrameRectParams::mode
NvOSD_Mode mode
Holds the OSD mode to be used for processing.
Definition: sources/includes/nvll_osd_api.h:77
nvll_osd_draw_rectangles
int nvll_osd_draw_rectangles(NvOSDCtxHandle nvosd_ctx, NvOSD_FrameRectParams *frame_rect_params)
Overlays boxes at a given location in a buffer.
NvOSD_FrameLineParams
struct _NvOSD_FrameLineParams NvOSD_FrameLineParams
Holds information about the lines in a frame.
NvOSDCtxHandle
void * NvOSDCtxHandle
Definition: 9.0/sources/includes/nvll_osd_api.h:51
_NvOSD_FrameSegmentMaskParams::mask_params_list
NvOSD_MaskParams * mask_params_list
Holds mask parameters.
Definition: sources/includes/nvll_osd_api.h:101
NvOSD_FrameSegmentMaskParams
struct _NvOSD_FrameSegmentMaskParams NvOSD_FrameSegmentMaskParams
Holds information about the rectangles in a frame.
_NvOSD_FrameRectParams
Holds information about the rectangles in a frame.
Definition: sources/includes/nvll_osd_api.h:71
_NvOSD_FrameSegmentMaskParams::num_segments
int num_segments
Holds the number of rectangles.
Definition: sources/includes/nvll_osd_api.h:97
_NvOSD_FrameLineParams::buf_ptr
NvBufSurfaceParams * buf_ptr
Holds a pointer to the buffer containing the frame.
Definition: sources/includes/nvll_osd_api.h:111
_NvOSD_FrameSegmentMaskParams::rect_params_list
NvOSD_RectParams * rect_params_list
Holds the rectangles' parameters.
Definition: sources/includes/nvll_osd_api.h:99
nvll_osd_draw_lines
int nvll_osd_draw_lines(NvOSDCtxHandle nvosd_ctx, NvOSD_FrameLineParams *frame_line_params)
Overlays lines on the buffer.
_NvOSD_FrameArrowParams::arrow_params_list
NvOSD_ArrowParams * arrow_params_list
Holds the parameters of the arrows.
Definition: sources/includes/nvll_osd_api.h:133
_NvOSD_FrameArrowParams::mode
NvOSD_Mode mode
Holds the OSD mode to be used for processing.
Definition: sources/includes/nvll_osd_api.h:129
nvll_osd_struct.h
_NvOSD_ArrowParams
Holds arrow parameters to be overlaid.
Definition: sources/includes/nvll_osd_struct.h:202
nvll_osd_put_text
int nvll_osd_put_text(NvOSDCtxHandle nvosd_ctx, NvOSD_FrameTextParams *frame_text_params)
/brief Overlays clock and given text at a given location in a buffer.
nvll_osd_draw_arrows
int nvll_osd_draw_arrows(NvOSDCtxHandle nvosd_ctx, NvOSD_FrameArrowParams *frame_arrow_params)
Overlays arrows on the buffer.
nvll_osd_blur_rectangles
int nvll_osd_blur_rectangles(NvOSDCtxHandle nvosd_ctx, NvOSD_FrameRectParams *frame_rect_params)
Blur boxes at a given location in a buffer.
NvBufSurfaceParams
Hold the information of single buffer in the batch.
Definition: sources/includes/nvbufsurface.h:562
_NvOSD_FrameCircleParams::mode
NvOSD_Mode mode
Holds the OSD mode to be used for processing.
Definition: sources/includes/nvll_osd_api.h:145
_NvOSD_FrameArrowParams::surf
NvBufSurface * surf
Holds information about batched buffers.
Definition: sources/includes/nvll_osd_api.h:135
nvll_osd_apply
int nvll_osd_apply(NvOSDCtxHandle nvosd_ctx, NvBufSurfaceParams *buf_ptr, NvBufSurface *surf)
Apply OSD to the video frame for GPU backend.
_NvOSD_FrameCircleParams
Holds information about the circles in a frame.
Definition: sources/includes/nvll_osd_api.h:139
_NvOSD_FrameCircleParams::buf_ptr
NvBufSurfaceParams * buf_ptr
Holds a pointer to the buffer containing the frame.
Definition: sources/includes/nvll_osd_api.h:143
NvOSD_Mode
NvOSD_Mode
Defines modes used to overlay boxes and text.
Definition: sources/includes/nvll_osd_struct.h:42
nvll_osd_set_params
void * nvll_osd_set_params(NvOSDCtxHandle nvosd_ctx, int width, int height)
Sets the resolution of the frames on which the NvOSDContext is to operate.
nvll_osd_create_context
NvOSDCtxHandle nvll_osd_create_context(void)
Creates an NvOSD context.
nvll_osd_destroy_context
void nvll_osd_destroy_context(NvOSDCtxHandle nvosd_ctx)
Destroys an NvOSD context.
_NvOSD_FrameCircleParams::circle_params_list
NvOSD_CircleParams * circle_params_list
Holds the parameters of the circles.
Definition: sources/includes/nvll_osd_api.h:149
_NvOSD_FrameArrowParams::buf_ptr
NvBufSurfaceParams * buf_ptr
Holds a pointer to the buffer containing the frame.
Definition: sources/includes/nvll_osd_api.h:127
_NvOSD_FrameArrowParams::num_arrows
int num_arrows
Holds the number of arrows.
Definition: sources/includes/nvll_osd_api.h:131
_NvOSD_FrameTextParams
Holds information about the text in a frame.
Definition: sources/includes/nvll_osd_api.h:55
_NvOSD_FrameArrowParams
Holds information about the arrows in a frame.
Definition: sources/includes/nvll_osd_api.h:123
_NvOSD_FrameSegmentMaskParams
Holds information about the rectangles in a frame.
Definition: sources/includes/nvll_osd_api.h:89
NvOSD_FrameArrowParams
struct _NvOSD_FrameArrowParams NvOSD_FrameArrowParams
Holds information about the arrows in a frame.
_NvOSD_TextParams
Holds parameters of text to be overlayed.
Definition: sources/includes/nvll_osd_struct.h:115
_NvOSD_FrameSegmentMaskParams::surf
NvBufSurface * surf
Holds information about batched buffers.
Definition: sources/includes/nvll_osd_api.h:103
_NvOSD_FrameTextParams::num_strings
int num_strings
Holds the number of strings.
Definition: sources/includes/nvll_osd_api.h:63
_NvOSD_FrameRectParams::buf_ptr
NvBufSurfaceParams * buf_ptr
Holds a pointer to the buffer containing the frame.
Definition: sources/includes/nvll_osd_api.h:75
_NvOSD_FrameRectParams::mask_params_list
NvOSD_MaskParams * mask_params_list
Holds mask parameters.
Definition: sources/includes/nvll_osd_api.h:83
NvOSD_FrameTextParams
struct _NvOSD_FrameTextParams NvOSD_FrameTextParams
Holds information about the text in a frame.
_NvOSD_FrameLineParams::surf
NvBufSurface * surf
Holds information about batched buffers.
Definition: sources/includes/nvll_osd_api.h:119
_NvOSD_FrameTextParams::buf_ptr
NvBufSurfaceParams * buf_ptr
Holds a pointer to a buffer containing a frame.
Definition: sources/includes/nvll_osd_api.h:59
_NvOSD_FrameRectParams::surf
NvBufSurface * surf
Holds information about batched buffers.
Definition: sources/includes/nvll_osd_api.h:85
_NvOSD_FrameSegmentMaskParams::mode
NvOSD_Mode mode
Holds the OSD mode to be used for processing.
Definition: sources/includes/nvll_osd_api.h:95
_NvOSD_FrameLineParams
Holds information about the lines in a frame.
Definition: sources/includes/nvll_osd_api.h:107
nvll_osd_init_colors_for_hw_blend
int nvll_osd_init_colors_for_hw_blend(void *nvosd_ctx, NvOSD_Color_info *color_info, int num_classes)
Initializes colors for HW based blending.