mirror of
https://gitee.com/houstudio/Cdroid.git
synced 2024-12-05 21:58:44 +08:00
remove nx5 libs
This commit is contained in:
parent
e0e87d2c75
commit
5c2680ea6a
@ -1,310 +0,0 @@
|
||||
/******************************************************************************
|
||||
Copyright(c) 2016-2018 Digital Power Inc.
|
||||
File name: vdecapi.h
|
||||
Author: LiuZhengzhong
|
||||
Version: 1.0.0
|
||||
Date: 2018/1/30
|
||||
Description: Platform of DP X5 video decode C api
|
||||
History:
|
||||
Bug report: liuzhengzhong@d-power.com.cn
|
||||
******************************************************************************/
|
||||
|
||||
#ifndef __VDECAPI_H__
|
||||
#define __VDECAPI_H__
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C"
|
||||
{
|
||||
#endif
|
||||
|
||||
typedef long long int64_t;
|
||||
|
||||
typedef enum _PAYLOAD_TYPE_E
|
||||
{
|
||||
VDEC_PAYLOAD_TYPE_H264 = 1,
|
||||
VDEC_PAYLOAD_TYPE_MJPEG = 2,
|
||||
VDEC_PAYLOAD_TYPE_H265 = 3,
|
||||
VDEC_PAYLOAD_TYPE_MAX,
|
||||
} VDEC_PAYLOAD_TYPE_E;
|
||||
|
||||
typedef enum _PIXEL_FORMAT_E
|
||||
{
|
||||
FORMAT_YV12 = 1,
|
||||
FORMAT_NV21 = 2,
|
||||
|
||||
} PIXEL_FORMAT_E;
|
||||
|
||||
// 解码器属性
|
||||
typedef struct _VDEC_CHN_ATTR_S
|
||||
{
|
||||
// 解码类型,默认PAYLOAD_TYPE_H264
|
||||
VDEC_PAYLOAD_TYPE_E deType;
|
||||
// 解码输出格式,默认YV12
|
||||
PIXEL_FORMAT_E FormatType;
|
||||
// 解码宽度,H264流中携带长宽信息,所以可以不指定
|
||||
// 对于X9 JPG解码,这个参数表示填充后的宽度,填0输出原始宽度
|
||||
// 若X9解码时,指定了非0,且JPG原始宽度大于填充宽度,则会自动缩放
|
||||
unsigned int u32PicWidth;
|
||||
// 解码高度
|
||||
// 对于X9 JPG解码,这个参数表示填充后的高度,填0输出原始高度
|
||||
// 若X9解码时,指定了非0,且JPG原始宽度大于填充高度,则会自动缩放
|
||||
unsigned int u32PicHight;
|
||||
// 解码帧率,默认25
|
||||
unsigned int u32FrameRate;
|
||||
// 码流缓冲区大小,范围0x10000-0x800000,默认0x100000
|
||||
unsigned int BufSize;
|
||||
|
||||
} VDEC_CHN_ATTR_S;
|
||||
|
||||
// 码流属性
|
||||
typedef struct _VDEC_STREAM_S
|
||||
{
|
||||
// 码流地址
|
||||
unsigned char *pu8Addr;
|
||||
// 码流长度
|
||||
unsigned int u32Len;
|
||||
// 时间戳
|
||||
unsigned long long u64PTS;
|
||||
|
||||
} VDEC_STREAM_S, *PTR_VDEC_STREAM_S;
|
||||
|
||||
// 通道状态
|
||||
typedef struct _VDEC_CHN_STAT_S
|
||||
{
|
||||
// 解码类型
|
||||
VDEC_PAYLOAD_TYPE_E deType;
|
||||
// 缓冲区内有效未解码数据大小,字节
|
||||
unsigned int u32LeftPics;
|
||||
// 缓冲区内有效未解码数据帧数
|
||||
unsigned int u32FrameNum;
|
||||
// 码流buffer总大小,字节,若解码器未初始化,为0
|
||||
unsigned int u32BufSize;
|
||||
|
||||
} VDEC_CHN_STAT_S;
|
||||
|
||||
typedef enum _VDEC_FORMAT_E
|
||||
{
|
||||
HWC_FORMAT_MINVALUE = 0x50,
|
||||
HWC_FORMAT_RGBA_8888 = 0x51,
|
||||
HWC_FORMAT_RGB_565 = 0x52,
|
||||
HWC_FORMAT_BGRA_8888 = 0x53,
|
||||
HWC_FORMAT_YCbYCr_422_I = 0x54,
|
||||
HWC_FORMAT_CbYCrY_422_I = 0x55,
|
||||
HWC_FORMAT_MBYUV420 = 0x56,
|
||||
HWC_FORMAT_MBYUV422 = 0x57,
|
||||
HWC_FORMAT_YUV420PLANAR = 0x58,
|
||||
HWC_FORMAT_YUV411PLANAR = 0x59,
|
||||
HWC_FORMAT_YUV422PLANAR = 0x60,
|
||||
HWC_FORMAT_YUV444PLANAR = 0x61,
|
||||
HWC_FORMAT_YUV420UVC = 0x62,
|
||||
HWC_FORMAT_YUV420VUC = 0x63,
|
||||
HWC_FORMAT_YUV422UVC = 0x64,
|
||||
HWC_FORMAT_YUV422VUC = 0x65,
|
||||
HWC_FORMAT_YUV411UVC = 0x66,
|
||||
HWC_FORMAT_YUV411VUC = 0x67,
|
||||
// The actual color format is determined
|
||||
HWC_FORMAT_DEFAULT = 0x99,
|
||||
HWC_FORMAT_MAXVALUE = 0x100
|
||||
|
||||
} VDEC_FORMAT_E;
|
||||
|
||||
typedef struct _VDEC_SRC_INFO
|
||||
{
|
||||
unsigned int W;
|
||||
unsigned int H;
|
||||
unsigned int Crop_X;
|
||||
unsigned int Crop_Y;
|
||||
unsigned int Crop_W;
|
||||
unsigned int Crop_H;
|
||||
VDEC_FORMAT_E Format;
|
||||
|
||||
} VDEC_SRC_INFO;
|
||||
|
||||
// 解码图像信息
|
||||
typedef struct _VDEC_FRAME_S
|
||||
{
|
||||
// 图像信息
|
||||
VDEC_SRC_INFO SrcInfo;
|
||||
// 像素格式
|
||||
PIXEL_FORMAT_E enPixelFormat;
|
||||
// 物理地址
|
||||
// 若YV12格式:Frame->u32PhyAddr[1]是U地址,Frame->u32PhyAddr[2]是V地址
|
||||
// 若NV21格式:Frame->u32PhyAddr[1]是VU混合地址,Frame->u32PhyAddr[2]无效
|
||||
void *u32PhyAddr[3];
|
||||
// 虚拟地址
|
||||
// 若YV12格式:Frame->pVirAddr[1]是U地址,Frame->pVirAddr[2]是V地址
|
||||
// YV12内存分布:Y0Y1Y2Y3/V0/U0
|
||||
// 若NV21格式:Frame->pVirAddr[1]是VU混合地址,Frame->pVirAddr[2]无效
|
||||
// NV21内存分布:Y0Y1Y2Y3/V0U0
|
||||
void *pVirAddr[3];
|
||||
// 图像行宽,单位为像素
|
||||
unsigned int u32Stride;
|
||||
// 时间戳
|
||||
unsigned long long u64pts;
|
||||
// 解码器内显示队列中待显示图像个数
|
||||
unsigned int u32ValidPic;
|
||||
// 解码器内共有多少个图像Buf
|
||||
unsigned int u32TotalBuf;
|
||||
// 未被解码器和显示占用的图像Buf个数
|
||||
unsigned int u32EmptyBuf;
|
||||
// 内部使用,用户无需关心此字段
|
||||
void *Pic;
|
||||
|
||||
} VDEC_FRAME_S;
|
||||
|
||||
typedef enum _VDEC_STATUS
|
||||
{
|
||||
VDEC_RESULT_OK = 0,
|
||||
// 解码成功,输出了一帧图像
|
||||
VDEC_FRAME_DECODED = 1,
|
||||
// 解码成功,但没有图像输出,需要继续解码
|
||||
VDEC_CONTINUE = 2,
|
||||
// 解码成功,输出了一帧关键帧
|
||||
VDEC_KEYFRAME_DECODED = 3,
|
||||
// 当前无法获取到图像Buffer
|
||||
VDEC_NO_FRAME_BUFFER = 4,
|
||||
// 当前无法获取到码流数据
|
||||
VDEC_NO_BITSTREAM = 5,
|
||||
// 视频分辨率发生变化,无法继续
|
||||
VDEC_RESOLUTION_CHANGE = 6,
|
||||
// 不能支持的格式或申请内存失败,无法继续解码
|
||||
VDEC_UNSUPPORTED = -1,
|
||||
// 解码通道错误
|
||||
VDEC_CHANNEL_ERROR = -2,
|
||||
|
||||
} VDEC_STATUS;
|
||||
|
||||
#define MAX_VID_DECODE_CHANNEL 8
|
||||
|
||||
/******************************************************************************
|
||||
Function: VDEC_Init
|
||||
Description: 初始化视频解码器
|
||||
Param:
|
||||
Return: 成功返回1,失败返回0
|
||||
Others:
|
||||
******************************************************************************/
|
||||
int VDEC_Init(void);
|
||||
|
||||
/******************************************************************************
|
||||
Function: VDEC_DeInit
|
||||
Description: 反初始化视频解码器
|
||||
Param:
|
||||
Return: 成功返回1,失败返回0
|
||||
Others: 执行此函数会销毁所有视频通道
|
||||
******************************************************************************/
|
||||
int VDEC_DeInit(void);
|
||||
|
||||
/******************************************************************************
|
||||
Function: VDEC_CreateChn
|
||||
Description: 创建解码通道
|
||||
Param:
|
||||
Attr in 解码器属性
|
||||
Return: 成功返回大于等于0的通道号,失败返回-1
|
||||
Others:
|
||||
******************************************************************************/
|
||||
int VDEC_CreateChn(VDEC_CHN_ATTR_S *Attr);
|
||||
|
||||
/******************************************************************************
|
||||
Function: VDEC_DestroyChn
|
||||
Description: 销毁解码通道
|
||||
Param:
|
||||
Channel in 通道号
|
||||
Return: 成功返回1,失败返回0
|
||||
Others:
|
||||
******************************************************************************/
|
||||
int VDEC_DestroyChn(int Channel);
|
||||
|
||||
/******************************************************************************
|
||||
Function: VDEC_GetChnAttr
|
||||
Description: 获取通道属性
|
||||
Param:
|
||||
Channel in 指定通道号
|
||||
Attr out 接收数据结构体指针
|
||||
Return: 成功返回1,失败返回0
|
||||
Others: Attr的内容为强拷贝
|
||||
******************************************************************************/
|
||||
int VDEC_GetChnAttr(int Channel, VDEC_CHN_ATTR_S *Attr);
|
||||
|
||||
/******************************************************************************
|
||||
Function: VDEC_StartRecvStream
|
||||
Description: 开始解码
|
||||
Param:
|
||||
Channel in 指定通道号
|
||||
DropB in 当码流的时间戳比当前时间大时,是否丢弃B帧,取值0或1
|
||||
OnlyI in 只解码I帧,取值0或1
|
||||
Time in 当前时间,微秒,可以填0
|
||||
Return:
|
||||
Others: 解码一帧数据
|
||||
******************************************************************************/
|
||||
VDEC_STATUS VDEC_StartRecvStream(int Channel, unsigned int DropB, unsigned int OnlyI, int64_t Time);
|
||||
|
||||
/******************************************************************************
|
||||
Function: VDEC_StopRecvStream
|
||||
Description: 停止解码
|
||||
Param:
|
||||
Channel in 指定通道号
|
||||
Return:
|
||||
Others:
|
||||
******************************************************************************/
|
||||
VDEC_STATUS VDEC_StopRecvStream(int Channel);
|
||||
|
||||
/******************************************************************************
|
||||
Function: VDEC_SendStream
|
||||
Description: 向解码器送一帧数据
|
||||
Param:
|
||||
Channel in 指定通道号
|
||||
Stream in 码流信息
|
||||
Return: 成功返回1,失败返回0
|
||||
Others:
|
||||
******************************************************************************/
|
||||
int VDEC_SendStream(int Channel, VDEC_STREAM_S *Stream);
|
||||
|
||||
/******************************************************************************
|
||||
Function: VDEC_Query
|
||||
Description: 查询通道状态
|
||||
Param:
|
||||
Channel in 指定通道号
|
||||
Stat out 接收数据结构体指针
|
||||
Return: 成功返回1,失败返回0
|
||||
Others:
|
||||
******************************************************************************/
|
||||
int VDEC_Query(int Channel, VDEC_CHN_STAT_S *Stat);
|
||||
|
||||
/******************************************************************************
|
||||
Function: VDEC_ResetChn
|
||||
Description: 复位通道
|
||||
Param:
|
||||
Channel in 指定通道号
|
||||
Return: 成功返回1,失败返回0
|
||||
Others: 解码器被重置,但初始化信息被保留,码流Buffer被清空,图像数据被清空
|
||||
******************************************************************************/
|
||||
int VDEC_ResetChn(int Channel);
|
||||
|
||||
/******************************************************************************
|
||||
Function: VDEC_GetImage
|
||||
Description: 获取解码数据
|
||||
Param:
|
||||
Channel in 指定通道号
|
||||
Frame out 接收数据结构体指针
|
||||
Return: 成功返回1,失败返回0
|
||||
Others:
|
||||
******************************************************************************/
|
||||
int VDEC_GetImage(int Channel, VDEC_FRAME_S *Frame);
|
||||
|
||||
/******************************************************************************
|
||||
Function: VDEC_ReleaseImage
|
||||
Description: 释放解码数据
|
||||
Param:
|
||||
Channel in 指定通道号
|
||||
Frame in X5_VDEC_GetImage所得结构体指针
|
||||
Return: 成功返回1,失败返回0
|
||||
Others: X5_VDEC_GetImage与X5_VDEC_ReleaseImage必须串行,成对出现
|
||||
不允许出现调用两次X5_VDEC_GetImage再X5_VDEC_ReleaseImage两次的情况
|
||||
******************************************************************************/
|
||||
int VDEC_ReleaseImage(int Channel, VDEC_FRAME_S *Frame);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif // !__VDECAPI_H__
|
@ -1,224 +0,0 @@
|
||||
/******************************************************************************
|
||||
Copyright(c) 2016-2018 Digital Power Inc.
|
||||
File name: voapi.h
|
||||
Author: LiuZhengzhong
|
||||
Version: 1.0.0
|
||||
Date: 2018/1/30
|
||||
Description: Platform of DP X5 display C api
|
||||
History:
|
||||
Bug report: liuzhengzhong@d-power.com.cn
|
||||
******************************************************************************/
|
||||
|
||||
#ifndef __DISPLAY_H__
|
||||
#define __DISPLAY_H__
|
||||
|
||||
#include "VDecApi.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C"
|
||||
{
|
||||
#endif
|
||||
|
||||
typedef struct tagSYNC_INFO_S
|
||||
{
|
||||
|
||||
} SYNC_INFO_S;
|
||||
|
||||
typedef struct _PUB_ATTR_S
|
||||
{
|
||||
// 背景色,从低位起,ARGB排序
|
||||
unsigned int u32BgColor;
|
||||
// VO接口时序配置,空结构,相关参数已在系统配置中提供
|
||||
SYNC_INFO_S stSyncInfo;
|
||||
|
||||
} PUB_ATTR_S;
|
||||
|
||||
typedef struct _LAYER_RECT
|
||||
{
|
||||
// 图层的X坐标
|
||||
int X;
|
||||
// 图层的Y坐标
|
||||
int Y;
|
||||
// 图层的宽度
|
||||
unsigned int W;
|
||||
// 图层的高度
|
||||
unsigned int H;
|
||||
|
||||
} LAYER_RECT;
|
||||
|
||||
typedef enum _LAYER_ROTATE_E
|
||||
{
|
||||
ROTATE_NONE = 0,
|
||||
ROTATE_90 = 1,
|
||||
ROTATE_180 = 2,
|
||||
ROTATE_270 = 3,
|
||||
} LAYER_ROTATE_E;
|
||||
|
||||
typedef struct _LAYER_INFO
|
||||
{
|
||||
// 位置信息
|
||||
LAYER_RECT Rect;
|
||||
// 图层模式,0或1,0:带buffer的图层,1:无buffer,只用一个颜色值表示图像内容,通常使用带buffer的图层
|
||||
unsigned int LayerMode;
|
||||
// 仅当图层模式为1时此成员有效
|
||||
unsigned int Color;
|
||||
// 全局Alpha值,默认0xFF
|
||||
unsigned char AlphaValue;
|
||||
// 默认填0即可
|
||||
unsigned char Specified_Layer;
|
||||
// 是否在显示时旋转
|
||||
LAYER_ROTATE_E Rotate;
|
||||
} LAYER_INFO;
|
||||
|
||||
/******************************************************************************
|
||||
Function: Enable
|
||||
Description: 打开显示设备
|
||||
Param:
|
||||
Return: 成功返回1,失败返回0
|
||||
Others:
|
||||
******************************************************************************/
|
||||
int Enable(void);
|
||||
|
||||
/******************************************************************************
|
||||
Function: Disable
|
||||
Description: 关闭显示设备
|
||||
Param:
|
||||
Return: 成功返回1,失败返回0
|
||||
Others:
|
||||
******************************************************************************/
|
||||
int Disable(void);
|
||||
|
||||
/******************************************************************************
|
||||
Function: SetPubAttr
|
||||
Description: 设置VO公共属性
|
||||
Param:
|
||||
Attr in 属性
|
||||
Return: 成功返回1,失败返回0
|
||||
Others: 暂时只支持设置背景色
|
||||
******************************************************************************/
|
||||
int SetPubAttr(PUB_ATTR_S *Attr);
|
||||
|
||||
/******************************************************************************
|
||||
Function: GetPubAttr
|
||||
Description: 获取VO公共属性
|
||||
Param:
|
||||
Attr out 接收数据结构体指针
|
||||
Return: 成功返回1,失败返回0
|
||||
Others: 暂时只支持获取背景色信息
|
||||
******************************************************************************/
|
||||
int GetPubAttr(PUB_ATTR_S *Attr);
|
||||
|
||||
/******************************************************************************
|
||||
Function: EnableChn
|
||||
Description: 使能视频通道
|
||||
Param:
|
||||
Channel in 指定通道
|
||||
Info in 图层参数结构
|
||||
Return: 成功返回1,失败返回0
|
||||
Others: Channel取值范围是0和1,两个视频通道供使用
|
||||
使能通道的同时,会使能该通道的第0个图层
|
||||
******************************************************************************/
|
||||
int EnableChn(unsigned int Channel, LAYER_INFO *Info);
|
||||
|
||||
/******************************************************************************
|
||||
Function: DisableChn
|
||||
Description: 关闭视频通道
|
||||
Param:
|
||||
Channel in 指定通道
|
||||
Return: 成功返回1,失败返回0
|
||||
Others: Channel取值范围是0和1,两个视频通道供使用
|
||||
关闭通道的同时,会关闭该通道的第0个图层
|
||||
如果有其他图层存在,并且0图层关闭,其他图层也无法显示
|
||||
******************************************************************************/
|
||||
int DisableChn(unsigned int Channel);
|
||||
|
||||
/******************************************************************************
|
||||
Function: EnableVideoLayer
|
||||
Description: 使能视频层
|
||||
Param:
|
||||
Channel in 指定通道
|
||||
Layer in 指定图层
|
||||
Info in 图层参数结构
|
||||
Return: 成功返回1,失败返回0
|
||||
Others: Channel取值范围是0和1,两个视频通道供使用
|
||||
Layer取值范围是0到3,每个通道4层供使用
|
||||
******************************************************************************/
|
||||
int EnableVideoLayer(unsigned int Channel, unsigned int Layer, LAYER_INFO *Info);
|
||||
|
||||
/******************************************************************************
|
||||
Function: DisableVideoLayer
|
||||
Description: 关闭视频层
|
||||
Param:
|
||||
Channel in 指定通道
|
||||
Layer in 指定图层
|
||||
Return: 成功返回1,失败返回0
|
||||
Others: Channel取值范围是0和1,两个视频通道供使用
|
||||
Layer取值范围是0到3,每个通道4层供使用
|
||||
******************************************************************************/
|
||||
int DisableVideoLayer(unsigned int Channel, unsigned int Layer);
|
||||
|
||||
/******************************************************************************
|
||||
Function: SetVideoLayerAttr
|
||||
Description: 设置视频层属性
|
||||
Param:
|
||||
Channel in 指定通道
|
||||
Layer in 指定图层
|
||||
Info in 图层参数结构
|
||||
Return: 成功返回1,失败返回0
|
||||
Others: 空函数
|
||||
******************************************************************************/
|
||||
int SetVideoLayerAttr(unsigned int Channel, unsigned int Layer, LAYER_INFO *Info);
|
||||
|
||||
/******************************************************************************
|
||||
Function: GetVideoLayerAttr
|
||||
Description: 获取视频层属性
|
||||
Param:
|
||||
Channel in 指定通道
|
||||
Layer in 指定图层
|
||||
Info out 接收图层参数结构
|
||||
Return: 成功返回1,失败返回0
|
||||
Others: 空函数
|
||||
******************************************************************************/
|
||||
int GetVideoLayerAttr(unsigned int Channel, unsigned int Layer, LAYER_INFO *Info);
|
||||
|
||||
/******************************************************************************
|
||||
Function: SetZoomInWindow
|
||||
Description: 设置缩放窗口
|
||||
Param:
|
||||
Channel in 指定通道
|
||||
Layer in 指定图层
|
||||
SrcInfo in 图像信息结构
|
||||
Return: 成功返回1,失败返回0
|
||||
Others:
|
||||
******************************************************************************/
|
||||
int SetZoomInWindow(unsigned int Channel, unsigned int Layer, VDEC_SRC_INFO *SrcInfo);
|
||||
|
||||
/******************************************************************************
|
||||
Function: ChnShow
|
||||
Description: 显示指定窗口的图像
|
||||
Param:
|
||||
Channel in 指定通道
|
||||
Layer in 指定图层
|
||||
Frame in 解码后的Frame结构
|
||||
Return: 成功返回1,失败返回0
|
||||
Others:
|
||||
******************************************************************************/
|
||||
int ChnShow(unsigned int Channel, unsigned int Layer, VDEC_FRAME_S *Frame);
|
||||
|
||||
/******************************************************************************
|
||||
Function: Resize
|
||||
Description: 重新指定图层的位置和大小
|
||||
Param:
|
||||
Channel in 指定通道
|
||||
Layer in 指定图层
|
||||
Rect in 位置和大小
|
||||
Return: 成功返回1,失败返回0
|
||||
Others:
|
||||
******************************************************************************/
|
||||
int Resize(unsigned int Channel, unsigned int Layer, LAYER_RECT *Rect);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif // !__DISPLAY_H__
|
@ -1,160 +0,0 @@
|
||||
#ifndef __FY_VGS_DRV_H__
|
||||
#define __FY_VGS_DRV_H__
|
||||
|
||||
|
||||
/******************************************************************************
|
||||
Include other header files
|
||||
*****************************************************************************/
|
||||
#include "../fy_comm_vgs.h"
|
||||
#include "../fy_comm_tde.h"
|
||||
#include "../fy_comm_vppu.h"
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
#if __cplusplus
|
||||
extern "C"{
|
||||
#endif
|
||||
#endif /* End of #ifdef __cplusplus */
|
||||
|
||||
/******************************************************************************
|
||||
Macros, Enums, Structures definition list
|
||||
*****************************************************************************/
|
||||
|
||||
typedef struct
|
||||
{
|
||||
FY_S32 handle;
|
||||
FY_S32 reserved;
|
||||
VGS_TASK_ATTR_S stTaskAttr;
|
||||
}VGS_TASK_ATTR_S_T;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
FY_S32 handle;
|
||||
FY_BOOL bFrmToSur;
|
||||
VIDEO_FRAME_S stFrame;
|
||||
TDE2_SURFACE_S stSurface;
|
||||
}VGS_FMT_CONVERT_S;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
FY_S32 handle;
|
||||
FY_S32 reserved1;
|
||||
VGS_TASK_ATTR_S stTaskAttr;
|
||||
VGS_LINE_S astVgsDrawLine[10];
|
||||
FY_U32 count;
|
||||
FY_U32 reserved2;
|
||||
}ADD_DRAW_LINE_S;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
FY_S32 handle;
|
||||
FY_S32 reserved1;
|
||||
VGS_TASK_ATTR_S stTaskAttr;
|
||||
VGS_COVER_S astVgsAddCover[100];
|
||||
FY_U32 count;
|
||||
FY_U32 reserved2;
|
||||
}ADD_COVER_S;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
FY_S32 handle;
|
||||
FY_S32 reserved1;
|
||||
VGS_TASK_ATTR_S stTaskAttr;
|
||||
VGS_OSD_S astVgsAddOsd[100];
|
||||
FY_U32 count;
|
||||
FY_U32 reserved2;
|
||||
}ADD_OSD_S;
|
||||
|
||||
typedef struct fyVGS_SEND_FRAME_S
|
||||
{
|
||||
VPPU_CHN vppuChn;
|
||||
FY_BOOL bPlayMode;
|
||||
VIDEO_FRAME_INFO_S stImgSd; /* send picture */
|
||||
FY_U32 u32TimeOut;
|
||||
}VGS_SEND_FRAME_S;
|
||||
|
||||
typedef struct fyVGS_CHN_STAT_S
|
||||
{
|
||||
VPPU_CHN vppuChn;
|
||||
FY_U32 u32GotFrmNum;
|
||||
FY_U32 u32SkipFrmNum;
|
||||
FY_U32 u32SendFrmOk;
|
||||
FY_U32 u32SendFrmFail;
|
||||
}VGS_CHN_STAT_S;
|
||||
|
||||
typedef struct fyVGS_CHN_MODE_S
|
||||
{
|
||||
VPPU_CHN vppuChn;
|
||||
VPPU_PTH vppuPth;
|
||||
VPPU_CHN_MODE_S vppuMode;
|
||||
}VGS_CHN_MODE_S;
|
||||
|
||||
typedef struct fyVGS_CROP_INFO_S
|
||||
{
|
||||
VPPU_CHN vppuChn;
|
||||
VPPU_CROP_INFO_S stVppuCrop;
|
||||
}VGS_CROP_INFO_S;
|
||||
|
||||
typedef struct fyVGS_ROTATE_INFO_S
|
||||
{
|
||||
VPPU_CHN vppuChn;
|
||||
VPPU_PTH vppuPth;
|
||||
ROTATE_E enRotate;
|
||||
}VGS_ROTATE_INFO_S;
|
||||
|
||||
typedef struct VGS_MULTI_PATH_S
|
||||
{
|
||||
FY_S32 handle;
|
||||
VIDEO_FRAME_INFO_S stImgIn; /* input picture */
|
||||
VIDEO_FRAME_INFO_S stImgOut0; /* output path0 picture */
|
||||
VIDEO_FRAME_INFO_S stImgOut1; /* output path1 picture */
|
||||
VIDEO_FRAME_INFO_S stImgOut2; /* output path2 picture */
|
||||
}VGS_MULTI_PATH_S;
|
||||
|
||||
typedef struct fyVGS_IMG_GET_S
|
||||
{
|
||||
FY_U32 u32TimeOut;
|
||||
FY_S32 NULL_Flag; /* path1 NULL:0x02, path2 NULL:0x04 */
|
||||
VPPU_CHN vppuChn;
|
||||
VIDEO_FRAME_INFO_S stFrmPth1;
|
||||
VIDEO_FRAME_INFO_S stFrmPth2;
|
||||
}VGS_IMG_GET_S;
|
||||
|
||||
/******************************************************************************
|
||||
VGS driver ioctl definition list
|
||||
*****************************************************************************/
|
||||
#define IOC_VGS_BEGIN_JOB _IOWR('J',0,FY_S32)
|
||||
#define IOC_VGS_END_JOB _IOW('J',2,FY_S32)
|
||||
#define IOC_VGS_CANCEL_JOB _IOW('J',1,FY_S32)
|
||||
#define IOC_VGS_ADD_SCALE_TASK _IOW('J',3,VGS_TASK_ATTR_S_T)
|
||||
#define IOC_VGS_ADD_DRAW_LINE_TASK _IOW('J',5,ADD_DRAW_LINE_S)
|
||||
#define IOC_VGS_ADD_COVER_TASK _IOW('J',6,ADD_COVER_S)
|
||||
#define IOC_VGS_ADD_OSD_TASK _IOW('J',7,ADD_OSD_S)
|
||||
#define IOC_VGS_ADD_DECOMPRESS_TASK _IOW('J',8,VGS_TASK_ATTR_S_T)
|
||||
#define IOC_VGS_SEND_FRAME _IOW('J',9,VGS_SEND_FRAME_S)
|
||||
#define IOC_VGS_ADD_COMBINE_TASK _IOW('J',10,VGS_COMBINE_S)
|
||||
#define IOC_VGS_SET_CHN_MODE _IOW('J',11,VGS_CHN_MODE_S)
|
||||
#define IOC_VGS_GET_CHN_MODE _IOWR('J',12,VGS_CHN_MODE_S)
|
||||
#define IOC_VGS_CREATE_CHN _IOWR('J',13,VPPU_CHN)
|
||||
#define IOC_VGS_DESTORY_CHN _IOWR('J',14,VPPU_CHN)
|
||||
#define IOC_VGS_SET_CROP_INFO _IOWR('J',15,VGS_CROP_INFO_S)
|
||||
#define IOC_VGS_GET_CROP_INFO _IOWR('J',16,VGS_CROP_INFO_S)
|
||||
#define IOC_VGS_QUERY_FRAME _IOWR('J',17,VGS_SEND_FRAME_S)
|
||||
#define IOC_VGS_ADD_CONVERT_TASK _IOWR('J',18,VGS_FMT_CONVERT_S)
|
||||
#define IOC_VGS_ADD_ROTATE_TASK _IOWR('J',19,VGS_TASK_ATTR_S_T)
|
||||
#define IOC_VGS_SET_ROTAT_INFO _IOWR('J',20,VGS_ROTATE_INFO_S)
|
||||
#define IOC_VGS_GET_ROTAT_INFO _IOWR('J',21,VGS_ROTATE_INFO_S)
|
||||
#define IOC_VGS_ADD_MULTIPTH_TASK _IOWR('J',22,VGS_MULTI_PATH_S)
|
||||
#define IOC_VGS_GET_IMAGE _IOWR('J',23,VGS_IMG_GET_S)
|
||||
|
||||
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
#if __cplusplus
|
||||
}
|
||||
#endif
|
||||
#endif /* End of #ifdef __cplusplus */
|
||||
|
||||
|
||||
#endif//__FY_VGS_DRV_H__
|
@ -1,48 +0,0 @@
|
||||
#ifndef __FY_COMM_SYS_H__
|
||||
#define __FY_COMM_SYS_H__
|
||||
|
||||
#include "fy_type.h"
|
||||
#include "fy_errno.h"
|
||||
#include "fy_debug.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
#if __cplusplus
|
||||
extern "C"{
|
||||
#endif
|
||||
#endif /* End of #ifdef __cplusplus */
|
||||
|
||||
typedef struct fyMPP_SYS_CONF_S
|
||||
{
|
||||
/* stride of picture buffer must be aligned with this value.
|
||||
* you can choose a value from 1 to 1024, and it must be multiple of 16.
|
||||
*/
|
||||
FY_U32 u32AlignWidth;
|
||||
|
||||
}MPP_SYS_CONF_S;
|
||||
|
||||
typedef enum fyEN_SYS_ERR_CODE_E
|
||||
{
|
||||
ERR_SYS_NOHEARTBEAT = 0x40,
|
||||
|
||||
ERR_SYS_BUTT
|
||||
}EN_SYS_ERR_CODE_E;
|
||||
|
||||
|
||||
#define FY_ERR_SYS_NULL_PTR FY_DEF_ERR(FY_ID_SYS, EN_ERR_LEVEL_ERROR, EN_ERR_NULL_PTR)
|
||||
#define FY_ERR_SYS_NOTREADY FY_DEF_ERR(FY_ID_SYS, EN_ERR_LEVEL_ERROR, EN_ERR_SYS_NOTREADY)
|
||||
#define FY_ERR_SYS_NOT_PERM FY_DEF_ERR(FY_ID_SYS, EN_ERR_LEVEL_ERROR, EN_ERR_NOT_PERM)
|
||||
#define FY_ERR_SYS_NOMEM FY_DEF_ERR(FY_ID_SYS, EN_ERR_LEVEL_ERROR, EN_ERR_NOMEM)
|
||||
#define FY_ERR_SYS_ILLEGAL_PARAM FY_DEF_ERR(FY_ID_SYS, EN_ERR_LEVEL_ERROR, EN_ERR_ILLEGAL_PARAM)
|
||||
#define FY_ERR_SYS_BUSY FY_DEF_ERR(FY_ID_SYS, EN_ERR_LEVEL_ERROR, EN_ERR_BUSY)
|
||||
#define FY_ERR_SYS_NOT_SUPPORT FY_DEF_ERR(FY_ID_SYS, EN_ERR_LEVEL_ERROR, EN_ERR_NOT_SUPPORT)
|
||||
#define FY_ERR_SYS_NOHEARTBEAT FY_DEF_ERR(FY_ID_SYS, EN_ERR_LEVEL_ERROR, ERR_SYS_NOHEARTBEAT)
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
#if __cplusplus
|
||||
}
|
||||
#endif
|
||||
#endif /* __cplusplus */
|
||||
|
||||
#endif /* __FY_COMM_SYS_H__ */
|
||||
|
@ -1,535 +0,0 @@
|
||||
#ifndef __TDE_TYPE_H__
|
||||
#define __TDE_TYPE_H__
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
#if __cplusplus
|
||||
extern "C"{
|
||||
#endif
|
||||
#endif /* End of #ifdef __cplusplus */
|
||||
|
||||
/****************************************************************************/
|
||||
/* TDE2 types define */
|
||||
/****************************************************************************/
|
||||
/** TDE handle */
|
||||
typedef FY_S32 TDE_HANDLE;
|
||||
typedef float FY_FLOAT;
|
||||
|
||||
|
||||
/** TDE callback */
|
||||
typedef FY_VOID (* TDE_FUNC_CB) (FY_VOID *pParaml, FY_VOID *pParamr);
|
||||
|
||||
|
||||
//#define FY_ID_TDE 100
|
||||
/* tde start err no. */
|
||||
#define FY_ERR_TDE_BASE ((FY_S32)( ((0x80UL + 0x20UL)<<24) | (100 << 16 ) | (4 << 13) | 1 ))
|
||||
|
||||
enum
|
||||
{
|
||||
FY_ERR_TDE_DEV_NOT_OPEN = FY_ERR_TDE_BASE, /**< tde device not open yet */
|
||||
FY_ERR_TDE_DEV_OPEN_FAILED, /**< open tde device failed */
|
||||
FY_ERR_TDE_NULL_PTR, /**< input parameters contain null ptr */
|
||||
FY_ERR_TDE_NO_MEM, /**< malloc failed */
|
||||
FY_ERR_TDE_INVALID_HANDLE, /**< invalid job handle */
|
||||
FY_ERR_TDE_INVALID_PARA, /**< invalid parameter */
|
||||
FY_ERR_TDE_NOT_ALIGNED, /**< aligned error for position, stride, width */
|
||||
FY_ERR_TDE_MINIFICATION, /**< invalid minification */
|
||||
FY_ERR_TDE_CLIP_AREA, /**< clip area and operation area have no intersection */
|
||||
FY_ERR_TDE_JOB_TIMEOUT, /**< blocked job wait timeout */
|
||||
FY_ERR_TDE_UNSUPPORTED_OPERATION, /**< unsupported operation */
|
||||
FY_ERR_TDE_QUERY_TIMEOUT, /**< query time out */
|
||||
FY_ERR_TDE_INTERRUPT /**< blocked job was interrupted */
|
||||
};
|
||||
|
||||
|
||||
/* color format */
|
||||
typedef enum fyTDE2_COLOR_FMT_E
|
||||
{
|
||||
TDE2_COLOR_FMT_RGB444 = 0, /**< RGB444 format */
|
||||
TDE2_COLOR_FMT_BGR444, /**< BGR444 format */
|
||||
TDE2_COLOR_FMT_RGB555, /**< RGB555 format */
|
||||
TDE2_COLOR_FMT_BGR555, /**< BGR555 format */
|
||||
TDE2_COLOR_FMT_RGB565, /**< RGB565 format */
|
||||
TDE2_COLOR_FMT_BGR565, /**< BGR565 format */
|
||||
TDE2_COLOR_FMT_RGB888, /**< RGB888 format */
|
||||
TDE2_COLOR_FMT_BGR888, /**< BGR888 format */
|
||||
TDE2_COLOR_FMT_ARGB4444, /**< ARGB4444 format */
|
||||
TDE2_COLOR_FMT_ABGR4444, /**< ABGR4444 format */
|
||||
TDE2_COLOR_FMT_RGBA4444, /**< RGBA4444 format */
|
||||
TDE2_COLOR_FMT_BGRA4444, /**< BGRA4444 format */
|
||||
TDE2_COLOR_FMT_ARGB1555, /**< ARGB1555 format */
|
||||
TDE2_COLOR_FMT_ABGR1555, /**< ABGR1555 format */
|
||||
TDE2_COLOR_FMT_RGBA1555, /**< RGBA1555 format */
|
||||
TDE2_COLOR_FMT_BGRA1555, /**< BGRA1555 format */
|
||||
TDE2_COLOR_FMT_ARGB8565, /**< ARGB8565 format */
|
||||
TDE2_COLOR_FMT_ABGR8565, /**< ABGR8565 format */
|
||||
TDE2_COLOR_FMT_RGBA8565, /**< RGBA8565 format */
|
||||
TDE2_COLOR_FMT_BGRA8565, /**< BGRA8565 format */
|
||||
TDE2_COLOR_FMT_ARGB8888, /**< ARGB8888 format */
|
||||
TDE2_COLOR_FMT_ABGR8888, /**< ABGR8888 format */
|
||||
TDE2_COLOR_FMT_RGBA8888, /**< RGBA8888 format */
|
||||
TDE2_COLOR_FMT_BGRA8888, /**< BGRA8888 format */
|
||||
TDE2_COLOR_FMT_RABG8888, /**<RABG8888 format*/
|
||||
TDE2_COLOR_FMT_CLUT1, /**CLUT1 */
|
||||
TDE2_COLOR_FMT_CLUT2, /**CLUT2 */
|
||||
TDE2_COLOR_FMT_CLUT4, /**CLUT4 */
|
||||
TDE2_COLOR_FMT_CLUT8, /**CLUT8 */
|
||||
TDE2_COLOR_FMT_ACLUT44, /**CLUT44 */
|
||||
TDE2_COLOR_FMT_ACLUT88, /**CLUT88 */
|
||||
TDE2_COLOR_FMT_A1, /**<alpha format??1bit */
|
||||
TDE2_COLOR_FMT_A8, /**<alpha format??8bit */
|
||||
TDE2_COLOR_FMT_YCbCr888, /**<YUV packet format??no alpha*/
|
||||
TDE2_COLOR_FMT_AYCbCr8888, /**<YUV packet format??with alpha*/
|
||||
TDE2_COLOR_FMT_YCbCr422, /**<YUV packet422 format */
|
||||
TDE2_COLOR_FMT_byte, /**<byte*/
|
||||
TDE2_COLOR_FMT_halfword, /**<halfword*/
|
||||
TDE2_COLOR_FMT_JPG_YCbCr400MBP, /**<Semi-planar YUV400 format in the JPEG encoding format */
|
||||
TDE2_COLOR_FMT_JPG_YCbCr422MBHP, /**<Semi-planar YUV422 format (half of the horizontal sampling)*/
|
||||
TDE2_COLOR_FMT_JPG_YCbCr422MBVP, /**<Semi-planar YUV422 format (half of the vertical sampling) */
|
||||
TDE2_COLOR_FMT_MP1_YCbCr420MBP, /**<Semi-planar YUV420 format */
|
||||
TDE2_COLOR_FMT_MP2_YCbCr420MBP, /**<Semi-planar YUV420 format */
|
||||
TDE2_COLOR_FMT_MP2_YCbCr420MBI, /**<Semi-planar YUV400 format */
|
||||
TDE2_COLOR_FMT_JPG_YCbCr420MBP, /**<Semi-planar YUV400 format in the JPEG encoding format */
|
||||
TDE2_COLOR_FMT_JPG_YCbCr444MBP, /**<Semi-planar YUV444 format */
|
||||
TDE2_COLOR_FMT_BUTT
|
||||
} TDE2_COLOR_FMT_E;
|
||||
|
||||
/** Semi-planar YUV format */
|
||||
typedef enum fyTDE2_MB_COLORFMT_E
|
||||
{
|
||||
TDE2_MB_COLOR_FMT_JPG_YCbCr400MBP = 0,/**<Macroblock 400 in the JPEG encoding format*/
|
||||
TDE2_MB_COLOR_FMT_JPG_YCbCr422MBHP, /**<Macroblock 422 in the JPEG encoding format (half of the horizontal sampling) */
|
||||
TDE2_MB_COLOR_FMT_JPG_YCbCr422MBVP, /**<Macroblock 422 in the JPEG encoding format (half of the vertical sampling) */
|
||||
TDE2_MB_COLOR_FMT_MP1_YCbCr420MBP, /**<Macroblock 420 in the MPEG-1 encoding format */
|
||||
TDE2_MB_COLOR_FMT_MP2_YCbCr420MBP, /**<Macroblock 420 in the MPEG-2 encoding format */
|
||||
TDE2_MB_COLOR_FMT_MP2_YCbCr420MBI, /**<Macroblock 420 in the MPEG-2 encoding format (interlaced) */
|
||||
TDE2_MB_COLOR_FMT_JPG_YCbCr420MBP, /**<Macroblock 420 in the JPEG encoding format */
|
||||
TDE2_MB_COLOR_FMT_JPG_YCbCr444MBP, /**<Macroblock 444 in the JPEG encoding format */
|
||||
TDE2_MB_COLOR_FMT_BUTT
|
||||
} TDE2_MB_COLOR_FMT_E;
|
||||
|
||||
/* raster picture information */
|
||||
typedef struct fyTDE2_SURFACE_S
|
||||
{
|
||||
/* the physical address of picture data */
|
||||
FY_U32 u32PhyAddr;
|
||||
|
||||
/* color format */
|
||||
TDE2_COLOR_FMT_E enColorFmt;
|
||||
|
||||
/* picture height */
|
||||
FY_U32 u32Height;
|
||||
|
||||
/* picture width */
|
||||
FY_U32 u32Width;
|
||||
|
||||
/* picture stride */
|
||||
FY_U32 u32Stride;
|
||||
|
||||
/* the physical address of Clut data */
|
||||
FY_U8* pu8ClutPhyAddr;
|
||||
|
||||
/* if the Clut is in YCbCr space */
|
||||
FY_BOOL bYCbCrClut;
|
||||
|
||||
/* if the alpha max value is 255 */
|
||||
FY_BOOL bAlphaMax255;
|
||||
|
||||
/* for ARGB1555 to extend alpha */
|
||||
FY_BOOL bAlphaExt1555;
|
||||
FY_U8 u8Alpha0;
|
||||
FY_U8 u8Alpha1;
|
||||
|
||||
FY_U32 u32CbCrPhyAddr; /**< CbCr address */
|
||||
FY_U32 u32CbCrStride; /**< CbCr stride */
|
||||
} TDE2_SURFACE_S;
|
||||
|
||||
/** Semi-planar YUV format */
|
||||
typedef struct fyTDE2_MB_S
|
||||
{
|
||||
TDE2_MB_COLOR_FMT_E enMbFmt;
|
||||
FY_U32 u32YPhyAddr;
|
||||
FY_U32 u32YWidth;
|
||||
FY_U32 u32YHeight;
|
||||
FY_U32 u32YStride;
|
||||
FY_U32 u32CbCrPhyAddr;
|
||||
FY_U32 u32CbCrStride;
|
||||
} TDE2_MB_S;
|
||||
|
||||
typedef struct fyTDE2_RECT_S
|
||||
{
|
||||
FY_S32 s32Xpos;
|
||||
FY_S32 s32Ypos;
|
||||
FY_U32 u32Width;
|
||||
FY_U32 u32Height;
|
||||
} TDE2_RECT_S;
|
||||
|
||||
/* the operation modes for raster picture */
|
||||
typedef enum fyTDE2_ALUCMD_E
|
||||
{
|
||||
TDE2_ALUCMD_NONE = 0x0, /**< none */
|
||||
TDE2_ALUCMD_BLEND = 0x1, /**< Alpha blending type */
|
||||
TDE2_ALUCMD_ROP = 0x2, /**< rop */
|
||||
TDE2_ALUCMD_COLORIZE = 0x4, /**< Colorize */
|
||||
TDE2_ALUCMD_BUTT = 0x8
|
||||
} TDE2_ALUCMD_E;
|
||||
|
||||
/** the ROP type supported by the TDE */
|
||||
typedef enum fyTDE2_ROP_CODE_E
|
||||
{
|
||||
TDE2_ROP_BLACK = 0, /**<Blackness*/
|
||||
TDE2_ROP_NOTMERGEPEN, /**<~(S2 | S1)*/
|
||||
TDE2_ROP_MASKNOTPEN, /**<~S2&S1*/
|
||||
TDE2_ROP_NOTCOPYPEN, /**< ~S2*/
|
||||
TDE2_ROP_MASKPENNOT, /**< S2&~S1 */
|
||||
TDE2_ROP_NOT, /**< ~S1 */
|
||||
TDE2_ROP_XORPEN, /**< S2^S1 */
|
||||
TDE2_ROP_NOTMASKPEN, /**< ~(S2 & S1) */
|
||||
TDE2_ROP_MASKPEN, /**< S2&S1 */
|
||||
TDE2_ROP_NOTXORPEN, /**< ~(S2^S1) */
|
||||
TDE2_ROP_NOP, /**< S1 */
|
||||
TDE2_ROP_MERGENOTPEN, /**< ~S2|S1 */
|
||||
TDE2_ROP_COPYPEN, /**< S2 */
|
||||
TDE2_ROP_MERGEPENNOT, /**< S2|~S1 */
|
||||
TDE2_ROP_MERGEPEN, /**< S2|S1 */
|
||||
TDE2_ROP_WHITE, /**< Whiteness */
|
||||
TDE2_ROP_BUTT
|
||||
} TDE2_ROP_CODE_E;
|
||||
|
||||
/** the mirror attributes of a picture */
|
||||
typedef enum fyTDE2_MIRROR_E
|
||||
{
|
||||
TDE2_MIRROR_NONE = 0,
|
||||
TDE2_MIRROR_HORIZONTAL,
|
||||
TDE2_MIRROR_VERTICAL,
|
||||
TDE2_MIRROR_BOTH,
|
||||
TDE2_MIRROR_BUTT
|
||||
} TDE2_MIRROR_E;
|
||||
|
||||
/* Clip mode */
|
||||
typedef enum fyTDE2_CLIPMODE_E
|
||||
{
|
||||
TDE2_CLIPMODE_NONE = 0,
|
||||
TDE2_CLIPMODE_INSIDE,
|
||||
TDE2_CLIPMODE_OUTSIDE,
|
||||
TDE2_CLIPMODE_BUTT
|
||||
} TDE2_CLIPMODE_E;
|
||||
|
||||
/* the resize mode of macro picture */
|
||||
typedef enum fyTDE2_MBRESIZE_E
|
||||
{
|
||||
TDE2_MBRESIZE_NONE = 0,
|
||||
TDE2_MBRESIZE_QUALITY_LOW,
|
||||
TDE2_MBRESIZE_QUALITY_MIDDLE,
|
||||
TDE2_MBRESIZE_QUALITY_HIGH,
|
||||
TDE2_MBRESIZE_BUTT
|
||||
} TDE2_MBRESIZE_E;
|
||||
|
||||
/** the attributes of the picture fill colors */
|
||||
typedef struct fyTDE2_FILLCOLOR_S
|
||||
{
|
||||
TDE2_COLOR_FMT_E enColorFmt;
|
||||
FY_U32 u32FillColor;
|
||||
} TDE2_FILLCOLOR_S;
|
||||
|
||||
/** colorkey mode */
|
||||
typedef enum fyTDE2_COLORKEY_MODE_E
|
||||
{
|
||||
TDE2_COLORKEY_MODE_NONE = 0, /**< no color key operation*/
|
||||
TDE2_COLORKEY_MODE_FOREGROUND, /**< Performs the colorkey operation in the foreground mode*/
|
||||
TDE2_COLORKEY_MODE_BACKGROUND, /**< Performs the colorkey operation in the background mode*/
|
||||
TDE2_COLORKEY_MODE_BUTT
|
||||
} TDE2_COLORKEY_MODE_E;
|
||||
|
||||
/* the colorkey attributes of each color component */
|
||||
typedef struct fyTDE2_COLORKEY_COMP_S
|
||||
{
|
||||
FY_U8 u8CompMin; /*Minimum colorkey of a component.*/
|
||||
FY_U8 u8CompMax; /*Maximum colorkey of a component.*/
|
||||
FY_U8 bCompOut; /*The colorkey of a component is within or out of the range.*/
|
||||
FY_U8 bCompIgnore; /*Whether to ignore a component.*/
|
||||
FY_U8 u8CompMask; /**<Component mask*/
|
||||
FY_U8 u8Reserved;
|
||||
FY_U8 u8Reserved1;
|
||||
FY_U8 u8Reserved2;
|
||||
} TDE2_COLORKEY_COMP_S;
|
||||
|
||||
/** the attributes of the colorkey */
|
||||
typedef union fyTDE2_COLORKEY_U
|
||||
{
|
||||
struct
|
||||
{
|
||||
TDE2_COLORKEY_COMP_S stAlpha;
|
||||
TDE2_COLORKEY_COMP_S stRed;
|
||||
TDE2_COLORKEY_COMP_S stGreen;
|
||||
TDE2_COLORKEY_COMP_S stBlue;
|
||||
} struCkARGB;
|
||||
struct
|
||||
{
|
||||
TDE2_COLORKEY_COMP_S stAlpha;
|
||||
TDE2_COLORKEY_COMP_S stY;
|
||||
TDE2_COLORKEY_COMP_S stCb;
|
||||
TDE2_COLORKEY_COMP_S stCr;
|
||||
} struCkYCbCr;
|
||||
struct
|
||||
{
|
||||
TDE2_COLORKEY_COMP_S stAlpha;
|
||||
TDE2_COLORKEY_COMP_S stClut;
|
||||
} struCkClut;
|
||||
} TDE2_COLORKEY_U;
|
||||
|
||||
/* Type of the alpha output source */
|
||||
typedef enum fyTDE2_OUTALPHA_FROM_E
|
||||
{
|
||||
TDE2_OUTALPHA_FROM_NORM = 0, /* from the result of the alpha
|
||||
blending or anti-flicker operation */
|
||||
TDE2_OUTALPHA_FROM_BACKGROUND, /* from background */
|
||||
TDE2_OUTALPHA_FROM_FOREGROUND, /* from foreground */
|
||||
TDE2_OUTALPHA_FROM_GLOBALALPHA, /* from the global alpha */
|
||||
TDE2_OUTALPHA_FROM_BUTT
|
||||
} TDE2_OUTALPHA_FROM_E;
|
||||
|
||||
/** filtering mode */
|
||||
typedef enum fyTDE2_FILTER_MODE_E
|
||||
{
|
||||
TDE2_FILTER_MODE_COLOR = 0, /**< Filters the color */
|
||||
TDE2_FILTER_MODE_ALPHA, /**< Filters the alpha */
|
||||
TDE2_FILTER_MODE_BOTH, /* both color and alpha will be filter */
|
||||
TDE2_FILTER_MODE_NONE, /**<No filter *//**<CNcomment:$)A2;=xPPBK2( */
|
||||
TDE2_FILTER_MODE_BUTT
|
||||
} TDE2_FILTER_MODE_E;
|
||||
|
||||
/* the anti-flicker configuration of a channel */
|
||||
typedef enum fyTDE2_DEFLICKER_MODE_E
|
||||
{
|
||||
TDE2_DEFLICKER_MODE_NONE = 0, /**< No anti-flicker */
|
||||
TDE2_DEFLICKER_MODE_RGB, /**< Anti-flicker on RGB component */
|
||||
TDE2_DEFLICKER_MODE_BOTH, /**< Anti-flicker on alpha component */
|
||||
TDE2_DEFLICKER_MODE_BUTT
|
||||
}TDE2_DEFLICKER_MODE_E;
|
||||
|
||||
/* blend mode */
|
||||
typedef enum fyTDE2_BLEND_MODE_E
|
||||
{
|
||||
TDE2_BLEND_ZERO = 0x0,
|
||||
TDE2_BLEND_ONE,
|
||||
TDE2_BLEND_SRC2COLOR,
|
||||
TDE2_BLEND_INVSRC2COLOR,
|
||||
TDE2_BLEND_SRC2ALPHA,
|
||||
TDE2_BLEND_INVSRC2ALPHA,
|
||||
TDE2_BLEND_SRC1COLOR,
|
||||
TDE2_BLEND_INVSRC1COLOR,
|
||||
TDE2_BLEND_SRC1ALPHA,
|
||||
TDE2_BLEND_INVSRC1ALPHA,
|
||||
TDE2_BLEND_SRC2ALPHASAT,
|
||||
TDE2_BLEND_BUTT
|
||||
}TDE2_BLEND_MODE_E;
|
||||
|
||||
/** Defines the alpha blending command */
|
||||
/* pixel = (source * fs + destination * fd),
|
||||
sa = source alpha,
|
||||
da = destination alpha */
|
||||
typedef enum fyTDE2_BLENDCMD_E
|
||||
{
|
||||
TDE2_BLENDCMD_NONE = 0x0, /**< fs: sa fd: 1.0-sa */
|
||||
TDE2_BLENDCMD_CLEAR, /**< fs: 0.0 fd: 0.0 */
|
||||
TDE2_BLENDCMD_SRC, /**< fs: 1.0 fd: 0.0 */
|
||||
TDE2_BLENDCMD_SRCOVER, /**< fs: 1.0 fd: 1.0-sa */
|
||||
TDE2_BLENDCMD_DSTOVER, /**< fs: 1.0-da fd: 1.0 */
|
||||
TDE2_BLENDCMD_SRCIN, /**< fs: da fd: 0.0 */
|
||||
TDE2_BLENDCMD_DSTIN, /**< fs: 0.0 fd: sa */
|
||||
TDE2_BLENDCMD_SRCOUT, /**< fs: 1.0-da fd: 0.0 */
|
||||
TDE2_BLENDCMD_DSTOUT, /**< fs: 0.0 fd: 1.0-sa */
|
||||
TDE2_BLENDCMD_SRCATOP, /**< fs: da fd: 1.0-sa */
|
||||
TDE2_BLENDCMD_DSTATOP, /**< fs: 1.0-da fd: sa */
|
||||
TDE2_BLENDCMD_ADD, /**< fs: 1.0 fd: 1.0 */
|
||||
TDE2_BLENDCMD_XOR, /**< fs: 1.0-da fd: 1.0-sa */
|
||||
TDE2_BLENDCMD_DST, /**< fs: 0.0 fd: 1.0 */
|
||||
TDE2_BLENDCMD_CONFIG, /**< User-defined configuration */
|
||||
TDE2_BLENDCMD_BUTT
|
||||
}TDE2_BLENDCMD_E;
|
||||
|
||||
/* the options for alpha blending */
|
||||
typedef struct fyTDE2_BLEND_OPT_S
|
||||
{
|
||||
FY_BOOL bGlobalAlphaEnable; /**< Global alpha enable */
|
||||
FY_BOOL bPixelAlphaEnable; /**< Pixel alpha enable */
|
||||
FY_BOOL bSrc1AlphaPremulti; /**< Src1 alpha premultiply enable */
|
||||
FY_BOOL bSrc2AlphaPremulti; /**< Src2 alpha premultiply enable */
|
||||
TDE2_BLENDCMD_E eBlendCmd; /**< Alpha blending command */
|
||||
TDE2_BLEND_MODE_E eSrc1BlendMode; /**< Src1 blending mode select. It is valid when eBlendCmd is set to TDE2_BLENDCMD_CONFIG */
|
||||
TDE2_BLEND_MODE_E eSrc2BlendMode; /**< Src2 blending mode select. It is valid when eBlendCmd is set to TDE2_BLENDCMD_CONFIG */
|
||||
}TDE2_BLEND_OPT_S;
|
||||
|
||||
/* CSC parameter options */
|
||||
typedef struct fyTDE2_CSC_OPT_S
|
||||
{
|
||||
FY_BOOL bICSCUserEnable; /**User-defined ICSC parameter enable*/
|
||||
FY_BOOL bICSCParamReload; /**User-defined ICSC parameter reload enable*/
|
||||
FY_BOOL bOCSCUserEnable; /**User-defined OCSC parameter enable*/
|
||||
FY_BOOL bOCSCParamReload; /**User-defined OCSC parameter reload enable*/
|
||||
FY_U32 u32ICSCParamAddr; /**ICSC parameter address. The address must be 128-bit aligned.*/
|
||||
FY_U32 u32OCSCParamAddr; /**OCSC parameter address. The address must be 128-bit aligned.*/
|
||||
}TDE2_CSC_OPT_S;
|
||||
|
||||
//////////////////////////////////////
|
||||
typedef enum fyTDE2_Clip_MODE_E
|
||||
{
|
||||
TDE2_CLIP_CUTOFF = 0x0,
|
||||
TDE2_CLIP_SHRINK,
|
||||
TDE2_CLIP_BUTT
|
||||
}TDE2_Clip_MODE_E;
|
||||
|
||||
typedef struct fyTDE2_Clip_Info_S{
|
||||
FY_U8 yrgb_clip_low;
|
||||
FY_U8 yrgb_clip_high;
|
||||
FY_U8 uv_clip_low;
|
||||
FY_U8 uv_clip_high;
|
||||
} TDE2_Clip_Info_S;
|
||||
//////////////////////////////////////
|
||||
|
||||
/** the attributes of a TDE operation?*/
|
||||
typedef struct fyTDE2_OPT_S
|
||||
{
|
||||
/* Logical operation type */
|
||||
TDE2_ALUCMD_E enAluCmd;
|
||||
|
||||
/* ROP type of the color space */
|
||||
TDE2_ROP_CODE_E enRopCode_Color;
|
||||
|
||||
/* ROP type of the alpha */
|
||||
TDE2_ROP_CODE_E enRopCode_Alpha;
|
||||
|
||||
/* Colorkey mode */
|
||||
TDE2_COLORKEY_MODE_E enColorKeyMode;
|
||||
|
||||
/* Colorkey value */
|
||||
TDE2_COLORKEY_U unColorKeyValue;
|
||||
|
||||
/* Intra-area clip or entra-area clip */
|
||||
TDE2_CLIPMODE_E enClipMode;
|
||||
|
||||
/* Definition of the clipped area */
|
||||
TDE2_RECT_S stClipRect;
|
||||
|
||||
/* Whether to deflicker */
|
||||
FY_BOOL bDeflicker;
|
||||
|
||||
/* anti-flicker mode */
|
||||
TDE2_DEFLICKER_MODE_E enDeflickerMode;
|
||||
|
||||
/* Whether to scale */
|
||||
FY_BOOL bResize;
|
||||
|
||||
/* Filtering mode for scaling or anti-flicker */
|
||||
TDE2_FILTER_MODE_E enFilterMode;
|
||||
|
||||
/* Mirror type */
|
||||
TDE2_MIRROR_E enMirror;
|
||||
|
||||
/* Whether to reload the CLUT */
|
||||
FY_BOOL bClutReload;
|
||||
|
||||
/* Global alpha value */
|
||||
FY_U8 u8GlobalAlpha;
|
||||
|
||||
/* Alpha output source */
|
||||
TDE2_OUTALPHA_FROM_E enOutAlphaFrom;
|
||||
|
||||
FY_U32 u32Colorize; /**< Colorize value */
|
||||
|
||||
TDE2_BLEND_OPT_S stBlendOpt;
|
||||
|
||||
TDE2_CSC_OPT_S stCscOpt;
|
||||
} TDE2_OPT_S;
|
||||
|
||||
|
||||
/** the attributes of the macroblock surface operation */
|
||||
typedef struct fyTDE2_MBOPT_S
|
||||
{
|
||||
/* Clip mode: intra-area clip or entra-area clip */
|
||||
TDE2_CLIPMODE_E enClipMode;
|
||||
|
||||
/* Definition of the clipped area */
|
||||
TDE2_RECT_S stClipRect;
|
||||
|
||||
/* Whether to perform anti-flicker */
|
||||
FY_BOOL bDeflicker;
|
||||
|
||||
/* scaling mode */
|
||||
TDE2_MBRESIZE_E enResize;
|
||||
|
||||
/* Whether the alpha value of the output result bitmap is specified by users */
|
||||
FY_BOOL bSetOutAlpha;
|
||||
FY_U8 u8OutAlpha;
|
||||
} TDE2_MBOPT_S;
|
||||
|
||||
/** the information about pattern filling */
|
||||
typedef struct fyTDE2_PATTERN_FILL_OPT_S
|
||||
{
|
||||
TDE2_ALUCMD_E enAluCmd; /**< Logical operation type */
|
||||
|
||||
TDE2_ROP_CODE_E enRopCode_Color; /**< ROP type of the color space */
|
||||
|
||||
TDE2_ROP_CODE_E enRopCode_Alpha; /**< ROP type of the alpha */
|
||||
|
||||
TDE2_COLORKEY_MODE_E enColorKeyMode; /**< Colorkey mode*/
|
||||
|
||||
TDE2_COLORKEY_U unColorKeyValue; /**< Colorkey value*/
|
||||
|
||||
TDE2_CLIPMODE_E enClipMode; /**< Clip mode*/
|
||||
|
||||
TDE2_RECT_S stClipRect; /**< Clipped area*/
|
||||
|
||||
FY_BOOL bClutReload; /**< Whether to reload the CLUT*/
|
||||
|
||||
FY_U8 u8GlobalAlpha; /**< Global alpha*/
|
||||
|
||||
TDE2_OUTALPHA_FROM_E enOutAlphaFrom; /**< Alpha output source*/
|
||||
|
||||
FY_U32 u32Colorize; /* Colorize value*/
|
||||
|
||||
TDE2_BLEND_OPT_S stBlendOpt; /* Blending option */
|
||||
|
||||
TDE2_CSC_OPT_S stCscOpt; /* CSC parameter option */
|
||||
|
||||
}TDE2_PATTERN_FILL_OPT_S;
|
||||
|
||||
|
||||
|
||||
/** the anti-flicker level */
|
||||
typedef enum fyTDE_DEFLICKER_LEVEL_E
|
||||
{
|
||||
TDE_DEFLICKER_AUTO = 0, /**< *<The anti-flicker coefficient is selected by the TDE*/
|
||||
TDE_DEFLICKER_LOW, /**< *Low-level anti-flicker*/
|
||||
TDE_DEFLICKER_MIDDLE, /**< *Medium-level anti-flicker*/
|
||||
TDE_DEFLICKER_HIGH, /**< *Intermediate-level anti-flicker*/
|
||||
TDE_DEFLICKER_BUTT
|
||||
}TDE_DEFLICKER_LEVEL_E;
|
||||
|
||||
/* composed surface info */
|
||||
typedef struct fyTDE_COMPOSOR_S
|
||||
{
|
||||
TDE2_SURFACE_S stSrcSurface;
|
||||
TDE2_RECT_S stInRect;
|
||||
TDE2_RECT_S stOutRect;
|
||||
TDE2_OPT_S stOpt;
|
||||
}TDE_COMPOSOR_S;
|
||||
|
||||
/* composed surface list */
|
||||
typedef struct fyTDE_SURFACE_LIST_S
|
||||
{
|
||||
FY_U32 u32SurfaceNum;
|
||||
TDE2_SURFACE_S *pDstSurface;
|
||||
TDE_COMPOSOR_S *pstComposor;
|
||||
}TDE_SURFACE_LIST_S;
|
||||
#ifdef __cplusplus
|
||||
#if __cplusplus
|
||||
}
|
||||
#endif
|
||||
#endif /* End of #ifdef __cplusplus */
|
||||
|
||||
|
||||
#endif /* End of #ifndef __TDE_TYPE_H__ */
|
||||
|
||||
|
@ -1,125 +0,0 @@
|
||||
#ifndef __FY_COMM_VB_H__
|
||||
#define __FY_COMM_VB_H__
|
||||
|
||||
#include "fy_type.h"
|
||||
#include "fy_errno.h"
|
||||
#include "fy_debug.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
#if __cplusplus
|
||||
extern "C"{
|
||||
#endif
|
||||
#endif /* End of #ifdef __cplusplus */
|
||||
|
||||
#define VB_MAX_POOLS 256
|
||||
#define VB_MAX_COMM_POOLS 16
|
||||
#define VB_MAX_MOD_COMM_POOLS 16
|
||||
|
||||
|
||||
/* user ID for VB */
|
||||
|
||||
typedef enum fyVB_UID_E
|
||||
{
|
||||
VB_UID_VIU = 0,
|
||||
VB_UID_VOU = 1,
|
||||
VB_UID_VGS = 2,
|
||||
VB_UID_VENC = 3,
|
||||
VB_UID_VDEC = 4,
|
||||
VB_UID_VDA = 5,
|
||||
VB_UID_H264E = 6,
|
||||
VB_UID_JPEGED = 7,
|
||||
VB_UID_MPEG4E = 8,
|
||||
VB_UID_H264D = 9,
|
||||
VB_UID_JPEGD = 10,
|
||||
VB_UID_MPEG4D = 11,
|
||||
VB_UID_VPSS = 12,
|
||||
VB_UID_GRP = 13,
|
||||
VB_UID_MPI = 14,
|
||||
VB_UID_PCIV = 15,
|
||||
VB_UID_AI = 16,
|
||||
VB_UID_AENC = 17,
|
||||
VB_UID_RC = 18,
|
||||
VB_UID_VFMW = 19,
|
||||
VB_UID_USER = 20,
|
||||
VB_UID_H265E = 21,
|
||||
//fh module
|
||||
VB_UID_BGM = 22,
|
||||
VB_UID_BGMX = 23,
|
||||
VB_UID_BGMSW = 24,
|
||||
|
||||
VB_UID_VPPU = 25,
|
||||
|
||||
VB_UID_BUTT
|
||||
} VB_UID_E;
|
||||
|
||||
#define VB_MAX_USER VB_UID_BUTT
|
||||
|
||||
#define VB_INVALID_POOLID (-1UL)
|
||||
#define VB_INVALID_HANDLE (-1UL)
|
||||
|
||||
/* Generall common pool use this owner id, module common pool use VB_UID as owner id */
|
||||
#define POOL_OWNER_COMMON -1
|
||||
|
||||
/* Private pool use this owner id */
|
||||
#define POOL_OWNER_PRIVATE -2
|
||||
|
||||
typedef enum fyPOOL_TYPE_E
|
||||
{
|
||||
POOL_TYPE_COMMON = 0,
|
||||
POOL_TYPE_PRIVATE = 1,
|
||||
POOL_TYPE_MODULE_COMMON = 2,
|
||||
POOL_TYPE_BUTT
|
||||
} POOL_TYPE_E;
|
||||
|
||||
typedef FY_U32 VB_POOL;
|
||||
typedef FY_U32 VB_BLK;
|
||||
|
||||
#define RESERVE_MMZ_NAME "window"
|
||||
|
||||
typedef struct fyVB_CONF_S
|
||||
{
|
||||
FY_U32 u32MaxPoolCnt; /* max count of pools, (0,VB_MAX_POOLS] */
|
||||
struct fyVB_CPOOL_S
|
||||
{
|
||||
FY_U32 u32BlkSize;
|
||||
FY_U32 u32BlkCnt;
|
||||
FY_CHAR acMmzName[MAX_MMZ_NAME_LEN];
|
||||
}astCommPool[VB_MAX_COMM_POOLS];
|
||||
} VB_CONF_S;
|
||||
|
||||
typedef struct fyVB_POOL_STATUS_S
|
||||
{
|
||||
FY_U32 bIsCommPool;
|
||||
FY_U32 u32BlkCnt;
|
||||
FY_U32 u32FreeBlkCnt;
|
||||
}VB_POOL_STATUS_S;
|
||||
|
||||
#define VB_SUPPLEMENT_JPEG_MASK 0x1
|
||||
|
||||
typedef struct fyVB_SUPPLEMENT_CONF_S
|
||||
{
|
||||
FY_U32 u32SupplementConf;
|
||||
}VB_SUPPLEMENT_CONF_S;
|
||||
|
||||
|
||||
#define FY_ERR_VB_NULL_PTR FY_DEF_ERR(FY_ID_VB, EN_ERR_LEVEL_ERROR, EN_ERR_NULL_PTR)
|
||||
#define FY_ERR_VB_NOMEM FY_DEF_ERR(FY_ID_VB, EN_ERR_LEVEL_ERROR, EN_ERR_NOMEM)
|
||||
#define FY_ERR_VB_NOBUF FY_DEF_ERR(FY_ID_VB, EN_ERR_LEVEL_ERROR, EN_ERR_NOBUF)
|
||||
#define FY_ERR_VB_UNEXIST FY_DEF_ERR(FY_ID_VB, EN_ERR_LEVEL_ERROR, EN_ERR_UNEXIST)
|
||||
#define FY_ERR_VB_ILLEGAL_PARAM FY_DEF_ERR(FY_ID_VB, EN_ERR_LEVEL_ERROR, EN_ERR_ILLEGAL_PARAM)
|
||||
#define FY_ERR_VB_NOTREADY FY_DEF_ERR(FY_ID_VB, EN_ERR_LEVEL_ERROR, EN_ERR_SYS_NOTREADY)
|
||||
#define FY_ERR_VB_BUSY FY_DEF_ERR(FY_ID_VB, EN_ERR_LEVEL_ERROR, EN_ERR_BUSY)
|
||||
#define FY_ERR_VB_NOT_PERM FY_DEF_ERR(FY_ID_VB, EN_ERR_LEVEL_ERROR, EN_ERR_NOT_PERM)
|
||||
|
||||
#define FY_ERR_VB_2MPOOLS FY_DEF_ERR(FY_ID_VB, EN_ERR_LEVEL_ERROR, EN_ERR_BUTT + 1)
|
||||
|
||||
#define FY_TRACE_VB(level,fmt...) FY_TRACE(level, FY_ID_VB,##fmt)
|
||||
|
||||
#ifdef __cplusplus
|
||||
#if __cplusplus
|
||||
}
|
||||
#endif
|
||||
#endif /* __cplusplus */
|
||||
|
||||
#endif /* __FY_COMM_VB_H_ */
|
||||
|
@ -1,142 +0,0 @@
|
||||
#ifndef __FY_COMM_VGS_H__
|
||||
#define __FY_COMM_VGS_H__
|
||||
|
||||
#ifdef __cplusplus
|
||||
#if __cplusplus
|
||||
extern "C"{
|
||||
#endif
|
||||
#endif /* __cplusplus */
|
||||
|
||||
#include "fy_type.h"
|
||||
#include "fy_common.h"
|
||||
#include "fy_errno.h"
|
||||
#include "fy_comm_video.h"
|
||||
|
||||
/* failure caused by malloc buffer */
|
||||
#define FY_ERR_VGS_NOBUF FY_DEF_ERR(FY_ID_VGS, EN_ERR_LEVEL_ERROR, EN_ERR_NOBUF)
|
||||
#define FY_ERR_VGS_BUF_EMPTY FY_DEF_ERR(FY_ID_VGS, EN_ERR_LEVEL_ERROR, EN_ERR_BUF_EMPTY)
|
||||
#define FY_ERR_VGS_NULL_PTR FY_DEF_ERR(FY_ID_VGS, EN_ERR_LEVEL_ERROR, EN_ERR_NULL_PTR)
|
||||
#define FY_ERR_VGS_ILLEGAL_PARAM FY_DEF_ERR(FY_ID_VGS, EN_ERR_LEVEL_ERROR, EN_ERR_ILLEGAL_PARAM)
|
||||
#define FY_ERR_VGS_BUF_FULL FY_DEF_ERR(FY_ID_VGS, EN_ERR_LEVEL_ERROR, EN_ERR_BUF_FULL)
|
||||
#define FY_ERR_VGS_SYS_NOTREADY FY_DEF_ERR(FY_ID_VGS, EN_ERR_LEVEL_ERROR, EN_ERR_SYS_NOTREADY)
|
||||
#define FY_ERR_VGS_NOT_SUPPORT FY_DEF_ERR(FY_ID_VGS, EN_ERR_LEVEL_ERROR, EN_ERR_NOT_SUPPORT)
|
||||
#define FY_ERR_VGS_NOT_PERMITTED FY_DEF_ERR(FY_ID_VGS, EN_ERR_LEVEL_ERROR, EN_ERR_NOT_PERM)
|
||||
|
||||
typedef FY_S32 VGS_HANDLE;
|
||||
|
||||
typedef struct fyVGS_TASK_ATTR_S
|
||||
{
|
||||
VIDEO_FRAME_INFO_S stImgIn; /* input picture */
|
||||
VIDEO_FRAME_INFO_S stImgOut; /* output picture */
|
||||
FY_U32 au32privateData[4]; /* task's private data */
|
||||
FY_U32 reserved; /* save current picture's state while debug */
|
||||
}VGS_TASK_ATTR_S;
|
||||
|
||||
typedef struct fyVGS_LINE_S
|
||||
{
|
||||
POINT_S stStartPoint; /* line start point [-8191, 8191] */
|
||||
POINT_S stEndPoint; /* line end point [-8191, 8191] */
|
||||
FY_U32 u32Thick; /* width of line [0, 14] */
|
||||
FY_U32 u32Color; /* color of line */
|
||||
}VGS_LINE_S;
|
||||
|
||||
typedef struct fyVGS_COMBINE_S
|
||||
{
|
||||
FY_S32 handle;
|
||||
VIDEO_FRAME_S stVFrameIn;
|
||||
RECT_S stRectIn;
|
||||
VIDEO_FRAME_S stVFrameOut;
|
||||
RECT_S stRectOut;
|
||||
}VGS_COMBINE_S;
|
||||
|
||||
typedef struct fyVGS_ROTATE_S
|
||||
{
|
||||
FY_BOOL mirrorEn;
|
||||
FY_BOOL flipEn;
|
||||
FY_BOOL rotateEn;
|
||||
}VGS_ROTATE_S;
|
||||
|
||||
typedef enum fyVGS_COVER_TYPE_E
|
||||
{
|
||||
COVER_RECT = 0,
|
||||
COVER_QUAD_RANGLE,
|
||||
COVER_BUTT
|
||||
} VGS_COVER_TYPE_E;
|
||||
|
||||
typedef struct fyVGS_QUADRANGLE_COVER_S
|
||||
{
|
||||
FY_BOOL bSolid; /* solid or hollow cover */
|
||||
FY_U32 u32Thick; /* width of hollow cover */
|
||||
POINT_S stPoint[4]; /* four coordinate of quadrangle */
|
||||
} VGS_QUADRANGLE_COVER_S;
|
||||
|
||||
typedef struct fyVGS_COVER_S
|
||||
{
|
||||
VGS_COVER_TYPE_E enCoverType;
|
||||
union
|
||||
{
|
||||
RECT_S stDstRect; /* config of rectrangle */
|
||||
VGS_QUADRANGLE_COVER_S stQuadRangle; /* config of quadrangle */
|
||||
};
|
||||
|
||||
FY_U32 u32Color; /* color of cover */
|
||||
}VGS_COVER_S;
|
||||
|
||||
typedef struct fyVGS_OSD_S
|
||||
{
|
||||
RECT_S stRect; /* start point, width and height of osd [0, 8192] */
|
||||
FY_U32 u32BgColor; /* background color of osd */
|
||||
fyPIXEL_FORMAT_E enPixelFmt; /* pixel format of osd */
|
||||
FY_U32 u32PhyAddr;
|
||||
FY_U32 u32Stride;
|
||||
FY_U32 u32BgAlpha;
|
||||
FY_U32 u32FgAlpha;
|
||||
}VGS_OSD_S;
|
||||
|
||||
typedef enum fyVGS_ROTATE_E
|
||||
{
|
||||
VGS_ROTATE_NONE = 0, /* no rotate */
|
||||
VGS_ROTATE_90 = 1, /* 90 degrees clockwise */
|
||||
VGS_ROTATE_180 = 2, /* 180 degrees clockwise */
|
||||
VGS_ROTATE_270 = 3, /* 270 degrees clockwise */
|
||||
VGS_ROTATE_BUTT
|
||||
} VGS_ROTATE_E;
|
||||
|
||||
typedef struct FY_VGS_BORDER_S
|
||||
{
|
||||
FY_U32 u32Width[4]; /* width of 4 frames,0:L,1:R,2:B,3:T */
|
||||
FY_U32 u32Color; /* color of 4 frames,R/G/B */
|
||||
}VGS_BORDER_S;
|
||||
|
||||
typedef struct fyVGS_ASPECTRATIO_S
|
||||
{
|
||||
RECT_S stVideoRect;
|
||||
FY_U32 u32CoverData;
|
||||
}VGS_ASPECTRATIO_S;
|
||||
|
||||
|
||||
typedef struct fyVGS_ONLINE_S
|
||||
{
|
||||
FY_BOOL bCrop; /* if enable crop */
|
||||
RECT_S stCropRect;
|
||||
FY_BOOL bHSharpen; /* if enable sharpen */
|
||||
FY_U32 u32LumaGain;
|
||||
FY_BOOL bBorder; /* if enable Border */
|
||||
VGS_BORDER_S stBorderOpt;
|
||||
FY_BOOL bAspectRatio; /* if enable aspect ratio */
|
||||
VGS_ASPECTRATIO_S stAspectRatioOpt;
|
||||
|
||||
FY_BOOL bForceHFilt; /* if enable horizontal filter */
|
||||
FY_BOOL bForceVFilt; /* if enable vertical filter */
|
||||
FY_BOOL bDeflicker; /* if enable deflicker */
|
||||
}VGS_ONLINE_S;
|
||||
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
#if __cplusplus
|
||||
}
|
||||
#endif
|
||||
#endif /* __cplusplus */
|
||||
|
||||
#endif /* __FY_COMM_VGS_H__ */
|
@ -1,343 +0,0 @@
|
||||
#ifndef __FY_COMM_VIDEO_H__
|
||||
#define __FY_COMM_VIDEO_H__
|
||||
|
||||
#include "fy_type.h"
|
||||
#include "fy_common.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
#if __cplusplus
|
||||
extern "C"{
|
||||
#endif
|
||||
#endif /* __cplusplus */
|
||||
|
||||
#define FISHEYE_MAX_REGION_NUM 4
|
||||
#define FISHEYE_MAX_OFFSET 127
|
||||
|
||||
typedef enum fyPIC_SIZE_E
|
||||
{
|
||||
PIC_QCIF = 0,
|
||||
PIC_CIF,
|
||||
PIC_2CIF,
|
||||
PIC_HD1,
|
||||
PIC_D1,
|
||||
PIC_960H,
|
||||
PIC_1280H,
|
||||
PIC_1440H,
|
||||
|
||||
PIC_QVGA, /* 320 * 240 */
|
||||
PIC_VGA, /* 640 * 480 */
|
||||
PIC_XGA, /* 1024 * 768 */
|
||||
PIC_SXGA, /* 1400 * 1050 */
|
||||
PIC_UXGA, /* 1600 * 1200 */
|
||||
PIC_QXGA, /* 2048 * 1536 */
|
||||
|
||||
PIC_WVGA, /* 854 * 480 */
|
||||
PIC_WSXGA, /* 1680 * 1050 */
|
||||
PIC_WUXGA, /* 1920 * 1200 */
|
||||
PIC_WQXGA, /* 2560 * 1600 */
|
||||
|
||||
PIC_HD720, /* 1280 * 720 */
|
||||
PIC_HD1080, /* 1920 * 1080 */
|
||||
PIC_qHD, /*960 * 540*/
|
||||
|
||||
PIC_UHD2K, /* 2560 * 1440 */
|
||||
PIC_UHD4K, /* 3840*2160 */
|
||||
|
||||
PIC_1080LITE,/* 960*1080 */
|
||||
|
||||
PIC_BUTT
|
||||
}PIC_SIZE_E;
|
||||
|
||||
typedef enum fyVIDEO_NORM_E
|
||||
{
|
||||
VIDEO_ENCODING_MODE_PAL=0,
|
||||
VIDEO_ENCODING_MODE_NTSC,
|
||||
VIDEO_ENCODING_MODE_AUTO,
|
||||
VIDEO_ENCODING_MODE_BUTT
|
||||
} VIDEO_NORM_E;
|
||||
|
||||
typedef enum fyVIDEO_CONTROL_MODE_E
|
||||
{
|
||||
VIDEO_CONTROL_MODE_SLAVER=0,
|
||||
VIDEO_CONTROL_MODE_MASTER,
|
||||
VIDEO_CONTROL_MODE_BUTT
|
||||
}VIDEO_CONTROL_MODE_E;
|
||||
|
||||
typedef enum fyPIXEL_FORMAT_E
|
||||
{
|
||||
PIXEL_FORMAT_RGB_1BPP = 0,
|
||||
PIXEL_FORMAT_RGB_2BPP,
|
||||
PIXEL_FORMAT_RGB_4BPP,
|
||||
PIXEL_FORMAT_RGB_8BPP,
|
||||
PIXEL_FORMAT_RGB_444,
|
||||
|
||||
PIXEL_FORMAT_RGB_4444,
|
||||
PIXEL_FORMAT_RGB_555,
|
||||
PIXEL_FORMAT_RGB_565,
|
||||
PIXEL_FORMAT_RGB_1555,
|
||||
|
||||
/* 9 reserved */
|
||||
PIXEL_FORMAT_RGB_888,
|
||||
PIXEL_FORMAT_RGB_8888,
|
||||
|
||||
PIXEL_FORMAT_RGB_PLANAR_888,
|
||||
PIXEL_FORMAT_RGB_BAYER_8BPP,
|
||||
PIXEL_FORMAT_RGB_BAYER_10BPP,
|
||||
PIXEL_FORMAT_RGB_BAYER_12BPP,
|
||||
PIXEL_FORMAT_RGB_BAYER_14BPP,
|
||||
|
||||
PIXEL_FORMAT_RGB_BAYER, /* 16 bpp */
|
||||
|
||||
PIXEL_FORMAT_YUV_A422,
|
||||
PIXEL_FORMAT_YUV_A444,
|
||||
|
||||
PIXEL_FORMAT_YUV_PLANAR_422,
|
||||
PIXEL_FORMAT_YUV_PLANAR_420,
|
||||
|
||||
PIXEL_FORMAT_YUV_PLANAR_444,
|
||||
|
||||
PIXEL_FORMAT_YUV_SEMIPLANAR_422, // 22
|
||||
PIXEL_FORMAT_YUV_SEMIPLANAR_420, // 23
|
||||
PIXEL_FORMAT_YUV_SEMIPLANAR_444,
|
||||
|
||||
PIXEL_FORMAT_UYVY_PACKAGE_422,
|
||||
PIXEL_FORMAT_YUYV_PACKAGE_422,
|
||||
PIXEL_FORMAT_VYUY_PACKAGE_422,
|
||||
PIXEL_FORMAT_YCbCr_PLANAR,
|
||||
|
||||
PIXEL_FORMAT_YUV_400,
|
||||
|
||||
/******FY add begin********/
|
||||
PIXEL_FORMAT_YUV_422_10BPP=43,
|
||||
PIXEL_FORMAT_YUV_420_BLOCK, //<yuv420 block for venc
|
||||
|
||||
PIXEL_FORMAT_YUV_422_MIRROR, //only support 1D compress mode.
|
||||
|
||||
PIXEL_FORMAT_YUV_FIELD_422,
|
||||
|
||||
PIXEL_FORMAT_YVU_SEMIPLANAR_420, // NV21
|
||||
|
||||
/******FY add end*********/
|
||||
|
||||
PIXEL_FORMAT_BUTT
|
||||
} fyPIXEL_FORMAT_E;
|
||||
|
||||
typedef struct fyVIDEO_VBI_INFO_S
|
||||
{
|
||||
FY_U32 au32Data[32];
|
||||
FY_U32 u32Len;
|
||||
}VIDEO_VBI_INFO_S;
|
||||
|
||||
typedef enum fyVIDEO_FIELD_E
|
||||
{
|
||||
VIDEO_FIELD_TOP = 0x1, /* even field */
|
||||
VIDEO_FIELD_BOTTOM = 0x2, /* odd field */
|
||||
VIDEO_FIELD_INTERLACED = 0x3, /* two interlaced fields */
|
||||
VIDEO_FIELD_FRAME = 0x4, /* frame */
|
||||
|
||||
VIDEO_FIELD_BUTT
|
||||
} VIDEO_FIELD_E;
|
||||
|
||||
typedef enum fyVIDEO_FORMAT_E
|
||||
{
|
||||
VIDEO_FORMAT_LINEAR = 0x0, /* nature video line */
|
||||
VIDEO_FORMAT_TILE = 0x1, /* tile cell: 256pixel x 16line, default tile mode */
|
||||
VIDEO_FORMAT_TILE64 = 0x2, /* tile cell: 64pixel x 16line */
|
||||
VIDEO_FORMAT_BLOCK = 0x3, /* macro block */
|
||||
VIDEO_FORMAT_BUTT
|
||||
} VIDEO_FORMAT_E;
|
||||
|
||||
typedef enum fyCOMPRESS_MODE_E
|
||||
{
|
||||
COMPRESS_MODE_NONE = 0x0, /* no compress */
|
||||
COMPRESS_MODE_SEG = 0x1, /* compress unit is 256 bytes as a segment, default seg mode */
|
||||
COMPRESS_MODE_SEG128 = 0x2, /* compress unit is 128 bytes as a segment */
|
||||
COMPRESS_MODE_LINE = 0x3, /* compress unit is the whole line */
|
||||
COMPRESS_MODE_FRAME = 0x4, /* compress unit is the whole frame */
|
||||
|
||||
/*FY add, compress type 1D,match VI:VI_EC_LEVEL_E*/
|
||||
COMPRESS_MODE_128byte = 0x5, /*compress rate 50%*/
|
||||
COMPRESS_MODE_160byte = 0x6, /*compress rate 63%*/
|
||||
COMPRESS_MODE_192byte = 0x7, /*compress rate 75%*/
|
||||
|
||||
/*FY add, compress type TILE,*/
|
||||
COMPRESS_MODE_TILE_192 = 0x8,
|
||||
|
||||
/*FY add, compress type SLICE,*/
|
||||
COMPRESS_MODE_SLICE = 0x9,
|
||||
|
||||
COMPRESS_MODE_CF10 = 0xa,
|
||||
COMPRESS_MODE_FBC = 0xb,
|
||||
|
||||
/*FY add, compress type TILE,*/
|
||||
COMPRESS_MODE_TILE_224 = 0xc,
|
||||
COMPRESS_MODE_TILE_256 = 0xd,
|
||||
|
||||
COMPRESS_MODE_MFBC = 0xe,
|
||||
|
||||
COMPRESS_MODE_BUTT
|
||||
} COMPRESS_MODE_E;
|
||||
|
||||
typedef enum fyVIDEO_DISPLAY_MODE_E
|
||||
{
|
||||
VIDEO_DISPLAY_MODE_PREVIEW = 0x0,
|
||||
VIDEO_DISPLAY_MODE_PLAYBACK = 0x1,
|
||||
|
||||
VIDEO_DISPLAY_MODE_BUTT
|
||||
} VIDEO_DISPLAY_MODE_E;
|
||||
|
||||
typedef enum fyFRAME_FLASH_TYPE_E
|
||||
{
|
||||
FRAME_FLASH_OFF = 0,
|
||||
FRAME_FLASH_ON = 1,
|
||||
FRAME_FLASH_BUTT,
|
||||
}FRAME_FLASH_TYPE_E;
|
||||
typedef enum fyFISHEYE_MOUNT_MODE_E
|
||||
{
|
||||
FISHEYE_DESKTOP_MOUNT = 0, /* desktop mount mode */
|
||||
FISHEYE_CEILING_MOUNT = 1, /* ceiling mount mode */
|
||||
FISHEYE_WALL_MOUNT = 2, /* wall mount mode */
|
||||
FISHEYE_MOUNT_MODE_BUTT
|
||||
}FISHEYE_MOUNT_MODE_E;
|
||||
typedef enum fyFISHEYE_VIEW_MODE_E
|
||||
{
|
||||
FISHEYE_VIEW_360_PANORAMA = 0, /* 360 panorama mode of fisheye correction */
|
||||
FISHEYE_VIEW_180_PANORAMA = 1, /* 180 panorama mode of fisheye correction */
|
||||
FISHEYE_VIEW_NORMAL = 2, /* normal mode of fisheye correction */
|
||||
FISHEYE_NO_TRANSFORMATION = 3, /* no fisheye correction */
|
||||
FISHEYE_VIEW_MODE_BUTT
|
||||
}FISHEYE_VIEW_MODE_E;
|
||||
typedef enum fyFISHEYE_FILTER_MODE_E
|
||||
{
|
||||
FISHEYE_FILTER_BILINEAR = 0, /* bilinear filter */
|
||||
FISHEYE_FILTER_LINEAR = 1, /* linear filter */
|
||||
FISHEYE_FILTER_NEAREST = 2, /* nearest filter */
|
||||
FISHEYE_FILTER_MODE_BUTT
|
||||
}FISHEYE_FILTER_MODE_E;
|
||||
|
||||
typedef struct fyVIDEO_SUPPLEMENT_S
|
||||
{
|
||||
FY_U32 u32JpegDcfPhyAddr;
|
||||
FY_VOID *pJpegDcfVirAddr;
|
||||
|
||||
FRAME_FLASH_TYPE_E enFlashType;
|
||||
}VIDEO_SUPPLEMENT_S;
|
||||
|
||||
typedef struct fyVIDEO_FRAME_S
|
||||
{
|
||||
FY_U32 u32Width;
|
||||
FY_U32 u32Height;
|
||||
VIDEO_FIELD_E u32Field;
|
||||
fyPIXEL_FORMAT_E enPixelFormat;
|
||||
|
||||
VIDEO_FORMAT_E enVideoFormat;
|
||||
COMPRESS_MODE_E enCompressMode;
|
||||
|
||||
FY_U32 u32PhyAddr[3];
|
||||
FY_VOID *pVirAddr[3];
|
||||
FY_U32 u32Stride[3];
|
||||
|
||||
FY_U32 u32HeaderPhyAddr[3];
|
||||
FY_VOID *pHeaderVirAddr[3];
|
||||
FY_U32 u32HeaderStride[3];
|
||||
|
||||
FY_S16 s16OffsetTop; /* top offset of show area */
|
||||
FY_S16 s16OffsetBottom; /* bottom offset of show area */
|
||||
FY_S16 s16OffsetLeft; /* left offset of show area */
|
||||
FY_S16 s16OffsetRight; /* right offset of show area */
|
||||
|
||||
FY_U64 u64pts;
|
||||
FY_U32 u32TimeRef;
|
||||
|
||||
FY_U32 u32PrivateData;
|
||||
VIDEO_SUPPLEMENT_S stSupplement;
|
||||
}VIDEO_FRAME_S;
|
||||
|
||||
typedef struct fyVIDEO_FRAME_INFO_S
|
||||
{
|
||||
VIDEO_FRAME_S stVFrame;
|
||||
FY_U32 u32PoolId;
|
||||
} VIDEO_FRAME_INFO_S;
|
||||
|
||||
/* VI Mix-Capture info. */
|
||||
typedef struct fyVI_MIXCAP_STAT_S
|
||||
{
|
||||
FY_BOOL bMixCapMode; /* In mix-capture mode or not. */
|
||||
FY_BOOL bHasDownScale; /* VI Frame is downscaled or not. */
|
||||
} VI_MIXCAP_STAT_S;
|
||||
|
||||
/* VI output frame info. */
|
||||
typedef struct fyVI_FRAME_INFO_S
|
||||
{
|
||||
VI_MIXCAP_STAT_S stMixCapState; /* VI Mix-Capture info. */
|
||||
VIDEO_FRAME_INFO_S stViFrmInfo; /* Video frame info. */
|
||||
FY_BOOL bFlashed; /* Flashed Video frame or not. */
|
||||
}VI_FRAME_INFO_S;
|
||||
|
||||
|
||||
typedef struct fyBITMAP_S
|
||||
{
|
||||
fyPIXEL_FORMAT_E enPixelFormat; /* Bitmap's pixel format */
|
||||
FY_U32 u32Width; /* Bitmap's width */
|
||||
FY_U32 u32Height; /* Bitmap's height */
|
||||
FY_VOID *pData; /* Address of Bitmap's data */
|
||||
} BITMAP_S;
|
||||
|
||||
|
||||
typedef struct fyFISHEYE_GPU_PRI_S
|
||||
{
|
||||
FISHEYE_FILTER_MODE_E enYFilter; /* Fiter mode for Luma */
|
||||
FISHEYE_FILTER_MODE_E enCbCrFilter; /* Fiter mode for chroma */
|
||||
FY_U32 u32CCMPhyAddr; /* Physical address of correction coordinate memory , the size is region's width x height x sizeof(float) x 2. */
|
||||
}FISHEYE_GPU_PRI_S;
|
||||
|
||||
|
||||
typedef struct fyFISHEYE_REGION_ATTR_S
|
||||
{
|
||||
FISHEYE_VIEW_MODE_E enViewMode; /* fisheye view mode */
|
||||
FY_U32 u32InRadius; /* inner radius of fisheye correction region [0, u32OutRadius) */
|
||||
FY_U32 u32OutRadius; /* out radius of fisheye correction region [1, max(width/2 of input picture, height/2 of input picture)] */
|
||||
FY_U32 u32Pan; /* [0, 360] */
|
||||
FY_U32 u32Tilt; /* [0, 360] */
|
||||
FY_U32 u32HorZoom; /* [1, 4095] */
|
||||
FY_U32 u32VerZoom; /* [1, 4095] */
|
||||
RECT_S stOutRect; /* output image info after fisheye correction range of width [960, 4608],
|
||||
rang of height [360, 3456], rang of x [0, 4608), rang of y [0, 3456) */
|
||||
FISHEYE_GPU_PRI_S stGPUPrivate; /* GPU related attribute. Only for GPU use */
|
||||
}FISHEYE_REGION_ATTR_S;
|
||||
|
||||
|
||||
typedef struct fyFISHEYE_ATTR_S
|
||||
{
|
||||
FY_BOOL bEnable; /* whether enable fisheye correction or not */
|
||||
FY_BOOL bLMF; /* whether fisheye len's LMF coefficient is from user config
|
||||
or from default linear config */
|
||||
FY_BOOL bBgColor; /* whether use background color or not */
|
||||
FY_U32 u32BgColor; /* the background color ARGB8888 */
|
||||
|
||||
FY_S32 s32HorOffset; /* the horizontal offset between image center and physical center of len */
|
||||
FY_S32 s32VerOffset; /* the vertical offset between image center and physical center of len */
|
||||
|
||||
FY_U32 u32TrapezoidCoef; /* strength coefficient of trapezoid correction */
|
||||
|
||||
FISHEYE_MOUNT_MODE_E enMountMode; /* fisheye mount mode */
|
||||
|
||||
FY_U32 u32RegionNum; /* fisheye correction region number */
|
||||
FISHEYE_REGION_ATTR_S astFisheyeRegionAttr[FISHEYE_MAX_REGION_NUM];/* attribution of fisheye correction region */
|
||||
}FISHEYE_ATTR_S;
|
||||
|
||||
|
||||
typedef struct fyFISHEYE_CONFIG_S
|
||||
{
|
||||
FY_U16 au16LMFCoef[128]; /* LMF coefficient of fisheye len */
|
||||
}FISHEYE_CONFIG_S;
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
#if __cplusplus
|
||||
}
|
||||
#endif
|
||||
#endif /* __cplusplus */
|
||||
|
||||
#endif /* _FY_COMM_VIDEO_H_ */
|
||||
|
@ -1,68 +0,0 @@
|
||||
#ifndef __FY_COMM_VPPU_H__
|
||||
#define __FY_COMM_VPPU_H__
|
||||
|
||||
#include "fy_type.h"
|
||||
#include "fy_common.h"
|
||||
#include "fy_errno.h"
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
#if __cplusplus
|
||||
extern "C"{
|
||||
#endif
|
||||
#endif /* End of #ifdef __cplusplus */
|
||||
|
||||
/*Define vpss channel's work mode*/
|
||||
typedef enum fyVPPU_CHN_MODE_E
|
||||
{
|
||||
VPPU_CHN_MODE_AUTO = 0, /*Auto mode*/
|
||||
VPPU_CHN_MODE_USER /*User mode*/
|
||||
}VPPU_CHN_MODE_E;
|
||||
|
||||
typedef struct fyVPPU_CHN_MODE_S
|
||||
{
|
||||
VPPU_CHN_MODE_E enChnMode; /*Vppu channel's work mode*/
|
||||
FY_U32 u32Width; /*Width of target image*/
|
||||
FY_U32 u32Height; /*Height of target image*/
|
||||
fyPIXEL_FORMAT_E enPixelFormat;/*Pixel format of target image*/
|
||||
//COMPRESS_MODE_E enCompressMode; /*Compression mode of the output, vppu out must None*/
|
||||
}VPPU_CHN_MODE_S;
|
||||
|
||||
typedef enum fyVPPU_CROP_COORDINATE_E
|
||||
{
|
||||
VPPU_CROP_RATIO_COOR = 0, /*Ratio coordinate*/
|
||||
VPPU_CROP_ABS_COOR /*Absolute coordinate*/
|
||||
}VPPU_CROP_COORDINATE_E;
|
||||
|
||||
typedef struct fyVPPU_CROP_INFO_S
|
||||
{
|
||||
FY_BOOL bEnable; /*CROP enable*/
|
||||
VPPU_CROP_COORDINATE_E enCropCoordinate; /*Coordinate mode of the crop start point*/
|
||||
RECT_S stCropRect; /*CROP rectangular*/
|
||||
}VPPU_CROP_INFO_S ;
|
||||
|
||||
|
||||
/* invlalid channel ID */
|
||||
#define FY_ERR_VPPU_INVALID_CHNID FY_DEF_ERR(FY_ID_VPPU, EN_ERR_LEVEL_ERROR, EN_ERR_INVALID_CHNID)
|
||||
/* at lease one parameter is illagal ,eg, an illegal enumeration value */
|
||||
#define FY_ERR_VPPU_ILLEGAL_PARAM FY_DEF_ERR(FY_ID_VPPU, EN_ERR_LEVEL_ERROR, EN_ERR_ILLEGAL_PARAM)
|
||||
/* channel exists */
|
||||
#define FY_ERR_VPPU_EXIST FY_DEF_ERR(FY_ID_VPPU, EN_ERR_LEVEL_ERROR, EN_ERR_EXIST)
|
||||
/* using a NULL point */
|
||||
#define FY_ERR_VPPU_NULL_PTR FY_DEF_ERR(FY_ID_VPPU, EN_ERR_LEVEL_ERROR, EN_ERR_NULL_PTR)
|
||||
/* operation is not supported by NOW */
|
||||
#define FY_ERR_VPPU_NOT_SUPPORT FY_DEF_ERR(FY_ID_VPPU, EN_ERR_LEVEL_ERROR, EN_ERR_NOT_SUPPORT)
|
||||
/* operation is not permitted ,eg, try to change static attribute */
|
||||
#define FY_ERR_VPPU_NOT_PERM FY_DEF_ERR(FY_ID_VPPU, EN_ERR_LEVEL_ERROR, EN_ERR_NOT_PERM)
|
||||
#define FY_ERR_VPPU_SYS_NOTREADY FY_DEF_ERR(FY_ID_VPPU, EN_ERR_LEVEL_ERROR, EN_ERR_SYS_NOTREADY)
|
||||
#define FY_ERR_VPPU_NOMEM FY_DEF_ERR(FY_ID_VPPU, EN_ERR_LEVEL_ERROR, EN_ERR_NOMEM)
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
#if __cplusplus
|
||||
}
|
||||
#endif
|
||||
#endif /* End of #ifdef __cplusplus */
|
||||
|
||||
#endif/* End of #ifndef __FY_COMM_VPPU_H__*/
|
||||
|
@ -1,398 +0,0 @@
|
||||
#ifndef __FY_COMMON_H__
|
||||
#define __FY_COMMON_H__
|
||||
|
||||
#include "fy_type.h"
|
||||
#include "fy_math.h"
|
||||
#include "fy_defines.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
#if __cplusplus
|
||||
extern "C"{
|
||||
#endif
|
||||
#endif /* End of #ifdef __cplusplus */
|
||||
|
||||
#ifndef VER_X
|
||||
#define VER_X 1
|
||||
#endif
|
||||
|
||||
#ifndef VER_Y
|
||||
#define VER_Y 0
|
||||
#endif
|
||||
|
||||
#ifndef VER_Z
|
||||
#define VER_Z 0
|
||||
#endif
|
||||
|
||||
#ifndef VER_P
|
||||
#define VER_P 0
|
||||
#endif
|
||||
|
||||
#ifndef VER_B
|
||||
#define VER_B 0
|
||||
#endif
|
||||
|
||||
#ifdef FY_DEBUG
|
||||
#define VER_D " Debug"
|
||||
#else
|
||||
#define VER_D " Release"
|
||||
#endif
|
||||
|
||||
#define __DEFINE_TO_STR(s) #s
|
||||
#define DEFINE_TO_STR(s) __DEFINE_TO_STR(s)
|
||||
|
||||
#define __MK_VERSION(x,y,z,p,b) #x"."#y"."#z"."#p" B"#b
|
||||
#define MK_VERSION(x,y,z,p,b) __MK_VERSION(x,y,z,p,b)
|
||||
#define MPP_VERSION MPP_VER_PRIX MK_VERSION(VER_X,VER_Y,VER_Z,VER_P,VER_B) VER_D
|
||||
|
||||
#define BUILD_VERSION DEFINE_TO_STR(VER_B)
|
||||
|
||||
#define FYMODULE_VERSION(name, version) \
|
||||
"[" name "] Version:[v" version " (" BUILD_VERSION ")] Build Time:[" __DATE__ "-" __TIME__ "]"
|
||||
|
||||
|
||||
#define VERSION_NAME_MAXLEN 64
|
||||
typedef struct fyMPP_VERSION_S
|
||||
{
|
||||
FY_CHAR aVersion[VERSION_NAME_MAXLEN];
|
||||
}MPP_VERSION_S;
|
||||
|
||||
|
||||
typedef struct
|
||||
{
|
||||
FY_U32 base;
|
||||
void * vbase;
|
||||
FY_U32 size;
|
||||
}MEM_INFO_S;
|
||||
|
||||
typedef struct fyPOINT_S
|
||||
{
|
||||
FY_S32 s32X;
|
||||
FY_S32 s32Y;
|
||||
}POINT_S;
|
||||
|
||||
typedef struct fySIZE_S
|
||||
{
|
||||
FY_U32 u32Width;
|
||||
FY_U32 u32Height;
|
||||
} SIZE_S;
|
||||
|
||||
typedef struct fyRECT_S
|
||||
{
|
||||
FY_S32 s32X;
|
||||
FY_S32 s32Y;
|
||||
FY_U32 u32Width;
|
||||
FY_U32 u32Height;
|
||||
}RECT_S;
|
||||
|
||||
typedef struct fyCROP_INFO_S
|
||||
{
|
||||
FY_BOOL bEnable;
|
||||
RECT_S stRect;
|
||||
}CROP_INFO_S;
|
||||
|
||||
typedef enum fyROTATE_E
|
||||
{
|
||||
ROTATE_NONE = 0, /* no rotate */
|
||||
ROTATE_90 = 1, /* 90 degrees clockwise */
|
||||
ROTATE_180 = 2, /* 180 degrees clockwise */
|
||||
ROTATE_270 = 3, /* 270 degrees clockwise */
|
||||
ROTATE_BUTT
|
||||
} ROTATE_E;
|
||||
|
||||
typedef struct fyBORDER_S
|
||||
{
|
||||
FY_U32 u32TopWidth; /* top border weight, in pixel*/
|
||||
FY_U32 u32BottomWidth; /* bottom border weight, in pixel*/
|
||||
FY_U32 u32LeftWidth; /* left border weight, in pixel*/
|
||||
FY_U32 u32RightWidth; /* right border weight, in pixel*/
|
||||
FY_U32 u32Color; /* border color, RGB888*/
|
||||
} BORDER_S;
|
||||
|
||||
typedef enum fyASPECT_RATIO_E
|
||||
{
|
||||
ASPECT_RATIO_NONE = 0, /* full screen */
|
||||
ASPECT_RATIO_AUTO = 1, /* ratio no change, 1:1*/
|
||||
ASPECT_RATIO_MANUAL = 2, /* ratio manual set */
|
||||
ASPECT_RATIO_BUTT
|
||||
}ASPECT_RATIO_E;
|
||||
|
||||
typedef struct fyASPECT_RATIO_S
|
||||
{
|
||||
ASPECT_RATIO_E enMode; /* aspect ratio mode: none/auto/manual */
|
||||
FY_U32 u32BgColor; /* background color, RGB 888 */
|
||||
RECT_S stVideoRect; /* valid in ASPECT_RATIO_MANUAL mode */
|
||||
} ASPECT_RATIO_S;
|
||||
|
||||
|
||||
typedef struct fyALPHA_S
|
||||
{
|
||||
FY_BOOL bAlphaEnable; /**< alpha enable flag */
|
||||
FY_BOOL bAlphaChannel; /**< alpha channel enable flag */
|
||||
FY_U8 u8Alpha0; /**< alpha0 value, used in ARGB1555 */
|
||||
FY_U8 u8Alpha1; /**< alpha1 value, used in ARGB1555 */
|
||||
FY_U8 u8GlobalAlpha; /**< global alpha value */
|
||||
FY_U8 u8Reserved;
|
||||
} ALPHA_S;
|
||||
|
||||
typedef FY_S32 AI_CHN;
|
||||
typedef FY_S32 AO_CHN;
|
||||
typedef FY_S32 AENC_CHN;
|
||||
typedef FY_S32 ADEC_CHN;
|
||||
typedef FY_S32 AUDIO_DEV;
|
||||
typedef FY_S32 AVENC_CHN;
|
||||
typedef FY_S32 VI_DEV;
|
||||
typedef FY_S32 VI_WAY;
|
||||
typedef FY_S32 VI_CHN;
|
||||
typedef FY_S32 DEV;
|
||||
typedef FY_S32 LAYER;
|
||||
typedef FY_S32 CHN;
|
||||
typedef FY_S32 WBC;
|
||||
typedef FY_S32 GRAPHIC_LAYER;
|
||||
typedef FY_S32 VENC_CHN;
|
||||
typedef FY_S32 VDEC_CHN;
|
||||
typedef FY_S32 VENC_GRP;
|
||||
typedef FY_S32 GRP;
|
||||
typedef FY_S32 VDA_CHN;
|
||||
typedef FY_S32 IVE_HANDLE;
|
||||
typedef FY_S32 CLS_HANDLE;
|
||||
typedef FY_S32 FD_CHN;
|
||||
typedef FY_S32 MD_CHN;
|
||||
typedef FY_S32 VPPU_CHN;
|
||||
typedef FY_S32 VPPU_PTH;
|
||||
|
||||
|
||||
#define FY_INVALID_CHN (-1)
|
||||
#define FY_INVALID_WAY (-1)
|
||||
#define FY_INVALID_LAYER (-1)
|
||||
#define FY_INVALID_DEV (-1)
|
||||
#define FY_INVALID_HANDLE (-1)
|
||||
#define FY_INVALID_VALUE (-1)
|
||||
#define FY_INVALID_TYPE (-1)
|
||||
|
||||
typedef enum fyMOD_ID_E
|
||||
{
|
||||
FY_ID_CMPI = 0,
|
||||
FY_ID_VB = 1,
|
||||
FY_ID_SYS = 2,
|
||||
FY_ID_RGN = 3,
|
||||
FY_ID_CHNL = 4,
|
||||
FY_ID_VDEC = 5,
|
||||
FY_ID_GROUP = 6,
|
||||
FY_ID_VPSS = 7,
|
||||
FY_ID_VENC = 8,
|
||||
FY_ID_VDA = 9,
|
||||
FY_ID_H264E = 10,
|
||||
FY_ID_JPEGED = 11,
|
||||
FY_ID_MPEG4E = 12,
|
||||
FY_ID_H264D = 13,
|
||||
FY_ID_JPEGD = 14,
|
||||
FY_ID_VOU = 15,
|
||||
FY_ID_VIU = 16,
|
||||
FY_ID_DSU = 17,
|
||||
FY_ID_VALG = 18,
|
||||
FY_ID_RC = 19,
|
||||
FY_ID_AIO = 20,
|
||||
FY_ID_AI = 21,
|
||||
FY_ID_AO = 22,
|
||||
FY_ID_AENC = 23,
|
||||
FY_ID_ADEC = 24,
|
||||
FY_ID_AVENC = 25,
|
||||
FY_ID_PCIV = 26,
|
||||
FY_ID_PCIVFMW = 27,
|
||||
FY_ID_ISP = 28,
|
||||
FY_ID_IVE = 29,
|
||||
|
||||
FY_ID_DCCM = 31,
|
||||
FY_ID_DCCS = 32,
|
||||
FY_ID_PROC = 33,
|
||||
FY_ID_LOG = 34,
|
||||
FY_ID_MST_LOG = 35,
|
||||
FY_ID_VD = 36,
|
||||
|
||||
FY_ID_VCMP = 38,
|
||||
FY_ID_FB = 39,
|
||||
FY_ID_HDMI = 40,
|
||||
FY_ID_VOIE = 41,
|
||||
FY_ID_TDE = 42,
|
||||
FY_ID_USR = 43,
|
||||
FY_ID_VEDU = 44,
|
||||
FY_ID_VGS = 45,
|
||||
FY_ID_H265E = 46,
|
||||
FY_ID_FD = 47,
|
||||
FY_ID_ODT = 48, //Object Detection and Tracing
|
||||
FY_ID_VQA = 49, //Video Quality Analysis
|
||||
FY_ID_LPR = 50, //License Plate Recognition
|
||||
FY_ID_FISHEYE = 51,
|
||||
FY_ID_VPPU = 52,
|
||||
//fh module
|
||||
FY_ID_BGM = 60,
|
||||
FY_ID_BGMX = 61,
|
||||
FY_ID_BGMSW = 62,
|
||||
FY_ID_BUTT,
|
||||
//for following only for driver log
|
||||
FY_ID_VIU_LLD,
|
||||
FY_ID_VOU_LLD,
|
||||
FY_ID_VPPU_LLD,
|
||||
FY_ID_VPU_LLD,
|
||||
FY_ID_JPEG_LLD,
|
||||
FY_ID_LOG_BUTT,
|
||||
} MOD_ID_E;
|
||||
|
||||
typedef struct fyMPP_CHN_S
|
||||
{
|
||||
MOD_ID_E enModId;
|
||||
FY_S32 s32DevId;
|
||||
FY_S32 s32ChnId;
|
||||
} MPP_CHN_S;
|
||||
|
||||
#define MPP_MOD_VIU "vi"
|
||||
#define MPP_MOD_VOU "vo"
|
||||
#define MPP_MOD_HDMI "hdmi"
|
||||
#define MPP_MOD_DSU "dsu"
|
||||
#define MPP_MOD_VGS "vgs"
|
||||
|
||||
#define MPP_MOD_CHNL "chnl"
|
||||
#define MPP_MOD_VENC "venc"
|
||||
#define MPP_MOD_GRP "grp"
|
||||
#define MPP_MOD_VDA "vda"
|
||||
#define MPP_MOD_VPSS "vpss"
|
||||
#define MPP_MOD_RGN "rgn"
|
||||
#define MPP_MOD_IVE "ive"
|
||||
#define MPP_MOD_FD "fd"
|
||||
#define MPP_MOD_MD "md"
|
||||
|
||||
#define MPP_MOD_H264E "h264e"
|
||||
#define MPP_MOD_H265E "h265e"
|
||||
#define MPP_MOD_JPEGE "jpege"
|
||||
#define MPP_MOD_MPEG4E "mpeg4e"
|
||||
|
||||
#define MPP_MOD_VDEC "vdec"
|
||||
#define MPP_MOD_H264D "h264d"
|
||||
#define MPP_MOD_JPEGD "jpegd"
|
||||
|
||||
#define MPP_MOD_AI "ai"
|
||||
#define MPP_MOD_AO "ao"
|
||||
#define MPP_MOD_AENC "aenc"
|
||||
#define MPP_MOD_ADEC "adec"
|
||||
#define MPP_MOD_AIO "aio"
|
||||
#define MPP_MOD_ACODEC "acodec"
|
||||
|
||||
|
||||
#define MPP_MOD_VB "vb"
|
||||
#define MPP_MOD_SYS "sys"
|
||||
#define MPP_MOD_CMPI "cmpi"
|
||||
|
||||
#define MPP_MOD_PCIV "pciv"
|
||||
#define MPP_MOD_PCIVFMW "pcivfmw"
|
||||
|
||||
#define MPP_MOD_PROC "proc"
|
||||
#define MPP_MOD_LOG "logfy"
|
||||
#define MPP_MOD_MST_LOG "mstlogfy"
|
||||
|
||||
#define MPP_MOD_DCCM "dccm"
|
||||
#define MPP_MOD_DCCS "dccs"
|
||||
|
||||
#define MPP_MOD_VCMP "vcmp"
|
||||
#define MPP_MOD_FB "fb"
|
||||
|
||||
#define MPP_MOD_RC "rc"
|
||||
|
||||
#define MPP_MOD_VOIE "voie"
|
||||
|
||||
#define MPP_MOD_TDE "tde"
|
||||
#define MPP_MOD_ISP "isp"
|
||||
#define MPP_MOD_USR "usr"
|
||||
|
||||
/* We just coyp this value of payload type from RTP/RTSP definition */
|
||||
typedef enum
|
||||
{
|
||||
PT_PCMU = 0,
|
||||
PT_1016 = 1,
|
||||
PT_G721 = 2,
|
||||
PT_GSM = 3,
|
||||
PT_G723 = 4,
|
||||
PT_DVI4_8K = 5,
|
||||
PT_DVI4_16K = 6,
|
||||
PT_LPC = 7,
|
||||
PT_PCMA = 8,
|
||||
PT_G722 = 9,
|
||||
PT_S16BE_STEREO = 10,
|
||||
PT_S16BE_MONO = 11,
|
||||
PT_QCELP = 12,
|
||||
PT_CN = 13,
|
||||
PT_MPEGAUDIO = 14,
|
||||
PT_G728 = 15,
|
||||
PT_DVI4_3 = 16,
|
||||
PT_DVI4_4 = 17,
|
||||
PT_G729 = 18,
|
||||
PT_G711A = 19,
|
||||
PT_G711U = 20,
|
||||
PT_G726 = 21,
|
||||
PT_G726_32K = 22,
|
||||
PT_G729A = 23,
|
||||
PT_LPCM = 24,
|
||||
PT_CelB = 25,
|
||||
PT_JPEG = 26,
|
||||
PT_CUSM = 27,
|
||||
PT_NV = 28,
|
||||
PT_PICW = 29,
|
||||
PT_CPV = 30,
|
||||
PT_H261 = 31,
|
||||
PT_MPEGVIDEO = 32,
|
||||
PT_MPEG2TS = 33,
|
||||
PT_H263 = 34,
|
||||
PT_SPEG = 35,
|
||||
PT_MPEG2VIDEO = 36,
|
||||
PT_AAC = 37,
|
||||
PT_WMA9STD = 38,
|
||||
PT_HEAAC = 39,
|
||||
PT_PCM_VOICE = 40,
|
||||
PT_PCM_AUDIO = 41,
|
||||
PT_AACLC = 42,
|
||||
PT_MP3 = 43,
|
||||
PT_ADPCMA = 49,
|
||||
PT_AEC = 50,
|
||||
PT_X_LD = 95,
|
||||
PT_H264 = 96,
|
||||
PT_D_GSM_HR = 200,
|
||||
PT_D_GSM_EFR = 201,
|
||||
PT_D_L8 = 202,
|
||||
PT_D_RED = 203,
|
||||
PT_D_VDVI = 204,
|
||||
PT_D_BT656 = 220,
|
||||
PT_D_H263_1998 = 221,
|
||||
PT_D_MP1S = 222,
|
||||
PT_D_MP2P = 223,
|
||||
PT_D_BMPEG = 224,
|
||||
PT_MP4VIDEO = 230,
|
||||
PT_MP4AUDIO = 237,
|
||||
PT_VC1 = 238,
|
||||
PT_JVC_ASF = 255,
|
||||
PT_D_AVI = 256,
|
||||
PT_DIVX3 = 257,
|
||||
PT_AVS = 258,
|
||||
PT_REAL8 = 259,
|
||||
PT_REAL9 = 260,
|
||||
PT_VP6 = 261,
|
||||
PT_VP6F = 262,
|
||||
PT_VP6A = 263,
|
||||
PT_SORENSON = 264,
|
||||
PT_H265 = 265,
|
||||
PT_VP8 = 266,
|
||||
PT_MVC = 267,
|
||||
PT_MAX = 268,
|
||||
/* add by fysilicon */
|
||||
PT_AMR = 1001,
|
||||
PT_MJPEG = 1002,
|
||||
PT_AMRWB = 1003,
|
||||
PT_BUTT
|
||||
}PAYLOAD_TYPE_E;
|
||||
|
||||
#ifdef __cplusplus
|
||||
#if __cplusplus
|
||||
}
|
||||
#endif
|
||||
#endif /* End of #ifdef __cplusplus */
|
||||
|
||||
#endif /* _FY_COMMON_H_ */
|
||||
|
@ -1,112 +0,0 @@
|
||||
#ifndef __FY_DEBUG_H__
|
||||
#define __FY_DEBUG_H__
|
||||
|
||||
#ifndef __KERNEL__
|
||||
#include <stdarg.h>
|
||||
#endif
|
||||
|
||||
#include "fy_type.h"
|
||||
#include "fy_common.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
#if __cplusplus
|
||||
extern "C"{
|
||||
#endif
|
||||
#endif /* __cplusplus */
|
||||
|
||||
#define _EX__FILE_LINE(fxx,lxx) "[File]:"fxx"\n[Line]:"#lxx"\n[Info]:"
|
||||
#define EX__FILE_LINE(fxx,lxx) _EX__FILE_LINE(fxx,lxx)
|
||||
#define __FILE_LINE__ EX__FILE_LINE(__FILE__, __LINE__)
|
||||
|
||||
#define FY_DBG_EMERG 0 /* system is unusable */
|
||||
#define FY_DBG_ALERT 1 /* action must be taken immediately */
|
||||
#define FY_DBG_CRIT 2 /* critical conditions */
|
||||
#define FY_DBG_ERR 3 /* error conditions */
|
||||
#define FY_DBG_WARN 4 /* warning conditions */
|
||||
#define FY_DBG_NOTICE 5 /* normal but significant condition */
|
||||
#define FY_DBG_INFO 6 /* informational */
|
||||
#define FY_DBG_DEBUG 7 /* debug-level messages */
|
||||
|
||||
typedef struct fyLOG_LEVEL_CONF_S
|
||||
{
|
||||
MOD_ID_E enModId;
|
||||
FY_S32 s32Level;
|
||||
FY_CHAR cModName[16];
|
||||
} LOG_LEVEL_CONF_S;
|
||||
|
||||
#ifndef __KERNEL__
|
||||
/******************************************************************************
|
||||
** For User Mode : FY_PRINT, FY_ASSERT, FY_TRACE
|
||||
******************************************************************************/
|
||||
|
||||
#define FY_PRINT printf
|
||||
|
||||
/* #ifdef FY_DEBUG */
|
||||
#if 1
|
||||
/* Using samples: FY_ASSERT(x>y); */
|
||||
#define FY_ASSERT(expr) \
|
||||
do{ \
|
||||
if (!(expr)) { \
|
||||
printf("\nASSERT failed at:\n"\
|
||||
" >File name: %s\n" \
|
||||
" >Function : %s\n" \
|
||||
" >Line No. : %d\n" \
|
||||
" >Condition: %s\n", \
|
||||
__FILE__,__FUNCTION__, __LINE__, #expr);\
|
||||
_exit(-1);\
|
||||
} \
|
||||
}while(0)
|
||||
|
||||
/* Using samples:
|
||||
** FY_TRACE(FY_DBG_DEBUG, FY_ID_CMPI, "Test %d, %s\n", 12, "Test");
|
||||
**/
|
||||
#define FY_TRACE(level, enModId, fmt...) fprintf(stderr,##fmt)
|
||||
#else
|
||||
#define FY_ASSERT(expr)
|
||||
#define FY_TRACE(level, enModId, fmt...)
|
||||
#endif
|
||||
|
||||
#else
|
||||
/******************************************************************************
|
||||
** For Linux Kernel : FY_PRINT, FY_ASSERT, FY_TRACE
|
||||
******************************************************************************/
|
||||
|
||||
#define FY_PRINT printk
|
||||
|
||||
extern FY_S32 FY_ChkLogLevel(FY_S32 s32Levle, MOD_ID_E enModId);
|
||||
asmlinkage int FY_LOG(FY_S32 level, MOD_ID_E enModId,const char *fmt, ...);
|
||||
|
||||
/* #ifdef FY_DEBUG */
|
||||
#if 1
|
||||
/* Using samples: FY_ASSERT(x>y); */
|
||||
#define FY_ASSERT(expr) \
|
||||
do{ \
|
||||
if (!(expr)) { \
|
||||
panic("\nASSERT failed at:\n" \
|
||||
" >File name: %s\n" \
|
||||
" >Function : %s\n" \
|
||||
" >Line No. : %d\n" \
|
||||
" >Condition: %s\n", \
|
||||
__FILE__,__FUNCTION__, __LINE__, #expr);\
|
||||
} \
|
||||
}while(0)
|
||||
|
||||
/* Using samples:
|
||||
** FY_TRACE(FY_DBG_DEBUG, FY_ID_CMPI, "Test %d, %s\n", 12, "Test");
|
||||
**/
|
||||
#define FY_TRACE FY_LOG
|
||||
#else
|
||||
#define FY_ASSERT(expr)
|
||||
#define FY_TRACE(level, enModId, fmt...)
|
||||
#endif
|
||||
|
||||
#endif /* end of __KERNEL__ */
|
||||
|
||||
#ifdef __cplusplus
|
||||
#if __cplusplus
|
||||
}
|
||||
#endif
|
||||
#endif /* __cplusplus */
|
||||
|
||||
#endif /* __FY_DEBUG_H__ */
|
||||
|
@ -1,261 +0,0 @@
|
||||
#ifndef __FY_DEFINES_H__
|
||||
#define __FY_DEFINES_H__
|
||||
|
||||
#ifdef __cplusplus
|
||||
#if __cplusplus
|
||||
extern "C"{
|
||||
#endif
|
||||
#endif /* __cplusplus */
|
||||
|
||||
#define FY_V01 0x46590100
|
||||
|
||||
#ifndef FYCHIP
|
||||
#define FYCHIP FY_V01
|
||||
#endif
|
||||
|
||||
#if FYCHIP==FY_V01
|
||||
#define CHIP_NAME "FY01"
|
||||
#define MPP_VER_PRIX "_MPP_V"
|
||||
#else
|
||||
#error FYCHIP define may be error
|
||||
#endif
|
||||
|
||||
#define LINE_LEN_BIT 5
|
||||
#define LINE_LEN (1<<LINE_LEN_BIT)
|
||||
#define LINE_BASE_MASK (~(LINE_LEN-1))
|
||||
static inline void InvalidateDcache(unsigned long addr, unsigned long len)
|
||||
{
|
||||
unsigned long end;
|
||||
//TODO: cache need rewrite when flush
|
||||
return ;
|
||||
|
||||
addr &= LINE_BASE_MASK;
|
||||
len >>= LINE_LEN_BIT;
|
||||
end = addr + len*LINE_LEN;
|
||||
|
||||
while(addr != end)
|
||||
{
|
||||
asm("mcr p15, 0, %0, c7, c6, 1"::"r"(addr));
|
||||
addr += LINE_LEN;
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
static inline void FlushDcache(unsigned long addr, unsigned long len)
|
||||
{
|
||||
unsigned long end;
|
||||
|
||||
//TODO: cache need rewrite when flush
|
||||
return ;
|
||||
|
||||
addr &= LINE_BASE_MASK;
|
||||
len >>= LINE_LEN_BIT;
|
||||
end = addr + len*LINE_LEN;
|
||||
|
||||
while(addr != end)
|
||||
{
|
||||
asm("mcr p15, 0, %0, c7, c10, 1"::"r"(addr));
|
||||
addr += LINE_LEN;
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
#define DEFAULT_ALIGN 16
|
||||
#define MAX_MMZ_NAME_LEN 32
|
||||
#define MMAX_MMB_NAME_LEN 16
|
||||
|
||||
#define MAX_NODE_NUM 16
|
||||
|
||||
/* For VDA */
|
||||
#define VDA_CHN_NUM_MAX 0
|
||||
|
||||
|
||||
/* For VENC */
|
||||
#define VENC_MAX_CHN_NUM 32
|
||||
#define VENC_MAX_GRP_NUM 128
|
||||
#define JPEGE_MAX_WIDTH 4096
|
||||
#define JPEGE_MAX_HEIGHT 3072
|
||||
#define VENC_MAX_ROI_NUM 8
|
||||
#define JPEGE_MAX_CHN_NUM 32
|
||||
|
||||
|
||||
/*For RC*/
|
||||
#define RC_TEXTURE_THR_SIZE 12
|
||||
#define RC_RQRATIO_SIZE 8
|
||||
|
||||
|
||||
|
||||
/* For VDEC */
|
||||
#define VDEC_MAX_CHN_NUM 16
|
||||
#define MAX_VDEC_CHN VDEC_MAX_CHN_NUM
|
||||
|
||||
|
||||
|
||||
/* for VDH-H264 */
|
||||
|
||||
/* for VDH-HEVC */
|
||||
|
||||
|
||||
/* for JPEGD */
|
||||
|
||||
/* for VPSS */
|
||||
|
||||
#define VPSS_MAX_WIDTH 1920
|
||||
#define VPSS_MAX_HEIGHT 1920
|
||||
#define VPSS_MAX_GRP_NUM 256
|
||||
#define VPSS_MAX_PHY_CHN_NUM 5
|
||||
#define VPSS_MAX_EXT_CHN_NUM 0
|
||||
#define VPSS_MAX_CHN_NUM (VPSS_MAX_PHY_CHN_NUM + VPSS_MAX_EXT_CHN_NUM)
|
||||
#define VPSS_CHN0 0
|
||||
#define VPSS_CHN1 1
|
||||
#define VPSS_CHN2 2
|
||||
#define VPSS_CHN3 3
|
||||
#define VPSS_CHN4 4
|
||||
#define VPSS_INVALID_CHN -1
|
||||
#define VPSS_LUMA_STAT_NUM 64
|
||||
|
||||
/* For PCIV */
|
||||
#define PCIV_MAX_CHN_NUM 128 /* max pciv channel number in each pciv device */
|
||||
|
||||
/* for REGION */
|
||||
#define OVERLAY_MAX_NUM_VPSS 8
|
||||
|
||||
/* for VPPU */
|
||||
#define VPPU_MAX_CHN_NUM 16
|
||||
#define VPPU_MAX_PTH_NUM 3
|
||||
|
||||
|
||||
#if 0
|
||||
#define MAX_COVER_NUM 4
|
||||
#define MAX_VIOVERLAY_NUM 8
|
||||
#define MAX_COVEREX_REGION_NUM 16
|
||||
#define MAX_REGION_NUM 8
|
||||
#define OVERLAY_START_X_ALIGN 8
|
||||
#define OVERLAY_START_Y_ALIGN 2
|
||||
#define MAX_VIOVERLAY_ALPHA 255
|
||||
#endif
|
||||
|
||||
|
||||
/* number of channle and device on video input unit of chip
|
||||
* Note! VIU_MAX_CHN_NUM is NOT equal to VIU_MAX_DEV_NUM
|
||||
* multiplied by VIU_MAX_CHN_NUM, because all VI devices
|
||||
* can't work at mode of 4 channles at the same time.
|
||||
*/
|
||||
#define VIU_MAX_DEV_NUM 2
|
||||
#define VIU_MAX_CHN_NUM_PER_DEV 4
|
||||
#define VIU_SUB_CHN_START 16
|
||||
#define VIU_MAX_CHN_NUM (VIU_MAX_DEV_NUM * VIU_MAX_CHN_NUM_PER_DEV)
|
||||
|
||||
/*get the subchn index by main chn */
|
||||
#define SUBCHN(ViChn) (ViChn + VIU_SUB_CHN_START)
|
||||
|
||||
|
||||
/* for VOU */
|
||||
#define MAX_DEV_NUM 2 /* max dev num */
|
||||
#define MAX_LAYER_NUM 3 /* max layer num */
|
||||
#define VHD_MAX_CHN_NUM 16 /* max VHD chn num */
|
||||
#define MAX_CHN_NUM VHD_MAX_CHN_NUM /* max chn num */
|
||||
#define MAX_GRAPHICS_LAYER_NUM 4 /* max gfx layer num */
|
||||
#define MAX_WBC_NUM 1 /* max wbc dev num */
|
||||
|
||||
#define AENC_MAX_CHN_NUM 32
|
||||
#define ADEC_MAX_CHN_NUM 32
|
||||
|
||||
/* VB size calculate for compressed frame.
|
||||
[param input]
|
||||
w: width
|
||||
h: height
|
||||
fmt: pixel format, 0: SP420, 1: SP422
|
||||
z: compress mode, 0: no compress, 1: default compress
|
||||
[param output]
|
||||
size: vb blk size
|
||||
|
||||
*/
|
||||
#define VB_W_ALIGN 16
|
||||
#define VB_H_ALIGN 32
|
||||
#define VB_ALIGN(x, a) ((a) * (((x) + (a) - 1) / (a)))
|
||||
|
||||
|
||||
#define VDU_ALIGN4(_x) (((_x)+0x03)&~0x03)
|
||||
#define VDU_ALIGN8(_x) (((_x)+0x07)&~0x07)
|
||||
#define VDU_ALIGN16(_x) (((_x)+0x0f)&~0x0f)
|
||||
#define VDU_ALIGN32(_x) (((_x)+0x1f)&~0x1f)
|
||||
#define VDU_ALIGN64(_x) (((_x)+0x3f)&~0x3f)
|
||||
#define VDU_ALIGN128(_x) (((_x)+0x7f)&~0x7f)
|
||||
#define VDU_ALIGN256(_x) (((_x)+0xff)&~0xff)
|
||||
#define VDU_ALIGN512(_x) (((_x)+0x1ff)&~0x1ff)
|
||||
#define VDU_ALIGN1024(_x) (((_x)+0x3ff)&~0x3ff)
|
||||
#define VDU_ALIGN2048(_x) (((_x)+0x7ff)&~0x7ff)
|
||||
#define VDU_ALIGN4096(_x) (((_x)+0xfff)&~0xfff)
|
||||
#define VDU_ALIGN16384(_x) (((_x)+0x3fff)&~0x3fff)
|
||||
|
||||
/* VB size calculate for compressed frame.
|
||||
[param input]
|
||||
w: width
|
||||
h: height
|
||||
fmt: pixel format, 0: SP420, 1: SP422
|
||||
z: compress mode, 0: no compress, 1: default compress
|
||||
[param output]
|
||||
size: vb blk size
|
||||
*/
|
||||
#define VB_HEADER_STRIDE 16
|
||||
|
||||
#define VB_PIC_Y_HEADER_SIZE(Width, Height, size)\
|
||||
do{\
|
||||
size = VB_HEADER_STRIDE * (Height);\
|
||||
}while(0)
|
||||
|
||||
#define VB_PIC_HEADER_SIZE(Width, Height, Type, size)\
|
||||
do{\
|
||||
if (PIXEL_FORMAT_YUV_SEMIPLANAR_422 == Type)\
|
||||
{\
|
||||
size = VB_HEADER_STRIDE * (Height) * 2;\
|
||||
}\
|
||||
else\
|
||||
{\
|
||||
size = (VB_HEADER_STRIDE * (Height) * 3) >> 1;\
|
||||
}\
|
||||
}while(0)
|
||||
|
||||
|
||||
#define VB_PIC_BLK_SIZE(Width, Height, Type, size)\
|
||||
do{\
|
||||
unsigned int u32AlignWidth;\
|
||||
unsigned int u32AlignHeight;\
|
||||
unsigned int __mvSize = 0;\
|
||||
unsigned int __fbcYHeaderSize = 0;\
|
||||
unsigned int __fbcCHeaderSize = 0;\
|
||||
if (Type==PT_H264 || Type==PT_H265) \
|
||||
{\
|
||||
u32AlignWidth = VDU_ALIGN64(Width);\
|
||||
if(Type==PT_H264) \
|
||||
u32AlignHeight= VDU_ALIGN16(Height);\
|
||||
else \
|
||||
u32AlignHeight= VDU_ALIGN64(Height);\
|
||||
size = (u32AlignWidth * u32AlignHeight * 3 )>> 1;\
|
||||
if(Type==PT_H264) \
|
||||
__mvSize = 0; \
|
||||
else if(Type==PT_H265) \
|
||||
__mvSize = (size>>3); \
|
||||
__fbcCHeaderSize = (VDU_ALIGN1024(Width)>>10)*( (VDU_ALIGN4((Height)>>1))>>2)*64; \
|
||||
__fbcYHeaderSize = (__fbcCHeaderSize<<1); \
|
||||
size += (__mvSize + __fbcYHeaderSize + __fbcCHeaderSize);\
|
||||
}\
|
||||
else\
|
||||
{\
|
||||
u32AlignWidth = VDU_ALIGN16(Width);\
|
||||
u32AlignHeight= VDU_ALIGN16(Height);\
|
||||
size = (u32AlignWidth * u32AlignHeight * 3) >> 1;\
|
||||
}\
|
||||
size = VDU_ALIGN4096(size); \
|
||||
}while(0)
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
#if __cplusplus
|
||||
}
|
||||
#endif
|
||||
#endif /* __cplusplus */
|
||||
|
||||
#endif /* __FY_DEFINES_H__ */
|
||||
|
@ -1,98 +0,0 @@
|
||||
#ifndef __FY_ERRNO_H__
|
||||
#define __FY_ERRNO_H__
|
||||
|
||||
#include "fy_debug.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
#if __cplusplus
|
||||
extern "C"{
|
||||
#endif
|
||||
#endif /* End of #ifdef __cplusplus */
|
||||
|
||||
|
||||
/* 1010 0000b
|
||||
* VTOP use APPID from 0~31
|
||||
* so, fysilicon use APPID based on 32
|
||||
*/
|
||||
#define FY_ERR_APPID (0x80000000L + 0x20000000L)
|
||||
|
||||
typedef enum fyERR_LEVEL_E
|
||||
{
|
||||
EN_ERR_LEVEL_DEBUG = 0, /* debug-level */
|
||||
EN_ERR_LEVEL_INFO, /* informational */
|
||||
EN_ERR_LEVEL_NOTICE, /* normal but significant condition */
|
||||
EN_ERR_LEVEL_WARNING, /* warning conditions */
|
||||
EN_ERR_LEVEL_ERROR, /* error conditions */
|
||||
EN_ERR_LEVEL_CRIT, /* critical conditions */
|
||||
EN_ERR_LEVEL_ALERT, /* action must be taken immediately */
|
||||
EN_ERR_LEVEL_FATAL, /* just for compatibility with previous version */
|
||||
EN_ERR_LEVEL_BUTT
|
||||
}ERR_LEVEL_E;
|
||||
|
||||
|
||||
/******************************************************************************
|
||||
|----------------------------------------------------------------|
|
||||
| 1 | APP_ID | MOD_ID | ERR_LEVEL | ERR_ID |
|
||||
|----------------------------------------------------------------|
|
||||
|<--><--7bits----><----8bits---><--3bits---><------13bits------->|
|
||||
******************************************************************************/
|
||||
|
||||
#define FY_DEF_ERR( module, level, errid) \
|
||||
((FY_S32)( (FY_ERR_APPID) | ((module) << 16 ) | ((level)<<13) | (errid) ))
|
||||
|
||||
/* NOTE! the following defined all common error code,
|
||||
** all module must reserved 0~63 for their common error code
|
||||
*/
|
||||
typedef enum fyEN_ERR_CODE_E
|
||||
{
|
||||
EN_ERR_INVALID_DEVID = 1, /* invlalid device ID */
|
||||
EN_ERR_INVALID_CHNID = 2, /* invlalid channel ID */
|
||||
EN_ERR_ILLEGAL_PARAM = 3, /* at lease one parameter is illagal
|
||||
* eg, an illegal enumeration value */
|
||||
EN_ERR_EXIST = 4, /* resource exists */
|
||||
EN_ERR_UNEXIST = 5, /* resource unexists */
|
||||
|
||||
EN_ERR_NULL_PTR = 6, /* using a NULL point */
|
||||
|
||||
EN_ERR_NOT_CONFIG = 7, /* try to enable or initialize system, device
|
||||
** or channel, before configing attribute */
|
||||
|
||||
EN_ERR_NOT_SUPPORT = 8, /* operation or type is not supported by NOW */
|
||||
EN_ERR_NOT_PERM = 9, /* operation is not permitted
|
||||
** eg, try to change static attribute */
|
||||
|
||||
EN_ERR_NOMEM = 12,/* failure caused by malloc memory */
|
||||
EN_ERR_NOBUF = 13,/* failure caused by malloc buffer */
|
||||
|
||||
EN_ERR_BUF_EMPTY = 14,/* no data in buffer */
|
||||
EN_ERR_BUF_FULL = 15,/* no buffer for new data */
|
||||
|
||||
EN_ERR_SYS_NOTREADY = 16,/* System is not ready,maybe not initialed or
|
||||
** loaded. Returning the error code when opening
|
||||
** a device file failed. */
|
||||
|
||||
EN_ERR_BADADDR = 17,/* bad address,
|
||||
** eg. used for copy_from_user & copy_to_user */
|
||||
|
||||
EN_ERR_BUSY = 18,/* resource is busy,
|
||||
** eg. destroy a venc chn without unregister it */
|
||||
|
||||
EN_ERR_BUTT = 63,/* maxium code, private error code of all modules
|
||||
** must be greater than it */
|
||||
}EN_ERR_CODE_E;
|
||||
|
||||
|
||||
/*
|
||||
** following is an example for defining error code of VDA module
|
||||
** #define FY_ERR_MD_INVALID_CHNID FY_DEF_ERR(FY_ID_VDA, EN_ERR_LEVEL_ERROR, EN_ERR_INVALID_CHNID)
|
||||
**
|
||||
*/
|
||||
|
||||
#ifdef __cplusplus
|
||||
#if __cplusplus
|
||||
}
|
||||
#endif
|
||||
#endif /* __cplusplus */
|
||||
|
||||
#endif /* __FY_ERRNO_H__ */
|
||||
|
@ -1,267 +0,0 @@
|
||||
#ifndef __FY_MATH_H__
|
||||
#define __FY_MATH_H__
|
||||
|
||||
#include "fy_type.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
#if __cplusplus
|
||||
extern "C"{
|
||||
#endif
|
||||
#endif /* __cplusplus */
|
||||
|
||||
/******************************************************************************
|
||||
** ABS(x) absolute value of x
|
||||
** SIGN(x) sign of x
|
||||
** CMP(x,y) 0 if x==y; 1 if x>y; -1 if x<y
|
||||
******************************************************************************/
|
||||
#define ABS(x) ( (x) >= 0 ? (x) : (-(x)) )
|
||||
#define SIGN(x) ( (x) >= 0 ? 1 : -1 )
|
||||
#define CMP(x,y) (((x) == (y)) ? 0 : (((x) > (y)) ? 1 : -1))
|
||||
|
||||
/******************************************************************************
|
||||
** MAX2(x,y) maximum of x and y
|
||||
** MIN2(x,y) minimum of x and y
|
||||
** MAX3(x,y,z) maximum of x, y and z
|
||||
** MIN3(x,y,z) minimun of x, y and z
|
||||
** MEDIAN(x,y,z) median of x,y,z
|
||||
** MEAN2(x,y) mean of x,y
|
||||
******************************************************************************/
|
||||
#define MAX2(x,y) ( (x)>(y) ? (x):(y) )
|
||||
#define MIN2(x,y) ( (x)<(y) ? (x):(y) )
|
||||
#define MAX3(x,y,z) ( (x)>(y) ? MAX2(x,z) : MAX2(y,z) )
|
||||
#define MIN3(x,y,z) ( (x)<(y) ? MIN2(x,z) : MIN2(y,z) )
|
||||
#define MEDIAN(x,y,z) (((x)+(y)+(z) - MAX3(x,y,z)) - MIN3(x,y,z) )
|
||||
#define MEAN2(x,y) (((x)+(y)) >> 1 )
|
||||
|
||||
/******************************************************************************
|
||||
** CLIP3(x,min,max) clip x within [min,max]
|
||||
** WRAP_MAX(x,max,min) wrap to min if x equal max
|
||||
** WRAP_MIN(x,min,max) wrap to max if x equal min
|
||||
** VALUE_BETWEEN(x,min.max) True if x is between [min,max] inclusively.
|
||||
******************************************************************************/
|
||||
#define CLIP3(x,min,max) ( (x)< (min) ? (min) : ((x)>(max)?(max):(x)) )
|
||||
#define WRAP_MAX(x,max,min) ( (x)>=(max) ? (min) : (x) )
|
||||
#define WRAP_MIN(x,min,max) ( (x)<=(min) ? (max) : (x) )
|
||||
#define VALUE_BETWEEN(x,min,max) (((x)>=(min)) && ((x) <= (max)))
|
||||
|
||||
/******************************************************************************
|
||||
** MULTI_OF_2_POWER(x,a) whether x is multiple of a(a must be power of 2)
|
||||
** CEILING_2_POWER(x,a) ceiling x to multiple of a(a must be power of 2)
|
||||
** FLOOR_2_POWER(x,a) floor x to multiple of a(a must be power of 2)
|
||||
** FYALIGN(x, a) align x to multiple of a
|
||||
**
|
||||
** Example:
|
||||
** CEILING_2_POWER(5,4) = 8
|
||||
** FLOOR_2_POWER(5,4) = 4
|
||||
******************************************************************************/
|
||||
#define MULTI_OF_2_POWER(x,a) (!((x) & ((a) - 1) ) )
|
||||
#define CEILING_2_POWER(x,a) ( ((x) + ((a) - 1) ) & ( ~((a) - 1) ) )
|
||||
#define FLOOR_2_POWER(x,a) ( (x) & (~((a) - 1) ) )
|
||||
#define FYALIGN(x, a) ((a) * (((x) + (a) - 1) / (a)))
|
||||
#define FYCEILING(x, a) (((x)+(a)-1)/(a))
|
||||
|
||||
/******************************************************************************
|
||||
** Get the span between two unsinged number, such as
|
||||
** SPAN(FY_U32, 100, 200) is 200 - 100 = 100
|
||||
** SPAN(FY_U32, 200, 100) is 0xFFFFFFFF - 200 + 100
|
||||
** SPAN(FY_U64, 200, 100) is 0xFFFFFFFFFFFFFFFF - 200 + 100
|
||||
******************************************************************************/
|
||||
#define SPAN(type, begin, end)\
|
||||
({ \
|
||||
type b = (begin); \
|
||||
type e = (end); \
|
||||
(type)((b >= e) ? (b - e) : (b + ((~((type)0))-e))); \
|
||||
})
|
||||
|
||||
/******************************************************************************
|
||||
** ENDIAN32(x,y) little endian <---> big endian
|
||||
** IS_LITTLE_END() whether the system is little end mode
|
||||
******************************************************************************/
|
||||
#define ENDIAN32( x ) \
|
||||
( ( (x) << 24 ) | \
|
||||
( ( (x) & 0x0000ff00 ) << 8 ) | \
|
||||
( ( (x) & 0x00ff0000 ) >> 8 ) | \
|
||||
( ( (x) >> 24 ) & 0x000000ff ) )
|
||||
|
||||
__inline static FY_BOOL IS_LITTLE_END(void)
|
||||
{
|
||||
union unEND_TEST_U
|
||||
{
|
||||
FY_CHAR cTest[4];
|
||||
FY_U32 u32Test;
|
||||
} unEndTest;
|
||||
|
||||
unEndTest.cTest[0] = 0x01;
|
||||
unEndTest.cTest[1] = 0x02;
|
||||
unEndTest.cTest[2] = 0x03;
|
||||
unEndTest.cTest[3] = 0x04;
|
||||
|
||||
return (unEndTest.u32Test > 0x01020304) ? (FY_TRUE) : (FY_FALSE);
|
||||
}
|
||||
|
||||
|
||||
/******************************************************************************
|
||||
** FRACTION32(de,nu) fraction: nu(minator) / de(nominator).
|
||||
** NUMERATOR32(x) of x(x is fraction)
|
||||
** DENOMINATOR32(x) Denominator of x(x is fraction)
|
||||
|
||||
** represent fraction in 32 bit. LSB 16 is numerator, MSB 16 is denominator
|
||||
** It is integer if denominator is 0.
|
||||
******************************************************************************/
|
||||
#define FRACTION32(de,nu) ( ((de) << 16) | (nu) )
|
||||
#define NUMERATOR32(x) ( (x) & 0xffff)
|
||||
#define DENOMINATOR32(x) ( (x) >> 16 )
|
||||
|
||||
/******************************************************************************
|
||||
** RGB(r,g,b) assemble the r,g,b to 24bit color
|
||||
** RGB_R(c) get RED from 24bit color
|
||||
** RGB_G(c) get GREEN from 24bit color
|
||||
** RGB_B(c) get BLUE from 24bit color
|
||||
******************************************************************************/
|
||||
#define RGB(r,g,b) ((((r) & 0xff) << 16) | (((g) & 0xff) << 8) | ((b) & 0xff))
|
||||
#define RGB_R(c) ( ((c) & 0xff0000) >> 16)
|
||||
#define RGB_G(c) ( ((c) & 0xff00) >> 8)
|
||||
#define RGB_B(c) ( (c) & 0xff)
|
||||
|
||||
/******************************************************************************
|
||||
** YUV(y,u,v) assemble the y,u,v to 24bit color
|
||||
** YUV_Y(c) get Y from 24bit color
|
||||
** YUV_U(c) get U from 24bit color
|
||||
** YUV_V(c) get V from 24bit color
|
||||
******************************************************************************/
|
||||
#define YUV(y,u,v) ((((y) & 0xff) << 16) | (((u) & 0xff) << 8) | ((v) & 0xff))
|
||||
#define YUV_Y(c) ( ((c) & 0xff0000) >> 16)
|
||||
#define YUV_U(c) ( ((c) & 0xff00) >> 8)
|
||||
#define YUV_V(c) ( (c) & 0xff)
|
||||
|
||||
/******************************************************************************
|
||||
** Rgb2Yc(r, g, b, *y, *u, *u) convert r,g,b to y,u,v
|
||||
** Rgb2Yuv(rgb, *yuv) convert rgb to yuv
|
||||
******************************************************************************/
|
||||
__inline static FY_VOID Rgb2Yc(FY_U8 r, FY_U8 g, FY_U8 b, FY_U8 * py, FY_U8 * pcb, FY_U8 * pcr)
|
||||
{
|
||||
/* Y */
|
||||
*py = (FY_U8)(((r*66+g*129+b*25) >> 8) + 16);
|
||||
|
||||
/* Cb */
|
||||
*pcb = (FY_U8)((((b*112-r*38)-g*74) >> 8) + 128);
|
||||
|
||||
/* Cr */
|
||||
*pcr = (FY_U8)((((r*112-g*94)-b*18) >> 8) + 128);
|
||||
}
|
||||
|
||||
__inline static FY_U32 Rgb2Yuv(FY_U32 u32Rgb)
|
||||
{
|
||||
FY_U8 y,u,v;
|
||||
|
||||
Rgb2Yc(RGB_R(u32Rgb), RGB_G(u32Rgb), RGB_B(u32Rgb), &y, &u, &v);
|
||||
|
||||
return YUV(y,u,v);
|
||||
}
|
||||
|
||||
/******************************************************************************
|
||||
** GetYCFromRGB(rgb, *y, *cbcr) convert rgb to yyyy, uvuv,
|
||||
******************************************************************************/
|
||||
__inline static FY_VOID GetYCFromRGB(FY_U32 rgb, FY_U32 * pY, FY_U32 * pC)
|
||||
{
|
||||
FY_U8 y, cb, cr;
|
||||
FY_U32 color_y, color_c, tmp;
|
||||
|
||||
Rgb2Yc(RGB_R(rgb), RGB_G(rgb), RGB_B(rgb), &y, &cb, &cr);
|
||||
|
||||
tmp = y & 0xFF;
|
||||
color_y = (tmp<<24) + (tmp<<16) + (tmp<<8) + tmp;
|
||||
|
||||
tmp = cb & 0xFF;
|
||||
color_c = (tmp<<24) + (tmp<<8);
|
||||
|
||||
tmp = cr & 0xFF;
|
||||
color_c = color_c + (tmp<<16) + tmp;
|
||||
|
||||
*pY = color_y;
|
||||
*pC = color_c;
|
||||
}
|
||||
|
||||
/*******************************************************************************
|
||||
** FpsControl Useing Sample:
|
||||
** FPS_CTRL_S g_stFpsCtrl;
|
||||
**
|
||||
** Take 12 frame uniform in 25.
|
||||
** InitFps(&g_stFpsCtrl, 25, 12);
|
||||
**
|
||||
** {
|
||||
** if(FpsControl(&g_stFpsCtrl)) printf("Yes, this frmae should be token");
|
||||
** }
|
||||
**
|
||||
*******************************************************************************/
|
||||
typedef struct fyFPS_CTRL_S
|
||||
{
|
||||
FY_U32 u32Ffps; /* Full frame rate */
|
||||
FY_U32 u32Tfps; /* Target frame rate */
|
||||
FY_U32 u32FrmKey; /* update key frame */
|
||||
} FPS_CTRL_S;
|
||||
|
||||
__inline static FY_VOID InitFps(FPS_CTRL_S *pFrmCtrl, FY_U32 u32FullFps,
|
||||
FY_U32 u32TagFps)
|
||||
{
|
||||
pFrmCtrl->u32Ffps = u32FullFps;
|
||||
pFrmCtrl->u32Tfps = u32TagFps;
|
||||
pFrmCtrl->u32FrmKey = 0;
|
||||
}
|
||||
|
||||
__inline static FY_BOOL FpsControl(FPS_CTRL_S *pFrmCtrl)
|
||||
{
|
||||
FY_BOOL bReturn = FY_FALSE;
|
||||
|
||||
pFrmCtrl->u32FrmKey += pFrmCtrl->u32Tfps;
|
||||
if (pFrmCtrl->u32FrmKey >= pFrmCtrl->u32Ffps)
|
||||
{
|
||||
pFrmCtrl->u32FrmKey -= pFrmCtrl->u32Ffps;
|
||||
bReturn = FY_TRUE;
|
||||
}
|
||||
|
||||
return bReturn;
|
||||
}
|
||||
|
||||
/*******************************************************************************
|
||||
** GetSysTimeBySec
|
||||
** GetSysTimeByUsec
|
||||
*******************************************************************************/
|
||||
#ifdef __KERNEL__
|
||||
//#include <linux/time.h>
|
||||
#include <linux/ktime.h>
|
||||
#else
|
||||
#include <sys/time.h>
|
||||
#endif
|
||||
__inline static FY_U32 GetSysTimeBySec(void)
|
||||
{
|
||||
struct timeval stTime;
|
||||
#ifdef __KERNEL__
|
||||
do_gettimeofday(&stTime);
|
||||
#else
|
||||
gettimeofday(&stTime, NULL);
|
||||
#endif
|
||||
return stTime.tv_sec;
|
||||
}
|
||||
|
||||
__inline static FY_U64 GetSysTimeByUsec(void)
|
||||
{
|
||||
struct timeval stTime;
|
||||
#ifdef __KERNEL__
|
||||
do_gettimeofday(&stTime);
|
||||
#else
|
||||
gettimeofday(&stTime, NULL);
|
||||
#endif
|
||||
return (stTime.tv_sec * 1000000LLU) + stTime.tv_usec;
|
||||
}
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
#if __cplusplus
|
||||
}
|
||||
#endif
|
||||
#endif /* __cplusplus */
|
||||
|
||||
|
||||
#endif /* __FY_MATH_H__ */
|
||||
|
@ -1,58 +0,0 @@
|
||||
#ifndef __FY_TYPE_H__
|
||||
#define __FY_TYPE_H__
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
#if __cplusplus
|
||||
extern "C"{
|
||||
#endif
|
||||
#endif /* __cplusplus */
|
||||
|
||||
/*----------------------------------------------*
|
||||
* The common data type, will be used in the whole project.*
|
||||
*----------------------------------------------*/
|
||||
|
||||
typedef unsigned char FY_U8;
|
||||
typedef unsigned short FY_U16;
|
||||
typedef unsigned int FY_U32;
|
||||
typedef double FY_DOUBLE;
|
||||
typedef signed char FY_S8;
|
||||
typedef short FY_S16;
|
||||
typedef int FY_S32;
|
||||
|
||||
#ifndef _M_IX86
|
||||
typedef unsigned long long FY_U64;
|
||||
typedef long long FY_S64;
|
||||
#else
|
||||
typedef __int64 FY_U64;
|
||||
typedef __int64 FY_S64;
|
||||
#endif
|
||||
|
||||
typedef char FY_CHAR;
|
||||
#define FY_VOID void
|
||||
|
||||
/*----------------------------------------------*
|
||||
* const defination *
|
||||
*----------------------------------------------*/
|
||||
typedef enum {
|
||||
FY_FALSE = 0,
|
||||
FY_TRUE = 1,
|
||||
} FY_BOOL;
|
||||
|
||||
#ifndef NULL
|
||||
#define NULL 0L
|
||||
#endif
|
||||
|
||||
#define FY_NULL 0L
|
||||
#define FY_SUCCESS 0
|
||||
#define FY_FAILURE (-1)
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
#if __cplusplus
|
||||
}
|
||||
#endif
|
||||
#endif /* __cplusplus */
|
||||
|
||||
#endif /* __FY_TYPE_H__ */
|
||||
|
@ -1,85 +0,0 @@
|
||||
#ifndef __MPI_SYS_H__
|
||||
#define __MPI_SYS_H__
|
||||
|
||||
#include "include/fy_type.h"
|
||||
#include "include/fy_common.h"
|
||||
#include "include/fy_comm_sys.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
#if __cplusplus
|
||||
extern "C"{
|
||||
#endif
|
||||
#endif /* End of #ifdef __cplusplus */
|
||||
|
||||
FY_S32 FY_MPI_SYS_Init();
|
||||
FY_S32 FY_MPI_SYS_Exit();
|
||||
|
||||
FY_S32 FY_MPI_SYS_SetConf(const MPP_SYS_CONF_S *pstSysConf);
|
||||
FY_S32 FY_MPI_SYS_GetConf(MPP_SYS_CONF_S *pstSysConf);
|
||||
|
||||
FY_S32 FY_MPI_SYS_Bind(MPP_CHN_S *pstSrcChn, MPP_CHN_S *pstDestChn);
|
||||
FY_S32 FY_MPI_SYS_UnBind(MPP_CHN_S *pstSrcChn, MPP_CHN_S *pstDestChn);
|
||||
FY_S32 FY_MPI_SYS_GetBindbyDest(MPP_CHN_S *pstDestChn, MPP_CHN_S *pstSrcChn);
|
||||
|
||||
FY_S32 FY_MPI_SYS_GetVersion(MPP_VERSION_S *pstVersion);
|
||||
|
||||
/*
|
||||
** u64Base is the global PTS of the system.
|
||||
** ADVICE:
|
||||
** 1. Better to call FY_MPI_SYS_GetCurPts on the host board to get u64Base.
|
||||
** 2. When os start up, call FY_MPI_SYS_InitPtsBase to set the init PTS.
|
||||
** 3. When media bussines is running, synchronize the PTS one time per minute
|
||||
** by calling FY_MPI_SYS_SyncPts.
|
||||
*/
|
||||
FY_S32 FY_MPI_SYS_GetCurPts(FY_U64 *pu64CurPts);
|
||||
FY_S32 FY_MPI_SYS_InitPtsBase(FY_U64 u64PtsBase);
|
||||
FY_S32 FY_MPI_SYS_SyncPts(FY_U64 u64PtsBase);
|
||||
|
||||
/* alloc mmz memory in user context */
|
||||
FY_S32 FY_MPI_SYS_MmzAlloc(FY_U32 *pu32PhyAddr, FY_VOID **ppVirtAddr,
|
||||
const FY_CHAR *strMmb, const FY_CHAR *strZone, FY_U32 u32Len);
|
||||
|
||||
/* alloc mmz memory with cache */
|
||||
FY_S32 FY_MPI_SYS_MmzAlloc_Cached(FY_U32 *pu32PhyAddr, FY_VOID **ppVitAddr,
|
||||
const FY_CHAR *pstrMmb, const FY_CHAR *pstrZone, FY_U32 u32Len);
|
||||
|
||||
/* free mmz memory in user context */
|
||||
FY_S32 FY_MPI_SYS_MmzFree(FY_U32 u32PhyAddr, FY_VOID *pVirtAddr);
|
||||
|
||||
/* fulsh cache */
|
||||
FY_S32 FY_MPI_SYS_MmzFlushCache(FY_U32 u32PhyAddr, FY_VOID *pVitAddr, FY_U32 u32Size);
|
||||
|
||||
/*
|
||||
** Call the mmap function to map physical address to virtual address
|
||||
** The system function mmap is too complicated, so we packge it.
|
||||
*/
|
||||
FY_VOID * FY_MPI_SYS_Mmap(FY_U32 u32PhyAddr, FY_U32 u32Size);
|
||||
FY_VOID* FY_MPI_SYS_MmapCache(FY_U32 u32PhyAddr, FY_U32 u32Size);
|
||||
FY_S32 FY_MPI_SYS_Munmap(FY_VOID* pVirAddr, FY_U32 u32Size);
|
||||
FY_S32 FY_MPI_SYS_MflushCache(FY_U32 u32PhyAddr, FY_VOID *pVirAddr, FY_U32 u32Size);
|
||||
|
||||
|
||||
/*
|
||||
** Access the physical address.
|
||||
** You can use this function to access memory address or register address.
|
||||
*/
|
||||
FY_S32 FY_MPI_SYS_SetReg(FY_U32 u32Addr, FY_U32 u32Value);
|
||||
FY_S32 FY_MPI_SYS_GetReg(FY_U32 u32Addr, FY_U32 *pu32Value);
|
||||
|
||||
FY_S32 FY_MPI_SYS_SetMemConf(MPP_CHN_S *pstMppChn,const FY_CHAR *pcMmzName);
|
||||
FY_S32 FY_MPI_SYS_GetMemConf(MPP_CHN_S *pstMppChn,FY_CHAR *pcMmzName);
|
||||
|
||||
/* Close all the FD which is used by sys module */
|
||||
FY_S32 FY_MPI_SYS_CloseFd(FY_VOID);
|
||||
|
||||
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
#if __cplusplus
|
||||
}
|
||||
#endif
|
||||
#endif /* End of #ifdef __cplusplus */
|
||||
|
||||
#endif /*__MPI_SYS_H__ */
|
||||
|
@ -1,334 +0,0 @@
|
||||
#ifndef _FY_API_TDE_H_
|
||||
#define _FY_API_TDE_H_
|
||||
|
||||
#ifdef __cplusplus
|
||||
#if __cplusplus
|
||||
extern "C" {
|
||||
#endif /* __cplusplus */
|
||||
#endif /* __cplusplus */
|
||||
|
||||
#include "include/fy_type.h"
|
||||
#include "include/fy_comm_tde.h"
|
||||
|
||||
#define FY_TDE_Open FY_TDE2_Open
|
||||
#define FY_TDE_Close FY_TDE2_Close
|
||||
#define FY_TDE_BeginJob FY_TDE2_BeginJob
|
||||
|
||||
|
||||
/*****************************************************************************
|
||||
* Function: FY_TDE2_Open
|
||||
* Description: Open the TDE device
|
||||
* Input: None
|
||||
* Return: Success / Error code
|
||||
*****************************************************************************/
|
||||
FY_S32 FY_TDE2_Open(FY_VOID);
|
||||
|
||||
/*****************************************************************************
|
||||
* Function: FY_TDE2_Close
|
||||
* Description: Close the TDE device
|
||||
* Input: None
|
||||
* Return: None
|
||||
*****************************************************************************/
|
||||
FY_VOID FY_TDE2_Close(FY_VOID);
|
||||
|
||||
/*****************************************************************************
|
||||
* Function: FY_TDE2_BeginJob
|
||||
* Description: Create a TDE job, get a TDE job handle
|
||||
* Input: None
|
||||
* Return: tde handle / Error code
|
||||
*****************************************************************************/
|
||||
TDE_HANDLE FY_TDE2_BeginJob(FY_VOID);
|
||||
|
||||
/*****************************************************************************
|
||||
* Function: FY_TDE2_EndJob
|
||||
* Description: Submit a TDE job
|
||||
* Input: s32Handle: job handle
|
||||
* bSync: if synchronous
|
||||
* bBlock: if blocked
|
||||
* u32TimeOut: timeout value(in 10ms)
|
||||
* Return: Success / Error code
|
||||
*****************************************************************************/
|
||||
FY_S32 FY_TDE2_EndJob(TDE_HANDLE s32Handle, FY_BOOL bSync, FY_BOOL bBlock, FY_U32 u32TimeOut);
|
||||
|
||||
/*****************************************************************************
|
||||
* Function: FY_TDE2_CancelJob
|
||||
* Description: Cancel a specific TDE job, only successful before calling EndJob
|
||||
* Input: s32Handle: job handle
|
||||
* Return: Success / Error code
|
||||
*****************************************************************************/
|
||||
FY_S32 FY_TDE2_CancelJob(TDE_HANDLE s32Handle);
|
||||
|
||||
/*****************************************************************************
|
||||
* Function: FY_TDE2_WaitForDone
|
||||
* Description: Wait for a submitted job to finish
|
||||
* Input: s32Handle: job handle
|
||||
* Return: Success / Error code
|
||||
*****************************************************************************/
|
||||
FY_S32 FY_TDE2_WaitForDone(TDE_HANDLE s32Handle);
|
||||
|
||||
/*****************************************************************************
|
||||
* Function: FY_TDE2_WaitAllDone
|
||||
* Description: Wait for all submitted jobs to finish
|
||||
* Input: None
|
||||
* Return: Success / Error code
|
||||
*****************************************************************************/
|
||||
FY_S32 FY_TDE2_WaitAllDone(FY_VOID);
|
||||
|
||||
/*****************************************************************************
|
||||
* Function: FY_TDE2_Reset
|
||||
* Description: Reset tde
|
||||
* Input: None
|
||||
* Return: Success / Error code
|
||||
*****************************************************************************/
|
||||
FY_S32 FY_TDE2_Reset(FY_VOID);
|
||||
|
||||
/*****************************************************************************
|
||||
* Function: FY_TDE2_SetDeflickerLevel
|
||||
* Description: Set the anti-flicker level
|
||||
* Input: enDeflickerLevel: anti-flicker level
|
||||
* Return: Success / Error code
|
||||
*****************************************************************************/
|
||||
FY_S32 FY_TDE2_SetDeflickerLevel(TDE_DEFLICKER_LEVEL_E enDeflickerLevel);
|
||||
|
||||
/*****************************************************************************
|
||||
* Function: FY_TDE2_GetDeflickerLevel
|
||||
* Description: Get the anti-flicker level
|
||||
* Input: pDeflickerLevel: to save the anti-flicker level
|
||||
* Return: Success / Error code
|
||||
*****************************************************************************/
|
||||
FY_S32 FY_TDE2_GetDeflickerLevel(TDE_DEFLICKER_LEVEL_E *pDeflickerLevel);
|
||||
|
||||
/*****************************************************************************
|
||||
* Function: FY_TDE2_SetAlphaThresholdValue
|
||||
* Description: Set the anti-flicker level
|
||||
* Input: u8ThresholdValue: Alpha threshold
|
||||
* Return: Success / Error code
|
||||
*****************************************************************************/
|
||||
FY_S32 FY_TDE2_SetAlphaThresholdValue(FY_U8 u8ThresholdValue);
|
||||
|
||||
/*****************************************************************************
|
||||
* Function: FY_TDE2_GetAlphaThresholdValue
|
||||
* Description: Get the anti-flicker level
|
||||
* Input: pu8ThresholdValue: to save the alpha threshold
|
||||
* Return: Success / Error code
|
||||
*****************************************************************************/
|
||||
FY_S32 FY_TDE2_GetAlphaThresholdValue(FY_U8 *pu8ThresholdValue);
|
||||
|
||||
/*****************************************************************************
|
||||
* Function: FY_TDE2_GetAlphaThresholdValue
|
||||
* Description: Enable or disable alpha judgment
|
||||
* Input: bEnAlphaThreshold: whether to enable alpha judgment
|
||||
* Return: Success / Error code
|
||||
*****************************************************************************/
|
||||
FY_S32 FY_TDE2_SetAlphaThresholdState(FY_BOOL bEnAlphaThreshold);
|
||||
|
||||
/*****************************************************************************
|
||||
* Function: FY_TDE2_GetAlphaThresholdState
|
||||
* Description: Get alpha judgment state
|
||||
* Input: p_bEnAlphaThreshold: To save the alpha judgment state
|
||||
* Return: Success / Error code
|
||||
*****************************************************************************/
|
||||
FY_S32 FY_TDE2_GetAlphaThresholdState(FY_BOOL * p_bEnAlphaThreshold);
|
||||
|
||||
/*****************************************************************************
|
||||
* Function: FY_TDE2_QuickCopy
|
||||
* Description: Just quick copy, the size of source region and destination region should be the same, so is the color format
|
||||
* Input: s32Handle: job handle
|
||||
* pSrc: the source picture information
|
||||
* pstSrcRect: the source picture operation region
|
||||
* pDst: the destination picture information
|
||||
* pstDstRect: the destination picture operation region
|
||||
* Return: Success / Error code
|
||||
*****************************************************************************/
|
||||
FY_S32 FY_TDE2_QuickCopy(TDE_HANDLE s32Handle, TDE2_SURFACE_S* pstSrc, TDE2_RECT_S *pstSrcRect,
|
||||
TDE2_SURFACE_S* pstDst, TDE2_RECT_S *pstDstRect);
|
||||
|
||||
/*****************************************************************************
|
||||
* Function: FY_TDE2_QuickFill
|
||||
* Description: Quick fill
|
||||
* Input: s32Handle: job handle
|
||||
* pDst: the destination picture information
|
||||
* pstDstRect: the destination picture operation region
|
||||
* u32FillData: the color value,its format should be the same to the destination picture
|
||||
* Return: Success / Error code
|
||||
*****************************************************************************/
|
||||
FY_S32 FY_TDE2_QuickFill(TDE_HANDLE s32Handle, TDE2_SURFACE_S* pstDst, TDE2_RECT_S *pstDstRect,
|
||||
FY_U32 u32FillData);
|
||||
|
||||
/*****************************************************************************
|
||||
* Function: FY_TDE2_QuickResize
|
||||
* Description: Add the raster bitmap scaling operation to a TDE job
|
||||
* Input: s32Handle: job handle
|
||||
* pSrc: the source picture information
|
||||
* pstSrcRect: the source picture operation region
|
||||
* pDst: the destination picture information
|
||||
* pstDstRect: the destination picture operation region
|
||||
* Return: Success / Error code
|
||||
*****************************************************************************/
|
||||
FY_S32 FY_TDE2_QuickResize(TDE_HANDLE s32Handle, TDE2_SURFACE_S* pstSrc, TDE2_RECT_S *pstSrcRect,
|
||||
TDE2_SURFACE_S* pstDst, TDE2_RECT_S *pstDstRect);
|
||||
|
||||
/*****************************************************************************
|
||||
* Function: FY_TDE2_QuickFlicker
|
||||
* Description: Add the anti-flicker operation to a TDE job
|
||||
* Input: s32Handle: job handle
|
||||
* pSrc: the source picture information
|
||||
* pstSrcRect: the source picture operation region
|
||||
* pDst: the destination picture information
|
||||
* pstDstRect: the destination picture operation region
|
||||
* Return: Success / Error code
|
||||
*****************************************************************************/
|
||||
FY_S32 FY_TDE2_QuickDeflicker(TDE_HANDLE s32Handle, TDE2_SURFACE_S* pstSrc, TDE2_RECT_S *pstSrcRect,
|
||||
TDE2_SURFACE_S* pstDst, TDE2_RECT_S *pstDstRect);
|
||||
|
||||
/*****************************************************************************
|
||||
* Function: FY_TDE2_Blit
|
||||
* Description: Add the transfer operation with additional functions performed on
|
||||
the raster bitmap to a TDE task
|
||||
* Input: s32Handle: job handle
|
||||
* pstBackGround: the background picture information
|
||||
* pstBackGroundRect: the background picture operation region
|
||||
* pstForeGround: the foreground picture information
|
||||
* pstForeGroundRect: the foreground picture operation region
|
||||
* pstDst: the destination picture information
|
||||
* pstDstRect: the destination picture operation region
|
||||
* pOpt: operation parameter settings
|
||||
* Return: Success / Error code
|
||||
*****************************************************************************/
|
||||
FY_S32 FY_TDE2_Bitblit(TDE_HANDLE s32Handle, TDE2_SURFACE_S* pstBackGround, TDE2_RECT_S *pstBackGroundRect,
|
||||
TDE2_SURFACE_S* pstForeGround, TDE2_RECT_S *pstForeGroundRect, TDE2_SURFACE_S* pstDst,
|
||||
TDE2_RECT_S *pstDstRect, TDE2_OPT_S* pstOpt);
|
||||
|
||||
/*****************************************************************************
|
||||
* Function: FY_TDE2_SolidDraw
|
||||
* Description: Add the filling operation with additional functions performed on
|
||||
the raster bitmap to a TDE task
|
||||
* Input: s32Handle: job handle
|
||||
* pstForeGround: the foreground picture information
|
||||
* pstForeGroundRect: the source picture operation region
|
||||
* pstDst: the background picture information
|
||||
* pstDstRect: the destination picture operation region
|
||||
* pstFillColor: the color value
|
||||
* pstOpt: operation parameter settings
|
||||
* Return: Success / Error code
|
||||
*****************************************************************************/
|
||||
FY_S32 FY_TDE2_SolidDraw(TDE_HANDLE s32Handle, TDE2_SURFACE_S* pstForeGround, TDE2_RECT_S *pstForeGroundRect,
|
||||
TDE2_SURFACE_S *pstDst,
|
||||
TDE2_RECT_S *pstDstRect, TDE2_FILLCOLOR_S *pstFillColor,
|
||||
TDE2_OPT_S *pstOpt);
|
||||
|
||||
/*****************************************************************************
|
||||
* Function: FY_TDE2_DoCompress
|
||||
* Description: Compress the data
|
||||
* Input: pstSrc: the picture information needs be compressed
|
||||
pstDst: the picture information compressed
|
||||
* Return: Success / Error code
|
||||
*****************************************************************************/
|
||||
FY_S32 FY_TDE2_DoCompress(TDE_HANDLE s32Handle, TDE2_SURFACE_S* pstSrc, TDE2_SURFACE_S* pstDst);
|
||||
|
||||
/*****************************************************************************
|
||||
* Function: FY_TDE2_DeCompress
|
||||
* Description: Decompress the data
|
||||
* Input: pstSrc: the picture information compressed
|
||||
pstDst: the original picture information before compressed
|
||||
* Return: Success / Error code
|
||||
*****************************************************************************/
|
||||
FY_S32 FY_TDE2_DeCompress(TDE_HANDLE s32Handle, TDE2_SURFACE_S* pstSrc, TDE2_SURFACE_S* pstDst);
|
||||
|
||||
/*****************************************************************************
|
||||
* Function: FY_TDE2_MbBlit
|
||||
* Description: Add the transfer operation with additional functions performed on
|
||||
the macroblock bitmap to a TDE task
|
||||
* Input: s32Handle: job handle
|
||||
* pstMB: Surface of the macroblock
|
||||
* pstDst: Operating region of the macroblock
|
||||
* pstDstRect: the destination picture operation region
|
||||
* pstMbOpt: operation parameter settings
|
||||
* Return: Success / Error code
|
||||
*****************************************************************************/
|
||||
FY_S32 FY_TDE2_MbBlit(TDE_HANDLE s32Handle, TDE2_MB_S* pstMB, TDE2_RECT_S *pstMbRect, TDE2_SURFACE_S* pstDst, TDE2_RECT_S *pstDstRect,
|
||||
TDE2_MBOPT_S* pstMbOpt);
|
||||
|
||||
/*****************************************************************************
|
||||
* Function: FY_TDE2_BitmapMaskRop
|
||||
* Description: Add the mask raster operation (ROP) operation performed
|
||||
on the raster bitmap to a TDE task.
|
||||
* Input: s32Handle: job handle
|
||||
* pstBackGround: the background picture information
|
||||
* pstBackGroundRect: the background picture operation region
|
||||
* pstForeGround: the foreground picture information
|
||||
* pstForeGroundRect: the source picture operation region
|
||||
* pstMask: mask picture information
|
||||
* pstMaskRect: operating region of the mask picture
|
||||
* pstDst: the destination picture information
|
||||
* pstDstRect: the destination picture operation region
|
||||
* enRopCode_Color: ROP operation code of the color component
|
||||
* enRopCode_Alpha: ROP operation code of the alpha component
|
||||
* Return: Success / Error code
|
||||
*****************************************************************************/
|
||||
FY_S32 FY_TDE2_BitmapMaskRop(TDE_HANDLE s32Handle,
|
||||
TDE2_SURFACE_S* pstBackGround, TDE2_RECT_S *pstBackGroundRect,
|
||||
TDE2_SURFACE_S* pstForeGround, TDE2_RECT_S *pstForeGroundRect,
|
||||
TDE2_SURFACE_S* pstMask, TDE2_RECT_S *pstMaskRect,
|
||||
TDE2_SURFACE_S* pstDst, TDE2_RECT_S *pstDstRect,
|
||||
TDE2_ROP_CODE_E enRopCode_Color, TDE2_ROP_CODE_E enRopCode_Alpha);
|
||||
|
||||
/*****************************************************************************
|
||||
* Function: FY_TDE2_BitmapMaskBlend
|
||||
* Description: Add the mask blending operation performed on the raster
|
||||
bitmap to a TDE task
|
||||
* Input: s32Handle: job handle
|
||||
* pstBackGround: the background picture information
|
||||
* pstBackGroundRect: the background picture operation region
|
||||
* pstForeGround: the foreground picture information
|
||||
* pstForeGroundRect: the foreground picture operation region
|
||||
* pstMask: mask picture information
|
||||
* pstMaskRect: operating region of the mask picture
|
||||
* pstDst: the destination picture information
|
||||
* pstDstRect: the destination picture operation region
|
||||
* u8Alpha: global alpha value during alpha blending
|
||||
* enBlendMode: alpha blending mode
|
||||
* Return: Success / Error code
|
||||
*****************************************************************************/
|
||||
FY_S32 FY_TDE2_BitmapMaskBlend(TDE_HANDLE s32Handle,
|
||||
TDE2_SURFACE_S* pstBackGround, TDE2_RECT_S *pstBackGroundRect,
|
||||
TDE2_SURFACE_S* pstForeGround, TDE2_RECT_S *pstForeGroundRect,
|
||||
TDE2_SURFACE_S* pstMask, TDE2_RECT_S *pstMaskRect,
|
||||
TDE2_SURFACE_S* pstDst, TDE2_RECT_S *pstDstRect,
|
||||
FY_U8 u8Alpha, TDE2_ALUCMD_E enBlendMode);
|
||||
|
||||
/*****************************************************************************
|
||||
* Function: FY_TDE2_PatternFill
|
||||
* Description: Pattern fill
|
||||
*Input: s32Handle: job handle
|
||||
* pstBackGround: the background picture information
|
||||
* pstBackGroundRect: the background picture operation region
|
||||
* pstForeGround: the foreground picture information
|
||||
* pstForeGroundRect: the foreground picture operation region
|
||||
* pstDst: the destination picture information
|
||||
* pstDstRect: the destination picture operation region
|
||||
* pstOpt: operation parameter settings
|
||||
* Return: Success / Error code
|
||||
*****************************************************************************/
|
||||
FY_S32 FY_TDE2_PatternFill(TDE_HANDLE s32Handle, TDE2_SURFACE_S *pstBackGround,
|
||||
TDE2_RECT_S *pstBackGroundRect, TDE2_SURFACE_S *pstForeGround,
|
||||
TDE2_RECT_S *pstForeGroundRect, TDE2_SURFACE_S *pstDst,
|
||||
TDE2_RECT_S *pstDstRect, TDE2_PATTERN_FILL_OPT_S *pstOpt);
|
||||
|
||||
/*****************************************************************************
|
||||
* Function: FY_TDE2_EnableRegionDeflicker
|
||||
* Description: To enable or disable the regional anti-flicker function
|
||||
* Input: bRegionDeflicker: enable flag
|
||||
* Return: Success / Error code
|
||||
*****************************************************************************/
|
||||
FY_S32 FY_TDE2_EnableRegionDeflicker(FY_BOOL bRegionDeflicker);
|
||||
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
#if __cplusplus
|
||||
}
|
||||
#endif /* __cplusplus */
|
||||
#endif /* __cplusplus */
|
||||
|
||||
#endif /* _FY_API_TDE_H_ */
|
@ -1,49 +0,0 @@
|
||||
#ifndef __MPI_VB_H__
|
||||
#define __MPI_VB_H__
|
||||
|
||||
#include "include/fy_comm_vb.h"
|
||||
#include "include/fy_comm_sys.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
#if __cplusplus
|
||||
extern "C"{
|
||||
#endif
|
||||
#endif /* End of #ifdef __cplusplus */
|
||||
|
||||
VB_POOL FY_MPI_VB_CreatePool(FY_U32 u32BlkSize,FY_U32 u32BlkCnt,const FY_CHAR *pcMmzName);
|
||||
FY_S32 FY_MPI_VB_DestroyPool(VB_POOL Pool);
|
||||
|
||||
VB_BLK FY_MPI_VB_GetBlock(VB_POOL Pool, FY_U32 u32BlkSize,const FY_CHAR *pcMmzName);
|
||||
FY_S32 FY_MPI_VB_ReleaseBlock(VB_BLK Block);
|
||||
|
||||
FY_U32 FY_MPI_VB_Handle2PhysAddr(VB_BLK Block);
|
||||
VB_POOL FY_MPI_VB_Handle2PoolId(VB_BLK Block);
|
||||
FY_S32 FY_MPI_VB_InquireUserCnt(VB_BLK Block);
|
||||
|
||||
FY_S32 FY_MPI_VB_Init(FY_VOID);
|
||||
FY_S32 FY_MPI_VB_Exit(FY_VOID);
|
||||
FY_S32 FY_MPI_VB_SetConf(const VB_CONF_S *pstVbConf);
|
||||
FY_S32 FY_MPI_VB_GetConf(VB_CONF_S *pstVbConf);
|
||||
|
||||
FY_S32 FY_MPI_VB_MmapPool(VB_POOL Pool);
|
||||
FY_S32 FY_MPI_VB_MunmapPool(VB_POOL Pool);
|
||||
|
||||
FY_S32 FY_MPI_VB_GetBlkVirAddr(VB_POOL Pool, FY_U32 u32PhyAddr, FY_VOID **ppVirAddr);
|
||||
|
||||
FY_S32 FY_MPI_VB_InitModCommPool(VB_UID_E enVbUid);
|
||||
FY_S32 FY_MPI_VB_ExitModCommPool(VB_UID_E enVbUid);
|
||||
|
||||
FY_S32 FY_MPI_VB_SetModPoolConf(VB_UID_E enVbUid, const VB_CONF_S *pstVbConf);
|
||||
FY_S32 FY_MPI_VB_GetModPoolConf(VB_UID_E enVbUid, VB_CONF_S *pstVbConf);
|
||||
|
||||
VB_POOL FY_MPI_VB_CreateVirtualVbPool(FY_U32 u32BlkCnt, const FY_CHAR *pcMmzName);
|
||||
VB_BLK FY_MPI_VB_AddBlock(VB_POOL Pool , FY_U32 u32PhyAddr, FY_U32 u32Size);
|
||||
|
||||
#ifdef __cplusplus
|
||||
#if __cplusplus
|
||||
}
|
||||
#endif
|
||||
#endif /* End of #ifdef __cplusplus */
|
||||
|
||||
#endif /*__MPI_VI_H__ */
|
||||
|
@ -1,96 +0,0 @@
|
||||
#ifndef __MPI_VGS_H__
|
||||
#define __MPI_VGS_H__
|
||||
|
||||
#include "include/fy_common.h"
|
||||
#include "include/fy_comm_video.h"
|
||||
#include "include/fy_comm_vgs.h"
|
||||
#include "include/fy_comm_tde.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
#if __cplusplus
|
||||
extern "C"{
|
||||
#endif
|
||||
#endif /* __cplusplus */
|
||||
|
||||
|
||||
|
||||
/*****************************************************************************
|
||||
* Function: FY_MPI_VGS_BeginJob
|
||||
* Description: Begin a vgs job,then add task into the job,vgs will finish all the task in the job.
|
||||
* Input: VGS_HANDLE *phHandle
|
||||
* Return: Success / Error code
|
||||
*****************************************************************************/
|
||||
FY_S32 FY_MPI_VGS_BeginJob(VGS_HANDLE *phHandle);
|
||||
|
||||
/*****************************************************************************
|
||||
* Function: FY_MPI_VGS_EndJob
|
||||
* Description: End a job,all tasks in the job will be submmitted to vgs.
|
||||
* Input: VGS_HANDLE *phHandle
|
||||
* Return: Success / Error code
|
||||
*****************************************************************************/
|
||||
FY_S32 FY_MPI_VGS_EndJob(VGS_HANDLE hHandle);
|
||||
|
||||
/*****************************************************************************
|
||||
* Function: FY_MPI_VGS_CancelJob
|
||||
* Description: Cancel a job ,then all tasks in the job will not be submmitted to vgs.
|
||||
* Input: VGS_HANDLE *phHandle
|
||||
* Return: Success / Error code
|
||||
*****************************************************************************/
|
||||
FY_S32 FY_MPI_VGS_CancelJob(VGS_HANDLE hHandle);
|
||||
|
||||
/*****************************************************************************
|
||||
* Function: FY_MPI_VGS_AddScaleTask
|
||||
* Description: Add a task to a vgs job.
|
||||
* Input: VGS_HANDLE hHandle
|
||||
* Return: Success / Error code
|
||||
*****************************************************************************/
|
||||
FY_S32 FY_MPI_VGS_AddScaleTask(VGS_HANDLE hHandle, VGS_TASK_ATTR_S *pstTask);
|
||||
|
||||
/*****************************************************************************
|
||||
* Function: FY_MPI_VGS_AddDrawLineTask
|
||||
* Description: Add a draw line task into a job.
|
||||
* Input: VGS_HANDLE hHandle
|
||||
* Return: Success / Error code
|
||||
*****************************************************************************/
|
||||
FY_S32 FY_MPI_VGS_AddDrawLineTask(VGS_HANDLE hHandle, VGS_TASK_ATTR_S *pstTask, VGS_LINE_S astVgsDrawLine[], FY_U32 u32ArraySize);
|
||||
|
||||
FY_S32 FY_MPI_VGS_AddCombineTask(VGS_HANDLE hHandle, VIDEO_FRAME_S *pstVFrmIn, RECT_S *pstInRect, VIDEO_FRAME_S *pstVFrmOut, RECT_S *pstOutRect);
|
||||
|
||||
/*****************************************************************************
|
||||
* Function: FY_MPI_VGS_DeCompress
|
||||
* Description: Add a deCompress task into a job.
|
||||
* Input: VGS_HANDLE hHandle
|
||||
* Return: Success / Error code
|
||||
*****************************************************************************/
|
||||
FY_S32 FY_MPI_VGS_DeCompress(VGS_HANDLE phHandle, const VIDEO_FRAME_S* pstVFrmIn, VIDEO_FRAME_S * pstVFrmOut);
|
||||
|
||||
/*****************************************************************************
|
||||
* Function: FY_MPI_VGS_AddCoverTask
|
||||
* Description: Add a cover task into a job.
|
||||
* Input: VGS_HANDLE hHandle
|
||||
* Return: Success / Error code
|
||||
*****************************************************************************/
|
||||
FY_S32 FY_MPI_VGS_AddCoverTask(VGS_HANDLE hHandle, VGS_TASK_ATTR_S *pstTask, VGS_COVER_S astVgsAddCover[], FY_U32 u32ArraySize);
|
||||
|
||||
/*****************************************************************************
|
||||
* Function: FY_MPI_VGS_AddOsdTask
|
||||
* Description: Add a osd task into a job.
|
||||
* Input: VGS_HANDLE hHandle
|
||||
* Return: Success / Error code
|
||||
*****************************************************************************/
|
||||
FY_S32 FY_MPI_VGS_AddOsdTask(VGS_HANDLE hHandle, VGS_TASK_ATTR_S *pstTask, VGS_OSD_S astVgsAddOsd[], FY_U32 u32ArraySize);
|
||||
|
||||
FY_S32 FY_MPI_VGS_FormatConvert(VGS_HANDLE hHandle, VIDEO_FRAME_S* pstFrame, TDE2_SURFACE_S* pstSurface, FY_BOOL bFrmToSur);
|
||||
|
||||
FY_S32 FY_MPI_VGS_Rotate(VGS_TASK_ATTR_S *pstTask, VGS_ROTATE_S *pstRotate);
|
||||
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
#if __cplusplus
|
||||
}
|
||||
#endif
|
||||
#endif /* __cplusplus */
|
||||
|
||||
#endif /* __MPI_VGS_H__ */
|
||||
|
@ -1,50 +0,0 @@
|
||||
#ifndef __MPI_VPPU_H__
|
||||
#define __MPI_VPPU_H__
|
||||
|
||||
#include "include/fy_comm_video.h"
|
||||
#include "include/fy_comm_vppu.h"
|
||||
#include "include/drv/vgs_drv_ioc.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
#if __cplusplus
|
||||
extern "C"
|
||||
{
|
||||
#endif
|
||||
#endif /* __cplusplus */
|
||||
|
||||
FY_S32 MPI_VPPU_Init();
|
||||
FY_S32 MPI_VPPU_Exit();
|
||||
|
||||
FY_S32 FY_MPI_VPPU_CreateChn(VPPU_CHN VppuChn);
|
||||
|
||||
FY_S32 FY_MPI_VPPU_DestroyChn(VPPU_CHN VppuChn);
|
||||
|
||||
FY_S32 FY_MPI_VPPU_SetChnMode(VPPU_CHN VppuChn, VPPU_PTH VppuPth, VPPU_CHN_MODE_S *pstVppuMode);
|
||||
|
||||
FY_S32 FY_MPI_VPPU_GetChnMode(VPPU_CHN VppuChn, VPPU_PTH VppuPth, VPPU_CHN_MODE_S *pstVppuMode);
|
||||
|
||||
FY_S32 FY_MPI_VPPU_SetChnCrop(VPPU_CHN VppuChn, VPPU_CROP_INFO_S *pstCropInfo);
|
||||
|
||||
FY_S32 FY_MPI_VPPU_GetChnCrop(VPPU_CHN VppuChn, VPPU_CROP_INFO_S *pstCropInfo);
|
||||
|
||||
FY_S32 FY_MPI_VPPU_SetChnRotate(VPPU_CHN VppuChn, VPPU_PTH VppuPth, ROTATE_E enRotate);
|
||||
|
||||
FY_S32 FY_MPI_VPPU_GetChnRotate(VPPU_CHN VppuChn, VPPU_PTH VppuPth, ROTATE_E *penRotate);
|
||||
|
||||
FY_S32 FY_MPI_VPPU_ImageConvert(const VIDEO_FRAME_S *pstVFrmIn, VIDEO_FRAME_S *pstVFrmOut);
|
||||
|
||||
FY_S32 FY_MPI_VPPU_FormatConvert(VIDEO_FRAME_S* pstFrame, TDE2_SURFACE_S* pstSurface, FY_BOOL bFrmToSur);
|
||||
|
||||
FY_S32 FY_MPI_VPPU_SendFrame(VPPU_CHN VppuChn, const VIDEO_FRAME_INFO_S *pstVFrm, FY_BOOL bPlayMode, FY_U32 u32TimeOut);
|
||||
|
||||
FY_S32 FY_MPI_VPPU_Query(VPPU_CHN VppuChn, FY_U32 *pSendNum);
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
#if __cplusplus
|
||||
}
|
||||
#endif
|
||||
#endif /* __cplusplus */
|
||||
|
||||
#endif /* __MPI_VPPU_H__ */
|
||||
|
@ -1,310 +0,0 @@
|
||||
/******************************************************************************
|
||||
Copyright(c) 2016-2018 Digital Power Inc.
|
||||
File name: vdecapi.h
|
||||
Author: LiuZhengzhong
|
||||
Version: 1.0.0
|
||||
Date: 2018/1/30
|
||||
Description: Platform of DP X5 video decode C api
|
||||
History:
|
||||
Bug report: liuzhengzhong@d-power.com.cn
|
||||
******************************************************************************/
|
||||
|
||||
#ifndef __VDECAPI_H__
|
||||
#define __VDECAPI_H__
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C"
|
||||
{
|
||||
#endif
|
||||
|
||||
typedef long long int64_t;
|
||||
|
||||
typedef enum _PAYLOAD_TYPE_E
|
||||
{
|
||||
VDEC_PAYLOAD_TYPE_H264 = 1,
|
||||
VDEC_PAYLOAD_TYPE_MJPEG = 2,
|
||||
VDEC_PAYLOAD_TYPE_H265 = 3,
|
||||
VDEC_PAYLOAD_TYPE_MAX,
|
||||
} VDEC_PAYLOAD_TYPE_E;
|
||||
|
||||
typedef enum _PIXEL_FORMAT_E
|
||||
{
|
||||
FORMAT_YV12 = 1,
|
||||
FORMAT_NV21 = 2,
|
||||
|
||||
} PIXEL_FORMAT_E;
|
||||
|
||||
// 解码器属性
|
||||
typedef struct _VDEC_CHN_ATTR_S
|
||||
{
|
||||
// 解码类型,默认PAYLOAD_TYPE_H264
|
||||
VDEC_PAYLOAD_TYPE_E deType;
|
||||
// 解码输出格式,默认YV12
|
||||
PIXEL_FORMAT_E FormatType;
|
||||
// 解码宽度,H264流中携带长宽信息,所以可以不指定
|
||||
// 对于X9 JPG解码,这个参数表示填充后的宽度,填0输出原始宽度
|
||||
// 若X9解码时,指定了非0,且JPG原始宽度大于填充宽度,则会自动缩放
|
||||
unsigned int u32PicWidth;
|
||||
// 解码高度
|
||||
// 对于X9 JPG解码,这个参数表示填充后的高度,填0输出原始高度
|
||||
// 若X9解码时,指定了非0,且JPG原始宽度大于填充高度,则会自动缩放
|
||||
unsigned int u32PicHight;
|
||||
// 解码帧率,默认25
|
||||
unsigned int u32FrameRate;
|
||||
// 码流缓冲区大小,范围0x10000-0x800000,默认0x100000
|
||||
unsigned int BufSize;
|
||||
|
||||
} VDEC_CHN_ATTR_S;
|
||||
|
||||
// 码流属性
|
||||
typedef struct _VDEC_STREAM_S
|
||||
{
|
||||
// 码流地址
|
||||
unsigned char *pu8Addr;
|
||||
// 码流长度
|
||||
unsigned int u32Len;
|
||||
// 时间戳
|
||||
unsigned long long u64PTS;
|
||||
|
||||
} VDEC_STREAM_S, *PTR_VDEC_STREAM_S;
|
||||
|
||||
// 通道状态
|
||||
typedef struct _VDEC_CHN_STAT_S
|
||||
{
|
||||
// 解码类型
|
||||
VDEC_PAYLOAD_TYPE_E deType;
|
||||
// 缓冲区内有效未解码数据大小,字节
|
||||
unsigned int u32LeftPics;
|
||||
// 缓冲区内有效未解码数据帧数
|
||||
unsigned int u32FrameNum;
|
||||
// 码流buffer总大小,字节,若解码器未初始化,为0
|
||||
unsigned int u32BufSize;
|
||||
|
||||
} VDEC_CHN_STAT_S;
|
||||
|
||||
typedef enum _VDEC_FORMAT_E
|
||||
{
|
||||
HWC_FORMAT_MINVALUE = 0x50,
|
||||
HWC_FORMAT_RGBA_8888 = 0x51,
|
||||
HWC_FORMAT_RGB_565 = 0x52,
|
||||
HWC_FORMAT_BGRA_8888 = 0x53,
|
||||
HWC_FORMAT_YCbYCr_422_I = 0x54,
|
||||
HWC_FORMAT_CbYCrY_422_I = 0x55,
|
||||
HWC_FORMAT_MBYUV420 = 0x56,
|
||||
HWC_FORMAT_MBYUV422 = 0x57,
|
||||
HWC_FORMAT_YUV420PLANAR = 0x58,
|
||||
HWC_FORMAT_YUV411PLANAR = 0x59,
|
||||
HWC_FORMAT_YUV422PLANAR = 0x60,
|
||||
HWC_FORMAT_YUV444PLANAR = 0x61,
|
||||
HWC_FORMAT_YUV420UVC = 0x62,
|
||||
HWC_FORMAT_YUV420VUC = 0x63,
|
||||
HWC_FORMAT_YUV422UVC = 0x64,
|
||||
HWC_FORMAT_YUV422VUC = 0x65,
|
||||
HWC_FORMAT_YUV411UVC = 0x66,
|
||||
HWC_FORMAT_YUV411VUC = 0x67,
|
||||
// The actual color format is determined
|
||||
HWC_FORMAT_DEFAULT = 0x99,
|
||||
HWC_FORMAT_MAXVALUE = 0x100
|
||||
|
||||
} VDEC_FORMAT_E;
|
||||
|
||||
typedef struct _VDEC_SRC_INFO
|
||||
{
|
||||
unsigned int W;
|
||||
unsigned int H;
|
||||
unsigned int Crop_X;
|
||||
unsigned int Crop_Y;
|
||||
unsigned int Crop_W;
|
||||
unsigned int Crop_H;
|
||||
VDEC_FORMAT_E Format;
|
||||
|
||||
} VDEC_SRC_INFO;
|
||||
|
||||
// 解码图像信息
|
||||
typedef struct _VDEC_FRAME_S
|
||||
{
|
||||
// 图像信息
|
||||
VDEC_SRC_INFO SrcInfo;
|
||||
// 像素格式
|
||||
PIXEL_FORMAT_E enPixelFormat;
|
||||
// 物理地址
|
||||
// 若YV12格式:Frame->u32PhyAddr[1]是U地址,Frame->u32PhyAddr[2]是V地址
|
||||
// 若NV21格式:Frame->u32PhyAddr[1]是VU混合地址,Frame->u32PhyAddr[2]无效
|
||||
void *u32PhyAddr[3];
|
||||
// 虚拟地址
|
||||
// 若YV12格式:Frame->pVirAddr[1]是U地址,Frame->pVirAddr[2]是V地址
|
||||
// YV12内存分布:Y0Y1Y2Y3/V0/U0
|
||||
// 若NV21格式:Frame->pVirAddr[1]是VU混合地址,Frame->pVirAddr[2]无效
|
||||
// NV21内存分布:Y0Y1Y2Y3/V0U0
|
||||
void *pVirAddr[3];
|
||||
// 图像行宽,单位为像素
|
||||
unsigned int u32Stride;
|
||||
// 时间戳
|
||||
unsigned long long u64pts;
|
||||
// 解码器内显示队列中待显示图像个数
|
||||
unsigned int u32ValidPic;
|
||||
// 解码器内共有多少个图像Buf
|
||||
unsigned int u32TotalBuf;
|
||||
// 未被解码器和显示占用的图像Buf个数
|
||||
unsigned int u32EmptyBuf;
|
||||
// 内部使用,用户无需关心此字段
|
||||
void *Pic;
|
||||
|
||||
} VDEC_FRAME_S;
|
||||
|
||||
typedef enum _VDEC_STATUS
|
||||
{
|
||||
VDEC_RESULT_OK = 0,
|
||||
// 解码成功,输出了一帧图像
|
||||
VDEC_FRAME_DECODED = 1,
|
||||
// 解码成功,但没有图像输出,需要继续解码
|
||||
VDEC_CONTINUE = 2,
|
||||
// 解码成功,输出了一帧关键帧
|
||||
VDEC_KEYFRAME_DECODED = 3,
|
||||
// 当前无法获取到图像Buffer
|
||||
VDEC_NO_FRAME_BUFFER = 4,
|
||||
// 当前无法获取到码流数据
|
||||
VDEC_NO_BITSTREAM = 5,
|
||||
// 视频分辨率发生变化,无法继续
|
||||
VDEC_RESOLUTION_CHANGE = 6,
|
||||
// 不能支持的格式或申请内存失败,无法继续解码
|
||||
VDEC_UNSUPPORTED = -1,
|
||||
// 解码通道错误
|
||||
VDEC_CHANNEL_ERROR = -2,
|
||||
|
||||
} VDEC_STATUS;
|
||||
|
||||
#define MAX_VID_DECODE_CHANNEL 8
|
||||
|
||||
/******************************************************************************
|
||||
Function: VDEC_Init
|
||||
Description: 初始化视频解码器
|
||||
Param:
|
||||
Return: 成功返回1,失败返回0
|
||||
Others:
|
||||
******************************************************************************/
|
||||
int VDEC_Init(void);
|
||||
|
||||
/******************************************************************************
|
||||
Function: VDEC_DeInit
|
||||
Description: 反初始化视频解码器
|
||||
Param:
|
||||
Return: 成功返回1,失败返回0
|
||||
Others: 执行此函数会销毁所有视频通道
|
||||
******************************************************************************/
|
||||
int VDEC_DeInit(void);
|
||||
|
||||
/******************************************************************************
|
||||
Function: VDEC_CreateChn
|
||||
Description: 创建解码通道
|
||||
Param:
|
||||
Attr in 解码器属性
|
||||
Return: 成功返回大于等于0的通道号,失败返回-1
|
||||
Others:
|
||||
******************************************************************************/
|
||||
int VDEC_CreateChn(VDEC_CHN_ATTR_S *Attr);
|
||||
|
||||
/******************************************************************************
|
||||
Function: VDEC_DestroyChn
|
||||
Description: 销毁解码通道
|
||||
Param:
|
||||
Channel in 通道号
|
||||
Return: 成功返回1,失败返回0
|
||||
Others:
|
||||
******************************************************************************/
|
||||
int VDEC_DestroyChn(int Channel);
|
||||
|
||||
/******************************************************************************
|
||||
Function: VDEC_GetChnAttr
|
||||
Description: 获取通道属性
|
||||
Param:
|
||||
Channel in 指定通道号
|
||||
Attr out 接收数据结构体指针
|
||||
Return: 成功返回1,失败返回0
|
||||
Others: Attr的内容为强拷贝
|
||||
******************************************************************************/
|
||||
int VDEC_GetChnAttr(int Channel, VDEC_CHN_ATTR_S *Attr);
|
||||
|
||||
/******************************************************************************
|
||||
Function: VDEC_StartRecvStream
|
||||
Description: 开始解码
|
||||
Param:
|
||||
Channel in 指定通道号
|
||||
DropB in 当码流的时间戳比当前时间大时,是否丢弃B帧,取值0或1
|
||||
OnlyI in 只解码I帧,取值0或1
|
||||
Time in 当前时间,微秒,可以填0
|
||||
Return:
|
||||
Others: 解码一帧数据
|
||||
******************************************************************************/
|
||||
VDEC_STATUS VDEC_StartRecvStream(int Channel, unsigned int DropB, unsigned int OnlyI, int64_t Time);
|
||||
|
||||
/******************************************************************************
|
||||
Function: VDEC_StopRecvStream
|
||||
Description: 停止解码
|
||||
Param:
|
||||
Channel in 指定通道号
|
||||
Return:
|
||||
Others:
|
||||
******************************************************************************/
|
||||
VDEC_STATUS VDEC_StopRecvStream(int Channel);
|
||||
|
||||
/******************************************************************************
|
||||
Function: VDEC_SendStream
|
||||
Description: 向解码器送一帧数据
|
||||
Param:
|
||||
Channel in 指定通道号
|
||||
Stream in 码流信息
|
||||
Return: 成功返回1,失败返回0
|
||||
Others:
|
||||
******************************************************************************/
|
||||
int VDEC_SendStream(int Channel, VDEC_STREAM_S *Stream);
|
||||
|
||||
/******************************************************************************
|
||||
Function: VDEC_Query
|
||||
Description: 查询通道状态
|
||||
Param:
|
||||
Channel in 指定通道号
|
||||
Stat out 接收数据结构体指针
|
||||
Return: 成功返回1,失败返回0
|
||||
Others:
|
||||
******************************************************************************/
|
||||
int VDEC_Query(int Channel, VDEC_CHN_STAT_S *Stat);
|
||||
|
||||
/******************************************************************************
|
||||
Function: VDEC_ResetChn
|
||||
Description: 复位通道
|
||||
Param:
|
||||
Channel in 指定通道号
|
||||
Return: 成功返回1,失败返回0
|
||||
Others: 解码器被重置,但初始化信息被保留,码流Buffer被清空,图像数据被清空
|
||||
******************************************************************************/
|
||||
int VDEC_ResetChn(int Channel);
|
||||
|
||||
/******************************************************************************
|
||||
Function: VDEC_GetImage
|
||||
Description: 获取解码数据
|
||||
Param:
|
||||
Channel in 指定通道号
|
||||
Frame out 接收数据结构体指针
|
||||
Return: 成功返回1,失败返回0
|
||||
Others:
|
||||
******************************************************************************/
|
||||
int VDEC_GetImage(int Channel, VDEC_FRAME_S *Frame);
|
||||
|
||||
/******************************************************************************
|
||||
Function: VDEC_ReleaseImage
|
||||
Description: 释放解码数据
|
||||
Param:
|
||||
Channel in 指定通道号
|
||||
Frame in X5_VDEC_GetImage所得结构体指针
|
||||
Return: 成功返回1,失败返回0
|
||||
Others: X5_VDEC_GetImage与X5_VDEC_ReleaseImage必须串行,成对出现
|
||||
不允许出现调用两次X5_VDEC_GetImage再X5_VDEC_ReleaseImage两次的情况
|
||||
******************************************************************************/
|
||||
int VDEC_ReleaseImage(int Channel, VDEC_FRAME_S *Frame);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif // !__VDECAPI_H__
|
@ -1,224 +0,0 @@
|
||||
/******************************************************************************
|
||||
Copyright(c) 2016-2018 Digital Power Inc.
|
||||
File name: voapi.h
|
||||
Author: LiuZhengzhong
|
||||
Version: 1.0.0
|
||||
Date: 2018/1/30
|
||||
Description: Platform of DP X5 display C api
|
||||
History:
|
||||
Bug report: liuzhengzhong@d-power.com.cn
|
||||
******************************************************************************/
|
||||
|
||||
#ifndef __DISPLAY_H__
|
||||
#define __DISPLAY_H__
|
||||
|
||||
#include "VDecApi.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C"
|
||||
{
|
||||
#endif
|
||||
|
||||
typedef struct tagSYNC_INFO_S
|
||||
{
|
||||
|
||||
} SYNC_INFO_S;
|
||||
|
||||
typedef struct _PUB_ATTR_S
|
||||
{
|
||||
// 背景色,从低位起,ARGB排序
|
||||
unsigned int u32BgColor;
|
||||
// VO接口时序配置,空结构,相关参数已在系统配置中提供
|
||||
SYNC_INFO_S stSyncInfo;
|
||||
|
||||
} PUB_ATTR_S;
|
||||
|
||||
typedef struct _LAYER_RECT
|
||||
{
|
||||
// 图层的X坐标
|
||||
int X;
|
||||
// 图层的Y坐标
|
||||
int Y;
|
||||
// 图层的宽度
|
||||
unsigned int W;
|
||||
// 图层的高度
|
||||
unsigned int H;
|
||||
|
||||
} LAYER_RECT;
|
||||
|
||||
typedef enum _LAYER_ROTATE_E
|
||||
{
|
||||
ROTATE_NONE = 0,
|
||||
ROTATE_90 = 1,
|
||||
ROTATE_180 = 2,
|
||||
ROTATE_270 = 3,
|
||||
} LAYER_ROTATE_E;
|
||||
|
||||
typedef struct _LAYER_INFO
|
||||
{
|
||||
// 位置信息
|
||||
LAYER_RECT Rect;
|
||||
// 图层模式,0或1,0:带buffer的图层,1:无buffer,只用一个颜色值表示图像内容,通常使用带buffer的图层
|
||||
unsigned int LayerMode;
|
||||
// 仅当图层模式为1时此成员有效
|
||||
unsigned int Color;
|
||||
// 全局Alpha值,默认0xFF
|
||||
unsigned char AlphaValue;
|
||||
// 默认填0即可
|
||||
unsigned char Specified_Layer;
|
||||
// 是否在显示时旋转
|
||||
LAYER_ROTATE_E Rotate;
|
||||
} LAYER_INFO;
|
||||
|
||||
/******************************************************************************
|
||||
Function: Enable
|
||||
Description: 打开显示设备
|
||||
Param:
|
||||
Return: 成功返回1,失败返回0
|
||||
Others:
|
||||
******************************************************************************/
|
||||
int Enable(void);
|
||||
|
||||
/******************************************************************************
|
||||
Function: Disable
|
||||
Description: 关闭显示设备
|
||||
Param:
|
||||
Return: 成功返回1,失败返回0
|
||||
Others:
|
||||
******************************************************************************/
|
||||
int Disable(void);
|
||||
|
||||
/******************************************************************************
|
||||
Function: SetPubAttr
|
||||
Description: 设置VO公共属性
|
||||
Param:
|
||||
Attr in 属性
|
||||
Return: 成功返回1,失败返回0
|
||||
Others: 暂时只支持设置背景色
|
||||
******************************************************************************/
|
||||
int SetPubAttr(PUB_ATTR_S *Attr);
|
||||
|
||||
/******************************************************************************
|
||||
Function: GetPubAttr
|
||||
Description: 获取VO公共属性
|
||||
Param:
|
||||
Attr out 接收数据结构体指针
|
||||
Return: 成功返回1,失败返回0
|
||||
Others: 暂时只支持获取背景色信息
|
||||
******************************************************************************/
|
||||
int GetPubAttr(PUB_ATTR_S *Attr);
|
||||
|
||||
/******************************************************************************
|
||||
Function: EnableChn
|
||||
Description: 使能视频通道
|
||||
Param:
|
||||
Channel in 指定通道
|
||||
Info in 图层参数结构
|
||||
Return: 成功返回1,失败返回0
|
||||
Others: Channel取值范围是0和1,两个视频通道供使用
|
||||
使能通道的同时,会使能该通道的第0个图层
|
||||
******************************************************************************/
|
||||
int EnableChn(unsigned int Channel, LAYER_INFO *Info);
|
||||
|
||||
/******************************************************************************
|
||||
Function: DisableChn
|
||||
Description: 关闭视频通道
|
||||
Param:
|
||||
Channel in 指定通道
|
||||
Return: 成功返回1,失败返回0
|
||||
Others: Channel取值范围是0和1,两个视频通道供使用
|
||||
关闭通道的同时,会关闭该通道的第0个图层
|
||||
如果有其他图层存在,并且0图层关闭,其他图层也无法显示
|
||||
******************************************************************************/
|
||||
int DisableChn(unsigned int Channel);
|
||||
|
||||
/******************************************************************************
|
||||
Function: EnableVideoLayer
|
||||
Description: 使能视频层
|
||||
Param:
|
||||
Channel in 指定通道
|
||||
Layer in 指定图层
|
||||
Info in 图层参数结构
|
||||
Return: 成功返回1,失败返回0
|
||||
Others: Channel取值范围是0和1,两个视频通道供使用
|
||||
Layer取值范围是0到3,每个通道4层供使用
|
||||
******************************************************************************/
|
||||
int EnableVideoLayer(unsigned int Channel, unsigned int Layer, LAYER_INFO *Info);
|
||||
|
||||
/******************************************************************************
|
||||
Function: DisableVideoLayer
|
||||
Description: 关闭视频层
|
||||
Param:
|
||||
Channel in 指定通道
|
||||
Layer in 指定图层
|
||||
Return: 成功返回1,失败返回0
|
||||
Others: Channel取值范围是0和1,两个视频通道供使用
|
||||
Layer取值范围是0到3,每个通道4层供使用
|
||||
******************************************************************************/
|
||||
int DisableVideoLayer(unsigned int Channel, unsigned int Layer);
|
||||
|
||||
/******************************************************************************
|
||||
Function: SetVideoLayerAttr
|
||||
Description: 设置视频层属性
|
||||
Param:
|
||||
Channel in 指定通道
|
||||
Layer in 指定图层
|
||||
Info in 图层参数结构
|
||||
Return: 成功返回1,失败返回0
|
||||
Others: 空函数
|
||||
******************************************************************************/
|
||||
int SetVideoLayerAttr(unsigned int Channel, unsigned int Layer, LAYER_INFO *Info);
|
||||
|
||||
/******************************************************************************
|
||||
Function: GetVideoLayerAttr
|
||||
Description: 获取视频层属性
|
||||
Param:
|
||||
Channel in 指定通道
|
||||
Layer in 指定图层
|
||||
Info out 接收图层参数结构
|
||||
Return: 成功返回1,失败返回0
|
||||
Others: 空函数
|
||||
******************************************************************************/
|
||||
int GetVideoLayerAttr(unsigned int Channel, unsigned int Layer, LAYER_INFO *Info);
|
||||
|
||||
/******************************************************************************
|
||||
Function: SetZoomInWindow
|
||||
Description: 设置缩放窗口
|
||||
Param:
|
||||
Channel in 指定通道
|
||||
Layer in 指定图层
|
||||
SrcInfo in 图像信息结构
|
||||
Return: 成功返回1,失败返回0
|
||||
Others:
|
||||
******************************************************************************/
|
||||
int SetZoomInWindow(unsigned int Channel, unsigned int Layer, VDEC_SRC_INFO *SrcInfo);
|
||||
|
||||
/******************************************************************************
|
||||
Function: ChnShow
|
||||
Description: 显示指定窗口的图像
|
||||
Param:
|
||||
Channel in 指定通道
|
||||
Layer in 指定图层
|
||||
Frame in 解码后的Frame结构
|
||||
Return: 成功返回1,失败返回0
|
||||
Others:
|
||||
******************************************************************************/
|
||||
int ChnShow(unsigned int Channel, unsigned int Layer, VDEC_FRAME_S *Frame);
|
||||
|
||||
/******************************************************************************
|
||||
Function: Resize
|
||||
Description: 重新指定图层的位置和大小
|
||||
Param:
|
||||
Channel in 指定通道
|
||||
Layer in 指定图层
|
||||
Rect in 位置和大小
|
||||
Return: 成功返回1,失败返回0
|
||||
Others:
|
||||
******************************************************************************/
|
||||
int Resize(unsigned int Channel, unsigned int Layer, LAYER_RECT *Rect);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif // !__DISPLAY_H__
|
Binary file not shown.
Loading…
Reference in New Issue
Block a user