Multimedia API Reference

November 16, 2016 | 24.2.1 Release

 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
nvosd.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2016, NVIDIA CORPORATION. All rights reserved.
3  *
4  * Redistribution and use in source and binary forms, with or without
5  * modification, are permitted provided that the following conditions
6  * are met:
7  * 1. Redistributions of source code must retain the above copyright
8  * notice, this list of conditions and the following disclaimer.
9  * 2. Redistributions in binary form must reproduce the above copyright
10  * notice, this list of conditions and the following disclaimer in
11  * the documentation and/or other materials provided with the
12  * distribution.
13  * 3. The names of its contributors may not be used to endorse or promote
14  * products derived from this software without specific prior written
15  * permission.
16  *
17  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
18  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
19  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
20  * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
21  * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
22  * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED
23  * TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
24  * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
25  * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
26  * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
27  * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
28  */
29 
48 #ifndef __NVOSD_DEFS__
49 #define __NVOSD_DEFS__
50 
51 #ifdef __cplusplus
52 extern "C"
53 {
54 #endif
55 
59 typedef struct _NvOSD_ColorParams {
60  double red;
63  double green;
66  double blue;
69  double alpha;
72 
73 
77 typedef struct _NvOSD_FontParams {
78  char * font_name;
81  unsigned int font_size;
85 
86 
91 typedef struct _NvOSD_TextParams {
92  char * display_text;
94  unsigned int x_offset;
96  unsigned int y_offset;
101 
102 
106 typedef struct _NvOSD_RectParams {
107  unsigned int left;
109  unsigned int top;
111  unsigned int width;
113  unsigned int height;
115  unsigned int border_width;
120  unsigned int has_bg_color;
123  unsigned int reserved;
128 
132 typedef enum{
141 } NvOSD_Mode;
142 
148 void *nvosd_create_context(void);
149 
156 void nvosd_destroy_context(void *nvosd_ctx);
157 
169 void nvosd_set_clock_params(void *nvosd_ctx, NvOSD_TextParams *clk_params);
170 
171 
192 int nvosd_put_text(void *nvosd_ctx, NvOSD_Mode mode, int fd, int num_strings,
193  NvOSD_TextParams *text_params_list);
194 
195 
224 int nvosd_draw_rectangles(void *nvosd_ctx, NvOSD_Mode mode, int fd,
225  int num_rects, NvOSD_RectParams *rect_params_list);
226 
227 #ifdef __cplusplus
228 }
229 #endif
230 
231 #endif
struct _NvOSD_ColorParams NvOSD_ColorParams
Holds the color parameters of the box or text to be overlayed.
unsigned int y_offset
Holds vertical offset w.r.t top left pixel of the frame.
Definition: nvosd.h:96
int nvosd_draw_rectangles(void *nvosd_ctx, NvOSD_Mode mode, int fd, int num_rects, NvOSD_RectParams *rect_params_list)
Overlays boxes at given location on a buffer.
Holds the font parameters of the text to be overlayed.
Definition: nvosd.h:77
int nvosd_put_text(void *nvosd_ctx, NvOSD_Mode mode, int fd, int num_strings, NvOSD_TextParams *text_params_list)
Overlays clock and given text at given location on a buffer.
Holds the box parameters of the box to be overlayed.
Definition: nvosd.h:106
unsigned int top
Holds top coordinate of the box in pixels.
Definition: nvosd.h:109
void nvosd_destroy_context(void *nvosd_ctx)
Destroys NvOSD context.
unsigned int height
Holds height of the box in pixels.
Definition: nvosd.h:113
NvOSD_ColorParams border_color
Holds color params of the border of the box.
Definition: nvosd.h:117
unsigned int reserved
Definition: nvosd.h:123
NvOSD_Mode
List modes used to overlay boxes and text.
Definition: nvosd.h:132
struct _NvOSD_TextParams NvOSD_TextParams
Holds the text parameters of the text to be overlayed.
unsigned int x_offset
Holds horizontal offset w.r.t top left pixel of the frame.
Definition: nvosd.h:94
void nvosd_set_clock_params(void *nvosd_ctx, NvOSD_TextParams *clk_params)
Sets clock parameters for the given context.
char * display_text
Holds the text to be overlayed.
Definition: nvosd.h:92
unsigned int left
Holds left coordinate of the box in pixels.
Definition: nvosd.h:107
double alpha
Holds alpha component of color.
Definition: nvosd.h:69
Selects NV HW engine for rectangle draw and mask.
Definition: nvosd.h:137
char * font_name
Holds pointer to the string containing font name.
Definition: nvosd.h:78
NvOSD_ColorParams font_color
Holds font color.
Definition: nvosd.h:83
struct _NvOSD_RectParams NvOSD_RectParams
Holds the box parameters of the box to be overlayed.
Holds the text parameters of the text to be overlayed.
Definition: nvosd.h:91
struct _NvOSD_FontParams NvOSD_FontParams
Holds the font parameters of the text to be overlayed.
Selects CPU for OSD processing.
Definition: nvosd.h:133
unsigned int width
Holds width of the box in pixels.
Definition: nvosd.h:111
Holds the color parameters of the box or text to be overlayed.
Definition: nvosd.h:59
unsigned int has_bg_color
Holds boolean value indicating whether box has background color.
Definition: nvosd.h:120
unsigned int border_width
Holds border_width of the box in pixels.
Definition: nvosd.h:115
double blue
Holds blue component of color.
Definition: nvosd.h:66
double red
Holds red component of color.
Definition: nvosd.h:60
unsigned int font_size
Holds size of the font.
Definition: nvosd.h:81
void * nvosd_create_context(void)
Creates NvOSD context.
NvOSD_FontParams font_params
font_params.
Definition: nvosd.h:99
double green
Holds green component of color.
Definition: nvosd.h:63
Selects GPU for OSD processing.
Definition: nvosd.h:135
NvOSD_ColorParams bg_color
Reserved field for future usage.
Definition: nvosd.h:126