4.3. API Reference¶
The Video Input (VI) module enables the activation of the video input device, creation of video input PIPE, configuration of video input channels, binding of the Dev to MIPI devices, and binding of the PIPE to Dev, etc.
The function module provides the following APIs.
CVI_VI_SetDevAttr: Set VI device properties.
CVI_VI_GetDevAttr: Get VI device properties.
CVI_VI_SetDevAttrEx: Set VI device advanced properties.
CVI_VI_GetDevAttrEx: Get VI device advanced properties.
CVI_VI_EnableDev: Enable the VI device.
CVI_VI_DisableDev: Disable VI devices.
CVI_VI_SetDevBindPipe: Set the binding relationship between VI device and physical PIPE.
CVI_VI_GetDevBindPipe: Obtain the physical PIPE bound to the VI device
CVI_VI_SetDevTimingAttr: Set the self-generating timing property.
CVI_VI_GetDevTimingAttr: Get the self-generating timing property.
CVI_VI_CreatePipe: Create a VI PIPE.
CVI_VI_DestroyPipe: Destroy a VI PIPE.
CVI_VI_SetPipeAttr: Set the properties of VI PIPE.
CVI_VI_GetPipeAttr: Get the properties of VI PIPE.
CVI_VI_StartPipe: Enable the VI PIPE.
CVI_VI_StopPipe: Disable the VI PIPE.
CVI_VI_SetPipeCrop: Set the VI physical PIPE clipping function properties.
CVI_VI_GetPipeCrop: Get the VI physical PIPE clipping function properties.
CVI_VI_SetPipeDumpAttr: Set the VI physical PIPE dump property.
CVI_VI_GetPipeDumpAttr: Get the VI physical PIPE dump property.
CVI_VI_SetPipeFrameSource: Set the source of VI PIPE data.
CVI_VI_GetPipeFrameSource: Get the source of VI PIPE data.
CVI_VI_GetPipeFrame: Get the data of VI physical PIPE.
CVI_VI_ReleasePipeFrame: Release the data of VI PIPE .
CVI_VI_SendPipeRaw: Send raw data through VI PIPE.
CVI_VI_QueryPipeStatus: View VI PIPE status.
CVI_VI_GetPipeFd: Get the VI PIPE file descriptor.
CVI_VI_CloseFd: Close the VI file descriptor.
CVI_VI_AttachVbPool :Bind the VI channel to a video cache VB pool.
CVI_VI_DetachVbPool : Unbind the VI channel from a video cache VB pool.
CVI_VI_SetChnAttr: Set VI channel properties.
CVI_VI_GetChnAttr: Get VI channel properties.
CVI_VI_EnableChn: Enable the VI channel.
CVI_VI_DisableChn: Disable the VI channel.
CVI_VI_SetChnCrop: Set VI channel clipping function properties.
CVI_VI_GetChnCrop: Get VI channel clipping function properties.
CVI_VI_GetChnFrame: Capture an image frame from VI channel.
CVI_VI_ReleaseChnFrame: Release an image captured from the VI channel.
CVI_VI_SetChnRotation: Set the properties of VI channel rotation.
CVI_VI_GetChnRotation: Get the properties of VI channel rotation.
CVI_VI_RegChnFlipMirrorCallBack :Register VI channel callback function for flip and mirror.
CVI_VI_UnRegChnFlipMirrorCallBack :Un-Register VI channel callback function for flip and mirror.
CVI_VI_SetChnFlipMirror :Set the properties of VI channel flip and mirror.
CVI_VI_GetChnFlipMirror :Get the properties of VI channel flip and mirror.
CVI_VI_Suspend: Susped VI device.
CVI_VI_Resume: Resume VI device.
CVI_VI_SetDevNum: Set VI device number.
CVI_VI_GetDevNum: Get VI device number.
CVI_VI_EnablePatt: Enable VI pattern mode.
CVI_VI_SetUserPic: Set user picture, Basically not used now.
CVI_VI_EnableUserPic: Enable user picture, Basically not used now.
CVI_VI_DisableUserPic: Disable user picture, Basically not used now.
CVI_VI_StartSmoothRawDump: Start dumping smooth raw images.
CVI_VI_StopSmoothRawDump: Stop dumping smooth raw images.
CVI_VI_GetSmoothRawDump: Get a smooth raw image after dumping.
CVI_VI_PutSmoothRawDump: Put a smooth raw image after dumping.
CVI_VI_GetRgbMapLeBuf: Get the rgbmap long frame buffer.
CVI_VI_GetRgbMapSeBuf: Get the rgbmap short frame buffer.
CVI_VI_DumpHwRegisterToFile: Download hardware register data to the file.
CVI_VI_QueryChnStatus: View the status of the VI channel.
CVI_VI_GetChnFd: Get the VI file descriptor.
CVI_VI_SetChnAlign: Set VI channel alignment.
CVI_VI_GetChnAlign: Get VI channel alignment.
CVI_VI_RegPmCallBack: Register VI device power management callback function.
CVI_VI_UnRegPmCallBack: Unregister VI device power management callback function.
CVI_VI_SetTuningDis: Set tuning parameters.
4.3.1. CVI_VI_SetDevAttr¶
【Description】
Set VI device properties. The basic device attributes default to some processor configurations.
【Syntax】
CVI_S32 CVI_VI_SetDevAttr(VI_DEV ViDev, const VI_DEV_ATTR_S *pstDevAttr);
【Parameter】
Parameter |
Description |
Input/Output |
---|---|---|
ViDev |
VI device number. Value range: [0, VI_MAX_DEV_NUM); |
Input |
pstDevAttr |
The property pointer for VI device. Static properties |
Input |
【Return Value】
Return Value |
Description |
---|---|
0 |
Success. |
Non 0 |
Failure. For details, please refer to Error Codes. |
【Requirement】
Header files: cvi_vi.h, cvi_comm_vi.h
Library files: libvpu.a
【Note】
Make sure the VI device is disabled before calling this interface. If the VI device is enabled, CVI_VI_DisableDev can be used to disable the device.
The parameter pstDevAttr is mainly used to configure the video interface mode for a specified VI device, which is used to interface with peripheral cameras, sensors, or codecs. The supported interface modes include MIPI_RX (MIPI/LVDS/HISPI).
Users need to configure the following information, and the specific attribute meanings are described in the “Data Types” section of Chapter 4.4:
Interface mode information: the interface mode can be MIPI_RX (MIPI/LVDS/HISPI) and other modes.
Working mode information: 1 channel multiplexed mode.
Data layout information: data arrangement under YUV data input.
Data information: RGB, YUV data input.
Synchronization timing information: Properties of vertical and horizontal synchronization signals.
【Example】
VI_DEV_ATTR_S DEV_ATTR_IMX327_2M_BASE = {
VI_MODE_MIPI,
VI_WORK_MODE_1Multiplex,
VI_SCAN_PROGRESSIVE,
{-1, -1, -1, -1},
VI_DATA_SEQ_YUYV,
{
/*port_vsync port_vsync_neg port_hsync port_hsync_neg */
VI_VSYNC_PULSE, VI_VSYNC_NEG_LOW, VI_HSYNC_VALID_SINGNAL, VI_HSYNC_NEG_HIGH,
VI_VSYNC_VALID_SIGNAL, VI_VSYNC_VALID_NEG_HIGH,
/*hsync_hfb hsync_act hsync_hhb*/
{0, 1920, 0,
/*vsync0_vhb vsync0_act vsync0_hhb*/
0, 1080, 0,
/*vsync1_vhb vsync1_act vsync1_hhb*/
0, 0, 0}
},
VI_DATA_TYPE_RGB,
{1920, 1080},
{
WDR_MODE_NONE,
1080
},
.enBayerFormat = BAYER_FORMAT_RG,
};
int main(void)
{
SAMPLE_SNS_TYPE_E enSnsType = SONY_IMX327_MIPI_2M_30FPS_12BIT;
VI_DEV_ATTR_S stViDevAttr;
SAMPLE_COMM_VI_GetDevAttrBySns(enSnsType, &stViDevAttr);
s32Ret = CVI_VI_SetDevAttr(0, &stViDevAttr);
if (s32Ret != CVI_SUCCESS) {
SAMPLE_PRT("CVI_VI_SetDevAttr failed with %#x\n", s32Ret);
return s32Ret;
}
s32Ret = CVI_VI_EnableDev(0);
if (s32Ret != CVI_SUCCESS) {
SAMPLE_PRT("CVI_VI_EnableDev failed with %#x\n", s32Ret);
return s32Ret;
}
CVI_VI_DisableDev(0);
s32Ret = CVI_VI_StopPipe(ViPipe);
if (s32Ret != CVI_SUCCESS) {
SAMPLE_PRT("CVI_VI_StopPipe failed with %#x!\n", s32Ret);
return s32Ret;
}
s32Ret = CVI_VI_DestroyPipe(ViPipe);
if (s32Ret != CVI_SUCCESS) {
SAMPLE_PRT("CVI_VI_DestroyPipe failed with %#x!\n", s32Ret);
return s32Ret;
}
}
【Related Topic】
4.3.2. CVI_VI_GetDevAttr¶
【Description】
Get VI device properties.
【Syntax】
CVI_S32 CVI_VI_GetDevAttr(VI_DEV ViDev, VI_DEV_ATTR_S *pstDevAttr);
【Parameter】
Parameter |
Description |
Input/Output |
---|---|---|
ViDev |
VI device number. Value range: [0, VI_MAX_DEV_NUM). |
Input |
pstDevAttr |
The property pointer for VI device. |
Output |
【Return Value】
Return Value |
Description |
---|---|
0 |
Success. |
Non 0 |
Failure. For details, please refer to Error Codes. |
【Requirement】
Header files: cvi_vi.h, cvi_comm_vi.h
Library files: libvpu.a
【Note】
If the VI device property is not set, the interface will return a failure.
【Example】
None.
【Related Topic】
4.3.3. CVI_VI_SetDevAttrEx¶
【Description】
Set VI device advanced properties.
【Syntax】
CVI_S32 CVI_VI_SetDevAttrEx(VI_DEV ViDev, const VI_DEV_ATTR_EX_S *pstDevAttrEx);
【Parameter】
Parameter |
Description |
Input/Output |
---|---|---|
ViDev |
VI device number. Value range: [0, VI_MAX_DEV_NUM). |
Input |
pstDevAttrEx |
The property pointer for VI device advanced. Static properties. |
Input |
【Return Value】
Return Value |
Description |
---|---|
0 |
Success. |
Non 0 |
Failure. For details, please refer to Error Codes. |
【Requirement】
Header files: cvi_vi.h, cvi_comm_vi.h
Library files: libvpu.a
【Note】
This interface is not supported at this time.
【Example】
None.
【Related Topic】
None.
4.3.4. CVI_VI_GetDevAttrEx¶
【Description】
Get VI device advanced properties.
【Syntax】
CVI_S32 CVI_VI_GetDevAttrEx(VI_DEV ViDev, VI_DEV_ATTR_EX_S *pstDevAttrEx);
【Parameter】
Parameter |
Description |
Input/Output |
---|---|---|
ViDev |
VI device number. Value range: [0, VI_MAX_DEV_NUM). |
Input |
pstDevAttrEx |
The property pointer for VI device advanced. Static properties. |
Output |
【Return Value】
Return Value |
Description |
---|---|
0 |
Success. |
Non 0 |
Failure. For details, please refer to Error Codes. |
【Requirement】
Header files: cvi_vi.h, cvi_comm_vi.h
Library files: libvpu.a
【Note】
This interface is not in use.
【Example】
None.
【Related Topic】
None.
4.3.5. CVI_VI_EnableDev¶
【Description】
Enable the VI device.
【Syntax】
CVI_S32 CVI_VI_EnableDev(VI_DEV ViDev);
【Parameter】
Parameter |
Description |
Input/Output |
---|---|---|
ViDev |
VI device number. Value range: [0, VI_MAX_DEV_NUM). |
Input |
【Return Value】
Return Value |
Description |
---|---|
0 |
Success. |
Non 0 |
Failure. For details, please refer to Error Codes. |
【Requirement】
Header files: cvi_vi.h, cvi_comm_vi.h
Library files: libvpu.a
【Note】
If the VI device property is not set, the interface will return failure.
CV181x supports three VI DEV starting at the same time.
CV180x supports one VI DEV starting at the same time.
【Example】
None.
【Related Topic】
4.3.6. CVI_VI_DisableDev¶
【Description】
Disable the VI device.
【Syntax】
CVI_S32 CVI_VI_DisableDev(VI_DEV ViDev);
【Parameter】
Parameter |
Description |
Input/Output |
---|---|---|
ViDev |
VI device number. Value range: [0, VI_MAX_DEV_NUM). |
Input |
【Return Value】
Return Value |
Description |
---|---|
0 |
Success. |
Non 0 |
Failure. For details, please refer to Error Codes. |
【Requirement】
Header files: cvi_vi.h, cvi_comm_vi.h
Library files: libvpu.a
【Note】
It is recommended to destroy all the physical PIPE bound to the VI device before disabling the VI device.
After the VI device is disabled, the device will shut down completely. You need to reset the properties to enable the VI device.
【Example】
None.
【Related Topic】
4.3.7. CVI_VI_SetDevBindPipe¶
【Description】
Set the binding relationship between VI device and physical pipe.
【Syntax】
CVI_S32 CVI_VI_SetDevBindPipe(VI_DEV ViDev, const VI_DEV_BIND_PIPE_S *pstDevBindPipe);
【Parameter】
Parameter |
Description |
Input/Output |
---|---|---|
ViDev |
VI device number. Value range: [0, VI_MAX_DEV_NUM). |
Input |
pstDevBindPipe |
Pointer to the structure of the physical PIPE information bound to the Dev. |
Input |
【Return Value】
Return Value |
Description |
---|---|
0 |
Success. |
Non 0 |
Failure. For details, please refer to Error Codes. |
【Requirement】
Header files: cvi_vi.h, cvi_comm_vi.h
Library files: libvpu.a
【Note】
The VI device must be enabled before binding the physical pipe.
This interface is not in use.
【Example】
None.
【Related Topic】
4.3.8. CVI_VI_GetDevBindPipe¶
【Description】
Get the physical pipe to which the VI device is bound.
【Syntax】
CVI_S32 CVI_VI_GetDevBindPipe(VI_DEV ViDev, VI_DEV_BIND_PIPE_S *pstDevBindPipe);
【Parameter】
Parameter |
Description |
Input/Output |
---|---|---|
ViDev |
VI device number. Value range: [0, VI_MAX_DEV_NUM). |
Input |
pstDevBindPipe |
Pointer to the structure of the physical PIPE information bound to the Dev. |
Output |
【Return Value】
Return Value |
Description |
---|---|
0 |
Success. |
Non 0 |
Failure. For details, please refer to Error Codes. |
【Requirement】
Header files: cvi_vi.h, cvi_comm_vi.h
Library files: libvpu.a
【Note】
Before using this interface, you need to enable the device and bind the physical pipe, otherwise it will return failure.
This interface is not in use.
【Example】
None.
【Related Topic】
4.3.9. CVI_VI_SetDevTimingAttr¶
【Description】
Set the self-generating timing property.
【Syntax】
CVI_S32 CVI_VI_SetDevTimingAttr(VI_DEV ViDev, const VI_DEV_TIMING_ATTR_S *pstTimingAttr);
【Parameter】
Parameter |
Description |
Input/Output |
---|---|---|
ViDev |
VI device number. Value range: [0, VI_MAX_DEV_NUM). |
Input |
pstTimingAttr |
See VI_DEV_TIMING_ATTR_S for details. |
Input |
【Return Value】
Return Value |
Description |
---|---|
0 |
Success. |
Non 0 |
Failure. For details, please refer to Error Codes. |
【Requirement】
Header files: cvi_vi.h, cvi_comm_vi.h
Library files: libvpu.a
【Note】
Before using this interface, you need to configure the DEV attribute and enable the device, otherwise it will return failure.
When filling RAW with self-generated timing function, the width and height of DEV/ PIPE/ CHN should be consistent with the width and height of RAW file.
After the time sequence is generated, if RAW is not filled, there will be no image display; for the way of filling RAW, please refer to CVI_VI_SendPipeRaw.
After enabling self-generated timing, the output frame rate of VI is determined by the effective frame rate generated by configuring self-generated timing.
【Example】
None.
【Related Topic】
4.3.10. CVI_VI_GetDevTimingAttr¶
【Description】
Get the self-generating timing property.
【Syntax】
CVI_S32 CVI_VI_GetDevTimingAttr(VI_DEV ViDev, VI_DEV_TIMING_ATTR_S *pstTimingAttr);
【Parameter】
Parameter |
Description |
Input/Output |
---|---|---|
ViDev |
VI device number. Value range: [0, VI_MAX_DEV_NUM). |
Input |
pstTimingAttr |
See VI_DEV_TIMING_ATTR_S for details. |
Output |
【Return Value】
Return Value |
Description |
---|---|
0 |
Success. |
Non 0 |
Failure. For details, please refer to Error Codes. |
【Requirement】
Header files: cvi_vi.h, cvi_comm_vi.h
Library files: libvpu.a
【Note】
Before using this interface, you need to configure DevTimingAttr and enable the device, otherwise it will return failure.
【Example】
None.
【Related Topic】
4.3.11. CVI_VI_CreatePipe¶
【Description】
Create a VI PIPE.
【Syntax】
CVI_S32 CVI_VI_CreatePipe(VI_PIPE ViPipe, const VI_PIPE_ATTR_S *pstPipeAttr);
【Parameter】
Parameter |
Description |
Input/Output |
---|---|---|
ViPipe |
VI physical PIPE number. |
Input |
pstPipeAttr |
PIPE attribute structure pointer. See VI_PIPE_ATTR_S for description. |
Input |
【Return Value】
Return Value |
Description |
---|---|
0 |
Success. |
Non 0 |
Failure. For details, please refer to Error Codes. |
【Requirement】
Header files: cvi_vi.h, cvi_comm_vi.h
Library files: libvpu.a
【Note】
Duplicate creation is not supported.
【Example】
None.
【Related Topic】
4.3.12. CVI_VI_DestroyPipe¶
【Description】
Destroy a VI PIPE.
【Syntax】
CVI_S32 CVI_VI_DestroyPipe(VI_PIPE ViPipe);
【Parameter】
Parameter |
Description |
Input/Output |
---|---|---|
ViPipe |
VI physical PIPE number. |
Input |
pstPipeAttr |
PIPE attribute structure pointer. |
Input |
【Return Value】
Return Value |
Description |
---|---|
0 |
Success. |
Non 0 |
Failure. For details, please refer to Error Codes. |
【Requirement】
Header files: cvi_vi.h, cvi_comm_vi.h
Library files: libvpu.a
【Note】
When the pipe is not created or repeatedly destroyed, calling this interface will prompt that the pipe does not exist.
【Example】
None.
【Related Topic】
4.3.13. CVI_VI_SetPipeAttr¶
【Description】
Set the properties of VI PIPE.
【Syntax】
CVI_S32 CVI_VI_SetPipeAttr(VI_PIPE ViPipe, const VI_PIPE_ATTR_S *pstPipeAttr);
【Parameter】
Parameter |
Description |
Input/Output |
---|---|---|
ViPipe |
VI physical PIPE number. |
Input |
pstPipeAttr |
PIPE attribute structure pointer. See VI_PIPE_ATTR_S for description. |
Input |
【Return Value】
Return Value |
Description |
---|---|
0 |
Success. |
Non 0 |
Failure. For details, please refer to Error Codes. |
【Requirement】
Header files: cvi_vi.h, cvi_comm_vi.h
Library files: libvpu.a
【Note】
Before using this interface, you need to call CVI_VI_CreatePipe(ViPipe) first, otherwise it will fail.
The PIPE attributes must be legal, and some of the static attributes cannot be dynamically set, please refer to VI_PIPE_ATTR_S for details.
【Example】
None.
【Related Topic】
None.
4.3.14. CVI_VI_GetPipeAttr¶
【Description】
Get the properties of VI PIPE
【Syntax】
CVI_S32 CVI_VI_GetPipeAttr(VI_PIPE ViPipe, VI_PIPE_ATTR_S *pstPipeAttr);
【Parameter】
Parameter |
Description |
Input/Output |
---|---|---|
ViPipe |
VI physical PIPE number. |
Input |
pstPipeAttr |
PIPE attribute structure pointer. See VI_PIPE_ATTR_S for details. |
Output |
【Return Value】
Return Value |
Description |
---|---|
0 |
Success. |
Non 0 |
Failure. For details, please refer to Error Codes. |
【Requirement】
Header files: cvi_vi.h, cvi_comm_vi.h
Library files: libvpu.a
【Note】
Before using this interface, call CVI_VI_SetPipeAttr(ViPipe) first.
【Example】
None.
【Related Topic】
4.3.15. CVI_VI_StartPipe¶
【Description】
Start VI PIPE.
【Syntax】
CVI_S32 CVI_VI_StartPipe(VI_PIPE ViPipe);
【Parameter】
Parameter |
Description |
Input/Output |
---|---|---|
ViPipe |
VI physical PIPE number. |
Input |
【Return Value】
Return Value |
Description |
---|---|
0 |
Success. |
Non 0 |
Failure. For details, please refer to Error Codes. |
【Requirement】
Header files: cvi_vi.h, cvi_comm_vi.h
Library files: libvpu.a
【Note】
Before using this interface, call CVI_VI_CreatePipe first.
【Example】
None.
【Related Topic】
4.3.16. CVI_VI_StopPipe¶
【Description】
Disable VI PIPE.
【Syntax】
CVI_S32 CVI_VI_StopPipe(VI_PIPE ViPipe);
【Parameter】
Parameter |
Description |
Input/Output |
---|---|---|
ViPipe |
VI physical PIPE number. |
Input |
【Return Value】
Return Value |
Description |
---|---|
0 |
Success. |
Non 0 |
Failure. For details, please refer to Error Codes. |
【Requirement】
Header files: cvi_vi.h, cvi_comm_vi.h
Library files: libvpu.a
【Note】
Before using this interface, the PIPE must have already been created.
【Example】
None.
【Related Topic】
4.3.17. CVI_VI_SetPipeCrop¶
【Description】
Set the VI physical PIPE clipping function properties.
【Syntax】
CVI_S32 CVI_VI_SetPipeCrop(VI_PIPE ViPipe, const CROP_INFO_S *pstCropInfo);
【Parameter】
Parameter |
Description |
Input/Output |
---|---|---|
ViPipe |
VI physical PIPE number. |
Input |
pstCropInfo |
Pointer to structure of clipping function parameter. |
Input |
【Return Value】
Return Value |
Description |
---|---|
0 |
Success. |
Non 0 |
Failure. For details, please refer to Error Codes. |
【Requirement】
Header files: cvi_vi.h, cvi_comm_vi.h
Library files: libvpu.a
【Note】
Before using this interface, the PIPE must have already been created.
This interface has the same effect as VI_SetChnCrop.
【Example】
None.
【Related Topic】
None.
4.3.18. CVI_VI_GetPipeCrop¶
【Description】
Get the properties of VI physical PIPE clipping function.
【Syntax】
CVI_S32 CVI_VI_GetPipeCrop(VI_PIPE ViPipe, CROP_INFO_S *pstCropInfo);
【Parameter】
Parameter |
Description |
Input/Output |
---|---|---|
ViPipe |
VI physical PIPE number. |
Input |
pstCropInfo |
Pointer to structure of clipping function parameter. |
Output |
【Return Value】
Return Value |
Description |
---|---|
0 |
Success. |
Non 0 |
Failure. For details, please refer to Error Codes. |
【Requirement】
Header files: cvi_vi.h, cvi_comm_vi.h
Library files: libvpu.a
【Note】
Before using this interface, the PIPE must have already been created.
【Example】
None.
【Related Topic】
None.
4.3.19. CVI_VI_SetPipeDumpAttr¶
【Description】
Set the VI physical PIPE dump property.
【Syntax】
CVI_S32 CVI_VI_SetPipeDumpAttr(VI_PIPE ViPipe, const VI_DUMP_ATTR_S *pstDumpAttr);
【Parameter】
Parameter |
Description |
Input/Output |
---|---|---|
ViPipe |
Physical pipe number. Value range: [0, VI_MAX_PHY_PIPE_NUM - 1). |
Input |
pstDumpAttr |
Attributes for dumping the VI physical PIPE. See VI_DUMP_ATTR_S for details. |
Input |
【Return Value】
Return Value |
Description |
---|---|
0 |
Success. |
Non 0 |
Failure. For details, please refer to Error Codes. |
【Requirement】
Header files: cvi_vi.h, cvi_comm_vi.h
Library files: libvpu.a
【Note】
Supports dumping 12-bit uncompressed or 6-bit compressed RAW files.
If the file is in YUV format, it is recommended to use CVI_VI_GetChnFrame.
Dumping IR data is not supported.
【Example】
None.
【Related Topic】
None.
4.3.20. CVI_VI_GetPipeDumpAttr¶
【Description】
Get the VI physical PIPE dump property.
【Syntax】
CVI_S32 CVI_VI_GetPipeDumpAttr(VI_PIPE ViPipe, VI_DUMP_ATTR_S *pstDumpAttr);
【Parameter】
Parameter |
Description |
Input/Output |
---|---|---|
ViPipe |
Physical pipe number. Value range: [0, VI_MAX_PHY_PIPE_NUM - 1). |
Input |
pstDumpAttr |
Attributes for dumping the VI physical PIPE. See VI_DUMP_ATTR_S for details. |
Output |
【Return Value】
Return Value |
Description |
---|---|
0 |
Success. |
Non 0 |
Failure. For details, please refer to Error Codes. |
【Requirement】
Header files: cvi_vi.h, cvi_comm_vi.h
Library files: libvpu.a
【Note】
PIPE must have already been created.
【Example】
None.
【Related Topic】
4.3.21. CVI_VI_SetPipeFrameSource¶
【Description】
Set the source of VI PIPE data.
【Syntax】
CVI_S32 CVI_VI_SetPipeFrameSource(VI_PIPE ViPipe, const VI_PIPE_FRAME_SOURCE_E enSource);
【Parameter】
Parameter |
Description |
Input/Output |
---|---|---|
ViPipe |
VI physical PIPE number. |
Input |
enSource |
The data source of PIPE. |
Output |
【Return Value】
Return Value |
Description |
---|---|
0 |
Success. |
Non 0 |
Failure. For details, please refer to Error Codes. |
【Requirement】
Header files: cvi_vi.h, cvi_comm_vi.h
Library files: libvpu.a
【Note】
PIPE must have been created.
【Example】
None.
【Related Topic】
None.
4.3.22. CVI_VI_GetPipeFrameSource¶
【Description】
Get the source of VI PIPE data.
【Syntax】
CVI_S32 CVI_VI_GetPipeFrameSource(VI_PIPE ViPipe, VI_PIPE_FRAME_SOURCE_E *penSource);
【Parameter】
Parameter |
Description |
Input/Output |
---|---|---|
ViPipe |
VI device number. Value range: [0, VI_MAX_DEV_NUM). |
Input |
penSource |
The data source of PIPE. |
Output |
【Return Value】
Return Value |
Description |
---|---|
0 |
Success. |
Non 0 |
Failure. For details, please refer to Error Codes. |
【Requirement】
Header files: cvi_vi.h, cvi_comm_vi.h
Library files: libvpu.a
【Note】
PIPE must have been created.
【Example】
None.
【Related Topic】
None.
4.3.23. CVI_VI_GetPipeFrame¶
【Description】
Get the data of VI physical pipe.
【Syntax】
CVI_S32 CVI_VI_GetPipeFrame(VI_PIPE ViPipe, VIDEO_FRAME_INFO_S *pstVideoFrame, CVI_S32 s32MilliSec);
【Parameter】
Parameter |
Description |
Input/Output |
---|---|---|
ViPipe |
Physical pipe number. Value range: [0, VI_MAX_PHY_PIPE_NUM - 1). |
Input |
pstVideoFrame |
Pointer to VI PIPE data information. |
Output |
s32MilliSec |
Timeout parameter: the unit of timeout is in milliseconds (ms). |
Input/Output |
【Return Value】
Return Value |
Description |
---|---|
0 |
Success. |
Non 0 |
Failure. For details, please refer to Error Codes. |
【Requirement】
Header files: cvi_vi.h, cvi_comm_vi.h
Library files: libvpu.a
【Note】
PIPE must have been created.
Call CVI_VI_SetPipeDumpAttr to set the dump property, enable dump, and set depth, otherwise raw data cannot be obtained.
The timeout parameter s32MilliSec and the valid range for setting is starting from 0.
If the raw data is obtained earlier than the timeout, the function returns.
【Example】
None.
【Related Topic】
4.3.24. CVI_VI_ReleasePipeFrame¶
【Description】
Release VI PIPE data
【Syntax】
CVI_S32 CVI_VI_ReleasePipeFrame(VI_PIPE ViPipe, const VIDEO_FRAME_INFO_S *pstVideoFrame);
【Parameter】
Parameter |
Description |
Input/Output |
---|---|---|
ViPipe |
Physical PIPE number. Value range: [0, VI_MAX_PHY_PIPE_NUM - 1); |
Input |
pstVideoFrame |
Pointer to VI PIPE data information. |
Input |
【Return Value】
Return Value |
Description |
---|---|
0 |
Success. |
Non 0 |
Failure. For details, please refer to Error Codes. |
【Requirement】
Header files: cvi_vi.h, cvi_comm_vi.h
Library files: libvpu.a
【Note】
This interface should be used in conjunction with CVI_VI_GetPipeFrame. Failure to release the frame obtained by GetPipeFrame will result in insufficient system memory, which will affect the operation of VI.
The user must ensure that the information in the pstVideoFrame structure is consistent with that used in GetPipeFrame, otherwise the release may not be successful.
【Example】
None.
【Related Topic】
4.3.25. CVI_VI_SendPipeRaw¶
【Description】
Send RAW data through VI PIPE.
【Syntax】
CVI_S32 CVI_VI_SendPipeRaw(CVI_U32 u32PipeNum, VI_PIPE PipeId[], const VIDEO_FRAME_INFO_S *pstVideoFrame[], CVI_S32 s32MilliSec);
【Parameter】
Parameter |
Description |
Input/Output |
---|---|---|
u32PipeNum |
Number of Pipes. Always filled with a value of 1. |
Input |
PipeId |
PIPE number array, which size is u32PipeNum. |
Input |
pstVideoFrame |
RAW data information. |
Input |
s32MilliSec |
The timeout parameter: If it is greater than 0, it indicates timeout mode, and the unit of timeout time is milliseconds (ms). |
Input |
【Return Value】
Return Value |
Description |
---|---|
0 |
Success. |
Non 0 |
Failure. For details, please refer to Error Codes. |
【Requirement】
Header filesv:cvi_vi.h, cvi_comm_vi.h
Library files: libvpu.a
【Note】
PIPE must be created and started.
To send RAW, the source of PIPE data needs to be set using CVI_VI_SetPipeFrameSource.
Support user-defined timing to load RAW data.
Only supports non-compressed mode.
【Example】
None.
【Related Topic】
4.3.26. CVI_VI_QueryPipeStatus¶
【Description】
Query VI PIPE status.
【Syntax】
CVI_S32 CVI_VI_QueryPipeStatus(VI_PIPE ViPipe, VI_PIPE_STATUS_S *pstStatus);
【Parameter】
Parameter |
Description |
Input/Output |
---|---|---|
ViPipe |
PIPE number. |
Input |
pstStatus |
PIPE status information. |
Output |
【Return Value】
Return Value |
Description |
---|---|
0 |
Success. |
Non 0 |
Failure. For details, please refer to Error Codes. |
【Requirement】
Header files: cvi_vi.h, cvi_comm_vi.h
Library files: libvpu.a
【Note】
PIPE must be created and started.
【Example】
None.
【Related Topic】
None.
4.3.27. CVI_VI_GetPipeFd¶
【Description】
Get the VI PIPE file descriptor.
【Syntax】
CVI_S32 CVI_VI_GetPipeFd(VI_PIPE ViPipe);
【Parameter】
Parameter |
Description |
Input/Output |
---|---|---|
ViPipe |
PIPE number. |
Input |
【Return Value】
Return Value |
Description |
---|---|
0 |
Success. |
Non 0 |
Failure. For details, please refer to Error Codes. |
【Requirement】
Header files: cvi_vi.h, cvi_comm_vi.h
Library files: libvpu.a
【Note】
PIPE must be created and started.
【Example】
None.
【Related Topic】
None.
4.3.28. CVI_VI_CloseFd¶
【Description】
Close the VI file descriptor.
【Syntax】
CVI_S32 CVI_VI_CloseFd(void);
【Parameter】
None.
【Return Value】
Return Value |
Description |
---|---|
0 |
Success. |
Non 0 |
Failure. For details, please refer to Error Codes. |
【Requirement】
Header files: cvi_vi.h, cvi_comm_vi.h
Library files: libvpu.a
【Note】
This interface is not supported at this time.
【Example】
None.
【Related Topic】
None.
4.3.29. CVI_VI_AttachVbPool¶
【Description】
Bind the VI channel to a video cache VB pool.
【Syntax】
CVI_S32 CVI_VI_AttachVbPool(VI_PIPE ViPipe, VI_CHN ViChn, VB_POOL VbPool);
【Parameter】
Parameter |
Description |
Input/Output |
---|---|---|
ViPipe |
PIPE number. |
Input |
ViChn |
VI channel number. |
Input |
VbPool |
video cache VB pool info. |
Input |
【Return Value】
Return Value |
Description |
---|---|
0 |
Success. |
Non 0 |
Failure. For details, please refer to Error Codes. |
【Requirement】
Header files: cvi_vi.h, cvi_comm_vb.h
Library files: libvpu.a
【Note】
ViPipe and ViChn must conform to the range of values.
VbPool must be guaranteed to be a valid pool ID for the VB pool that has been created.
【Example】
None.
【Related Topic】
None.
4.3.30. CVI_VI_DetachVbPool¶
【Description】
Unbind the VI channel from a video cache VB pool
【Syntax】
CVI_S32 CVI_VI_DetachVbPool(VI_PIPE ViPipe, VI_CHN ViChn);
【Parameter】
Parameter |
Description |
Input/Output |
---|---|---|
ViPipe |
PIPE number. |
Input |
ViChn |
VI channel number. |
Input |
【Return Value】
Return Value |
Description |
---|---|
0 |
Success. |
Non 0 |
Failure. For details, please refer to Error Codes. |
【Requirement】
Header files: cvi_vi.h, cvi_comm_vi.h
Library files: libvpu.a
【Note】
None.
【Example】
None.
【Related Topic】
None.
4.3.31. CVI_VI_SetChnAttr¶
【Description】
Set VI channel properties.
【Syntax】
CVI_S32 CVI_VI_SetChnAttr(VI_PIPE ViPipe, VI_CHN ViChn, const VI_CHN_ATTR_S *pstChnAttr);
【Parameter】
Parameter |
Description |
Input/Output |
---|---|---|
ViPipe |
PIPE number. |
Input |
ViChn |
VI channel number. |
Input |
pstChnAttr |
VI channel property structure pointer. |
Input |
【Return Value】
Return Value |
Description |
---|---|
0 |
Success. |
Non 0 |
Failure. For details, please refer to Error Codes. |
【Requirement】
Header files: cvi_vi.h, cvi_comm_vi.h
Library files: libvpu.a
【Note】
arget image size stSize: it is required to configure and the size needs to be within the range supported by the VI.
Pixel format enPixelFormat: Output Pixel format supports NV21.
Frame Rate Control stFrameRate: Does not support frame rate control.
【Example】
None.
【Related Topic】
None.
4.3.32. CVI_VI_GetChnAttr¶
【Description】
Gets the VI channel properties.
【Syntax】
CVI_S32 CVI_VI_GetChnAttr(VI_PIPE ViPipe, VI_CHN ViChn, VI_CHN_ATTR_S *pstChnAttr);
【Parameter】
Parameter |
Description |
Input/Output |
---|---|---|
ViPipe |
PIPE number. |
Input |
ViChn |
VI channel number. |
Input |
pstChnAttr |
VI channel property structure pointer. |
Output |
【Return Value】
Return Value |
Description |
---|---|
0 |
Success. |
Non 0 |
Failure. For details, please refer to Error Codes. |
【Requirement】
Header files: cvi_vi.h, cvi_comm_vi.h
Library files: libvpu.a
【Note】
PIPE must have been created or it will return a failure.
Channel properties need to be set before they can be obtained.
【Example】
None.
【Related Topic】
None.
4.3.33. CVI_VI_EnableChn¶
【Description】
Enable VI channel.
【Syntax】
CVI_S32 CVI_VI_EnableChn(VI_PIPE ViPipe, VI_CHN ViChn);
【Parameter】
Parameter |
Description |
Input/Output |
---|---|---|
ViPipe |
PIPE number. |
Input |
ViChn |
VI channel number. |
Input |
【Return Value】
Return Value |
Description |
---|---|
0 |
Success. |
Non 0 |
Failure. For details, please refer to Error Codes. |
【Requirement】
Header files: cvi_vi.h, cvi_comm_vi.h
Library files: libvpu.a
【Note】
PIPE must have been created or it will return a failure.
Channel properties must be set first.
Before enabling a VI channel, the channel needs to be turned off first.
【Example】
None.
【Related Topic】
None.
4.3.34. CVI_VI_DisableChn¶
【Description】
Disable the VI channel.
【Syntax】
CVI_S32 CVI_VI_DisableChn(VI_PIPE ViPipe, VI_CHN ViChn);
【Parameter】
Parameter |
Description |
Input/Output |
---|---|---|
ViPipe |
PIPE number. |
Input |
ViChn |
VI channel number. |
Input |
【Return Value】
Return Value |
Description |
---|---|
0 |
Success. |
Non 0 |
Failure. For details, please refer to Error Codes. |
【Requirement】
Header files: cvi_vi.h, cvi_comm_vi.h
Library files: libvpu.a
【Note】
PIPE must have been created or it will return a failure.
Channel properties must be set first.
The VI channel needs to be enabled first.
【Example】
None.
【Related Topic】
None.
4.3.35. CVI_VI_SetChnCrop¶
【Description】
Set VI channel clipping function properties.
【Syntax】
CVI_S32 CVI_VI_SetChnCrop(VI_PIPE ViPipe, VI_CHN ViChn, const VI_CROP_INFO_S *pstCropInfo);
【Parameter】
Parameter |
Description |
Input/Output |
---|---|---|
ViPipe |
PIPE number. |
Input |
ViChn |
VI channel number. |
Input |
pstCropInfo |
Clipping Function parameter Structure Pointer. |
Input |
【Return Value】
Return Value |
Description |
---|---|
0 |
Success. |
Non 0 |
Failure. For details, please refer to Error Codes. |
【Requirement】
Header files: cvi_vi.h, cvi_comm_vi.h
Library files: libvpu.a
【Note】
PIPE must have been created or it will return a failure.
Using this API for cropping will result in some parts of the image being lost.
After using this API for cropping, the input size of VPSS must be the same as the size of pstCropInfo
【Example】
None.
【Related Topic】
None.
4.3.36. CVI_VI_GetChnCrop¶
【Description】
Gets the VI channel clipping function properties.
【Syntax】
CVI_S32 CVI_VI_GetChnCrop(VI_PIPE ViPipe, VI_CHN ViChn, VI_CROP_INFO_S *pstCropInfo);
【Parameter】
Parameter |
Description |
Input/Output |
---|---|---|
ViPipe |
PIPE number. |
Input |
ViChn |
VI channel number. |
Input |
pstCropInfo |
Clipping Function parameter Structure Pointer. |
Output |
【Return Value】
Return Value |
Description |
---|---|
0 |
Success. |
Non 0 |
Failure. For details, please refer to Error Codes. |
【Requirement】
Header files: cvi_vi.h, cvi_comm_vi.h
Library files: libvpu.a
【Note】
PIPE must have been created or it will return a failure.
Property must be set using SetChnCrop before it can be obtained.
【Example】
None.
【Related Topic】
None.
4.3.37. CVI_VI_GetChnFrame¶
【Description】
Obtain captured images from the VI channel.
【Syntax】
CVI_S32 CVI_VI_GetChnFrame(VI_PIPE ViPipe, VI_CHN ViChn, VIDEO_FRAME_INFO_S *pstFrameInfo, CVI_S32 s32MilliSec);
【Parameter】
Parameter |
Description |
Input/Output |
---|---|---|
ViPipe |
PIPE number. |
Input |
ViChn |
VI channel number. |
Input |
pstFrameInfo |
VI Frame Information Structure Pointer. |
Output |
s32MilliSec |
Timeout parameter: -1 indicates blocking mode; 0 indicates non-blocking mode; A value greater than 0 indicates a time-out mode in milliseconds (ms). |
Input |
【Return Value】
Return Value |
Description |
---|---|
0 |
Success. |
Non 0 |
Failure. For details, please refer to Error Codes. |
【Requirement】
Header files: cvi_vi.h, cvi_comm_vi.h
Library files: libvpu.a
【Note】
PIPE PIPE must have been created or it will return a failure
Channel properties must be set first.
The physical address information obtained comes from the VideoBuffer used internally by CVI, so after use, you must call the CVI_VI_ReleaseChnFrame interface to free its memory.
pstFrameInfo->stVFrame.u64PhyAddr[0] and pstFrameInfo->stVFrame.u64PhyAddr[1]/[2] points to the physical addresses of the brightness and chroma components of the image.
When u32MilliSec is set to -1, it represents the blocking mode, and the program waits until an image is obtained before returning. If u32MilliSec is greater than 0, it represents the non-blocking mode, and the unit of the parameter is milliseconds, indicating the timeout period. If an image is not obtained within this time, a timeout occurs and the function returns.
【Example】
None.
【Related Topic】
4.3.38. CVI_VI_ReleaseChnFrame¶
【Description】
Release a frame of the image obtained from the VI channel.
【Syntax】
CVI_S32 CVI_VI_ReleaseChnFrame(VI_PIPE ViPipe, VI_CHN ViChn, const VIDEO_FRAME_INFO_S *pstFrameInfo);
【Parameter】
Parameter |
Description |
Input/Output |
---|---|---|
ViPipe |
PIPE number. |
Input |
ViChn |
VI channel number. |
Input |
pstFrameInfo |
VI Frame Information Structure Pointer. |
Input |
【Return Value】
Return Value |
Description |
---|---|
0 |
Success. |
Non 0 |
Failure. For details, please refer to Error Codes. |
【Requirement】
Header files: cvi_vi.h, cvi_comm_vi.h
Library files:libvpu.a
【Note】
PIPE must have been created or it will return a failure.
Channel properties must be set first.
This interface must be paired with CVI_VI_GetChnFrame.
Users must ensure that the information in the pstFrameInfo structure is consistent with what they get, or the release may be unsuccessful.
【Example】
None.
【Related Topic】
4.3.39. CVI_VI_SetChnRotation¶
【Description】
Set the VI channel rotation properties.
【Syntax】
CVI_S32 CVI_VI_SetChnRotation(VI_PIPE ViPipe, VI_CHN ViChn, const ROTATION_E enRotation);
【Parameter】
Parameter |
Description |
Input/Output |
---|---|---|
ViPipe |
VI physical PIPE number. Value range: [0, VI_MAX_PHY_PIPE_NUM - 1). |
Input |
ViChn |
VI physical channel number. Value range: [0, VI_MAX_PHY_CHN_NUM - 1). |
Input |
enRotation |
Rotation property. Please refer to ROTATION_E for detail instruction. |
Input |
【Return Value】
Return Value |
Description |
---|---|
0 |
Success. |
Non 0 |
Failure. For details, please refer to Error Codes. |
【Requirement】
Header files: cvi_vi.h, cvi_comm_vi.h
Library files: libvpu.a
【Note】
You need to call CVI_VI_CreatePipi(ViPipe) before using this interface, otherwise an error message will be displayed.
Channel property must be set first.
Rotation is only supported for three formats: RGB planar, YUV420 planar, and YUV400.
After rotation, the memory size of the image output from the channel may change, but the size obtained from the channel is still the value set by the user.
For example, an input image of 1920x1080 rotates 90 degrees and the actual output is 1080x1920.
Do not support VI_ONLINE_VPSS_ONLINE/ VI_OFFLINE_VPSS_ONLINE working mode.
【Example】
None.
【Related Topic】
None.
4.3.40. CVI_VI_GetChnRotation¶
【Description】
Get the properties of the VI channel rotation.
【Syntax】
CVI_S32 CVI_VI_GetChnRotation(VI_PIPE ViPipe, VI_CHN ViChn, ROTATION_E *penRotation);
【Parameter】
Parameter |
Description |
Input/Output |
---|---|---|
ViPipe |
VI physical PIPE number. Value range: [0, VI_MAX_PHY_PIPE_NUM - 1). |
Input |
ViChn |
VI physical channel number. Value range: [0, VI_MAX_PHY_CHN_NUM - 1). |
Input |
penRotation |
The property pointer for rotate. please refer to ROTATION_E for detail instructions. |
Output |
【Return Value】
Return Value |
Description |
---|---|
0 |
Success. |
Non 0 |
Failure. For details, please refer to Error Codes. |
【Requirement】
Header files: cvi_vi.h, cvi_comm_vi.h
Library files: libvpu.a
【Note】
You need to call CVI_VI_CreatePipi(ViPipe) before using this interface, otherwise an error message will be displayed.
Does not support VI_ONLINE_VPSS_ONLINE/ VI_OFFLINE_VPSS_ONLINE working mode.
【Example】
None.
【Related Topic】
4.3.41. CVI_VI_SetChnLDCAttr¶
【Description】
Sets the properties of the lens distortion correction for the VI channel.
【Syntax】
CVI_S32 CVI_VI_SetChnLDCAttr(VI_PIPE ViPipe, VI_CHN ViChn, const VI_LDC_ATTR_S *pstLDCAttr);
【Parameter】
Parameter |
Description |
Input/Output |
---|---|---|
ViPipe |
VI physical PIPE number. Value range: [0, VI_MAX_PHY_PIPE_NUM - 1). |
Input |
ViChn |
VI physical channel number. Value range: [0, VI_MAX_PHY_CHN_NUM - 1). |
Input |
pstLDCAttr |
Lens distortion correction properties. |
Input |
【Return Value】
Return Value |
Description |
---|---|
0 |
Success. |
Non 0 |
Failure. For details, please refer to Error Codes. |
【Requirement】
Header files:cvi_vi.h, cvi_comm_vi.h
Library files:libvpu.a
【Note】
You need to call CVI_VI_CreatePipi(ViPipe) before using this interface, otherwise an error message will be displayed.
Does not support VI_ONLINE_VPSS_ONLINE/ VI_OFFLINE_VPSS_ONLINE working mode.
Channel property must be set before it can be set.
【Example】
None.
【Related Topic】
VI_LDC_ATTR_S
4.3.42. CVI_VI_GetChnLDCAttr¶
【Description】
Get the properties of the lens distortion correction for the VI channel.
【Syntax】
CVI_S32 CVI_VI_GetChnLDCAttr(VI_PIPE ViPipe, VI_CHN ViChn, const VI_LDC_ATTR_S *pstLDCAttr);
【Parameter】
Parameter |
Description |
Input/Output |
---|---|---|
ViPipe |
VI physical PIPE number. Value range: [0, VI_MAX_PHY_PIPE_NUM - 1). |
Input |
ViChn |
VI physical channel number. Value range: [0, VI_MAX_PHY_CHN_NUM - 1). |
Input |
pstLDCAttr |
Lens distortion correction properties. |
Output |
【Return Value】
Return Value |
Description |
---|---|
0 |
Success. |
non0 |
Failure. For details, please refer to Error Codes. |
【Requirement】
Header files:cvi_vi.h, cvi_comm_vi.h
Library files: libvpu.a
【Note】
You need to call CVI_VI_CreatePipi(ViPipe) before using this interface, otherwise an error message will be displayed.
Does not support VI_ONLINE_VPSS_ONLINE/ VI_OFFLINE_VPSS_ONLINE working mode.
【Example】
None.
【Related Topic】
VI_LDC_ATTR_S
4.3.43. CVI_VI_RegChnFlipMirrorCallBack¶
【Description】
Register VI channel callback function for flip and mirror.
【Syntax】
CVI_S32 CVI_VI_RegChnFlipMirrorCallBack(VI_PIPE ViPipe, VI_DEV ViDev, void *pvData);
【Parameter】
Parameter |
Description |
Input/Output |
---|---|---|
ViPipe |
VI physical PIPE number. |
Input |
ViDev |
VI device number. |
Input |
pvData |
Callback function for flip and mirror pointer. |
Input |
【Return Value】
Return Value |
Description |
---|---|
0 |
Success. |
Non 0 |
Failure. For details, please refer to Error Codes. |
【Requirement】
Header files: cvi_vi.h, cvi_comm_vi.h
Library files: libvpu.a
【Note】
None.
【Example】
None.
【Related Topic】
None.
4.3.44. CVI_VI_UnRegChnFlipMirrorCallBack¶
【Description】
Un-Register VI channel callback function for flip and mirror.
【Syntax】
CVI_S32 CVI_VI_UnRegChnFlipMirrorCallBack(VI_PIPE ViPipe, VI_DEV ViDev);
【Parameter】
Parameter |
Description |
Input/Output |
---|---|---|
ViPipe |
VI physical PIPE number. |
Input |
ViDev |
VI device number. |
Input |
【Return Value】
Return Value |
Description |
---|---|
0 |
Success. |
Non 0 |
Failure. For details, please refer to Error Codes. |
【Requirement】
Header files: cvi_vi.h, cvi_comm_vi.h
Library files: libvpu.a
【Note】
None.
【Example】
None.
【Related Topic】
None.
4.3.45. CVI_VI_SetChnFlipMirror¶
【Description】
Set the properties of VI channel flip and mirror.
【Syntax】
CVI_S32 CVI_VI_SetChnFlipMirror(VI_PIPE ViPipe, VI_CHN ViChn, CVI_BOOL bFlip, CVI_BOOL bMirror);
【Parameter】
Parameter |
Description |
Input/Output |
---|---|---|
ViPipe |
VI physical PIPE number. |
Input |
ViChn |
VI channel number. |
Input |
bFlip |
Flip enable switch. |
Input |
bMirror |
Mirror enable switch. |
Input |
【Return Value】
Return Value |
Description |
---|---|
0 |
Success. |
Non 0 |
Failure. For details, please refer to Error Codes. |
【Requirement】
Header files: cvi_vi.h, cvi_comm_vi.h
Library files: libvpu.a
【Note】
Callback function must be register first.
【Example】
None.
【Related Topic】
None.
4.3.46. CVI_VI_GetChnFlipMirror¶
【Description】
Get the properties of VI channel flip and mirror.
【Syntax】
CVI_S32 CVI_VI_GetChnFlipMirror(VI_PIPE ViPipe, VI_CHN ViChn, CVI_BOOL *pbFlip, CVI_BOOL *pbMirror);
【Parameter】
Parameter |
Description |
Input/Output |
---|---|---|
ViPipe |
VI physical PIPE number. |
Input |
ViChn |
VI channel number. |
Input |
pbFlip |
The property pointer for flip. |
Output |
pbMirror |
The property pointer for mirror. |
Output |
【Return Value】
Return Value |
Description |
---|---|
0 |
Success. |
Non 0 |
Failure. For details, please refer to Error Codes. |
【Requirement】
Header files: cvi_vi.h, cvi_comm_vi.h
Library files: libvpu.a
【Note】
None.
【Example】
None.
【Related Topic】
None.
4.3.47. CVI_VI_Suspend¶
【Description】
Susped VI device.
【Syntax】
CVI_S32 CVI_VI_Suspend(void);
【Parameter】
None
【Return Value】
Return Value |
Description |
---|---|
0 |
Success. |
Non 0 |
Failure. For details, please refer to Error Codes. |
【Requirement】
Header files:cvi_vi.h
Library files:libvpu.a
【Note】
None
【Example】
None
【Related Topic】
4.3.48. CVI_VI_Resume¶
【Description】
Resume VI device.
【Syntax】
CVI_S32 CVI_VI_Resume(void);
【Parameter】
None
【Return Value】
Return Value |
Description |
---|---|
0 |
Success. |
Non 0 |
Failure. For details, please refer to Error Codes. |
【Requirement】
Header files:cvi_vi.h
Library files:libvpu.a
【Note】
None
【Example】
None
【Related Topic】
4.3.49. CVI_VI_SetDevNum¶
【Description】
Set VI device number.
【Syntax】
CVI_S32 CVI_VI_SetDevNum(CVI_U32 devNum);
【Parameter】
Parameter |
Description |
Input/Output |
---|---|---|
devNum |
VI device number |
Input |
【Return Value】
Return Value |
Description |
---|---|
0 |
Success. |
Non 0 |
Failure. For details, please refer to Error Codes. |
【Requirement】
Header files:cvi_vi.h, cvi_comm_vi.h
Library files:libvi.a
【Note】
None
【Example】
None
【Related Topic】
4.3.50. CVI_VI_GetDevNum¶
【Description】
Get VI device number.
【Syntax】
CVI_S32 CVI_VI_GetDevNum(CVI_U32 devNum);
【Parameter】
Parameter |
Description |
Input/Output |
---|---|---|
devNum |
VI device number |
Input |
【Return Value】
Return Value |
Description |
---|---|
0 |
Success. |
Non 0 |
Failure. For details, please refer to Error Codes. |
【Requirement】
Header files:cvi_vi.h, cvi_comm_vi.h
Library files:libvi.a
【Note】
None
【Example】
None
【Related Topic】
4.3.51. CVI_VI_EnablePatt¶
【Description】
Enable VI pattern mode.
【Syntax】
CVI_S32 CVI_VI_EnablePatt(VI_PIPE ViPipe);
【Parameter】
Parameter |
Description |
Input/Output |
---|---|---|
ViPipe |
VI physical PIPE number. |
Input |
【Return Value】
Return Value |
Description |
---|---|
0 |
Success. |
Non 0 |
Failure. For details, please refer to Error Codes. |
【Requirement】
Header files:cvi_vi.h
Library files:libvi.a
【Note】
Only supported by DUAL OS
【Example】
None
【Related Topic】
None
4.3.52. CVI_VI_StartSmoothRawDump¶
【Description】
Start dumping smooth raw images.
【Syntax】
CVI_S32 CVI_VI_StartSmoothRawDump(const VI_SMOOTH_RAW_DUMP_INFO_S *pstDumpInfo);
【Parameter】
Parameter |
Description |
Input/Output |
---|---|---|
pstDumpInfo |
Vi dump smooth raw images structure pointer |
Input |
【Return Value】
Return Value |
Description |
---|---|
0 |
Success. |
Non 0 |
Failure. For details, please refer to Error Codes. |
【Requirement】
Header files:cvi_vi.h, cvi_comm_vi.h
Library files:libvi.a
【Note】
None
【Example】
None
【Related Topic】
4.3.53. CVI_VI_StopSmoothRawDump¶
【Description】
Stop dumping smooth raw images.
【Syntax】
CVI_S32 CVI_VI_StopSmoothRawDump(const VI_SMOOTH_RAW_DUMP_INFO_S *pstDumpInfo);
【Parameter】
Parameter |
Description |
Input/Output |
---|---|---|
pstDumpInfo |
Vi dump smooth raw images structure pointer |
Input |
【Return Value】
Return Value |
Description |
---|---|
0 |
Success. |
Non 0 |
Failure. For details, please refer to Error Codes. |
【Requirement】
Header files:cvi_vi.h, cvi_comm_vi.h
Library files:libvi.a
【Note】
None
【Example】
None
【Related Topic】
4.3.54. CVI_VI_GetSmoothRawDump¶
【Description】
Get a smooth raw image after dumping.
【Syntax】
CVI_S32 CVI_VI_GetSmoothRawDump(VI_PIPE ViPipe, VIDEO_FRAME_INFO_S *pstVideoFrame, CVI_S32 s32MilliSec);
【Parameter】
Parameter |
Description |
Input/Output |
---|---|---|
ViPipe |
VI physical PIPE number |
Input |
pstVideoFrame |
RAW data information |
Output |
s32MilliSec |
Timeout parameter: -1 indicates blocking mode; 0 indicates non-blocking mode; A value greater than 0 indicates a time-out mode in milliseconds (ms). |
Input |
【Return Value】
Return Value |
Description |
---|---|
0 |
Success. |
Non 0 |
Failure. For details, please refer to Error Codes. |
【Requirement】
Header files:cvi_vi.h, cvi_comm_vi.h
Library files:libvi.a
【Note】
None
【Example】
None
【Related Topic】
None
4.3.55. CVI_VI_PutSmoothRawDump¶
【Description】
Put a smooth raw image after dumping.
【Syntax】
CVI_S32 CVI_VI_PutSmoothRawDump(VI_PIPE ViPipe, const VIDEO_FRAME_INFO_S *pstVideoFrame);
【Parameter】
Parameter |
Description |
Input/Output |
---|---|---|
ViPipe |
VI physical PIPE number |
Input |
pstVideoFrame |
rRAW data information |
Input |
【Return Value】
Return Value |
Description |
---|---|
0 |
Success. |
Non 0 |
Failure. For details, please refer to Error Codes. |
【Requirement】
Header files:cvi_vi.h, cvi_comm_vi.h
Library files:libvi.a
【Note】
None
【Example】
None
【Related Topic】
None
4.3.56. CVI_VI_GetRgbMapLeBuf¶
【Description】
Get the rgbmap long frame buffer.
【Syntax】
CVI_S32 CVI_VI_GetRgbMapLeBuf(VI_PIPE ViPipe, void *pstRgbMapBuf);
【Parameter】
Parameter |
Description |
Input/Output |
---|---|---|
ViPipe |
VI physical PIPE number |
Input |
pstRgbMapBuf |
Rgbmap buffer pointer |
Output |
【Return Value】
Return Value |
Description |
---|---|
0 |
Success. |
Non 0 |
Failure. For details, please refer to Error Codes. |
【Requirement】
Header files:cvi_vi.h, cvi_comm_vi.h
Library files:libvi.a
【Note】
Only supported by DUAL OS
【Example】
None
【Related Topic】
None
4.3.57. CVI_VI_GetRgbMapSeBuf¶
【Description】
Get the rgbmap short frame buffer.
【Syntax】
CVI_S32 CVI_VI_GetRgbMapSeBuf(VI_PIPE ViPipe, void *pstRgbMapBuf);
【Parameter】
Parameter |
Description |
Input/Output |
---|---|---|
ViPipe |
VI physical PIPE number |
Input |
pstRgbMapBuf |
Rgbmap buffer pointer |
Output |
【Return Value】
Return Value |
Description |
---|---|
0 |
Success. |
Non 0 |
Failure. For details, please refer to Error Codes. |
【Requirement】
Header files:cvi_vi.h, cvi_comm_vi.h
Library files:libvi.a
【Note】
Only supported by DUAL OS
【Example】
None
【Related Topic】
None
4.3.58. CVI_VI_DumpHwRegisterToFile¶
【Description】
Download hardware register data to the file.
【Syntax】
CVI_S32 CVI_VI_DumpHwRegisterToFile(VI_PIPE ViPipe, FILE *fp, VI_DUMP_REGISTER_TABLE_S *pstRegTbl);
【Parameter】
Parameter |
Description |
Input/Output |
---|---|---|
ViPipe |
VI physical PIPE number |
Input |
fp |
File descriptor |
Input |
pstRegTbl |
Hardware register data pointer |
Input |
【Return Value】
Return Value |
Description |
---|---|
0 |
Success. |
Non 0 |
Failure. For details, please refer to Error Codes. |
【Requirement】
Header files:cvi_vi.h, cvi_comm_vi.h
Library files:libvi.a
【Note】
None
【Example】
None
【Related Topic】
None
4.3.59. CVI_VI_QueryChnStatus¶
【Description】
View the status of the VI channel.
【Syntax】
CVI_S32 CVI_VI_QueryChnStatus(VI_PIPE ViPipe, VI_CHN ViChn, VI_CHN_STATUS_S *pstChnStatus);
【Parameter】
Parameter |
Description |
Input/Output |
---|---|---|
ViPipe |
VI physical PIPE number |
Input |
ViChn |
VI channel number |
Input |
pstChnStatus |
VI device channel state structure pointer |
Output |
【Return Value】
Return Value |
Description |
---|---|
0 |
Success. |
Non 0 |
Failure. For details, please refer to Error Codes. |
【Requirement】
Header files:cvi_vi.h, cvi_comm_vi.h
Library files:libvi.a
【Note】
None
【Example】
None
【Related Topic】
None
4.3.60. CVI_VI_GetChnFd¶
【Description】
Get the VI file descriptor.
【Syntax】
S32 CVI_VI_GetChnFd(VI_PIPE ViPipe, VI_CHN ViChn);
【Parameter】
Parameter |
Description |
Input/Output |
---|---|---|
ViPipe |
VI physical PIPE number |
Input |
ViChn |
VI channel number |
Input |
【Return Value】
Return Value |
Description |
---|---|
0 |
Success. |
Non 0 |
Failure. For details, please refer to Error Codes. |
【Requirement】
Header files:cvi_vi.h, cvi_comm_vi.h
Library files:libvi.a
【Note】
Only supported by DUAL OS
【Example】
None
【Related Topic】
None
4.3.61. CVI_VI_SetChnAlign¶
【Description】
Set VI channel alignment.
【Syntax】
CVI_S32 CVI_VI_SetChnAlign(VI_PIPE ViPipe, VI_CHN ViChn, CVI_U32 u32Align);
【Parameter】
Parameter |
Description |
Input/Output |
---|---|---|
ViPipe |
VI physical PIPE number |
Input |
ViChn |
VI channel number |
Input |
u32Align |
Number of VI channel alignments |
Input |
【Return Value】
Return Value |
Description |
---|---|
0 |
Success. |
Non 0 |
Failure. For details, please refer to Error Codes. |
【Requirement】
Header files:cvi_vi.h, cvi_comm_vi.h
Library files:libvi.a
【Note】
Only supported by DUAL OS
【Example】
None
【Related Topic】
4.3.62. CVI_VI_GetChnAlign¶
【Description】
Get VI channel alignment.
【Syntax】
CVI_S32 CVI_VI_GetChnAlign(VI_PIPE ViPipe, VI_CHN ViChn, CVI_U32 *pu32Align);
【Parameter】
Parameter |
Description |
Input/Output |
---|---|---|
ViPipe |
VI physical PIPE number |
Input |
ViChn |
VI channel number |
Input |
pu32Align |
VI channel alignment pointer |
Output |
【Return Value】
Return Value |
Description |
---|---|
0 |
Success. |
Non 0 |
Failure. For details, please refer to Error Codes. |
【Requirement】
Header files:cvi_vi.h, cvi_comm_vi.h
Library files:libvi.a
【Note】
Only supported by DUAL OS
【Example】
None
【Related Topic】
4.3.63. CVI_VI_RegPmCallBack¶
【Description】
Register VI device power management callback function.
【Syntax】
CVI_S32 CVI_VI_RegPmCallBack(VI_DEV ViDev, VI_PM_OPS_S *pstPmOps, void *pvData);
【Parameter】
Parameter |
Description |
Input/Output |
---|---|---|
ViDev |
VI device number |
Input |
pstPmOps |
Pointer to the VI device power management operation structure |
Input |
pvData |
User private data pointer |
Output |
【Return Value】
Return Value |
Description |
---|---|
0 |
Success. |
Non 0 |
Failure. For details, please refer to Error Codes. |
【Requirement】
Header files:cvi_vi.h, cvi_comm_vi.h
Library files:libvi.a
【Note】
None
【Example】
None
【Related Topic】
4.3.64. CVI_VI_UnRegPmCallBack¶
【Description】
Unregister VI device power management callback function.
【Syntax】
CVI_S32 CVI_VI_UnRegPmCallBack(VI_DEV ViDev);
【Parameter】
Parameter |
Description |
Input/Output |
---|---|---|
ViDev |
VI device number |
Input |
【Return Value】
Return Value |
Description |
---|---|
0 |
Success. |
Non 0 |
Failure. For details, please refer to Error Codes. |
【Requirement】
Header files:cvi_vi.h, cvi_comm_vi.h
Library files:libvi.a
【Note】
None
【Example】
None
【Related Topic】
4.3.65. CVI_VI_SetTuningDis¶
【Description】
Set tuning parameters.
【Syntax】
CVI_S32 CVI_VI_SetTuningDis(CVI_S32 ctrl, CVI_S32 fe, CVI_S32 be, CVI_S32 post);
【Parameter】
Parameter |
Description |
Input/Output |
---|---|---|
ctrl |
Control channel Parameter |
Input |
fe |
fe control Parameter |
Inputbe |
be |
be control Parameter |
Input |
post |
post control Parameter |
Input |
【Return Value】
Return Value |
Description |
---|---|
0 |
Success. |
Non 0 |
Failure. For details, please refer to Error Codes. |
【Requirement】
Header files:cvi_vi.h, cvi_comm_vi.h
Library files:libvi.a
【Note】
Only supported by DUAL OS
【Example】
None
【Related Topic】
None