|
|
/*
|
|
|
* Copyright (c) Hisilicon Technologies Co., Ltd. 2019-2020. All rights reserved.
|
|
|
* Description : Huanglong HDDEC API declaration
|
|
|
* Author:ATV team
|
|
|
* Create: 2019-11-20
|
|
|
*/
|
|
|
#ifndef __UAPI_HDDEC_H__
|
|
|
#define __UAPI_HDDEC_H__
|
|
|
|
|
|
#include "uapi_video.h"
|
|
|
#include "uapi_system.h"
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
#if __cplusplus
|
|
|
extern "C" {
|
|
|
#endif
|
|
|
#endif /* __cplusplus */
|
|
|
|
|
|
#define UAPI_HDDEC_EDID_SIZE 128 /* VGA source EDID data size */
|
|
|
/* CNcomment:VGA信号源EDID数据长度 */
|
|
|
/*
|
|
|
* VGA edid data definition
|
|
|
* CNcomment:VGA edid大小定义为128Byte
|
|
|
*/
|
|
|
typedef struct {
|
|
|
td_u8 edid_data[UAPI_HDDEC_EDID_SIZE]; /* VGA edid data */
|
|
|
/* CNcomment: VGA edid数据 */
|
|
|
} uapi_hddec_edid;
|
|
|
|
|
|
/*
|
|
|
* Source input pin select
|
|
|
* CNcomment:信号输入选择
|
|
|
*/
|
|
|
typedef struct {
|
|
|
uapi_video_source src_type; /* Source type */
|
|
|
/* CNcomment: 信号源类型 */
|
|
|
td_u32 index; /* Source index */
|
|
|
/* CNcomment: 输入信号源索引 */
|
|
|
} uapi_hddec_src_attr;
|
|
|
|
|
|
/*
|
|
|
* Signal timing information
|
|
|
* CNcomment:信号时序信息
|
|
|
*/
|
|
|
typedef struct {
|
|
|
td_u32 timing_index; /* Timing ID in the timing table */
|
|
|
/* CNcomment: timing序号 */
|
|
|
td_bool interlace; /* Interlace or progressive */
|
|
|
/* CNcomment: 逐隔行信息 */
|
|
|
td_u32 width; /* Standard width */
|
|
|
/* CNcomment: 标准信号一帧的宽度 */
|
|
|
td_u32 height; /* Standard height */
|
|
|
/* CNcomment: 标准信号一帧的高度,
|
|
|
即隔行信号是两场的高度,逐行信号是一帧的高度 */
|
|
|
td_u32 frame_rate; /* Standard frame rate */
|
|
|
/* CNcomment: 标准的场频,
|
|
|
如果是隔行信号则为场频,如果是逐行信号则为帧率 */
|
|
|
uapi_video_pixel_format pix_fmt; /* Pixel format */
|
|
|
/* CNcomment: 输入像素格式 RGB444,YUV444/422 */
|
|
|
uapi_color_description color_space; /* Color space */
|
|
|
/* CNcomment: 彩色空间 */
|
|
|
uapi_oversample oversample; /* Oversample information */
|
|
|
/* CNcomment: 过采样信息 */
|
|
|
uapi_pixel_bit_depth bit_depth; /* Bit width information */
|
|
|
/* CNcomment: 位宽信息 */
|
|
|
} uapi_hddec_timing_info;
|
|
|
|
|
|
/*
|
|
|
* Adjust state for color calibration and VGA auto adjust
|
|
|
* CNcomment:VGA图像自动调整的状态
|
|
|
*/
|
|
|
typedef enum {
|
|
|
UAPI_HDDEC_ADJUST_STATUS_BEGIN = 0, /* Adjust begin */
|
|
|
/* CNcomment: 调整开始 */
|
|
|
UAPI_HDDEC_ADJUST_STATUS_FINISH, /* Adjust finished */
|
|
|
/* CNcomment: 调整完成 */
|
|
|
UAPI_HDDEC_ADJUST_STATUS_TIMEOUT, /* Adjust timeout */
|
|
|
/* CNcomment: 调整超时 */
|
|
|
UAPI_HDDEC_ADJUST_STATUS_FAIL, /* Adjust failed */
|
|
|
/* CNcomment: 调整失败 */
|
|
|
UAPI_HDDEC_ADJUST_STATUS_MAX /* Invalid value */
|
|
|
/* CNcomment: 非法边界值 */
|
|
|
} uapi_hddec_adjust_status;
|
|
|
|
|
|
/*
|
|
|
* HDDEC parameters adjust type
|
|
|
* CNcomment:HDDEC参数手动调整类型
|
|
|
*/
|
|
|
typedef enum {
|
|
|
UAPI_HDDEC_ADJUST_TYPE_HPOS = 0, /* H Position adjust */
|
|
|
/* CNcomment: 水平位置调整 */
|
|
|
UAPI_HDDEC_ADJUST_TYPE_VPOS, /* V Position adjust */
|
|
|
/* CNcomment: 垂直位置调整 */
|
|
|
UAPI_HDDEC_ADJUST_TYPE_PHASE, /* phase adjust */
|
|
|
/* CNcomment: 相位调整 */
|
|
|
UAPI_HDDEC_ADJUST_TYPE_CLOCK, /* Clock adjust */
|
|
|
/* CNcomment: 时钟调整 */
|
|
|
UAPI_HDDEC_ADJUST_TYPE_MAX /* Invalid value */
|
|
|
/* CNcomment: 非法边界值 */
|
|
|
} uapi_hddec_adjust_type;
|
|
|
|
|
|
/* Defines the state of the color calibration. */
|
|
|
/* CNcomment: 定义颜色校正的状态 */
|
|
|
typedef enum {
|
|
|
UAPI_HDDEC_COLOR_CALIB_STATUS_BEGIN = 0, /* Color calibration begin */
|
|
|
/* CNcomment:颜色校正开始 */
|
|
|
UAPI_HDDEC_COLOR_CALIB_STATUS_FINISH, /* Color calibration finished */
|
|
|
/* CNcomment:颜色校正完成 */
|
|
|
UAPI_HDDEC_COLOR_CALIB_STATUS_TIMEOUT, /* Color calibration timeout */
|
|
|
/* CNcomment:颜色校正超时出错 */
|
|
|
UAPI_HDDEC_COLOR_CALIB_STATUS_FAIL, /* Color calibration failed */
|
|
|
/* CNcomment:颜色校正失败 */
|
|
|
UAPI_HDDEC_COLOR_CALIB_STATUS_MAX /* Invalid value */
|
|
|
/* CNcomment:非法边界值 */
|
|
|
} uapi_hddec_color_calib_status;
|
|
|
|
|
|
/* Defines the result data of the color calibration. */
|
|
|
/* CNcomment: 定义颜色校正的结果数据 */
|
|
|
typedef struct {
|
|
|
td_u32 r_gain; /* R Gain */ /* CNcomment:R通道增益 */
|
|
|
td_u32 g_gain; /* G Gain */ /* CNcomment:G通道增益 */
|
|
|
td_u32 b_gain; /* B Gain */ /* CNcomment:B通道增益 */
|
|
|
td_u32 r_offset; /* R Offset */ /* CNcomment:R通道偏移 */
|
|
|
td_u32 g_offset; /* G Offset */ /* CNcomment:G通道偏移 */
|
|
|
td_u32 b_offset; /* B Offset */ /* CNcomment:B通道偏移 */
|
|
|
} uapi_hddec_color_calib_param;
|
|
|
|
|
|
/* Defines hddec capability . */
|
|
|
/* CNcomment: 定义hddec能力信息 */
|
|
|
typedef struct {
|
|
|
td_u8 vga_max; /* vga capability */ /* CNcomment:VGA信源支持的个数 */
|
|
|
td_u8 ypbpr_max; /* ypbpr capability */ /* CNcomment:YPBPR信源支持的个数 */
|
|
|
td_u8 scart_max; /* scart capability */ /* CNcomment:SCART信源支持的个数 */
|
|
|
} uapi_hddec_capability;
|
|
|
|
|
|
/*
|
|
|
* brief the whole initialization of the HDDEC device. CNcomment:HDDEC接口驱动软件初始化 CNend
|
|
|
* attention \n
|
|
|
* param CNcomment:无 CNend
|
|
|
* retval TD_SUCCESS success. CNcomment:成功 CNend
|
|
|
* retval please refer to the err code definitino of mpi.CNcomment:请参考MPI错误码 CNend
|
|
|
* see \n
|
|
|
* CNcomment:无 CNend
|
|
|
*/
|
|
|
td_s32 uapi_hddec_init(td_void);
|
|
|
|
|
|
/*
|
|
|
* brief deinit the HDDEC device. CNcomment:HDDEC接口去初始化 CNend
|
|
|
* attention \n
|
|
|
* param CNcomment:无 CNend
|
|
|
* retval TD_SUCCESS success.CNcomment:成功 CNend
|
|
|
* retval please refer to the err code definitino of mpi.CNcomment:请参考MPI错误码 CNend
|
|
|
* see \n
|
|
|
* CNcomment:无 CNend
|
|
|
*/
|
|
|
td_s32 uapi_hddec_deinit(td_void);
|
|
|
|
|
|
/*
|
|
|
* connect the HDDEC device if source switch to YPbPr or VGA.
|
|
|
* CNcomment:切换HDDEC信号源(YPbPr或VGA)时连接HDDEC设备 CNend
|
|
|
* attention \n
|
|
|
* param[in] src_attr connected source attribute.CNcomment:连接的信号源 CNend
|
|
|
* retval TD_SUCCESS success. CNcomment:成功 CNend
|
|
|
* retval please refer to the err code definitino of mpi.CNcomment:请参考MPI错误码 CNend
|
|
|
* see \n
|
|
|
* CNcomment:无 CNend
|
|
|
*/
|
|
|
td_s32 uapi_hddec_connect(const uapi_hddec_src_attr *src_attr);
|
|
|
|
|
|
/*
|
|
|
* disconnect the HDDEC device if source switch to other source.
|
|
|
* CNcomment:切换到其他信号源时断开连接HDDEC设备 CNend
|
|
|
* attention \n
|
|
|
* param CNcomment:无 CNend
|
|
|
* retval TD_SUCCESS success. CNcomment:成功 CNend
|
|
|
* retval please refer to the err code definitino of mpi.CNcomment:请参考MPI错误码 CNend
|
|
|
* see \n
|
|
|
* CNcomment:无 CNend
|
|
|
*/
|
|
|
td_s32 uapi_hddec_disconnect(td_void);
|
|
|
|
|
|
/*
|
|
|
* check the signal is exist or not with the non-current source.
|
|
|
* CNcomment:获取离线信源的信号是否存在,阻塞返回 CNend
|
|
|
* attention \n
|
|
|
* param[in] src_attr source attribute. CNcomment:离线检测信号源信息 CNend
|
|
|
* param[out] exist signal exist information.CNcomment:信号是否存在信息 CNend
|
|
|
* retval TD_SUCCESS success. CNcomment:成功 CNend
|
|
|
* retval please refer to the err code definitino of mpi.CNcomment:请参考MPI错误码 CNend
|
|
|
* see \n
|
|
|
* CNcomment:无 CNend
|
|
|
*/
|
|
|
td_s32 uapi_hddec_get_offline_status(const uapi_hddec_src_attr *src_attr, td_bool *exist);
|
|
|
|
|
|
/*
|
|
|
* get the signal status like no signal/unstable/support.
|
|
|
* CNcomment:读取信号状态(无信号/不稳定/信号稳定) CNend
|
|
|
* attention \n
|
|
|
* param[out] sig_status signal status.CNcomment:获取的信号状态 CNend
|
|
|
* retval TD_SUCCESS success. CNcomment:成功 CNend
|
|
|
* retval please refer to the err code definitino of mpi.CNcomment:请参考MPI错误码 CNend
|
|
|
* see \n
|
|
|
* CNcomment:无 CNend
|
|
|
*/
|
|
|
td_s32 uapi_hddec_get_signal_status(uapi_sig_status *sig_status);
|
|
|
|
|
|
/*
|
|
|
* get the standard timing information of current signal. CNcomment:读取信号标准时序信息 CNend
|
|
|
* attention \n
|
|
|
* param[out] timing_info signal timing information.CNcomment:获取的信号时序信息 CNend
|
|
|
* retval TD_SUCCESS success. CNcomment:成功 CNend
|
|
|
* retval please refer to the err code definitino of mpi.CNcomment:请参考MPI错误码 CNend
|
|
|
* see \n
|
|
|
* CNcomment:无 CNend
|
|
|
*/
|
|
|
td_s32 uapi_hddec_get_timing_info(uapi_hddec_timing_info *timing_info);
|
|
|
|
|
|
/*
|
|
|
* to check the nonstand signal information. CNcomment:读取非标信息 CNend
|
|
|
* attention \n
|
|
|
* param[out] nonstd_info nonstand signal information.CNcomment:非标信号信息 CNend
|
|
|
* retval TD_SUCCESS success. CNcomment:成功 CNend
|
|
|
* retval please refer to the err code definitino of mpi.CNcomment:请参考MPI错误码 CNend
|
|
|
* see \n
|
|
|
* CNcomment:无 CNend
|
|
|
*/
|
|
|
td_s32 uapi_hddec_get_nonstd_info(uapi_video_nonstd_info *nonstd_info);
|
|
|
|
|
|
/*
|
|
|
* to start color calibration CNcomment:启动自动颜色校正 CNend
|
|
|
* attention \n
|
|
|
* param cNComment:无 CNend
|
|
|
* retval TD_SUCCESS success. CNcomment:成功 CNend
|
|
|
* retval please refer to the err code definitino of mpi.CNcomment:请参考MPI错误码 CNend
|
|
|
* see \n
|
|
|
* CNcomment:无 CNend
|
|
|
*/
|
|
|
td_s32 uapi_hddec_calibrate_color(td_void);
|
|
|
|
|
|
/*
|
|
|
* get color calibration information CNcomment:获取自动颜色校正状态 CNend
|
|
|
* attention \n
|
|
|
* param[out] calib_status color calibration information.CNcomment:自动颜色校正状态 CNend
|
|
|
* retval TD_SUCCESS success. CNcomment:成功 CNend
|
|
|
* retval please refer to the err code definitino of mpi.CNcomment:请参考MPI错误码 CNend
|
|
|
* see \n
|
|
|
* CNcomment:无 CNend
|
|
|
*/
|
|
|
td_s32 uapi_hddec_get_calibration_status(uapi_hddec_color_calib_status *calib_status);
|
|
|
|
|
|
/*
|
|
|
* get color calibration data CNcomment:获取自动颜色校正数据 CNend
|
|
|
* attention \n
|
|
|
* param[out] calib_param color calibration data.CNcomment:自动颜色校正数据 CNend
|
|
|
* retval TD_SUCCESS success. CNcomment:成功 CNend
|
|
|
* retval please refer to the err code definitino of mpi.CNcomment:请参考MPI错误码 CNend
|
|
|
* see \n
|
|
|
* CNcomment:无 CNend
|
|
|
*/
|
|
|
td_s32 uapi_hddec_get_calibration_param(uapi_hddec_color_calib_param *calib_param);
|
|
|
|
|
|
/*
|
|
|
* set color calibration data CNcomment:手动设置自动颜色校正 CNend
|
|
|
* attention \n
|
|
|
* param[in] calib_param color calibration data.CNcomment:设置的颜色校正数据 CNend
|
|
|
* retval TD_SUCCESS success. CNcomment:成功 CNend
|
|
|
* retval please refer to the err code definitino of mpi.CNcomment:请参考MPI错误码 CNend
|
|
|
* see \n
|
|
|
* CNcomment:无 CNend
|
|
|
*/
|
|
|
td_s32 uapi_hddec_set_calibration_param(const uapi_hddec_color_calib_param *calib_param);
|
|
|
|
|
|
/*
|
|
|
* to start VGA source auto adjust CNcomment:启动VGA图像自动调整 CNend
|
|
|
* attention \n
|
|
|
* param CNcomment:无 CNend
|
|
|
* retval TD_SUCCESS success. CNcomment:成功 CNend
|
|
|
* retval please refer to the err code definitino of mpi.CNcomment:请参考MPI错误码 CNend
|
|
|
* see \n
|
|
|
* CNcomment:无 CNend
|
|
|
*/
|
|
|
td_s32 uapi_hddec_adjust_image_param(td_void);
|
|
|
|
|
|
/*
|
|
|
* get VGA auto adjust information CNcomment:获取VGA图像自动调整状态 CNend
|
|
|
* attention \n
|
|
|
* param[out] adjust_status VGA auto adjust information.CNcomment:VGA图像自动调整状态 CNend
|
|
|
* retval TD_SUCCESS success. CNcomment:成功 CNend
|
|
|
* retval please refer to the err code definitino of mpi.CNcomment:请参考MPI错误码 CNend
|
|
|
* see \n
|
|
|
* CNcomment:无 CNend
|
|
|
*/
|
|
|
td_s32 uapi_hddec_get_adjust_status(uapi_hddec_adjust_status *adjust_status);
|
|
|
|
|
|
/*
|
|
|
* get adjust type range CNcomment:获取手动调整可调范围 CNend
|
|
|
* attention \n
|
|
|
* param[in] adjust_type adjust type.CNcomment:调整类型 CNend
|
|
|
* param[out] range adjust type range.CNcomment:手动调整可调范围 CNend
|
|
|
* retval TD_SUCCESS success. CNcomment:成功 CNend
|
|
|
* retval please refer to the err code definitino of mpi.CNcomment:请参考MPI错误码 CNend
|
|
|
* see \n
|
|
|
* CNcomment:无 CNend
|
|
|
*/
|
|
|
td_s32 uapi_hddec_get_adjust_range(uapi_hddec_adjust_type adjust_type, uapi_sys_range *range);
|
|
|
|
|
|
/*
|
|
|
* get adjust type data CNcomment:获取调整参数数值 CNend
|
|
|
* attention \n
|
|
|
* param[in] adjust_type adjust type.CNcomment:调整类型 CNend
|
|
|
* param[out] param adjust type data.CNcomment:调整参数数值 CNend
|
|
|
* retval TD_SUCCESS success. CNcomment:成功 CNend
|
|
|
* retval please refer to the err code definitino of mpi.CNcomment:请参考MPI错误码 CNend
|
|
|
* see \n
|
|
|
* CNcomment:无 CNend
|
|
|
*/
|
|
|
td_s32 uapi_hddec_get_adjust_param(uapi_hddec_adjust_type adjust_type, td_u32 *param);
|
|
|
|
|
|
/*
|
|
|
* set adjust type data CNcomment:设置调整参数数值 CNend
|
|
|
* attention \n
|
|
|
* param[in] adjust_type adjust type.CNcomment:调整类型 CNend
|
|
|
* param[in] param adjust type data.CNcomment:调整参数数值 CNend
|
|
|
* retval TD_SUCCESS success. CNcomment:成功 CNend
|
|
|
* retval please refer to the err code definitino of mpi.CNcomment:请参考MPI错误码 CNend
|
|
|
* see \n
|
|
|
* CNcomment:无 CNend
|
|
|
*/
|
|
|
td_s32 uapi_hddec_set_adjust_param(uapi_hddec_adjust_type adjust_type, td_u32 param);
|
|
|
|
|
|
/*
|
|
|
* update the EDID data CNcomment:更新EDID数据 CNend
|
|
|
* attention \n
|
|
|
* param[in] edid EDID data.CNcomment:EDID数据 CNend
|
|
|
* retval TD_SUCCESS success. CNcomment:成功 CNend
|
|
|
* retval please refer to the err code definitino of mpi.CNcomment:请参考MPI错误码 CNend
|
|
|
* see \n
|
|
|
* CNcomment:无 CNend
|
|
|
*/
|
|
|
td_s32 uapi_hddec_update_edid(const uapi_hddec_edid *edid);
|
|
|
|
|
|
/*
|
|
|
* get hddec capability. CNcomment: 获取hddec能力 CNend
|
|
|
* attention \n
|
|
|
* param[out] capability hddec capability. CNcomment: 获取到的能力信息 CNend
|
|
|
* retval TD_SUCCESS success. CNcomment:成功 CNend
|
|
|
* retval please refer to the err code definitino of mpi. CNcomment: 请参考MPI错误码 CNend
|
|
|
* see \n
|
|
|
* CNcomment: 无 CNend
|
|
|
*/
|
|
|
td_s32 uapi_hddec_get_capability(uapi_hddec_capability *capability);
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
#if __cplusplus
|
|
|
}
|
|
|
#endif
|
|
|
#endif /* __cplusplus */
|
|
|
|
|
|
#endif /* __UAPI_HDDEC_H__ */
|