11bd4fe43Sopenharmony_ci/* 21bd4fe43Sopenharmony_ci * Copyright (c) 2022 HiSilicon (Shanghai) Technologies CO., LIMITED. 31bd4fe43Sopenharmony_ci * Licensed under the Apache License, Version 2.0 (the "License"); 41bd4fe43Sopenharmony_ci * you may not use this file except in compliance with the License. 51bd4fe43Sopenharmony_ci * You may obtain a copy of the License at 61bd4fe43Sopenharmony_ci * 71bd4fe43Sopenharmony_ci * http://www.apache.org/licenses/LICENSE-2.0 81bd4fe43Sopenharmony_ci * 91bd4fe43Sopenharmony_ci * Unless required by applicable law or agreed to in writing, software 101bd4fe43Sopenharmony_ci * distributed under the License is distributed on an "AS IS" BASIS, 111bd4fe43Sopenharmony_ci * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 121bd4fe43Sopenharmony_ci * See the License for the specific language governing permissions and 131bd4fe43Sopenharmony_ci * limitations under the License. 141bd4fe43Sopenharmony_ci */ 151bd4fe43Sopenharmony_ci 161bd4fe43Sopenharmony_ci#ifndef __HI_COMM_VGS_H__ 171bd4fe43Sopenharmony_ci#define __HI_COMM_VGS_H__ 181bd4fe43Sopenharmony_ci 191bd4fe43Sopenharmony_ci#include "hi_type.h" 201bd4fe43Sopenharmony_ci#include "hi_common.h" 211bd4fe43Sopenharmony_ci#include "hi_errno.h" 221bd4fe43Sopenharmony_ci#include "hi_comm_video.h" 231bd4fe43Sopenharmony_ci 241bd4fe43Sopenharmony_ci#ifdef __cplusplus 251bd4fe43Sopenharmony_ci#if __cplusplus 261bd4fe43Sopenharmony_ciextern "C" { 271bd4fe43Sopenharmony_ci#endif 281bd4fe43Sopenharmony_ci#endif /* __cplusplus */ 291bd4fe43Sopenharmony_ci 301bd4fe43Sopenharmony_ci/* failure caused by malloc buffer */ 311bd4fe43Sopenharmony_ci#define HI_ERR_VGS_NOBUF HI_DEF_ERR(HI_ID_VGS, EN_ERR_LEVEL_ERROR, EN_ERR_NOBUF) 321bd4fe43Sopenharmony_ci#define HI_ERR_VGS_BUF_EMPTY HI_DEF_ERR(HI_ID_VGS, EN_ERR_LEVEL_ERROR, EN_ERR_BUF_EMPTY) 331bd4fe43Sopenharmony_ci#define HI_ERR_VGS_NULL_PTR HI_DEF_ERR(HI_ID_VGS, EN_ERR_LEVEL_ERROR, EN_ERR_NULL_PTR) 341bd4fe43Sopenharmony_ci#define HI_ERR_VGS_ILLEGAL_PARAM HI_DEF_ERR(HI_ID_VGS, EN_ERR_LEVEL_ERROR, EN_ERR_ILLEGAL_PARAM) 351bd4fe43Sopenharmony_ci#define HI_ERR_VGS_BUF_FULL HI_DEF_ERR(HI_ID_VGS, EN_ERR_LEVEL_ERROR, EN_ERR_BUF_FULL) 361bd4fe43Sopenharmony_ci#define HI_ERR_VGS_SYS_NOTREADY HI_DEF_ERR(HI_ID_VGS, EN_ERR_LEVEL_ERROR, EN_ERR_SYS_NOTREADY) 371bd4fe43Sopenharmony_ci#define HI_ERR_VGS_NOT_SUPPORT HI_DEF_ERR(HI_ID_VGS, EN_ERR_LEVEL_ERROR, EN_ERR_NOT_SUPPORT) 381bd4fe43Sopenharmony_ci#define HI_ERR_VGS_NOT_PERMITTED HI_DEF_ERR(HI_ID_VGS, EN_ERR_LEVEL_ERROR, EN_ERR_NOT_PERM) 391bd4fe43Sopenharmony_ci 401bd4fe43Sopenharmony_ci#define VGS_PRIVATE_DATA_LEN 6 411bd4fe43Sopenharmony_ci 421bd4fe43Sopenharmony_citypedef HI_S32 VGS_HANDLE; 431bd4fe43Sopenharmony_ci 441bd4fe43Sopenharmony_citypedef enum hiVGS_COLOR_REVERT_MODE_E { 451bd4fe43Sopenharmony_ci VGS_COLOR_REVERT_NONE = 0, /* Not revert */ 461bd4fe43Sopenharmony_ci VGS_COLOR_REVERT_RGB, /* Revert RGB */ 471bd4fe43Sopenharmony_ci VGS_COLOR_REVERT_ALPHA, /* Revert alpha */ 481bd4fe43Sopenharmony_ci VGS_COLOR_REVERT_BOTH, /* Revert RGB and alpha */ 491bd4fe43Sopenharmony_ci VGS_COLOR_REVERT_BUTT 501bd4fe43Sopenharmony_ci} VGS_COLOR_REVERT_MODE_E; 511bd4fe43Sopenharmony_ci 521bd4fe43Sopenharmony_citypedef struct hiVGS_OSD_REVERT_S { 531bd4fe43Sopenharmony_ci RECT_S stSrcRect; /* OSD color revert area */ 541bd4fe43Sopenharmony_ci VGS_COLOR_REVERT_MODE_E enColorRevertMode; /* OSD color revert mode */ 551bd4fe43Sopenharmony_ci} VGS_OSD_REVERT_S; 561bd4fe43Sopenharmony_ci 571bd4fe43Sopenharmony_citypedef struct hiVGS_TASK_ATTR_S { 581bd4fe43Sopenharmony_ci VIDEO_FRAME_INFO_S stImgIn; /* Input picture */ 591bd4fe43Sopenharmony_ci VIDEO_FRAME_INFO_S stImgOut; /* Output picture */ 601bd4fe43Sopenharmony_ci HI_U64 au64PrivateData[4]; /* RW; Private data of task */ 611bd4fe43Sopenharmony_ci HI_U32 reserved; /* RW; Debug information,state of current picture */ 621bd4fe43Sopenharmony_ci} VGS_TASK_ATTR_S; 631bd4fe43Sopenharmony_ci 641bd4fe43Sopenharmony_citypedef struct hiVGS_DRAW_LINE_S { 651bd4fe43Sopenharmony_ci POINT_S stStartPoint; /* Line start point */ 661bd4fe43Sopenharmony_ci POINT_S stEndPoint; /* Line end point */ 671bd4fe43Sopenharmony_ci HI_U32 u32Thick; /* RW; Width of line */ 681bd4fe43Sopenharmony_ci HI_U32 u32Color; /* RW; Range: [0,0xFFFFFF]; Color of line */ 691bd4fe43Sopenharmony_ci} VGS_DRAW_LINE_S; 701bd4fe43Sopenharmony_ci 711bd4fe43Sopenharmony_citypedef enum hiVGS_COVER_TYPE_E { 721bd4fe43Sopenharmony_ci COVER_RECT = 0, /* Retangle cover */ 731bd4fe43Sopenharmony_ci COVER_QUAD_RANGLE, /* Quadrangle cover */ 741bd4fe43Sopenharmony_ci COVER_BUTT 751bd4fe43Sopenharmony_ci} VGS_COVER_TYPE_E; 761bd4fe43Sopenharmony_ci 771bd4fe43Sopenharmony_citypedef struct hiVGS_QUADRANGLE_COVER_S { 781bd4fe43Sopenharmony_ci HI_BOOL bSolid; /* Solid or hollow cover */ 791bd4fe43Sopenharmony_ci HI_U32 u32Thick; /* RW; Range: [2,8]; Thick of the hollow quadrangle */ 801bd4fe43Sopenharmony_ci POINT_S stPoint[4]; /* Four points of the quadrangle */ 811bd4fe43Sopenharmony_ci} VGS_QUADRANGLE_COVER_S; 821bd4fe43Sopenharmony_ci 831bd4fe43Sopenharmony_citypedef struct hiVGS_ADD_COVER_S { 841bd4fe43Sopenharmony_ci VGS_COVER_TYPE_E enCoverType; /* Cover type */ 851bd4fe43Sopenharmony_ci union { 861bd4fe43Sopenharmony_ci RECT_S stDstRect; /* The rectangle area */ 871bd4fe43Sopenharmony_ci VGS_QUADRANGLE_COVER_S stQuadRangle; /* The quadrangle area */ 881bd4fe43Sopenharmony_ci }; 891bd4fe43Sopenharmony_ci 901bd4fe43Sopenharmony_ci HI_U32 u32Color; /* RW; Range: [0,0xFFFFFF]; Color of cover */ 911bd4fe43Sopenharmony_ci} VGS_ADD_COVER_S; 921bd4fe43Sopenharmony_ci 931bd4fe43Sopenharmony_citypedef struct hiVGS_ADD_OSD_S { 941bd4fe43Sopenharmony_ci RECT_S stRect; /* Osd area */ 951bd4fe43Sopenharmony_ci HI_U32 u32BgColor; /* RW; Background color of osd, depends on pixel format of osd, 961bd4fe43Sopenharmony_ci ARGB8888:[0,0xFFFFFFFF], ARGB4444:[0,0xFFFF], ARGB1555:[0,0x1FFF] */ 971bd4fe43Sopenharmony_ci PIXEL_FORMAT_E enPixelFmt; /* Pixel format of osd */ 981bd4fe43Sopenharmony_ci HI_U64 u64PhyAddr; /* RW; Physical address of osd */ 991bd4fe43Sopenharmony_ci HI_U32 u32Stride; /* RW; Range: [32,8192]; Stride of osd */ 1001bd4fe43Sopenharmony_ci HI_U32 u32BgAlpha; /* RW; Range: [0,255]; Background alpha of osd */ 1011bd4fe43Sopenharmony_ci HI_U32 u32FgAlpha; /* RW; Range: [0,255]; Foreground alpha of osd */ 1021bd4fe43Sopenharmony_ci HI_BOOL bOsdRevert; /* RW; Enable osd color revert */ 1031bd4fe43Sopenharmony_ci VGS_OSD_REVERT_S stOsdRevert; /* Osd color revert information */ 1041bd4fe43Sopenharmony_ci HI_U16 u16ColorLUT[2]; 1051bd4fe43Sopenharmony_ci} VGS_ADD_OSD_S; 1061bd4fe43Sopenharmony_ci 1071bd4fe43Sopenharmony_citypedef enum hiVGS_SCLCOEF_MODE_E { 1081bd4fe43Sopenharmony_ci VGS_SCLCOEF_NORMAL = 0, /* normal scale coefficient */ 1091bd4fe43Sopenharmony_ci VGS_SCLCOEF_TAP2 = 1, /* scale coefficient of 2 tap */ 1101bd4fe43Sopenharmony_ci VGS_SCLCOEF_TAP4 = 2, /* scale coefficient of 4 tap */ 1111bd4fe43Sopenharmony_ci VGS_SCLCOEF_TAP6 = 3, /* scale coefficient of 6 tap */ 1121bd4fe43Sopenharmony_ci VGS_SCLCOEF_TAP8 = 4, /* scale coefficient of 8 tap */ 1131bd4fe43Sopenharmony_ci VGS_SCLCOEF_BUTT 1141bd4fe43Sopenharmony_ci} VGS_SCLCOEF_MODE_E; 1151bd4fe43Sopenharmony_ci 1161bd4fe43Sopenharmony_ci#ifdef __cplusplus 1171bd4fe43Sopenharmony_ci#if __cplusplus 1181bd4fe43Sopenharmony_ci} 1191bd4fe43Sopenharmony_ci#endif 1201bd4fe43Sopenharmony_ci#endif /* __cplusplus */ 1211bd4fe43Sopenharmony_ci 1221bd4fe43Sopenharmony_ci#endif /* __HI_COMM_VGS_H__ */ 123