ISVP-SDK  3.12.0
Ingenic Smart Video Platform SDK
Data Structures | Macros | Typedefs | Enumerations | Functions

OSD module,On the video stream we can superimpose pictures, bitmap,line,rectangular box. More...

Collaboration diagram for IMP_OSD:

Data Structures

struct  lineRectData
 OSD region line and rectangle data. More...
 
struct  coverData
 OSD region cover data. More...
 
struct  picData
 OSD region picture data. More...
 
union  IMPOSDRgnAttrData
 OSD region attribute data. More...
 
struct  IMPOSDRgnAttr
 OSD region attribute data. More...
 
struct  IMPOSDRgnTimestamp
 OSD Rgn vaild timestamp. More...
 
struct  IMPOSDGrpRgnAttr
 OSD group region attribute. More...
 

Macros

#define INVHANDLE   (-1)
 Error return value.
 

Typedefs

typedef int IMPRgnHandle
 OSD region handle.
 

Enumerations

enum  IMPOsdColour {
  OSD_BLACK = 0xff000000, OSD_WHITE = 0xffffffff, OSD_RED = 0xffff0000, OSD_GREEN = 0xff00ff00,
  OSD_BLUE = 0xff0000ff
}
 OSD color type, color format is bgra. More...
 
enum  IMPOsdRgnType {
  OSD_REG_INV = 0, OSD_REG_LINE = 1, OSD_REG_RECT = 2, OSD_REG_BITMAP = 3,
  OSD_REG_COVER = 4, OSD_REG_PIC = 5
}
 OSD region type. More...
 

Functions

int IMP_OSD_CreateGroup (int grpNum)
 create OSD group More...
 
int IMP_OSD_DestroyGroup (int grpNum)
 destory OSD group More...
 
int IMP_OSD_AttachToGroup (IMPCell *from, IMPCell *to)
 Adding OSD group to the system. More...
 
IMPRgnHandle IMP_OSD_CreateRgn (IMPOSDRgnAttr *prAttr)
 Create OSD region. More...
 
void IMP_OSD_DestroyRgn (IMPRgnHandle handle)
 Destory OSD region. More...
 
int IMP_OSD_RegisterRgn (IMPRgnHandle handle, int grpNum, IMPOSDGrpRgnAttr *pgrAttr)
 Register OSD region. More...
 
int IMP_OSD_UnRegisterRgn (IMPRgnHandle handle, int grpNum)
 Register OSD region. More...
 
int IMP_OSD_SetRgnAttr (IMPRgnHandle handle, IMPOSDRgnAttr *prAttr)
 Set region properties. More...
 
int IMP_OSD_SetRgnAttrWithTimestamp (IMPRgnHandle handle, IMPOSDRgnAttr *prAttr, IMPOSDRgnTimestamp *prTs)
 Set region properties and effective time. More...
 
int IMP_OSD_GetRgnAttr (IMPRgnHandle handle, IMPOSDRgnAttr *prAttr)
 Get region attribute. More...
 
int IMP_OSD_UpdateRgnAttrData (IMPRgnHandle handle, IMPOSDRgnAttrData *prAttrData)
 Update the regional data attribute, only for OSD_REG_BITMAP and OSD_REG_PIC regional types. More...
 
int IMP_OSD_SetGrpRgnAttr (IMPRgnHandle handle, int grpNum, IMPOSDGrpRgnAttr *pgrAttr)
 Set OSD group region attributes. More...
 
int IMP_OSD_GetGrpRgnAttr (IMPRgnHandle handle, int grpNum, IMPOSDGrpRgnAttr *pgrAttr)
 Get OSD group region attributes. More...
 
int IMP_OSD_ShowRgn (IMPRgnHandle handle, int grpNum, int showFlag)
 Set whether the group region is displayed or not. More...
 
int IMP_OSD_Start (int grpNum)
 Set start OSD group display. More...
 
int IMP_OSD_Stop (int grpNum)
 Set the display to stop the OSD group. More...
 

Detailed Description

OSD module,On the video stream we can superimpose pictures, bitmap,line,rectangular box.

1 module introduction

The full name of OSD is On-Screen Display. The module function is to superimpose lines, pictures and other information on each source.

2 The related concepts

2.1 Region

Region is a superimposed area, in the API Rgn. each Region has a certain image information, after superimposing each OSD module, and the background image into a picture. For the image superimposition, you can also achieve the Alpha effect. For a detailed description of the various types please refer to 2.1 Region type.

2.1 Region type

There are several types of Region, respectively as:
OSD_REG_LINE:line
OSD_REG_RECT:rectangle
OSD_REG_BITMAP:bitmap
OSD_REG_COVER:cover
OSD_REG_PIC:picture
Among them, the difference between the bitmap and the picture is that the bitmap image is only a single color coverage, while the picture is a RGBA image Alpha superimposition.

3 Module function

OSD module support line, rectangular box, bitmap superimposition, rectangle cover and image superimposition. WE use software to achieve Line, rectangular box and bitmap; We use Hardware to achieve rectangle cover and image superimposition.

4 Module use

The use of OSD generally has the following steps

  1. create the OSD group
  2. bind OSD groups to the system
  3. create the OSD region
  4. register the OSD region to the OSD group
  5. Set the attributes of OSD group region and OSD region.
  6. set OSD function switch

Enumeration Type Documentation

OSD color type, color format is bgra.

Enumerator
OSD_BLACK 

black

OSD_WHITE 

white

OSD_RED 

red

OSD_GREEN 

green

OSD_BLUE 

blue

OSD region type.

Enumerator
OSD_REG_INV 

undefined region type

OSD_REG_LINE 

line

OSD_REG_RECT 

rectangle

OSD_REG_BITMAP 

dot matrix image

OSD_REG_COVER 

rectangle cover

OSD_REG_PIC 

picture, suitable for Logo or time stamp

Function Documentation

int IMP_OSD_AttachToGroup ( IMPCell from,
IMPCell to 
)

Adding OSD group to the system.

Parameters
[in]fromOSD unit
[in]toOther unit in the system
Return values
0success
non-0failure
Remarks
The new version of SDK is recommended to use Bind in order to string OSD into the system's data stream, Attach is no longer recommended to use, but API reservations, easy to be compatible with the previous version of the software. reference : 2 Bind
Attention
no.
int IMP_OSD_CreateGroup ( int  grpNum)

create OSD group

Parameters
[in]grpNumOSD group number, range: [0, NR_MAX_OSD_GROUPS - 1]
Return values
0success
non-0failure
Remarks
no。
Attention
no.
IMPRgnHandle IMP_OSD_CreateRgn ( IMPOSDRgnAttr prAttr)

Create OSD region.

Parameters
[in]prAttrOSD region attribute
Return values
greaterthan or equal to 0 success
lessthan 0 failure
Remarks
no.
Attention
no.
int IMP_OSD_DestroyGroup ( int  grpNum)

destory OSD group

Parameters
[in]grpNumOSD group number, range: [0, NR_MAX_OSD_GROUPS - 1]
Return values
0success
non-0failure
Remarks
When this is called the corresponding group should be created.
Attention
no.
void IMP_OSD_DestroyRgn ( IMPRgnHandle  handle)

Destory OSD region.

Parameters
[in]prAttrregion handle, IMP_OSD_CreateRgn return value
Return values
no
Remarks
no.
Attention
no.
int IMP_OSD_GetGrpRgnAttr ( IMPRgnHandle  handle,
int  grpNum,
IMPOSDGrpRgnAttr pgrAttr 
)

Get OSD group region attributes.

Parameters
[in]handleregion handle, IMP_OSD_CreateRgn return value
[in]grpNumOSD group number
[out]pgrAttrOSD group region attributes
Return values
0success
non-0failure
Remarks
Before calling this function, the corresponding OSD group should be already created and the region should be created and registered.
Attention
no.
int IMP_OSD_GetRgnAttr ( IMPRgnHandle  handle,
IMPOSDRgnAttr prAttr 
)

Get region attribute.

Parameters
[in]handleregion handle, IMP_OSD_CreateRgn return value
[out]prAttrOSD region attribute
Return values
0success
non-0failure
Remarks
The corresponding OSD group should be already created before calling this function.
Attention
no.
int IMP_OSD_RegisterRgn ( IMPRgnHandle  handle,
int  grpNum,
IMPOSDGrpRgnAttr pgrAttr 
)

Register OSD region.

Parameters
[in]handleregion handle, IMP_OSD_CreateRgn return value
[in]grpNumOSD group number
[in]pgrAttrOSD group display attribute
Return values
0success
non-0failure
Remarks
The corresponding OSD group should be already created before calling this function.
Attention
no.
int IMP_OSD_SetGrpRgnAttr ( IMPRgnHandle  handle,
int  grpNum,
IMPOSDGrpRgnAttr pgrAttr 
)

Set OSD group region attributes.

Parameters
[in]handleregion handle, IMP_OSD_CreateRgn return value
[in]grpNumOSD group number
[in]pgrAttrOSD group region attributes
Return values
0success
non-0failure
Remarks
Before calling this function, the corresponding OSD group should be already created and the region should be created and registered.
Attention
no.
int IMP_OSD_SetRgnAttr ( IMPRgnHandle  handle,
IMPOSDRgnAttr prAttr 
)

Set region properties.

Parameters
[in]handleregion handle, IMP_OSD_CreateRgn return value
[in]prAttrOSD region attribute
Return values
0success
non-0failure
Remarks
The corresponding OSD group should be already created before calling this function.
Attention
no.
int IMP_OSD_SetRgnAttrWithTimestamp ( IMPRgnHandle  handle,
IMPOSDRgnAttr prAttr,
IMPOSDRgnTimestamp prTs 
)

Set region properties and effective time.

Parameters
[in]handleregion handle, IMP_OSD_CreateRgn return value
[in]prAttrOSD region attribute
[in]prTseffective time
Return values
0success
non-0failure
Remarks
The corresponding OSD group should be already created before calling this function.
Attention
无。
int IMP_OSD_ShowRgn ( IMPRgnHandle  handle,
int  grpNum,
int  showFlag 
)

Set whether the group region is displayed or not.

Parameters
[in]handleregion handle, IMP_OSD_CreateRgn return value
[in]grpNumOSD group number
[in]showFlagOSD group region display switch
Return values
0success
non-0failure
Remarks
Before calling this function, the corresponding OSD group should be already created and the region should be created and registered.
Attention
no.
int IMP_OSD_Start ( int  grpNum)

Set start OSD group display.

Parameters
[in]grpNumOSD group number
Return values
0success
non-0failure
Remarks
Before calling this function, the corresponding OSD group should be already created.
Attention
no.
int IMP_OSD_Stop ( int  grpNum)

Set the display to stop the OSD group.

Parameters
[in]grpNumOSD group number
Return values
0success
non-0failure
Remarks
Before calling this function, the corresponding OSD group should be already created.
Attention
no.
int IMP_OSD_UnRegisterRgn ( IMPRgnHandle  handle,
int  grpNum 
)

Register OSD region.

Parameters
[in]handleregion handle, IMP_OSD_CreateRgn return value
[in]grpNumOSD group number
Return values
0success
non-0failure
Remarks
The corresponding OSD group should be already created and registered before calling this function.
Attention
no.
int IMP_OSD_UpdateRgnAttrData ( IMPRgnHandle  handle,
IMPOSDRgnAttrData prAttrData 
)

Update the regional data attribute, only for OSD_REG_BITMAP and OSD_REG_PIC regional types.

Parameters
[in]handleregion handle, IMP_OSD_CreateRgn return value
[in]prAttrDataOSD regional data attributes
Return values
0success
non-0failure
Remarks
Before calling this function, the corresponding OSD group should be already created and region attributes already set to OSD_REG_BITMAP or OSD_REG_PIC.
Attention
no.