You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

598 lines
32 KiB

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

/*
* Copyright (c) Hisilicon Technologies Co., Ltd. 2019-2020. All rights reserved.
* Description: Huanglong VI API declaration.
* Author: Hisilicon
* Create: 2019-11-20
*/
#ifndef __UAPI_VI_H__
#define __UAPI_VI_H__
#include "uapi_video.h"
#ifdef __cplusplus
#if __cplusplus
extern "C" {
#endif
#endif /* __cplusplus */
/*
* Defines the vi type required in a VI.
* CNcomment: 定义VI类型枚举
*/
typedef enum {
UAPI_VI_MAIN, /* The main vi */
/* CNcomment: 主通路 */
UAPI_VI_SUB, /* The main vi */
/* CNcomment: 次通路,一屏双显时使用 */
UAPI_VI_MAX
} uapi_vi_type;
/*
* Defines the Interface mode required in a VI.
* CNcomment: 定义VI对接时序
*/
typedef enum {
UAPI_VI_INTF_FVHDE = 0, /* The FVHDE */
/* CNcomment: FVHDE时序 */
UAPI_VI_INTF_BT1120, /* The BT1120 */
/* CNcomment: BT1120时序 */
UAPI_VI_INTF_MAX
} uapi_vi_intf_mode;
/*
* Defines the type of VI quantization range type.
* CNcomment: 定义VI的输入的量化区间类型
*/
typedef enum {
UAPI_VI_QUANTIZATION_RANGE_AUTO = 0, /* Auto Type : in/out use same range */
/* CNcomment: 自动模式由VI根据输入决策输出 */
UAPI_VI_QUANTIZATION_RANGE_LIMIT, /* Limit Range: force limit range */
/* CNcomment: 强制limit模式 */
UAPI_VI_QUANTIZATION_RANGE_FULL, /* Full Range : force full range */
/* CNcomment: 强制full模式 */
UAPI_VI_QUANTIZATION_RANGE_MAX
} uapi_vi_quantization_range;
/*
* Defines the access type required in a VI.
* CNcomment: 定义VI对接接口
*/
typedef enum {
UAPI_VI_ACCESS_TVD = 0, /* The access of TVD */
/* CNcomment: TVD接口 */
UAPI_VI_ACCESS_HDDEC, /* The access of HDDEC */
/* CNcomment: HDDEC接口 */
UAPI_VI_ACCESS_HDMIRX_PORT0, /* The access of HDMIRX PORT 0 */
/* CNcomment: HDMIRX接口0 */
UAPI_VI_ACCESS_HDMIRX_PORT1, /* The access of HDMIRX PORT 1 */
/* CNcomment: HDMIRX接口1 */
UAPI_VI_ACCESS_HDMIRX_PORT2, /* The access of HDMIRX PORT 2 */
/* CNcomment: HDMIRX接口2 */
UAPI_VI_ACCESS_HDMIRX_PORT3, /* The access of HDMIRX PORT 3 */
/* CNcomment: HDMIRX接口3 */
UAPI_VI_ACCESS_MAX
} uapi_vi_access_type;
/*
* Defines the type of VI display filed mode at game mode when interlace signal input.
* CNcomment: 定义隔行信号输入设置游戏模式下设置VI的显示场模式
*/
typedef enum {
UAPI_VI_DISPLAY_FIELD_ALL = 0, /* Display All Field : vi display top and bottom */
/* CNcomment: 显示所有场 */
UAPI_VI_DISPLAY_FIELD_TOP, /* Display Top Field : vi only display top field */
/* CNcomment: 只显示顶场 */
UAPI_VI_DISPLAY_FIELD_BOTTOM, /* Display Bottom Field :vi only display bottom field */
/* CNcomment: 只显示底场 */
UAPI_VI_DISPLAY_FIELD_MAX
} uapi_vi_display_field;
/*
* Defines the type of VI picture mode.
* CNcomment: 定义图像模式,三种模式的区别是处理程度不同,时延不同
*/
typedef enum {
UAPI_VI_PICTURE_MODE_VIDEO, /* pass vpss and pass csc */
/* CNcomment: 视频模式由vpss做后处理且会做csc颜色转换 */
UAPI_VI_PICTURE_MODE_GAME, /* bypass vpss and pass csc */
/* CNcomment: 游戏模式不做vpss处理但做csc */
UAPI_VI_PICTURE_MODE_PC, /* bypass vpss and bypass csc */
/* CNcomment: PC模式低延时不做vpss处理且不做csc颜色转换 */
UAPI_VI_PICTURE_MODE_MAX
} uapi_vi_picture_mode;
/*
* Defines the output configuration of VI.
* CNcomment: 定义VI的输出配置
*/
typedef struct {
td_u32 frame_rate; /* VI output frame rate. [0, input_frame_rate].
0 means input frame rate is equal to the output frame rate. */
/* CNcomment: VI输出的视频帧率[0, input_frame_rate]。
0表示输出帧率等于输入帧率 */
td_u32 width; /* VI output frame width */
/* CNcomment: VI输出的视频宽度 */
td_u32 height; /* VI output frame height */
/* CNcomment: VI输出的视频高度 */
} uapi_vi_output_attr;
/*
* Defines the config parameters of vi
* CNcomment: 定义可变更配置参数的结构体
*/
typedef struct {
uapi_video_rect input_rect; /* The crop rect of input window */
/* CNcomment: 输入窗口的裁减区域 */
td_u32 width; /* The width of source image */
/* CNcomment: 源图像一帧的宽度3D格式为单眼宽高 */
td_u32 height; /* The height of source image */
/* CNcomment: 源图像一帧的高度,
即隔行信号是两场的高度逐行信号是一帧的高度3D格式为单眼宽高 */
td_u32 frame_rate; /* The input framerate */
/* CNcomment: 输入帧率 */
uapi_color_sys color_sys; /* The color system */
/* CNcomment: ATV/CVBS信源下的彩色制式 */
uapi_vi_display_field display_field; /* The mode of display field mode at game mode or pc mode */
/* CNcomment: 隔行设置游戏模式或者pc模式设置场送帧模式 */
td_bool interlace; /* Is interlace or progressive */
/* CNcomment: 逐行隔行信息 */
} uapi_vi_config;
/*
* Defines the created parameters of vi
* CNcomment: 定义同步状态变更参数的结构体
*/
typedef struct {
uapi_vi_type vi_type; /* The type of vi */
/* CNcomment: vi类型实体vi最多创建两路2D或则一路3D */
uapi_vi_intf_mode intf_mode; /* The interface mode of vi */
/* CNcomment: 实体vi对接的接口时序类型 */
uapi_video_source source_type; /* The input soure type */
/* CNcomment: 输入信源类型 */
uapi_vi_access_type access_type; /* The access of vi */
/* CNcomment: 实体vi对接的输入数据源 */
uapi_oversample over_sample; /* The oversample mode */
/* CNcomment: 过采样模式 */
uapi_video_frame_packing_type video_3d_type; /* The 2d/3d format */
/* CNcomment: 2D/3D 格式 */
uapi_color_description color_description; /* The color spacet */
/* CNcomment: 彩色空间 */
uapi_video_pixel_format pixel_format; /* The pixel of Format, for example, RGB444/YUV444/YUV422 */
/* CNcomment: 输入像素格式 RGB444/YUV444/422 */
uapi_pixel_bit_depth bit_depth; /* The bit width, max 12bit */
/* CNcomment: 输入位宽 8/10/12BIT */
uapi_vi_picture_mode picture_mode; /* The UI picture mode */
/* CNcomment: 用户设置的图像模式 */
td_u32 vblank; /* The vblank, for the framepacking */
/* CNcomment: 场消隐区宽度用于处理3D格式FP */
td_bool secure; /* Support secure path */
/* CNcomment: 安全通路 */
uapi_vi_config vi_config;
} uapi_vi_attr;
/*
* Defines timing of pattern
* CNcomment: 定义pattern的时序源
*/
typedef enum {
UAPI_VI_PATTERN_TIMING_SOURCE_OFF, /* timing off */
/* CNcomment: 关闭时序 */
UAPI_VI_PATTERN_TIMING_SOURCE_INPUT, /* input timing */
/* CNcomment: 前端输入时序 */
UAPI_VI_PATTERN_TIMING_SOURCE_SELF, /* self timing */
/* CNcomment: 自产生时序 */
UAPI_VI_PATTERN_TIMING_SOURCE_MAX
} uapi_vi_pattern_timing_source;
/*
* Defines data of pattern
* CNcomment: 定义pattern的数据显示不同画面
*/
typedef enum {
UAPI_VI_PATTERN_DATA_OFF, /* data off */
/* CNcomment: 关闭数据 */
UAPI_VI_PATTERN_DATA_STATIC, /* static data */
/* CNcomment: 静态数据,显示静态画面 */
UAPI_VI_PATTERN_DATA_DYNAMIC, /* dynamic picture */
/* CNcomment: 动态数据,显示动态画面 */
UAPI_VI_PATTERN_DATA_MAX
} uapi_vi_pattern_data;
/*
* Defines pattern info
* CNcomment: 定义pattern信息
*/
typedef struct {
uapi_vi_pattern_timing_source timing_source; /* pattern timming source */
/* CNcomment: pattern时序源 */
uapi_vi_pattern_data data; /* pattern data */
/* CNcomment: pattern数据 */
} uapi_vi_pattern_info;
/*
* brief Initializes the VI module. CNcomment: 初始化VI模块 CNend
* attention \n
* Before calling ::uapi_vi_create to create a VI, you must call this application programming interface (API).
* CNcomment: 在调用VI模块其他接口前要求首先调用本接口 CNend
* param N/A
* retval ::TD_SUCCESS Success CNcomment: 成功 CNend
* retval ::TD_FAILURE Calling this API fails. CNcomment: API系统调用失败 CNend
* retval ::SOC_ERR_VI_OPEN_FAILED. The VI device is not exist CNcomment: Vi设备不存在 CNend
* see \n
* N/A CNcomment: 无 CNend
*/
td_s32 uapi_vi_init(td_void);
/*
* brief Deinitializes the VI module. CNcomment: 去初始化VI模块 CNend
* attention \n
* After calling ::uapi_vi_destroy, and Destroy all vi, Please call this API function.
* CNcomment: 在调用::uapi_vi_destroy接口销毁所有的VI通路后调用本接口 CNend
* param N/A
* retval ::TD_SUCCESS Success CNcomment: 成功 CNend
* retval ::TD_FAILURE Calling this API fails. CNcomment: API系统调用失败 CNend
* see \n
* N/A CNcomment: 无 CNend
*/
td_s32 uapi_vi_deinit(td_void);
/*
* brief Obtains the default configuration of a VI. CNcomment: 获取缺省的VI配置 CNend
* attention \n
* It is recommended that you call this API to obtain the default vi attributes before creating a vi.
* This avoids creation failures due to incomplete or incorrect parameters.
* CNcomment: 创建VI前建议调用本接口获取到VI默认属性避免创建VI时由于参数不全或参数错误导致VI创建不成功现象 CNend
* param[in] attr Pointer to VI attributes. For details, see the description of ::uapi_vi_attr.
* CNcomment: 指针类型VI创建属性请参见::uapi_vi_attr. CNend
* retval ::TD_SUCCESS Success CNcomment: 成功 CNend
* retval ::TD_FAILURE Calling this API fails. CNcomment: API系统调用失败 CNend
* see \n
* N/A CNcomment: 无 CNend
*/
td_s32 uapi_vi_get_default_attr(uapi_vi_attr *attr);
/*
* brief Create a VI. CNcomment: 创建VI CNend
* attention \n
* You can call this API to create a vi. input created attributes, This API return the created vi handle.
* CNcomment: 创建VI时调用本接口传入创建属性返回所创建VI的句柄 CNend
* param[in] attr Pointer to VI attributes. For details, see the description of ::uapi_vi_attr.
* CNcomment: 指针类型VI创建属性请参见::uapi_vi_attr. CNend
* param[out] vi_handle Pointer to VI handle. CNcomment: 指针类型VI句柄. CNend
* retval ::TD_SUCCESS Success CNcomment: 成功 CNend
* retval ::TD_FAILURE Calling this API fails. CNcomment: API系统调用失败 CNend
* retval ::SOC_ERR_VI_NULL_PTR. The pointer is null. CNcomment: 指针参数为空 CNend
* retval ::SOC_ERR_VI_NOT_INIT. The Vi module is not initialized. CNcomment: 模块未初始化 CNend
* retval ::SOC_ERR_VI_INVALID_PARA. The input parameter is invalid. CNcomment: 输入参数非法 CNend
* see \n
* N/A CNcomment: 无 CNend
*/
td_s32 uapi_vi_create(uapi_vi_attr *attr, td_handle *vi_handle);
/*
* brief Destroy a VI. CNcomment: 创建VI CNend
* attention \n
* You can call this API to destroy a vi. input VI handle. CNcomment: 销毁VI时调用本接口传入需销毁的VI句柄 CNend
* param[in] vi_handle VI handle. CNcomment: 32位整数VI句柄. CNend
* retval ::TD_SUCCESS Success CNcomment: 成功 CNend
* retval ::TD_FAILURE Calling this API fails. CNcomment: API系统调用失败 CNend
* retval ::SOC_ERR_VI_NOT_INIT. The Vi module is not initialized. CNcomment: 模块未初始化 CNend
* retval ::SOC_ERR_VI_INVALID_PARA. The input parameter is invalid. CNcomment: 输入参数非法 CNend
* see \n
* N/A CNcomment: 无 CNend
*/
td_s32 uapi_vi_destroy(td_handle vi_handle);
/*
* brief attach the window with vi source.
* CNcomment: 把WINDOW与VI绑定 CNend
* attention \n
* it can attach the handler of vi to the window.
* CNcomment: 可以将VI的句柄与WINDOW绑定。 CNend
* param[in] win_handle the input window handler. CNcomment: WINDOW句柄 CNend
* param[in] vi_handle the handle of video source. CNcomment: 数据源句柄 CNend
* retval ::TD_SUCCESS Success CNcomment: 成功 CNend
* retval ::TD_FAILURE Calling this API fails. CNcomment: API系统调用失败 CNend
* retval ::SOC_ERR_VI_NOT_INIT. The Vi module is not initialized. CNcomment: 模块未初始化 CNend
* retval ::SOC_ERR_VI_INVALID_PARA. The input parameter is invalid. CNcomment: 输入参数非法 CNend
* see \n
* CNcomment: 无 CNend
*/
td_s32 uapi_vi_attach_win(td_handle vi_handle, td_handle win_handle);
/*
* brief detach the window from vi. CNcomment: 把WINDOW与VI解绑定 CNend
* attention \n
* CNcomment: 无 CNend
* param[in] win_handle the input window handler. CNcomment: WINDOW句柄 CNend
* param[in] vi_handle the handler of video source. CNcomment: 数据源句柄 CNend
* retval ::TD_SUCCESS Success CNcomment: 成功 CNend
* retval ::TD_FAILURE Calling this API fails. CNcomment: API系统调用失败 CNend
* retval ::SOC_ERR_VI_NOT_INIT. The Vi module is not initialized. CNcomment: 模块未初始化 CNend
* retval ::SOC_ERR_VI_INVALID_PARA. The input parameter is invalid. CNcomment: 输入参数非法 CNend
* see \n
* CNcomment: 无 CNend
*/
td_s32 uapi_vi_detach_win(td_handle vi_handle, td_handle win_handle);
/*
* brief Start a VI. CNcomment: 启动VI CNend
* attention \n
* You can call this API to start a vi. input VI handle. CNcomment: 启动VI时调用本接口传入需启动的VI句柄 CNend
* param[in] vi_handle VI handle. CNcomment: 32位整数VI句柄. CNend
* retval ::TD_SUCCESS Success CNcomment: 成功 CNend
* retval ::TD_FAILURE Calling this API fails. CNcomment: API系统调用失败 CNend
* retval ::SOC_ERR_VI_NOT_INIT. The Vi module is not initialized. CNcomment: 模块未初始化 CNend
* retval ::SOC_ERR_VI_INVALID_PARA. The input parameter is invalid. CNcomment: 输入参数非法 CNend
* see \n
* N/A CNcomment: 无 CNend
*/
td_s32 uapi_vi_start(td_handle vi_handle);
/*
* brief Stop a VI. CNcomment: 停止VI CNend
* attention \n
* You can call this API to stop a vi. input VI handle. CNcomment: 停止VI时调用本接口传入需停止的VI句柄 CNend
* param[in] vi_handle VI handle. CNcomment: 32位整数VI句柄. CNend
* retval ::TD_SUCCESS Success CNcomment: 成功 CNend
* retval ::TD_FAILURE Calling this API fails. CNcomment: API系统调用失败 CNend
* retval ::SOC_ERR_VI_NOT_INIT. The Vi module is not initialized. CNcomment: 模块未初始化 CNend
* retval ::SOC_ERR_VI_INVALID_PARA. The input parameter is invalid. CNcomment: 输入参数非法 CNend
* see \n
* N/A CNcomment: 无 CNend
*/
td_s32 uapi_vi_stop(td_handle vi_handle);
/*
* brief Update the no standard Information of a VIspecial for TV. CNcomment: 更新VI的非标信息TV特有 CNend
* attention \n
* When you need update the no standard Information of a VI, You can call this API. CNcomment: 更新VI的非标信息 CNend
* param[in] vi_handle VI handle. CNcomment: 32位整数VI句柄. CNend
* param[in] info Pointer to VI no standard Information.
* For details, see the description of ::uapi_video_nonstd_info.
* CNcomment: 指针类型,非标信息属性,请参见::uapi_video_nonstd_info. CNend
* retval ::TD_SUCCESS Success CNcomment: 成功 CNend
* retval ::TD_FAILURE Calling this API fails. CNcomment: API系统调用失败 CNend
* retval ::SOC_ERR_VI_NULL_PTR. The pointer is null. CNcomment: 指针参数为空 CNend
* retval ::SOC_ERR_VI_NOT_INIT. The Vi module is not initialized. CNcomment: 模块未初始化 CNend
* retval ::SOC_ERR_VI_INVALID_PARA. The input parameter is invalid. CNcomment: 输入参数非法 CNend
* see \n
* N/A CNcomment: 无 CNend
*/
td_s32 uapi_vi_update_nstd_info(td_handle vi_handle, uapi_video_nonstd_info *info);
/*
* brief Set VI source csc type. CNcomment: 设置VI的Csc类型 CNend
* attention \n
* When you want to set VI Csc, You can call this API. CNcomment: 设置VI的输入源的Csc类型 CNend
* param[in] vi_handle VI handle. CNcomment: 32位整数VI句柄. CNend
* param[in] csc_type Pointer to Csc Range type. For details, see the description of ::uapi_vi_quantization_range.
* CNcomment: 指针类型Csc类型请参见::uapi_vi_quantization_range. CNend
* retval ::TD_SUCCESS Success CNcomment: 成功 CNend
* retval ::TD_FAILURE Calling this API fails. CNcomment: API系统调用失败 CNend
* retval ::SOC_ERR_VI_NOT_INIT. The Vi module is not initialized. CNcomment: 模块未初始化 CNend
* retval ::SOC_ERR_VI_INVALID_PARA. The input parameter is invalid. CNcomment: 输入参数非法 CNend
* see \n
* N/A CNcomment: 无 CNend
*/
td_s32 uapi_vi_set_src_quantization_range(td_handle vi_handle, uapi_vi_quantization_range range_type);
/*
* brief Set VI picture mode. CNcomment: 设置VI的图像模式 CNend
* attention \n
* When you want to set VI picture mode, You can call this API. CNcomment: 设置VI的图像模式 CNend
* param[in] vi_handle VI handle. CNcomment: 32位整数VI句柄. CNend
* param[in] picture_mode Pointer to picture mode. For details, see the description of ::uapi_vi_picture_mode.
* CNcomment: 指针类型,图像模式,请参见::uapi_vi_picture_mode. CNend
* retval ::TD_SUCCESS Success CNcomment: 成功 CNend
* retval ::TD_FAILURE Calling this API fails. CNcomment: API系统调用失败 CNend
* retval ::SOC_ERR_VI_NOT_INIT. The Vi module is not initialized. CNcomment: 模块未初始化 CNend
* retval ::SOC_ERR_VI_INVALID_PARA. The input parameter is invalid. CNcomment: 输入参数非法 CNend
* see \n
* N/A CNcomment: 无 CNend
*/
td_s32 uapi_vi_set_picture_mode(td_handle vi_handle, uapi_vi_picture_mode picture_mode);
/*
* brief Update VI's Config parameter. CNcomment: 设置VI的配置属性 CNend
* attention \n
* When you want to Update VI Config parameter, You can call this API. CNcomment: 设置VI的配置属性 CNend
* param[in] vi_handle VI handle. CNcomment: 32位整数VI句柄. CNend
* param[in] cfg Pointer to Create Attr. For details, see the description of ::uapi_vi_config.
* CNcomment:指针类型,创建属性,请参见::uapi_vi_config. CNend
* retval ::TD_SUCCESS Success CNcomment: 成功 CNend
* retval ::TD_FAILURE Calling this API fails. CNcomment: API系统调用失败 CNend
* retval ::SOC_ERR_VI_NULL_PTR. The pointer is null. CNcomment: 指针参数为空 CNend
* retval ::SOC_ERR_VI_NOT_INIT. The Vi module is not initialized. CNcomment: 模块未初始化 CNend
* retval ::SOC_ERR_VI_INVALID_PARA. The input parameter is invalid. CNcomment: 输入参数非法 CNend
* see \n
* N/A CNcomment: 无 CNend
*/
td_s32 uapi_vi_set_config(td_handle vi_handle, const uapi_vi_config *cfg);
/*
* brief Get VI's Config parameter. CNcomment: 获取VI的当前配置属性 CNend
* attention \n
* When you want to Get VI Config parameter, You can call this API. CNcomment: 获取VI的配置属性 CNend
* param[in] vi_handle VI handle. CNcomment: 32位整数VI句柄. CNend
* param[in] cfg Pointer to Config. For details, see the description of ::uapi_vi_config.
* CNcomment: 指针类型,配置属性,请参见::uapi_vi_config. CNend
* retval ::TD_SUCCESS Success CNcomment: 成功 CNend
* retval ::TD_FAILURE Calling this API fails. CNcomment: API系统调用失败 CNend
* retval ::SOC_ERR_VI_NULL_PTR. The pointer is null. CNcomment: 指针参数为空 CNend
* retval ::SOC_ERR_VI_NOT_INIT. The Vi module is not initialized. CNcomment: 模块未初始化 CNend
* retval ::SOC_ERR_VI_INVALID_PARA. The input parameter is invalid. CNcomment: 输入参数非法 CNend
* see \n
* N/A CNcomment: 无 CNend
*/
td_s32 uapi_vi_get_config(td_handle vi_handle, uapi_vi_config *cfg);
/*
* brief Get VI's Attr. CNcomment: 获取VI的当前属性 CNend
* attention \n
* When you want to Get VI Attr, You can call this API. CNcomment: 获取VI的属性 CNend
* param[in] vi_handle VI handle. CNcomment: 32位整数VI句柄. CNend
* param[in] attr Pointer to Attr. For details, see the description of ::uapi_vi_attr.
* CNcomment: 指针类型,创建属性,请参见::uapi_vi_attr. CNend
* retval ::TD_SUCCESS Success CNcomment: 成功 CNend
* retval ::TD_FAILURE Calling this API fails. CNcomment: API系统调用失败 CNend
* retval ::SOC_ERR_VI_NULL_PTR. The pointer is null. CNcomment: 指针参数为空 CNend
* retval ::SOC_ERR_VI_NOT_INIT. The Vi module is not initialized. CNcomment: 模块未初始化 CNend
* retval ::SOC_ERR_VI_INVALID_PARA. The input parameter is invalid. CNcomment: 输入参数非法 CNend
* see \n
* N/A CNcomment: 无 CNend
*/
td_s32 uapi_vi_get_attr(td_handle vi_handle, uapi_vi_attr *attr);
/*
* brief Set VI uapi_vi_set_capture_latency. CNcomment: 设置VI采集延迟值 CNend
* attention \n
* param[in] vi_handle: VI handle. CNcomment: 32位整数VI句柄. CNend
* param[in] capture_latency CNcomment:采集延时值 输入范围 0-100, 0:表示信号来即发送100:表示采集完再发送. CNend
* retval ::TD_SUCCESS Success CNcomment: 成功 CNend
* retval ::TD_FAILURE Calling this API fails. CNcomment: API系统调用失败 CNend
* see \n
* N/A CNcomment: 无 CNend
*/
td_s32 uapi_vi_set_capture_latency(td_handle vi_handle, td_u32 capture_latency);
/*
* brief Set VI uapi_vi_get_capture_latency. CNcomment: 获取VI采集延迟值 CNend
* attention \n
* param[in] vi_handle: VI handle. CNcomment: 32位整数VI句柄. CNend
* param[in] capture_latency CNcomment:采集延时值,正常范围 0-100. CNend
* retval ::TD_SUCCESS Success CNcomment: 成功 CNend
* retval ::TD_FAILURE Calling this API fails. CNcomment: API系统调用失败 CNend
* see \n
* N/A CNcomment: 无 CNend
*/
td_s32 uapi_vi_get_capture_latency(td_handle vi_handle, td_u32 *capture_latency);
/*
* brief Set VI pattern. CNcomment: 设置VI的pattern CNend
* attention When pattern is disabled, pattern timing and pattern data must be both off.
* When pattern is enabled, timing and data must be not off at the same time.
* CNcomment:当关闭pattern时pattern时序和pattern数据必须同时关闭当打开pattern时pattern时序和pattern数据必须同时打开 CNend
* When you want to set VI pattern to debug, you can call this API. CNcomment: 设置VI的pattern CNend
* param[in] vi_handle VI handle. CNcomment: 32位整数VI句柄. CNend
* param[in] pattern_info Pointer to pattern. For details, see the description of ::uapi_vi_pattern_info.
* CNcomment: 指针类型pattern信息请参见::uapi_vi_pattern_info. CNend
* retval ::TD_SUCCESS Success CNcomment: 成功 CNend
* retval ::TD_FAILURE Calling this API fails. CNcomment: API系统调用失败 CNend
* retval ::SOC_ERR_VI_NULL_PTR. The pointer is null. CNcomment: 指针参数为空 CNend
* retval ::SOC_ERR_VI_INVALID_PARA. The input parameter is invalid. CNcomment: 输入参数非法 CNend
* retval ::SOC_ERR_VI_NOT_SUPPORT. The ability is not support. CNcomment: 输入参数不支持 CNend
* see \n
* N/A CNcomment: 无 CNend
*/
td_s32 uapi_vi_set_pattern(td_handle vi_handle, uapi_vi_pattern_info *pattern_info);
/*
* brief Get VI pattern. CNcomment: 获取VI的pattern信息 CNend
* attention \n
* When you want to get VI pattern info, you can call this API. CNcomment: 获取VI的pattern info CNend
* param[in] vi_handle VI handle. CNcomment: 32位整数VI句柄. CNend
* param[in/out] pattern_info Pointer to pattern. For details, see the description of ::uapi_vi_pattern_info.
* CNcomment: 指针类型pattern信息请参见::uapi_vi_pattern_info. CNend
* retval ::TD_SUCCESS Success CNcomment: 成功 CNend
* retval ::TD_FAILURE Calling this API fails. CNcomment: API系统调用失败 CNend
* retval ::SOC_ERR_VI_NULL_PTR. The pointer is null. CNcomment: 指针参数为空 CNend
* retval ::SOC_ERR_VI_INVALID_PARA. The input parameter is invalid. CNcomment: 输入参数非法 CNend
* retval ::SOC_ERR_VI_NOT_SUPPORT. The ability is not support. CNcomment: 输入参数不支持 CNend
* see \n
* N/A CNcomment: 无 CNend
*/
td_s32 uapi_vi_get_pattern(td_handle vi_handle, uapi_vi_pattern_info *pattern_info);
/*
* brief Get VI frame info. CNcomment: 获取VI的视频帧信息 CNend
* attention \n
* When you want to get frame info from VI, you can call this API. CNcomment: 获取VI的视频帧信息 CNend
* param[in] vi_handle VI handle. CNcomment: 32位整数VI句柄. CNend
* param[in/out] frame_info. Pointer to farme. For details, see the description of ::uapi_video_frame_info.
* CNcomment: 指针类型,视频帧信息,请参见::uapi_video_frame_info. CNend
* param[in] timeout_ms.During this period, VI requires frame until timeout or require success.
* CNcomment: 32位整数超时时间单位ms。VI会在这个时间段内一直取帧直到取到或者超时再返回. CNend
* retval ::TD_SUCCESS Success CNcomment: 成功 CNend
* retval ::TD_FAILURE Calling this API fails. CNcomment: API系统调用失败 CNend
* retval ::SOC_ERR_VI_NULL_PTR. The pointer is null. CNcomment: 指针参数为空 CNend
* retval ::SOC_ERR_VI_INVALID_PARA. The input parameter is invalid. CNcomment: 输入参数非法 CNend
* retval ::SOC_ERR_VI_NOT_SUPPORT. The ability is not support. CNcomment: 输入参数不支持 CNend
* retval ::SOC_ERR_VI_BUFFER_EMPTY. Frame buffer list is empty. CNcomment: 获取帧失败,帧缓存队列为空 CNend
* retval ::SOC_ERR_VI_DEVICE_BUSY. VI has already attach win. CNcomment: 该VI已经与WIN绑定 CNend
* see This function cannot be bound to Windows. When uapi_vi_attach_win and uapi_vi_detach_win are invoked,
* win_handle needs to be 0.
* CNcomment: 使用本功能时不能和win绑定即调用uapi_vi_attach_win和uapi_vi_detach_win时win_handle需要传0 CNend
*/
td_s32 uapi_vi_acquire_frame(td_handle vi_handle, uapi_video_frame_info *frame_info, td_u32 timeout_ms);
/*
* brief release VI frame info. CNcomment: 释放VI的视频帧信息 CNend
* attention \n
* When you want to release frame info from VI, you can call this API. CNcomment: 释放VI的视频帧信息 CNend
* param[in] vi_handle VI handle. CNcomment: 32位整数VI句柄. CNend
* param[in] frame_info. Pointer to farme. For details, see the description of ::uapi_video_frame_info.
* CNcomment: 指针类型,视频帧信息,请参见::uapi_video_frame_info. CNend
* retval ::TD_SUCCESS Success CNcomment: 成功 CNend
* retval ::TD_FAILURE Calling this API fails. CNcomment: API系统调用失败 CNend
* retval ::SOC_ERR_VI_NULL_PTR. The pointer is null. CNcomment: 指针参数为空 CNend
* retval ::SOC_ERR_VI_INVALID_PARA. The input parameter is invalid. CNcomment: 输入参数非法 CNend
* retval ::SOC_ERR_VI_NOT_SUPPORT. The ability is not support. CNcomment: 输入参数不支持 CNend
* retval ::SOC_ERR_VI_DEVICE_BUSY. VI has already attach win. CNcomment: 该VI已经与WIN绑定 CNend
* see This function cannot be bound to Windows. When uapi_vi_attach_win and uapi_vi_detach_win are invoked,
* win_handle needs to be 0.
* CNcomment: 使用本功能时不能和win绑定即调用uapi_vi_attach_win和uapi_vi_detach_win时win_handle需要传0 CNend
*/
td_s32 uapi_vi_release_frame(td_handle vi_handle, uapi_video_frame_info *frame_info);
/*
* brief set output attribution of VI. CNcomment: 设置VI的输出属性 CNend
* attention \n
* When you need to control the output attribution of VI, such as output frame rate, you can call this API.
* CNcomment: 当需要控制VI的输出属性例如输出帧率时可以调用本接口 CNend
* param[in] vi_handle VI handle. CNcomment: 32位整数VI句柄. CNend
* param[in] output_attr. Pointer to uapi_vi_output_attr.
For details, see the description of ::uapi_vi_output_attr.
* CNcomment: 指针类型VI输出属性请参见::uapi_vi_output_attr. CNend
* retval ::TD_SUCCESS Success CNcomment: 成功 CNend
* retval ::TD_FAILURE Calling this API fails. CNcomment: API系统调用失败 CNend
* retval ::SOC_ERR_VI_NULL_PTR. The pointer is null. CNcomment: 指针参数为空 CNend
* retval ::SOC_ERR_VI_INVALID_PARA. The input parameter is invalid. CNcomment: 输入参数非法 CNend
* retval ::SOC_ERR_VI_NOT_SUPPORT. The ability is not support. CNcomment: 输入参数不支持 CNend
* see 1.After the output frame rate is changed, the VI module evenly discards frames to reach the target frame rate.
* This function is used in scenarios where the bandwidth is reduced. This function may cause frame freezing and
* is not recommended in other scenarios.
* 1. 输出帧率修改后VI会均匀丢帧以达到目标目标帧率用于降低带宽的场景使用。
* 该功能可能会造成卡顿等效果问题,其他场景不推荐使用。
* N/A CNcomment: 无 CNend
*/
td_s32 uapi_vi_set_output_attr(td_handle vi_handle, const uapi_vi_output_attr *output_attr);
/*
* brief set output attribution of VI. CNcomment: 获取VI的输出属性 CNend
* attention \n
* When you need to control the output of VI, such as output frame rate, you can call this API.
* CNcomment: 当需要获取VI的输出属性时可以调用本接口 CNend
* param[in] vi_handle VI handle. CNcomment: 32位整数VI句柄. CNend
* param[out] custom_config. Pointer to uapi_vi_output_attr.
For details, see the description of ::uapi_vi_output_attr.
* CNcomment: 指针类型VI输出属性请参见::uapi_vi_output_attr. CNend
* retval ::TD_SUCCESS Success CNcomment: 成功 CNend
* retval ::TD_FAILURE Calling this API fails. CNcomment: API系统调用失败 CNend
* retval ::SOC_ERR_VI_NULL_PTR. The pointer is null. CNcomment: 指针参数为空 CNend
* retval ::SOC_ERR_VI_INVALID_PARA. The input parameter is invalid. CNcomment: 输入参数非法 CNend
* retval ::SOC_ERR_VI_NOT_SUPPORT. The ability is not support. CNcomment: 输入参数不支持 CNend
* see \n
* N/A CNcomment: 无 CNend
*/
td_s32 uapi_vi_get_output_attr(td_handle vi_handle, uapi_vi_output_attr *output_attr);
#ifdef __cplusplus
#if __cplusplus
}
#endif
#endif /* __cplusplus */
#endif /* __UAPI_VI_H__ */