NVIDIA DeepStream SDK API Reference

4.0.2 Release

 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
On-Screen Display Manager

Detailed Description

Defines the NvOSD library to be used to draw rectangles and text over the frame for given parameters.

Data Structures

struct  _NvOSD_FrameTextParams
 
struct  _NvOSD_FrameRectParams
 
struct  _NvOSD_FrameLineParams
 
struct  _NvOSD_ColorParams
 Holds the color parameters of the box or text to be overlayed. More...
 
struct  _NvOSD_FontParams
 Holds the font parameters of the text to be overlayed. More...
 
struct  _NvOSD_TextParams
 Holds the text parameters of the text to be overlayed. More...
 
struct  _NvOSD_Color_info
 
struct  _NvOSD_RectParams
 Holds the box parameters of the box to be overlayed. More...
 
struct  _NvOSD_LineParams
 Holds the box parameters of the line to be overlayed. More...
 

Macros

#define NVOSD_PRINT_E(f_,...)   printf("libnvosd (%d):(ERROR) : " f_, __LINE__, ##__VA_ARGS__)
 
#define MAX_IN_BUF   16
 
#define MAX_BORDER_WIDTH   32
 
#define NVOSD_MAX_NUM_RECTS   128
 
#define MAX_BG_CLR   20
 

Typedefs

typedef struct
_NvOSD_FrameTextParams 
NvOSD_FrameTextParams
 
typedef struct
_NvOSD_FrameRectParams 
NvOSD_FrameRectParams
 
typedef struct
_NvOSD_FrameLineParams 
NvOSD_FrameLineParams
 
typedef struct _NvOSD_ColorParams NvOSD_ColorParams
 Holds the color parameters of the box or text to be overlayed. More...
 
typedef struct _NvOSD_FontParams NvOSD_FontParams
 Holds the font parameters of the text to be overlayed. More...
 
typedef struct _NvOSD_TextParams NvOSD_TextParams
 Holds the text parameters of the text to be overlayed. More...
 
typedef struct _NvOSD_Color_info NvOSD_Color_info
 
typedef struct _NvOSD_RectParams NvOSD_RectParams
 Holds the box parameters of the box to be overlayed. More...
 
typedef struct _NvOSD_LineParams NvOSD_LineParams
 Holds the box parameters of the line to be overlayed. More...
 

Enumerations

enum  NvOSD_Mode {
  MODE_CPU,
  MODE_GPU,
  MODE_HW
}
 List modes used to overlay boxes and text. More...
 

Functions

void * nvll_osd_create_context (void)
 Creates an NvOSD context. More...
 
void nvll_osd_destroy_context (void *nvosd_ctx)
 Destroys an NvOSD context. More...
 
void nvll_osd_set_clock_params (void *nvosd_ctx, NvOSD_TextParams *clk_params)
 Sets clock parameters for the given context. More...
 
int nvll_osd_put_text (void *nvosd_ctx, NvOSD_FrameTextParams *frame_text_params)
 Overlays clock and given text at given location on a buffer. More...
 
int nvll_osd_draw_rectangles (void *nvosd_ctx, NvOSD_FrameRectParams *frame_rect_params)
 Overlays boxes at given location on a buffer. More...
 
int nvll_osd_draw_lines (void *nvosd_ctx, NvOSD_FrameLineParams *frame_line_params)
 Overlays lines on the buffer. More...
 
void * nvll_osd_set_params (void *nvosd_ctx, int width, int height)
 Sets the resolution of the frames on which the NvOSDContext will operate. More...
 

Macro Definition Documentation

#define MAX_BG_CLR   20

Definition at line 56 of file nvll_osd_struct.h.

#define MAX_BORDER_WIDTH   32

Definition at line 56 of file nvll_osd_api.h.

#define MAX_IN_BUF   16

Definition at line 55 of file nvll_osd_api.h.

#define NVOSD_MAX_NUM_RECTS   128

Definition at line 55 of file nvll_osd_struct.h.

#define NVOSD_PRINT_E (   f_,
  ... 
)    printf("libnvosd (%d):(ERROR) : " f_, __LINE__, ##__VA_ARGS__)

Definition at line 52 of file nvll_osd_api.h.

Typedef Documentation

Holds the color parameters of the box or text to be overlayed.

Holds the font parameters of the text to be overlayed.

Holds the box parameters of the line to be overlayed.

Holds the box parameters of the box to be overlayed.

Holds the text parameters of the text to be overlayed.

Enumeration Type Documentation

enum NvOSD_Mode

List modes used to overlay boxes and text.

Enumerator
MODE_CPU 

Selects CPU for OSD processing.

Works with RGBA data only

MODE_GPU 

Selects GPU for OSD processing.

Yet to be implemented

MODE_HW 

Selects NV HW engine for rectangle draw and mask.

This mode works with both YUV and RGB data. It does not consider alpha parameter. Not applicable for drawing text.

Definition at line 61 of file nvll_osd_struct.h.

Function Documentation

void* nvll_osd_create_context ( void  )

Creates an NvOSD context.

Returns
A pointer to NvOSD context, NULL in case of failure.
void nvll_osd_destroy_context ( void *  nvosd_ctx)

Destroys an NvOSD context.

Parameters
[in]nvosd_ctxA pointer to NvOSD context.
int nvll_osd_draw_lines ( void *  nvosd_ctx,
NvOSD_FrameLineParams frame_line_params 
)

Overlays lines on the buffer.

The length of line_params_list must be equal to num_lines. The client is responsible for allocating this array.

Note
Currently only MODE_CPU is supported. Specifying other modes will have no effect.
Parameters
[in]nvosd_ctxA pointer to NvOSD context.
[in]frame_line_paramsA pointer to the FrameLineParams struct containing line information to be overlayed.
Returns
0 for success, -1 for failure.
int nvll_osd_draw_rectangles ( void *  nvosd_ctx,
NvOSD_FrameRectParams frame_rect_params 
)

Overlays boxes at given location on a buffer.

Boxes can be configured with: a. Only border To draw boxes with only border, you must set border_width and set has_bg_color to 0 for the given box. b. Border and background color To draw boxes with border and background color, you must set border_width and set has_bg_color to 1, and specify background color parameters for the given box. c. Solid fill acting as mask region To draw boxes with solid fill acting as mask region, you must set border_width to 0 and has_bg_color to 1 for the given box.

You must ensure that the length of rect_params_list is at least num_rects.

Parameters
[in]nvosd_ctxA pointer to NvOSD context.
[in]frame_rect_paramsA pointer to the FrameRectParams struct containing rectangles information to be overlayed.
Returns
0 for success, -1 for failure.
int nvll_osd_put_text ( void *  nvosd_ctx,
NvOSD_FrameTextParams frame_text_params 
)

Overlays clock and given text at given location on a buffer.

To overlay the clock, you must set clock params using nvll_osd_set_clock_params(). Additionally, you must ensure that the length of text_params_list is at least num_strings.

Note
Currently only MODE_CPU is supported. Specifying other modes wil have no effect.
Parameters
[in]nvosd_ctxA pointer to NvOSD context.
[in]frame_text_paramsA pointer to the FrameTextParams struct containing rectangles information to be overlayed
Returns
0 for success, -1 for failure.
void nvll_osd_set_clock_params ( void *  nvosd_ctx,
NvOSD_TextParams clk_params 
)

Sets clock parameters for the given context.

The clock is overlayed when nvll_osd_put_text() is called. If no other text is to be overlayed, nvll_osd_put_text must be called with num_strings as 0 and text_params_list as NULL.

Parameters
[in]nvosd_ctxA pointer to NvOSD context.
[in]clk_paramsA pointer to NvOSD_TextParams structure for the clock to be overlayed; NULL to disable the clock.
void* nvll_osd_set_params ( void *  nvosd_ctx,
int  width,
int  height 
)

Sets the resolution of the frames on which the NvOSDContext will operate.

Parameters
[in]nvosd_ctxA pointer to NvOSD context.
[in]widthWidth of the input frames.
[in]heightHeight of the input frames.
Returns
0 for success, -1 for failure.