├── README.md ├── hi35xx_audio.h ├── master_port.c ├── pjlib └── include │ └── hi_inc │ ├── 0 │ ├── hi35xx_audio.h │ ├── hi_comm_adec.h │ ├── hi_comm_aenc.h │ ├── hi_comm_ai.h │ ├── hi_comm_aio.h │ ├── hi_comm_ao.h │ ├── hi_comm_hdmi.h │ ├── hi_comm_ive.h │ ├── hi_comm_pciv.h │ ├── hi_comm_rc.h │ ├── hi_comm_region.h │ ├── hi_comm_sys.h │ ├── hi_comm_vb.h │ ├── hi_comm_vda.h │ ├── hi_comm_vdec.h │ ├── hi_comm_venc.h │ ├── hi_comm_vi.h │ ├── hi_comm_video.h │ ├── hi_comm_vo.h │ ├── hi_comm_vpss.h │ ├── hi_common.h │ ├── hi_debug.h │ ├── hi_defines.h │ ├── hi_errno.h │ ├── hi_io.h │ ├── hi_math.h │ ├── hi_tde_api.h │ ├── hi_tde_errcode.h │ ├── hi_tde_type.h │ ├── hi_type.h │ ├── hifb.h │ ├── list.h │ ├── mpi_adec.h │ ├── mpi_aenc.h │ ├── mpi_ai.h │ ├── mpi_ao.h │ ├── mpi_hdmi.h │ ├── mpi_ive.h │ ├── mpi_pciv.h │ ├── mpi_region.h │ ├── mpi_sys.h │ ├── mpi_vb.h │ ├── mpi_vda.h │ ├── mpi_vdec.h │ ├── mpi_venc.h │ ├── mpi_vi.h │ ├── mpi_vo.h │ ├── mpi_vpss.h │ └── sample_comm.h ├── pjmedia └── src │ └── pjmedia │ ├── 0 │ └── master_port.c ├── pjsip-apps └── src │ └── pjsua │ ├── main.c │ └── pjsua_app.c └── pjsua_app.c /README.md: -------------------------------------------------------------------------------- 1 | # hi35xx-pjsip 2 | 基于pjsip的海思3520d与PC端的对讲(尚未整理完) 3 | -------------------------------------------------------------------------------- /hi35xx_audio.h: -------------------------------------------------------------------------------- 1 | #ifndef __HI35XX_AUDIO_H__ 2 | #define __HI35XX_AUDIO_H__ 3 | 4 | #include "hi_type.h" 5 | 6 | 7 | 8 | #ifdef __cplusplus 9 | #if __cplusplus 10 | 11 | extern "C"{ 12 | #endif 13 | #endif /* End of #ifdef __cplusplus */ 14 | 15 | 16 | #define SAMPLE_AUDIO_AI_DEV 0 17 | #define SAMPLE_AUDIO_AO_DEV 0 18 | #define CHN_NUM 2 19 | 20 | 21 | #define SAMPLE_DBG(s32Ret)\ 22 | do{\ 23 | printf("s32Ret=%#x,fuc:%s,line:%d\n", s32Ret, __FUNCTION__, __LINE__);\ 24 | }while(0) 25 | 26 | ///全局变量音频指针 27 | 28 | 29 | 30 | 31 | static PAYLOAD_TYPE_E gs_enPayloadType = PT_G711A; 32 | static AUDIO_FRAME_S stFrame; //音频帧结构体 33 | 34 | static HI_BOOL gs_bMicIn = HI_FALSE; 35 | 36 | static HI_BOOL gs_bAiAnr = HI_FALSE; 37 | static HI_BOOL gs_bAioReSample = HI_FALSE; 38 | static HI_BOOL gs_bUserGetMode = HI_FALSE; 39 | static AUDIO_RESAMPLE_ATTR_S *gs_pstAiReSmpAttr = NULL; 40 | static AUDIO_RESAMPLE_ATTR_S *gs_pstAoReSmpAttr = NULL; 41 | static AUDIO_DEV AiDev = SAMPLE_AUDIO_AI_DEV; 42 | static AI_CHN AiChn; 43 | static AUDIO_DEV AoDev = SAMPLE_AUDIO_AO_DEV; 44 | static AO_CHN AoChn = 0; 45 | static ADEC_CHN AdChn = 0; 46 | static HI_S32 s32AiChnCnt; 47 | static HI_S32 s32AencChnCnt; 48 | static AENC_CHN AeChn; 49 | char lance_call_start; 50 | 51 | 52 | 53 | #ifdef __cplusplus 54 | #if __cplusplus 55 | } 56 | 57 | #endif 58 | 59 | #endif /* End of #ifdef __cplusplus */ 60 | #endif /* End of #ifndef __HI35XX_AUDIO_H__*/ 61 | 62 | -------------------------------------------------------------------------------- /pjlib/include/hi_inc/0: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /pjlib/include/hi_inc/hi35xx_audio.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dulton/hi35xx-pjsip/49d821d9fa23740daba04dbe881b9d358c6a50a5/pjlib/include/hi_inc/hi35xx_audio.h -------------------------------------------------------------------------------- /pjlib/include/hi_inc/hi_comm_adec.h: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | 3 | Copyright (C), 2001-2011, Hisilicon Tech. Co., Ltd. 4 | 5 | ****************************************************************************** 6 | File Name : hi_comm_adec.h 7 | Version : Initial Draft 8 | Author : Hisilicon multimedia software group 9 | Created : 2006/12/15 10 | Last Modified : 11 | Description : 12 | Function List : 13 | History : 14 | 1.Date : 2006/12/15 15 | Author : z50825 16 | Modification : Created file 17 | 2.Date : 2007/5/10 18 | Author : z50825 19 | Modification : add err code 20 | ******************************************************************************/ 21 | 22 | 23 | #ifndef __HI_COMM_ADEC_H__ 24 | #define __HI_COMM_ADEC_H__ 25 | 26 | 27 | #include "hi_type.h" 28 | #include "hi_common.h" 29 | #include "hi_comm_aio.h" 30 | 31 | #ifdef __cplusplus 32 | #if __cplusplus 33 | extern "C"{ 34 | #endif 35 | #endif /* End of #ifdef __cplusplus */ 36 | 37 | typedef struct hiADEC_ATTR_G711_S 38 | { 39 | HI_U32 resv; 40 | }ADEC_ATTR_G711_S; 41 | 42 | typedef struct hiADEC_ATTR_G726_S 43 | { 44 | G726_BPS_E enG726bps; 45 | }ADEC_ATTR_G726_S; 46 | 47 | typedef struct hiADEC_ATTR_ADPCM_S 48 | { 49 | ADPCM_TYPE_E enADPCMType; 50 | }ADEC_ATTR_ADPCM_S; 51 | 52 | typedef struct hiADEC_ATTR_LPCM_S 53 | { 54 | HI_U32 resv; 55 | }ADEC_ATTR_LPCM_S; 56 | 57 | typedef enum hiADEC_MODE_E 58 | { 59 | ADEC_MODE_PACK = 0,/*require input is valid dec pack(a 60 | complete frame encode result), 61 | e.g.the stream get from AENC is a 62 | valid dec pack, the stream know actually 63 | pack len from file is also a dec pack. 64 | this mode is high-performative*/ 65 | ADEC_MODE_STREAM ,/*input is stream,low-performative, 66 | if you couldn't find out whether a stream is 67 | vaild dec pack,you could use 68 | this mode*/ 69 | ADEC_MODE_BUTT 70 | }ADEC_MODE_E; 71 | 72 | typedef struct hiADEC_CH_ATTR_S 73 | { 74 | PAYLOAD_TYPE_E enType; 75 | HI_U32 u32BufSize; /*buf size[2~MAX_AUDIO_FRAME_NUM]*/ 76 | ADEC_MODE_E enMode; /*decode mode*/ 77 | HI_VOID *pValue; 78 | }ADEC_CHN_ATTR_S; 79 | 80 | typedef struct hiADEC_DECODER_S 81 | { 82 | PAYLOAD_TYPE_E enType; 83 | HI_CHAR aszName[16]; 84 | HI_S32 (*pfnOpenDecoder)(HI_VOID *pDecoderAttr, HI_VOID **ppDecoder); /*struct ppDecoder is packed by user,user malloc and free memory for this struct */ 85 | HI_S32 (*pfnDecodeFrm)(HI_VOID *pDecoder, HI_U8 **pu8Inbuf,HI_S32 *ps32LeftByte, 86 | HI_U16 *pu16Outbuf,HI_U32 *pu32OutLen,HI_U32 *pu32Chns); 87 | HI_S32 (*pfnGetFrmInfo)(HI_VOID *pDecoder, HI_VOID *pInfo); 88 | HI_S32 (*pfnCloseDecoder)(HI_VOID *pDecoder); 89 | } ADEC_DECODER_S; 90 | 91 | typedef enum hiEN_ADEC_ERR_CODE_E 92 | { 93 | ADEC_ERR_DECODER_ERR = 64, 94 | ADEC_ERR_BUF_LACK, 95 | ADEC_ERR_VOICE_DEC_TYPE, 96 | ADEC_ERR_VOICE_DEC_FRAMESIZE, 97 | ADEC_ERR_VOICE_DEC_FRAMETYPE, 98 | ADEC_ERR_VOICE_INVALID_DEVICE, 99 | ADEC_ERR_VOICE_INVALID_INBUF, 100 | ADEC_ERR_VOICE_INVALID_OUTBUF, 101 | ADEC_ERR_VOICE_TRANS_DEVICE, 102 | ADEC_ERR_VOICE_TRANS_TYPE, 103 | 104 | } EN_ADEC_ERR_CODE_E; 105 | 106 | 107 | /* invlalid device ID */ 108 | #define HI_ERR_ADEC_INVALID_DEVID HI_DEF_ERR(HI_ID_ADEC, EN_ERR_LEVEL_ERROR, EN_ERR_INVALID_DEVID) 109 | /* invlalid channel ID */ 110 | #define HI_ERR_ADEC_INVALID_CHNID HI_DEF_ERR(HI_ID_ADEC, EN_ERR_LEVEL_ERROR, EN_ERR_INVALID_CHNID) 111 | /* at lease one parameter is illagal ,eg, an illegal enumeration value */ 112 | #define HI_ERR_ADEC_ILLEGAL_PARAM HI_DEF_ERR(HI_ID_ADEC, EN_ERR_LEVEL_ERROR, EN_ERR_ILLEGAL_PARAM) 113 | /* channel exists */ 114 | #define HI_ERR_ADEC_EXIST HI_DEF_ERR(HI_ID_ADEC, EN_ERR_LEVEL_ERROR, EN_ERR_EXIST) 115 | /* channel unexists */ 116 | #define HI_ERR_ADEC_UNEXIST HI_DEF_ERR(HI_ID_ADEC, EN_ERR_LEVEL_ERROR, EN_ERR_UNEXIST) 117 | /* using a NULL point */ 118 | #define HI_ERR_ADEC_NULL_PTR HI_DEF_ERR(HI_ID_ADEC, EN_ERR_LEVEL_ERROR, EN_ERR_NULL_PTR) 119 | /* try to enable or initialize system,device or channel, before configing attribute */ 120 | #define HI_ERR_ADEC_NOT_CONFIG HI_DEF_ERR(HI_ID_ADEC, EN_ERR_LEVEL_ERROR, EN_ERR_NOT_CONFIG) 121 | /* operation is not supported by NOW */ 122 | #define HI_ERR_ADEC_NOT_SUPPORT HI_DEF_ERR(HI_ID_ADEC, EN_ERR_LEVEL_ERROR, EN_ERR_NOT_SUPPORT) 123 | /* operation is not permitted ,eg, try to change stati attribute */ 124 | #define HI_ERR_ADEC_NOT_PERM HI_DEF_ERR(HI_ID_ADEC, EN_ERR_LEVEL_ERROR, EN_ERR_NOT_PERM) 125 | /* failure caused by malloc memory */ 126 | #define HI_ERR_ADEC_NOMEM HI_DEF_ERR(HI_ID_ADEC, EN_ERR_LEVEL_ERROR, EN_ERR_NOMEM) 127 | /* failure caused by malloc buffer */ 128 | #define HI_ERR_ADEC_NOBUF HI_DEF_ERR(HI_ID_ADEC, EN_ERR_LEVEL_ERROR, EN_ERR_NOBUF) 129 | /* no data in buffer */ 130 | #define HI_ERR_ADEC_BUF_EMPTY HI_DEF_ERR(HI_ID_ADEC, EN_ERR_LEVEL_ERROR, EN_ERR_BUF_EMPTY) 131 | /* no buffer for new data */ 132 | #define HI_ERR_ADEC_BUF_FULL HI_DEF_ERR(HI_ID_ADEC, EN_ERR_LEVEL_ERROR, EN_ERR_BUF_FULL) 133 | /* system is not ready,had not initialed or loaded*/ 134 | #define HI_ERR_ADEC_SYS_NOTREADY HI_DEF_ERR(HI_ID_ADEC, EN_ERR_LEVEL_ERROR, EN_ERR_SYS_NOTREADY) 135 | /* decoder internal err */ 136 | #define HI_ERR_ADEC_DECODER_ERR HI_DEF_ERR(HI_ID_ADEC, EN_ERR_LEVEL_ERROR, ADEC_ERR_DECODER_ERR) 137 | /* input buffer not enough to decode one frame */ 138 | #define HI_ERR_ADEC_BUF_LACK HI_DEF_ERR(HI_ID_ADEC, EN_ERR_LEVEL_ERROR, ADEC_ERR_BUF_LACK) 139 | 140 | 141 | 142 | #define HI_ERR_ADEC_DEC_TYPE HI_DEF_ERR(HI_ID_ADEC, EN_ERR_LEVEL_ERROR, ADEC_ERR_VOICE_DEC_TYPE) 143 | #define HI_ERR_ADEC_DEC_FRAMESIZE HI_DEF_ERR(HI_ID_ADEC, EN_ERR_LEVEL_ERROR, ADEC_ERR_VOICE_DEC_FRAMESIZE) 144 | #define HI_ERR_ADEC_DEC_FRAMETYPE HI_DEF_ERR(HI_ID_ADEC, EN_ERR_LEVEL_ERROR, ADEC_ERR_VOICE_DEC_FRAMETYPE) 145 | #define HI_ERR_ADEC_INVALID_DEVICE HI_DEF_ERR(HI_ID_ADEC, EN_ERR_LEVEL_ERROR, ADEC_ERR_VOICE_INVALID_DEVICE) 146 | #define HI_ERR_ADEC_INVALID_INBUF HI_DEF_ERR(HI_ID_ADEC, EN_ERR_LEVEL_ERROR, ADEC_ERR_VOICE_INVALID_INBUF) 147 | #define HI_ERR_ADEC_INVALID_OUTBUF HI_DEF_ERR(HI_ID_ADEC, EN_ERR_LEVEL_ERROR, ADEC_ERR_VOICE_INVALID_OUTBUF) 148 | #define HI_ERR_ADEC_TRANS_DEVICE HI_DEF_ERR(HI_ID_ADEC, EN_ERR_LEVEL_ERROR, ADEC_ERR_VOICE_TRANS_DEVICE) 149 | #define HI_ERR_ADEC_TRANS_TYPE HI_DEF_ERR(HI_ID_ADEC, EN_ERR_LEVEL_ERROR, ADEC_ERR_VOICE_TRANS_TYPE) 150 | 151 | 152 | 153 | 154 | #ifdef __cplusplus 155 | #if __cplusplus 156 | } 157 | #endif 158 | #endif /* End of #ifdef __cplusplus */ 159 | 160 | #endif/* End of #ifndef __HI_COMM_ADEC_H__*/ 161 | 162 | -------------------------------------------------------------------------------- /pjlib/include/hi_inc/hi_comm_aenc.h: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | 3 | Copyright (C), 2001-2011, Hisilicon Tech. Co., Ltd. 4 | 5 | ****************************************************************************** 6 | File Name : hi_comm_aenc.h 7 | Version : Initial Draft 8 | Author : Hisilicon multimedia software group 9 | Created : 2006/12/15 10 | Last Modified : 11 | Description : 12 | Function List : 13 | History : 14 | 1.Date : 2006/12/15 15 | Author : z50825 16 | Modification : Created file 17 | 2.Date : 2007/5/10 18 | Author : z50825 19 | Modification : add err code 20 | ******************************************************************************/ 21 | 22 | 23 | #ifndef __HI_COMM_AENC_H__ 24 | #define __HI_COMM_AENC_H__ 25 | 26 | #include "hi_type.h" 27 | #include "hi_common.h" 28 | #include "hi_comm_aio.h" 29 | 30 | 31 | #ifdef __cplusplus 32 | #if __cplusplus 33 | extern "C"{ 34 | #endif 35 | #endif /* End of #ifdef __cplusplus */ 36 | 37 | typedef struct hiAENC_ATTR_G711_S 38 | { 39 | HI_U32 resv; /*reserve item*/ 40 | }AENC_ATTR_G711_S; 41 | 42 | typedef struct hiAENC_ATTR_G726_S 43 | { 44 | G726_BPS_E enG726bps; 45 | }AENC_ATTR_G726_S; 46 | 47 | typedef struct hiAENC_ATTR_ADPCM_S 48 | { 49 | ADPCM_TYPE_E enADPCMType; 50 | }AENC_ATTR_ADPCM_S; 51 | 52 | typedef struct hiAENC_ATTR_LPCM_S 53 | { 54 | HI_U32 resv; /*reserve item*/ 55 | }AENC_ATTR_LPCM_S; 56 | 57 | typedef struct hiAENC_ENCODER_S 58 | { 59 | PAYLOAD_TYPE_E enType; 60 | HI_U32 u32MaxFrmLen; 61 | HI_CHAR aszName[16]; /* encoder type,be used to print proc information */ 62 | HI_S32 (*pfnOpenEncoder)(HI_VOID *pEncoderAttr, HI_VOID **ppEncoder); /* pEncoder is the handle to control the encoder */ 63 | HI_S32 (*pfnEncodeFrm)(HI_VOID *pEncoder, const AUDIO_FRAME_S *pstData, 64 | HI_U8 *pu8Outbuf,HI_U32 *pu32OutLen); 65 | HI_S32 (*pfnCloseEncoder)(HI_VOID *pEncoder); 66 | } AENC_ENCODER_S; 67 | 68 | typedef struct hiAENC_CHN_ATTR_S 69 | { 70 | PAYLOAD_TYPE_E enType; /*payload type ()*/ 71 | HI_U32 u32BufSize; /*buf size [2~MAX_AUDIO_FRAME_NUM]*/ 72 | HI_VOID *pValue; /*point to attribute of definite audio encoder*/ 73 | }AENC_CHN_ATTR_S; 74 | 75 | typedef enum hiEN_AENC_ERR_CODE_E 76 | { 77 | ADEC_ERR_ENCODER_ERR = 64 , 78 | 79 | } EN_AENC_ERR_CODE_E; 80 | 81 | 82 | /* invlalid device ID */ 83 | #define HI_ERR_AENC_INVALID_DEVID HI_DEF_ERR(HI_ID_AENC, EN_ERR_LEVEL_ERROR, EN_ERR_INVALID_DEVID) 84 | /* invlalid channel ID */ 85 | #define HI_ERR_AENC_INVALID_CHNID HI_DEF_ERR(HI_ID_AENC, EN_ERR_LEVEL_ERROR, EN_ERR_INVALID_CHNID) 86 | /* at lease one parameter is illagal ,eg, an illegal enumeration value */ 87 | #define HI_ERR_AENC_ILLEGAL_PARAM HI_DEF_ERR(HI_ID_AENC, EN_ERR_LEVEL_ERROR, EN_ERR_ILLEGAL_PARAM) 88 | /* channel exists */ 89 | #define HI_ERR_AENC_EXIST HI_DEF_ERR(HI_ID_AENC, EN_ERR_LEVEL_ERROR, EN_ERR_EXIST) 90 | /* channel unexists */ 91 | #define HI_ERR_AENC_UNEXIST HI_DEF_ERR(HI_ID_AENC, EN_ERR_LEVEL_ERROR, EN_ERR_UNEXIST) 92 | /* using a NULL point */ 93 | #define HI_ERR_AENC_NULL_PTR HI_DEF_ERR(HI_ID_AENC, EN_ERR_LEVEL_ERROR, EN_ERR_NULL_PTR) 94 | /* try to enable or initialize system,device or channel, before configing attribute */ 95 | #define HI_ERR_AENC_NOT_CONFIG HI_DEF_ERR(HI_ID_AENC, EN_ERR_LEVEL_ERROR, EN_ERR_NOT_CONFIG) 96 | /* operation is not supported by NOW */ 97 | #define HI_ERR_AENC_NOT_SUPPORT HI_DEF_ERR(HI_ID_AENC, EN_ERR_LEVEL_ERROR, EN_ERR_NOT_SUPPORT) 98 | /* operation is not permitted ,eg, try to change static attribute */ 99 | #define HI_ERR_AENC_NOT_PERM HI_DEF_ERR(HI_ID_AENC, EN_ERR_LEVEL_ERROR, EN_ERR_NOT_PERM) 100 | /* failure caused by malloc memory */ 101 | #define HI_ERR_AENC_NOMEM HI_DEF_ERR(HI_ID_AENC, EN_ERR_LEVEL_ERROR, EN_ERR_NOMEM) 102 | /* failure caused by malloc buffer */ 103 | #define HI_ERR_AENC_NOBUF HI_DEF_ERR(HI_ID_AENC, EN_ERR_LEVEL_ERROR, EN_ERR_NOBUF) 104 | /* no data in buffer */ 105 | #define HI_ERR_AENC_BUF_EMPTY HI_DEF_ERR(HI_ID_AENC, EN_ERR_LEVEL_ERROR, EN_ERR_BUF_EMPTY) 106 | /* no buffer for new data */ 107 | #define HI_ERR_AENC_BUF_FULL HI_DEF_ERR(HI_ID_AENC, EN_ERR_LEVEL_ERROR, EN_ERR_BUF_FULL) 108 | /* system is not ready,had not initialed or loaded*/ 109 | #define HI_ERR_AENC_SYS_NOTREADY HI_DEF_ERR(HI_ID_AENC, EN_ERR_LEVEL_ERROR, EN_ERR_SYS_NOTREADY) 110 | /* encoder internal err */ 111 | #define HI_ERR_AENC_ENCODER_ERR HI_DEF_ERR(HI_ID_AENC, EN_ERR_LEVEL_ERROR, ADEC_ERR_ENCODER_ERR) 112 | 113 | 114 | #ifdef __cplusplus 115 | #if __cplusplus 116 | } 117 | #endif 118 | #endif /* End of #ifdef __cplusplus */ 119 | 120 | #endif/* End of #ifndef __HI_COMM_AENC_H__*/ 121 | 122 | -------------------------------------------------------------------------------- /pjlib/include/hi_inc/hi_comm_ai.h: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | 3 | Copyright (C), 2001-2011, Hisilicon Tech. Co., Ltd. 4 | 5 | ****************************************************************************** 6 | File Name : hi_comm_ai.h 7 | Version : Initial Draft 8 | Author : Hisilicon multimedia software group 9 | Created : 2009/5/5 10 | Description : 11 | History : 12 | 1.Date : 2009/5/5 13 | Author : p00123320 14 | Modification: Created file 15 | ******************************************************************************/ 16 | 17 | 18 | #ifndef __HI_COMM_AI_H__ 19 | #define __HI_COMM_AI_H__ 20 | 21 | #ifdef __cplusplus 22 | #if __cplusplus 23 | extern "C"{ 24 | #endif 25 | #endif /* End of #ifdef __cplusplus */ 26 | 27 | 28 | 29 | #ifdef __cplusplus 30 | #if __cplusplus 31 | } 32 | #endif 33 | #endif /* End of #ifdef __cplusplus */ 34 | 35 | #endif /* End of #ifndef __HI_COMM_AI_H__ */ 36 | 37 | -------------------------------------------------------------------------------- /pjlib/include/hi_inc/hi_comm_aio.h: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | 3 | Copyright (C), 2001-2011, Hisilicon Tech. Co., Ltd. 4 | 5 | ****************************************************************************** 6 | File Name : hi_comm_aio.h 7 | Version : Initial Draft 8 | Author : Hisilicon multimedia software group 9 | Created : 2009/5/5 10 | Description : 11 | History : 12 | 1.Date : 2009/5/5 13 | Author : p00123320 14 | Modification: Created file 15 | ******************************************************************************/ 16 | 17 | 18 | #ifndef __HI_COMM_AIO_H__ 19 | #define __HI_COMM_AIO_H__ 20 | 21 | #include "hi_common.h" 22 | #include "hi_errno.h" 23 | 24 | #ifdef __cplusplus 25 | #if __cplusplus 26 | extern "C"{ 27 | #endif 28 | #endif /* End of #ifdef __cplusplus */ 29 | 30 | 31 | #define MAX_AUDIO_FRAME_NUM 50 /*max count of audio frame in Buffer */ 32 | #define MAX_AUDIO_POINT_BYTES 4 /*max bytes of one sample point(now 32bit max)*/ 33 | 34 | #define MAX_VOICE_POINT_NUM 480 /*max sample per frame for voice encode */ 35 | 36 | #define MAX_AUDIO_POINT_NUM 2048 /*max sample per frame for all encoder(aacplus:2048)*/ 37 | #define MIN_AUDIO_POINT_NUM 80 /*min sample per frame*/ 38 | 39 | /*max length of audio frame by bytes, one frame contain many sample point */ 40 | #define MAX_AUDIO_FRAME_LEN (MAX_AUDIO_POINT_BYTES*MAX_AUDIO_POINT_NUM) 41 | 42 | /*max length of audio stream by bytes */ 43 | #define MAX_AUDIO_STREAM_LEN MAX_AUDIO_FRAME_LEN 44 | 45 | #define MAX_AI_USRFRM_DEPTH 30 /*max depth of user frame buf */ 46 | 47 | typedef enum hiAUDIO_SAMPLE_RATE_E 48 | { 49 | AUDIO_SAMPLE_RATE_8000 = 8000, /* 8K samplerate*/ 50 | AUDIO_SAMPLE_RATE_12000 = 12000, /* 12K samplerate*/ 51 | AUDIO_SAMPLE_RATE_11025 = 11025, /* 11.025K samplerate*/ 52 | AUDIO_SAMPLE_RATE_16000 = 16000, /* 16K samplerate*/ 53 | AUDIO_SAMPLE_RATE_22050 = 22050, /* 22.050K samplerate*/ 54 | AUDIO_SAMPLE_RATE_24000 = 24000, /* 24K samplerate*/ 55 | AUDIO_SAMPLE_RATE_32000 = 32000, /* 32K samplerate*/ 56 | AUDIO_SAMPLE_RATE_44100 = 44100, /* 44.1K samplerate*/ 57 | AUDIO_SAMPLE_RATE_48000 = 48000, /* 48K samplerate*/ 58 | AUDIO_SAMPLE_RATE_BUTT, 59 | } AUDIO_SAMPLE_RATE_E; 60 | 61 | typedef enum hiAUDIO_BIT_WIDTH_E 62 | { 63 | AUDIO_BIT_WIDTH_8 = 0, /* 8bit width */ 64 | AUDIO_BIT_WIDTH_16 = 1, /* 16bit width*/ 65 | AUDIO_BIT_WIDTH_32 = 2, /* 32bit width*/ 66 | AUDIO_BIT_WIDTH_BUTT, 67 | } AUDIO_BIT_WIDTH_E; 68 | 69 | typedef enum hiAIO_MODE_E 70 | { 71 | AIO_MODE_I2S_MASTER = 0, /* SIO I2S master mode */ 72 | AIO_MODE_I2S_SLAVE, /* SIO I2S slave mode */ 73 | AIO_MODE_PCM_SLAVE_STD, /* SIO PCM slave standard mode */ 74 | AIO_MODE_PCM_SLAVE_NSTD, /* SIO PCM slave non-standard mode */ 75 | AIO_MODE_PCM_MASTER_STD, /* SIO PCM master standard mode */ 76 | AIO_MODE_PCM_MASTER_NSTD, /* SIO PCM master non-standard mode */ 77 | AIO_MODE_BUTT 78 | } AIO_MODE_E; 79 | 80 | typedef enum hiAIO_SOUND_MODE_E 81 | { 82 | AUDIO_SOUND_MODE_MONO =0,/*mono*/ 83 | AUDIO_SOUND_MODE_STEREO =1,/*stereo*/ 84 | AUDIO_SOUND_MODE_BUTT 85 | } AUDIO_SOUND_MODE_E; 86 | 87 | /* 88 | An example of the packing scheme for G726-32 codewords is as shown, and bit A3 is the least significant bit of the first codeword: 89 | RTP G726-32: 90 | 0 1 91 | 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 92 | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+- 93 | |B B B B|A A A A|D D D D|C C C C| ... 94 | |0 1 2 3|0 1 2 3|0 1 2 3|0 1 2 3| 95 | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+- 96 | 97 | MEDIA G726-32: 98 | 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 99 | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+- 100 | |A A A A|B B B B|C C C C|D D D D| ... 101 | |3 2 1 0|3 2 1 0|3 2 1 0|3 2 1 0| 102 | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+- 103 | */ 104 | typedef enum hiG726_BPS_E 105 | { 106 | G726_16K = 0, /* G726 16kbps, see RFC3551.txt 4.5.4 G726-16 */ 107 | G726_24K, /* G726 24kbps, see RFC3551.txt 4.5.4 G726-24 */ 108 | G726_32K, /* G726 32kbps, see RFC3551.txt 4.5.4 G726-32 */ 109 | G726_40K, /* G726 40kbps, see RFC3551.txt 4.5.4 G726-40 */ 110 | MEDIA_G726_16K, /* G726 16kbps for ASF ... */ 111 | MEDIA_G726_24K, /* G726 24kbps for ASF ... */ 112 | MEDIA_G726_32K, /* G726 32kbps for ASF ... */ 113 | MEDIA_G726_40K, /* G726 40kbps for ASF ... */ 114 | G726_BUTT, 115 | } G726_BPS_E; 116 | 117 | typedef enum hiADPCM_TYPE_E 118 | { 119 | /* see DVI4 diiffers in three respects from the IMA ADPCM at RFC3551.txt 4.5.1 DVI4 */ 120 | 121 | ADPCM_TYPE_DVI4 = 0, /* 32kbps ADPCM(DVI4) for RTP */ 122 | ADPCM_TYPE_IMA, /* 32kbps ADPCM(IMA),NOTICE:point num must be 161/241/321/481 */ 123 | ADPCM_TYPE_ORG_DVI4, 124 | ADPCM_TYPE_BUTT, 125 | } ADPCM_TYPE_E; 126 | 127 | #define AI_EXPAND 0x01 128 | 129 | typedef struct hiAIO_ATTR_S 130 | { 131 | AUDIO_SAMPLE_RATE_E enSamplerate; /* sample rate*/ 132 | AUDIO_BIT_WIDTH_E enBitwidth; /* bitwidth*/ 133 | AIO_MODE_E enWorkmode; /* master or slave mode*/ 134 | AUDIO_SOUND_MODE_E enSoundmode; /* momo or steror*/ 135 | HI_U32 u32EXFlag; /* expand 8bit to 16bit,use AI_EXPAND(only valid for AI 8bit) */ 136 | HI_U32 u32FrmNum; /* frame num in buf[2,MAX_AUDIO_FRAME_NUM]*/ 137 | HI_U32 u32PtNumPerFrm; /* point num per frame (80/160/240/320/480/1024/2048) 138 | (ADPCM IMA should add 1 point, AMR only support 160)*/ 139 | HI_U32 u32ChnCnt; /* channle number on FS, valid value:2/4/8/16 */ 140 | HI_U32 u32ClkSel; /* clock select, meaning is diffrent when master and slave mode, 141 | if sio slave mode: 142 | 0: AD and DA clock of codec is separate 143 | 1: AD and DA clock of codec is inseparate 144 | else sio master mode: 145 | 0:ACKOUT clock is from sio 0 146 | 1:ACKOUT clock is from sio 1/2 147 | */ 148 | } AIO_ATTR_S; 149 | 150 | typedef struct hiAI_CHN_PARAM_S 151 | { 152 | HI_U32 u32UsrFrmDepth; 153 | HI_S32 s32Rev; 154 | } AI_CHN_PARAM_S; 155 | 156 | typedef struct hiAUDIO_FRAME_S 157 | { 158 | AUDIO_BIT_WIDTH_E enBitwidth; /*audio frame bitwidth*/ 159 | AUDIO_SOUND_MODE_E enSoundmode; /*audio frame momo or stereo mode*/ 160 | HI_VOID *pVirAddr[2]; 161 | HI_U32 u32PhyAddr[2]; 162 | HI_U64 u64TimeStamp; /*audio frame timestamp*/ 163 | HI_U32 u32Seq; /*audio frame seq*/ 164 | HI_U32 u32Len; /*data lenth per channel in frame*/ 165 | HI_U32 u32PoolId[2]; 166 | } AUDIO_FRAME_S; 167 | 168 | typedef struct hiAEC_FRAME_S 169 | { 170 | AUDIO_FRAME_S stRefFrame; /* AEC reference audio frame */ 171 | HI_BOOL bValid; /* whether frame is valid */ 172 | } AEC_FRAME_S; 173 | 174 | typedef struct hiAUDIO_FRAME_COMBINE_S 175 | { 176 | AUDIO_FRAME_S stFrm; /* audio frame */ 177 | AEC_FRAME_S stRefFrm; /* AEC reference audio frame */ 178 | } AUDIO_FRAME_COMBINE_S; 179 | 180 | typedef struct hiAUDIO_FRAME_INFO_S 181 | { 182 | AUDIO_FRAME_S *pstFrame;/*frame ptr*/ 183 | HI_U32 u32Id; /*frame id*/ 184 | } AUDIO_FRAME_INFO_S; 185 | 186 | typedef struct hiAUDIO_STREAM_S 187 | { 188 | HI_U8 *pStream; /* the virtual address of stream */ 189 | HI_U32 u32PhyAddr; /* the physics address of stream */ 190 | HI_U32 u32Len; /* stream lenth, by bytes */ 191 | HI_U64 u64TimeStamp; /* frame time stamp*/ 192 | HI_U32 u32Seq; /* frame seq,if stream is not a valid frame,u32Seq is 0*/ 193 | } AUDIO_STREAM_S; 194 | 195 | 196 | typedef enum hiAUDIO_RESAMPLE_TYPE_E 197 | { 198 | AUDIO_RESAMPLE_1X2 = 0x1, 199 | AUDIO_RESAMPLE_2X1 = 0x2, 200 | AUDIO_RESAMPLE_1X4 = 0x3, 201 | AUDIO_RESAMPLE_4X1 = 0x4, 202 | AUDIO_RESAMPLE_1X6 = 0x5, 203 | AUDIO_RESAMPLE_6X1 = 0x6, 204 | AUDIO_RESAMPLE_BUTT 205 | } AUDIO_RESAMPLE_TYPE_E; 206 | 207 | typedef struct hiAUDIO_RESAMPLE_ATTR_S 208 | { 209 | HI_U32 u32InPointNum; /* input point number of frame */ 210 | AUDIO_SAMPLE_RATE_E enInSampleRate; /* input sample rate */ 211 | AUDIO_RESAMPLE_TYPE_E enReSampleType; /* resample type */ 212 | } AUDIO_RESAMPLE_ATTR_S; 213 | 214 | typedef struct hiAO_CHN_STATE_S 215 | { 216 | HI_U32 u32ChnTotalNum; /* total number of channel buffer */ 217 | HI_U32 u32ChnFreeNum; /* free number of channel buffer */ 218 | HI_U32 u32ChnBusyNum; /* busy number of channel buffer */ 219 | } AO_CHN_STATE_S; 220 | 221 | typedef struct hiAIO_RESMP_INFO_S 222 | { 223 | HI_BOOL bReSmpEnable; /* resample enable or disable */ 224 | AUDIO_RESAMPLE_ATTR_S stResmpAttr; 225 | } AIO_RESMP_INFO_S; 226 | 227 | typedef struct hiAI_ANR_INFO_S 228 | { 229 | HI_BOOL bAnrEnable; /* noise reduce enable or disable */ 230 | } AI_ANR_INFO_S; 231 | 232 | 233 | 234 | /* invlalid device ID */ 235 | #define HI_ERR_AI_INVALID_DEVID HI_DEF_ERR(HI_ID_AI, EN_ERR_LEVEL_ERROR, EN_ERR_INVALID_DEVID) 236 | /* invlalid channel ID */ 237 | #define HI_ERR_AI_INVALID_CHNID HI_DEF_ERR(HI_ID_AI, EN_ERR_LEVEL_ERROR, EN_ERR_INVALID_CHNID) 238 | /* at lease one parameter is illagal ,eg, an illegal enumeration value */ 239 | #define HI_ERR_AI_ILLEGAL_PARAM HI_DEF_ERR(HI_ID_AI, EN_ERR_LEVEL_ERROR, EN_ERR_ILLEGAL_PARAM) 240 | /* using a NULL point */ 241 | #define HI_ERR_AI_NULL_PTR HI_DEF_ERR(HI_ID_AI, EN_ERR_LEVEL_ERROR, EN_ERR_NULL_PTR) 242 | /* try to enable or initialize system,device or channel, before configing attribute */ 243 | #define HI_ERR_AI_NOT_CONFIG HI_DEF_ERR(HI_ID_AI, EN_ERR_LEVEL_ERROR, EN_ERR_NOT_CONFIG) 244 | /* operation is not supported by NOW */ 245 | #define HI_ERR_AI_NOT_SUPPORT HI_DEF_ERR(HI_ID_AI, EN_ERR_LEVEL_ERROR, EN_ERR_NOT_SUPPORT) 246 | /* operation is not permitted ,eg, try to change stati attribute */ 247 | #define HI_ERR_AI_NOT_PERM HI_DEF_ERR(HI_ID_AI, EN_ERR_LEVEL_ERROR, EN_ERR_NOT_PERM) 248 | /* the devide is not enabled */ 249 | #define HI_ERR_AI_NOT_ENABLED HI_DEF_ERR(HI_ID_AI, EN_ERR_LEVEL_ERROR, EN_ERR_UNEXIST) 250 | /* failure caused by malloc memory */ 251 | #define HI_ERR_AI_NOMEM HI_DEF_ERR(HI_ID_AI, EN_ERR_LEVEL_ERROR, EN_ERR_NOMEM) 252 | /* failure caused by malloc buffer */ 253 | #define HI_ERR_AI_NOBUF HI_DEF_ERR(HI_ID_AI, EN_ERR_LEVEL_ERROR, EN_ERR_NOBUF) 254 | /* no data in buffer */ 255 | #define HI_ERR_AI_BUF_EMPTY HI_DEF_ERR(HI_ID_AI, EN_ERR_LEVEL_ERROR, EN_ERR_BUF_EMPTY) 256 | /* no buffer for new data */ 257 | #define HI_ERR_AI_BUF_FULL HI_DEF_ERR(HI_ID_AI, EN_ERR_LEVEL_ERROR, EN_ERR_BUF_FULL) 258 | /* system is not ready,had not initialed or loaded*/ 259 | #define HI_ERR_AI_SYS_NOTREADY HI_DEF_ERR(HI_ID_AI, EN_ERR_LEVEL_ERROR, EN_ERR_SYS_NOTREADY) 260 | 261 | #define HI_ERR_AI_BUSY HI_DEF_ERR(HI_ID_AI, EN_ERR_LEVEL_ERROR, EN_ERR_BUSY) 262 | 263 | /* invlalid device ID */ 264 | #define HI_ERR_AO_INVALID_DEVID HI_DEF_ERR(HI_ID_AO, EN_ERR_LEVEL_ERROR, EN_ERR_INVALID_DEVID) 265 | /* invlalid channel ID */ 266 | #define HI_ERR_AO_INVALID_CHNID HI_DEF_ERR(HI_ID_AO, EN_ERR_LEVEL_ERROR, EN_ERR_INVALID_CHNID) 267 | /* at lease one parameter is illagal ,eg, an illegal enumeration value */ 268 | #define HI_ERR_AO_ILLEGAL_PARAM HI_DEF_ERR(HI_ID_AO, EN_ERR_LEVEL_ERROR, EN_ERR_ILLEGAL_PARAM) 269 | /* using a NULL point */ 270 | #define HI_ERR_AO_NULL_PTR HI_DEF_ERR(HI_ID_AO, EN_ERR_LEVEL_ERROR, EN_ERR_NULL_PTR) 271 | /* try to enable or initialize system,device or channel, before configing attribute */ 272 | #define HI_ERR_AO_NOT_CONFIG HI_DEF_ERR(HI_ID_AO, EN_ERR_LEVEL_ERROR, EN_ERR_NOT_CONFIG) 273 | /* operation is not supported by NOW */ 274 | #define HI_ERR_AO_NOT_SUPPORT HI_DEF_ERR(HI_ID_AO, EN_ERR_LEVEL_ERROR, EN_ERR_NOT_SUPPORT) 275 | /* operation is not permitted ,eg, try to change stati attribute */ 276 | #define HI_ERR_AO_NOT_PERM HI_DEF_ERR(HI_ID_AO, EN_ERR_LEVEL_ERROR, EN_ERR_NOT_PERM) 277 | /* the devide is not enabled */ 278 | #define HI_ERR_AO_NOT_ENABLED HI_DEF_ERR(HI_ID_AO, EN_ERR_LEVEL_ERROR, EN_ERR_UNEXIST) 279 | /* failure caused by malloc memory */ 280 | #define HI_ERR_AO_NOMEM HI_DEF_ERR(HI_ID_AO, EN_ERR_LEVEL_ERROR, EN_ERR_NOMEM) 281 | /* failure caused by malloc buffer */ 282 | #define HI_ERR_AO_NOBUF HI_DEF_ERR(HI_ID_AO, EN_ERR_LEVEL_ERROR, EN_ERR_NOBUF) 283 | /* no data in buffer */ 284 | #define HI_ERR_AO_BUF_EMPTY HI_DEF_ERR(HI_ID_AO, EN_ERR_LEVEL_ERROR, EN_ERR_BUF_EMPTY) 285 | /* no buffer for new data */ 286 | #define HI_ERR_AO_BUF_FULL HI_DEF_ERR(HI_ID_AO, EN_ERR_LEVEL_ERROR, EN_ERR_BUF_FULL) 287 | /* system is not ready,had not initialed or loaded*/ 288 | #define HI_ERR_AO_SYS_NOTREADY HI_DEF_ERR(HI_ID_AO, EN_ERR_LEVEL_ERROR, EN_ERR_SYS_NOTREADY) 289 | 290 | #define HI_ERR_AO_BUSY HI_DEF_ERR(HI_ID_AO, EN_ERR_LEVEL_ERROR, EN_ERR_BUSY) 291 | 292 | 293 | #ifdef __cplusplus 294 | #if __cplusplus 295 | } 296 | #endif 297 | #endif /* End of #ifdef __cplusplus */ 298 | 299 | #endif /* End of #ifndef __HI_COMM_AI_H__ */ 300 | 301 | -------------------------------------------------------------------------------- /pjlib/include/hi_inc/hi_comm_ao.h: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | 3 | Copyright (C), 2001-2011, Hisilicon Tech. Co., Ltd. 4 | 5 | ****************************************************************************** 6 | File Name : hi_comm_ao.h 7 | Version : Initial Draft 8 | Author : Hisilicon multimedia software group 9 | Created : 2009/5/5 10 | Description : 11 | History : 12 | 1.Date : 2009/5/5 13 | Author : p00123320 14 | Modification: Created file 15 | ******************************************************************************/ 16 | 17 | 18 | #ifndef __HI_COMM_AO_H__ 19 | #define __HI_COMM_AO_H__ 20 | 21 | #ifdef __cplusplus 22 | #if __cplusplus 23 | extern "C"{ 24 | #endif 25 | #endif /* End of #ifdef __cplusplus */ 26 | 27 | 28 | 29 | 30 | #ifdef __cplusplus 31 | #if __cplusplus 32 | } 33 | #endif 34 | #endif /* End of #ifdef __cplusplus */ 35 | 36 | #endif /* End of #ifndef __HI_COMM_AO_H__ */ 37 | 38 | -------------------------------------------------------------------------------- /pjlib/include/hi_inc/hi_comm_hdmi.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dulton/hi35xx-pjsip/49d821d9fa23740daba04dbe881b9d358c6a50a5/pjlib/include/hi_inc/hi_comm_hdmi.h -------------------------------------------------------------------------------- /pjlib/include/hi_inc/hi_comm_ive.h: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | 3 | Copyright (C), 2001-2011, HiSilicon Technologies Co., Ltd. 4 | 5 | ****************************************************************************** 6 | File Name : hi_comm_ive.h 7 | Version : Initial Draft 8 | Author : HiSilicon multimedia software group 9 | Created on : 2011-04-12 10 | Description : Intelligent video engine (IVE) data structure 11 | 12 | History : 13 | 1.Date : 2011-04-12 14 | Author : Gong Xiongliang (employee ID: 00181683) 15 | Modification: This file is created. 16 | ******************************************************************************/ 17 | 18 | #ifndef __HI_COMM_IVE_H__ 19 | #define __HI_COMM_IVE_H__ 20 | 21 | #include "hi_type.h" 22 | #include "hi_debug.h" 23 | #include "hi_common.h" 24 | #include "hi_errno.h" 25 | #include "hi_defines.h" 26 | 27 | #ifdef __cplusplus 28 | #if __cplusplus 29 | extern "C"{ 30 | #endif 31 | #endif 32 | 33 | #define IVE_MAX_HANDLE_NR 0x0FFFFFFF 34 | 35 | /* 36 | *Describes the information about stored data. 37 | */ 38 | typedef struct hiIVE_DATA_ATTR_S 39 | { 40 | HI_U32 u32PhyAddr; /*Physical address of the data*/ 41 | HI_U32 u32Stride; /*Data stride*/ 42 | }IVE_MEM_INFO_S; 43 | 44 | /* 45 | *Type of the input data 46 | *The input data is classified into three types: 47 | *SP420, SP422, and single component (including the components Y, U, V, R, G, and B) 48 | */ 49 | typedef enum hiIVE_SRC_FMT_E 50 | { 51 | IVE_SRC_FMT_SINGLE = 0, /*Single component*/ 52 | IVE_SRC_FMT_SP420, /*YUV SP420*/ 53 | IVE_SRC_FMT_SP422, /*YUV SP422*/ 54 | IVE_SRC_FMT_BUTT 55 | }IVE_SRC_FMT_E; 56 | 57 | /* 58 | *Input data format 59 | *Information about the data formats supported by the IVE. The IVE supports the data in the following formats: 60 | *1 YUV SP422/SP420 61 | *2 RGB package/planar 62 | *3 Single component 63 | */ 64 | typedef struct hiIVE_SRC_INFO_S 65 | { 66 | IVE_SRC_FMT_E enSrcFmt; 67 | IVE_MEM_INFO_S stSrcMem; /*Data information*/ 68 | 69 | HI_U32 u32Height; /*Data height*/ 70 | HI_U32 u32Width; /*Data width*/ 71 | }IVE_SRC_INFO_S; 72 | 73 | 74 | /* 75 | *Type of the color space conversion (CSC) output results 76 | */ 77 | typedef enum hiIVE_CSC_OUT_FMT_E 78 | { 79 | IVE_CSC_OUT_FMT_PACKAGE = 0, 80 | IVE_CSC_OUT_FMT_PLANAR, 81 | IVE_CSC_OUT_FMT_BUTT 82 | }IVE_CSC_OUT_FMT_E; 83 | 84 | /* 85 | *CSC working mode 86 | */ 87 | typedef enum hiIVE_CSC_MODE_E 88 | { 89 | IVE_CSC_MODE_VIDEO_BT601_AND_BT656 = 0, /*CSC video transfer mode [16, 235]*/ 90 | IVE_CSC_MODE_VIDEO_BT709, /*CSC video transfer mode [16, 235]*/ 91 | IVE_CSC_MODE_PIC_BT601_AND_BT656, /*CSC picture transfer mode [0, 255]*/ 92 | IVE_CSC_MODE_PIC_BT709, /*CSC picture transfer mode [0, 255]*/ 93 | IVE_CSC_MODE_BUTT 94 | }IVE_CSC_MODE_E; 95 | 96 | /* 97 | *CSC control parameters 98 | *You need to set these parameters when using the CSC operator. 99 | */ 100 | typedef struct hiIVE_CSC_CTRL_S 101 | { 102 | IVE_CSC_OUT_FMT_E enOutFmt; /*Output format*/ 103 | IVE_CSC_MODE_E enCscMode; /*Working mode*/ 104 | }IVE_CSC_CTRL_S; 105 | 106 | 107 | /* 108 | *Filter control parameters 109 | *You need to set these parameters when using the filter operator. 110 | */ 111 | typedef struct hiIVE_FILTER_CTRL_S 112 | { 113 | HI_S8 as8Mask[9]; /*Template parameter filter coefficient*/ 114 | HI_S8 u8Norm; /*Sum of all mask parameter values for normalization*/ 115 | }IVE_FILTER_CTRL_S; 116 | 117 | 118 | /* 119 | *Filter+CSC control parameters 120 | *You need to set these parameters when using the filter+CSC operator. 121 | *The control information about both the filter and CSC needs to be configured. 122 | */ 123 | typedef struct hiIVE_FILTER_AND_CSC_CTRL_S 124 | { 125 | IVE_CSC_OUT_FMT_E enOutFmt; /*Output format*/ 126 | IVE_CSC_MODE_E enCscMode; /*CSC working mode*/ 127 | HI_S8 as8Mask[9]; /*Template parameter filter coefficient*/ 128 | HI_S8 u8Norm; /*Sum of all mask parameter values for normalization*/ 129 | }IVE_FILTER_AND_CSC_CTRL_S; 130 | 131 | /* 132 | *SOBEL control parameter 133 | */ 134 | typedef struct hiIVE_SOBEL_CTRL_S 135 | { 136 | HI_S8 as8Mask[9]; /*Template parameter*/ 137 | }IVE_SOBEL_CTRL_S; 138 | 139 | 140 | 141 | /* 142 | *Type of the CANNY output results 143 | */ 144 | typedef enum hiIVE_CANNY_OUT_FMT_E 145 | { 146 | IVE_CANNY_OUT_FMT_ONLY_MAG = 0, /*Only the magnitude is output.*/ 147 | IVE_CANNY_OUT_FMT_MAG_AND_ANG, /*The magnitude and angle are output.*/ 148 | IVE_CANNY_OUT_FMT_BUTT 149 | }IVE_CANNY_OUT_FMT_E; 150 | 151 | /* 152 | *CANNY control parameter 153 | */ 154 | typedef struct hiIVE_CANNY_CTRL_S 155 | { 156 | IVE_CANNY_OUT_FMT_E enOutFmt; 157 | HI_S8 as8Mask[9]; /*The template parameter is the same as that of the SOBEL operator.*/ 158 | }IVE_CANNY_CTRL_S; 159 | 160 | 161 | /* 162 | *Dilate control parameters 163 | */ 164 | typedef struct hiIVE_DILATE_CTRL_S 165 | { 166 | HI_U8 au8Mask[9]; /*The template parameter value must be 0 or 255.*/ 167 | }IVE_DILATE_CTRL_S; 168 | 169 | 170 | /* 171 | *Erode control parameter 172 | */ 173 | typedef struct hiIVE_ERODE_CTRL_S 174 | { 175 | HI_U8 au8Mask[9]; /*The template parameter value must be 0 or 255.*/ 176 | }IVE_ERODE_CTRL_S; 177 | 178 | 179 | /* 180 | *Type of the thresh output results 181 | */ 182 | typedef enum hiIVE_THRESH_OUT_FMT_E 183 | { 184 | IVE_THRESH_OUT_FMT_BINARY = 0,/*If the source value is greater than the thresh, the maximum value is used; if the source value is smaller than or equal to the thresh, the minimum value is used.*/ 185 | IVE_THRESH_OUT_FMT_TRUNC, /*If the source value is greater than the thresh, the maximum value is used; if the source value is smaller than or equal to the thresh, the source value is retained.*/ 186 | IVE_THRESH_OUT_FMT_TOZERO, /*If the source value is greater than the thresh, the source value is retained; if the source value is smaller than or equal to the thresh, the minimum value is used.*/ 187 | IVE_THRESH_OUT_FMT_BUTT 188 | }IVE_THRESH_OUT_FMT_E; 189 | 190 | /* 191 | *Thresh control parameters 192 | */ 193 | typedef struct hiIVE_THRESH_CTRL_S 194 | { 195 | IVE_THRESH_OUT_FMT_E enOutFmt; 196 | HI_U32 u32Thresh; /*user-defined threshold*/ 197 | HI_U32 u32MinVal; /*Minimum value when binarization*/ 198 | HI_U32 u32MaxVal; /*Maxmum value when binarization*/ 199 | }IVE_THRESH_CTRL_S; 200 | 201 | 202 | /* 203 | *Type of the SUB output results 204 | */ 205 | typedef enum hiIVE_SUB_OUT_FMT_E 206 | { 207 | IVE_SUB_OUT_FMT_ABS = 0, /*Absolute value of the difference*/ 208 | IVE_SUB_OUT_FMT_SFR, /*The output result is obtained by shifting the result one digit right to reserve the signed bit.*/ 209 | IVE_SUB_OUT_FMT_BUTT 210 | }IVE_SUB_OUT_FMT_E; 211 | 212 | 213 | /*Invalid device ID*/ 214 | #define HI_ERR_IVE_INVALID_DEVID HI_DEF_ERR(HI_ID_IVE, EN_ERR_LEVEL_ERROR, EN_ERR_INVALID_DEVID) 215 | /*Invalid channel ID*/ 216 | #define HI_ERR_IVE_INVALID_CHNID HI_DEF_ERR(HI_ID_IVE, EN_ERR_LEVEL_ERROR, EN_ERR_INVALID_CHNID) 217 | /*At least one parameter is illegal. For example, an illegal enumeration value exists.*/ 218 | #define HI_ERR_IVE_ILLEGAL_PARAM HI_DEF_ERR(HI_ID_IVE, EN_ERR_LEVEL_ERROR, EN_ERR_ILLEGAL_PARAM) 219 | /*The channel exists.*/ 220 | #define HI_ERR_IVE_EXIST HI_DEF_ERR(HI_ID_IVE, EN_ERR_LEVEL_ERROR, EN_ERR_EXIST) 221 | /*The UN exists.*/ 222 | #define HI_ERR_IVE_UNEXIST HI_DEF_ERR(HI_ID_IVE, EN_ERR_LEVEL_ERROR, EN_ERR_UNEXIST) 223 | /*A null point is used.*/ 224 | #define HI_ERR_IVE_NULL_PTR HI_DEF_ERR(HI_ID_IVE, EN_ERR_LEVEL_ERROR, EN_ERR_NULL_PTR) 225 | /*Try to enable or initialize the system, device, or channel before configuring attributes.*/ 226 | #define HI_ERR_IVE_NOT_CONFIG HI_DEF_ERR(HI_ID_IVE, EN_ERR_LEVEL_ERROR, EN_ERR_NOT_CONFIG) 227 | /*The operation is not supported currently.*/ 228 | #define HI_ERR_IVE_NOT_SURPPORT HI_DEF_ERR(HI_ID_IVE, EN_ERR_LEVEL_ERROR, EN_ERR_NOT_SUPPORT) 229 | /*The operation, changing static attributes for example, is not permitted.*/ 230 | #define HI_ERR_IVE_NOT_PERM HI_DEF_ERR(HI_ID_IVE, EN_ERR_LEVEL_ERROR, EN_ERR_NOT_PERM) 231 | /*A failure caused by the malloc memory occurs.*/ 232 | #define HI_ERR_IVE_NOMEM HI_DEF_ERR(HI_ID_IVE, EN_ERR_LEVEL_ERROR, EN_ERR_NOMEM) 233 | /*A failure caused by the malloc buffer occurs.*/ 234 | #define HI_ERR_IVE_NOBUF HI_DEF_ERR(HI_ID_IVE, EN_ERR_LEVEL_ERROR, EN_ERR_NOBUF) 235 | /*The buffer is empty.*/ 236 | #define HI_ERR_IVE_BUF_EMPTY HI_DEF_ERR(HI_ID_IVE, EN_ERR_LEVEL_ERROR, EN_ERR_BUF_EMPTY) 237 | /*No buffer is provided for storing new data.*/ 238 | #define HI_ERR_IVE_BUF_FULL HI_DEF_ERR(HI_ID_IVE, EN_ERR_LEVEL_ERROR, EN_ERR_BUF_FULL) 239 | /*The source address or target address is incorrect during the operations such as calling copy_from_user or copy_to_user.*/ 240 | #define HI_ERR_IVE_BADADDR HI_DEF_ERR(HI_ID_IVE, EN_ERR_LEVEL_ERROR, EN_ERR_BADADDR) 241 | /*The resource is busy during the operations such as destroying a VENC channel without deregistering it.*/ 242 | #define HI_ERR_IVE_BUSY HI_DEF_ERR(HI_ID_IVE, EN_ERR_LEVEL_ERROR, EN_ERR_BUSY) 243 | 244 | /*The system is not ready because it may be not initialized or loaded. 245 | *The error code is returned when a device file fails to be opened. 246 | */ 247 | #define HI_ERR_IVE_NOTREADY HI_DEF_ERR(HI_ID_IVE, EN_ERR_LEVEL_ERROR, EN_ERR_SYS_NOTREADY) 248 | 249 | 250 | #ifdef __cplusplus 251 | #if __cplusplus 252 | } 253 | #endif 254 | #endif 255 | #endif/*__HI_COMM_IVE_H__*/ 256 | 257 | 258 | -------------------------------------------------------------------------------- /pjlib/include/hi_inc/hi_comm_pciv.h: -------------------------------------------------------------------------------- 1 | 2 | /****************************************************************************** 3 | 4 | Copyright (C), 2001-2011, Hisilicon Tech. Co., Ltd. 5 | 6 | ****************************************************************************** 7 | File Name : hi_comm_pciv.h 8 | Version : Initial Draft 9 | Author : Hisilicon multimedia software pciv 10 | Created : 2008/06/04 11 | Last Modified : 12 | Description : common struct definition for PCIV 13 | Function List : 14 | History : 15 | 16 | ******************************************************************************/ 17 | 18 | #ifndef __HI_COMM_PCIV_H__ 19 | #define __HI_COMM_PCIV_H__ 20 | 21 | #include "hi_type.h" 22 | #include "hi_common.h" 23 | #include "hi_errno.h" 24 | #include "hi_comm_video.h" 25 | #include "hi_comm_vdec.h" 26 | #include "hi_comm_vpss.h" 27 | 28 | #ifdef __cplusplus 29 | #if __cplusplus 30 | extern "C"{ 31 | #endif 32 | #endif /* __cplusplus */ 33 | 34 | typedef HI_S32 PCIV_CHN; 35 | 36 | #define PCIV_MAX_BUF_NUM 16 /* pciv channel max buffer number */ 37 | #define PCIV_MAX_CHIPNUM 32 /* max pciv device number which can join in the system */ 38 | 39 | #define MAKE_DWORD(high,low) (((low)&0x0000ffff)|((high)<<16)) 40 | #define HIGH_WORD(x) (((x)&0xffff0000)>>16) 41 | #define LOW_WORD(x) ((x)&0x0000ffff) 42 | 43 | /* vi object struct */ 44 | typedef struct hiPCIV_VIDEVICE_S 45 | { 46 | VI_DEV viDev; /* vi device number */ 47 | VI_CHN viChn; /* vi channel number */ 48 | } PCIV_VIDEVICE_S; 49 | 50 | /* vo object struct */ 51 | typedef struct hiPCIV_VODEVICE_S 52 | { 53 | VO_DEV voDev; /* vo device number */ 54 | VO_CHN voChn; /* vo channel number */ 55 | } PCIV_VODEVICE_S; 56 | 57 | /* vdec object struct */ 58 | typedef struct hiPCIV_VDECDEVICE_S 59 | { 60 | VDEC_CHN vdecChn; /* vedc channel number */ 61 | } PCIV_VDECDEVICE_S; 62 | 63 | /* vpss object struct */ 64 | typedef struct hiPCIV_VPSSDEVICE_S 65 | { 66 | VPSS_GRP vpssGrp; /* vpss group number */ 67 | VPSS_CHN vpssChn; /* vpss channel number */ 68 | } PCIV_VPSSDEVICE_S; 69 | 70 | /* bind type for pciv */ 71 | typedef enum hiPCIV_BIND_TYPE_E 72 | { 73 | PCIV_BIND_VI = 0, 74 | PCIV_BIND_VO = 1, 75 | PCIV_BIND_VDEC = 2, 76 | PCIV_BIND_VPSS = 3, 77 | PCIV_BIND_BUTT 78 | } PCIV_BIND_TYPE_E; 79 | 80 | /* bind object struct for pciv */ 81 | typedef struct hiPCI_BIND_OBJ_S 82 | { 83 | PCIV_BIND_TYPE_E enType; /* bind type for pciv */ 84 | union 85 | { 86 | PCIV_VIDEVICE_S viDevice; 87 | PCIV_VODEVICE_S voDevice; 88 | PCIV_VDECDEVICE_S vdecDevice; 89 | PCIV_VPSSDEVICE_S vpssDevice; 90 | } unAttachObj; 91 | } PCIV_BIND_OBJ_S; 92 | 93 | /* remote pciv object */ 94 | typedef struct hiPCIV_REMOTE_OBJ_S 95 | { 96 | HI_S32 s32ChipId; /* remote pciv device Id number */ 97 | PCIV_CHN pcivChn; /* pciv channel number of remote pciv device */ 98 | } PCIV_REMOTE_OBJ_S; 99 | 100 | /* attribution of target picture */ 101 | typedef struct hiPCIV_PIC_ATTR_S 102 | { 103 | HI_U32 u32Width; /* pciture width of pciv channel */ 104 | HI_U32 u32Height; /* picture height of pciv channel */ 105 | HI_U32 u32Stride[3]; /* pciture stride of pciv channel */ 106 | VIDEO_FIELD_E u32Field; /* video frame field type of pciv channel */ 107 | PIXEL_FORMAT_E enPixelFormat; /* pixel format of pciture of pciv channel */ 108 | } PCIV_PIC_ATTR_S; 109 | 110 | 111 | /* attribution of pciv chn */ 112 | typedef struct hiPCIV_ATTR_S 113 | { 114 | PCIV_PIC_ATTR_S stPicAttr; /* picture attibute */ 115 | HI_S32 s32BufChip; /* The chip id which buffer is belong to */ 116 | HI_U32 u32BlkSize; /* vb size of receiver for preview */ 117 | HI_U32 u32Count; /* lenght of address list */ 118 | HI_U32 u32PhyAddr[PCIV_MAX_BUF_NUM]; /* address list for picture move */ 119 | PCIV_REMOTE_OBJ_S stRemoteObj; /* remote pciv object */ 120 | } PCIV_ATTR_S; 121 | 122 | /* max count of video buffer block for pci window */ 123 | #define PCIV_MAX_VBCOUNT 8 124 | 125 | /* mpp video buffer config for pci window */ 126 | typedef struct hiPCIV_WINVBCFG_S 127 | { 128 | HI_U32 u32PoolCount; /* total number of video buffer pool */ 129 | HI_U32 u32BlkSize[PCIV_MAX_VBCOUNT]; /* size of video buffer pool */ 130 | HI_U32 u32BlkCount[PCIV_MAX_VBCOUNT]; /* number of video buffer pool */ 131 | } PCIV_WINVBCFG_S; 132 | 133 | typedef struct hiPCIV_BASEWINDOW_S 134 | { 135 | HI_S32 s32ChipId; /* pciv device number */ 136 | HI_U32 u32NpWinBase; /* non-prefetch window pcie base address */ 137 | HI_U32 u32PfWinBase; /* prefetch window pcie base address */ 138 | HI_U32 u32CfgWinBase; /* config window pcie base address */ 139 | HI_U32 u32PfAHBAddr; /* prefetch window AHB base address */ 140 | } PCIV_BASEWINDOW_S; 141 | 142 | #define PCIV_MAX_DMABLK 128 143 | typedef struct hiPCIV_DMA_BLOCK_S 144 | { 145 | HI_U32 u32SrcAddr; /* source address of dma task */ 146 | HI_U32 u32DstAddr; /* destination address of dma task */ 147 | HI_U32 u32BlkSize; /* data block size of dma task */ 148 | } PCIV_DMA_BLOCK_S; 149 | 150 | typedef struct hiPCIV_DMA_TASK_S 151 | { 152 | HI_U32 u32Count; /* total dma task number */ 153 | HI_BOOL bRead; /* dam task is read or write data */ 154 | PCIV_DMA_BLOCK_S *pBlock; 155 | } PCIV_DMA_TASK_S; 156 | 157 | 158 | /* 159 | * Message port used in pciv_drvadp, you can't use it in your application. 160 | */ 161 | #define PCIV_MSGPORT_KERNEL 80 162 | 163 | 164 | /* 165 | * You should not use follow mocros, they will be deleted ! 166 | */ 167 | #define PCIV_MSGPORT_MAXPORT 100 168 | #define PCIV_MSGPORT_TIME 79 169 | #define PCIV_MSGPORT_USERCMD 81 170 | #define PCIV_MSGPORT_USERNOTIFY2HOST 82 171 | #define PCIV_MSGPORT_USERNOTIFY2SLAVE 83 172 | #define PCIV_MSGPORT_USERNOTIFY2HOST_VDEC 84 173 | #define PCIV_MSGPORT_USERNOTIFY2SLAVE_VDEC 85 174 | #define PCIV_MAXVO_BIND 4 175 | /*----------------------------------------*/ 176 | 177 | typedef enum hiPCIV_FILTER_TYPE_E 178 | { 179 | PCIV_FILTER_TYPE_NORM, 180 | PCIV_FILTER_TYPE_EX, 181 | PCIV_FILTER_TYPE_EX2, 182 | 183 | PCIV_FILTER_TYPE_BUTT 184 | } PCIV_FILTER_TYPE_E; 185 | 186 | typedef enum hiPCIV_PIC_FIELD_E 187 | { 188 | PCIV_FIELD_TOP, 189 | PCIV_FIELD_BOTTOM, 190 | PCIV_FIELD_BOTH, 191 | 192 | PCIV_FIELD_BUTT 193 | } PCIV_PIC_FIELD_E; 194 | 195 | /* 196 | * configuration of pre-process before sending source picture whth PCI 197 | * item in this structrue have default value when sys init 198 | */ 199 | typedef struct hiPCIV_PREPROC_CFG_S 200 | { 201 | PCIV_PIC_FIELD_E enFieldSel; /* pictrue field select */ 202 | PCIV_FILTER_TYPE_E enFilterType; /* filter group type */ 203 | DSU_HSCALE_FILTER_E enHFilter; /* horizontal filter */ 204 | DSU_VSCALE_FILTER_E enVFilterL; /* vertical filter of luminance */ 205 | DSU_VSCALE_FILTER_E enVFilterC; /* vertical filter of chroma */ 206 | } PCIV_PREPROC_CFG_S; 207 | 208 | 209 | #if 0 210 | /* Synchronize the time and PTS. The host is base. */ 211 | typedef struct hiPCIV_TIME_SYNC_S 212 | { 213 | struct timeval stSysTime; /* The current system time */ 214 | HI_U64 u64PtsBase; /* The media PTS */ 215 | HI_U32 u32ReqTagId; 216 | } PCIV_TIME_SYNC_S; 217 | #endif 218 | 219 | /* invlalid channel ID */ 220 | #define HI_ERR_PCIV_INVALID_CHNID HI_DEF_ERR(HI_ID_PCIV, EN_ERR_LEVEL_ERROR, EN_ERR_INVALID_CHNID) 221 | /* at lease one parameter is illagal ,eg, an illegal enumeration value */ 222 | #define HI_ERR_PCIV_ILLEGAL_PARAM HI_DEF_ERR(HI_ID_PCIV, EN_ERR_LEVEL_ERROR, EN_ERR_ILLEGAL_PARAM) 223 | /* channel exists */ 224 | #define HI_ERR_PCIV_EXIST HI_DEF_ERR(HI_ID_PCIV, EN_ERR_LEVEL_ERROR, EN_ERR_EXIST) 225 | /* channel exists */ 226 | #define HI_ERR_PCIV_UNEXIST HI_DEF_ERR(HI_ID_PCIV, EN_ERR_LEVEL_ERROR, EN_ERR_UNEXIST) 227 | /* using a NULL point */ 228 | #define HI_ERR_PCIV_NULL_PTR HI_DEF_ERR(HI_ID_PCIV, EN_ERR_LEVEL_ERROR, EN_ERR_NULL_PTR) 229 | /* try to enable or initialize system,device or channel, before configing attribute */ 230 | #define HI_ERR_PCIV_NOT_CONFIG HI_DEF_ERR(HI_ID_PCIV, EN_ERR_LEVEL_ERROR, EN_ERR_NOT_CONFIG) 231 | /* operation is not supported by NOW */ 232 | #define HI_ERR_PCIV_NOT_SUPPORT HI_DEF_ERR(HI_ID_PCIV, EN_ERR_LEVEL_ERROR, EN_ERR_NOT_SUPPORT) 233 | /* operation is not permitted ,eg, try to change stati attribute */ 234 | #define HI_ERR_PCIV_NOT_PERM HI_DEF_ERR(HI_ID_PCIV, EN_ERR_LEVEL_ERROR, EN_ERR_NOT_PERM) 235 | /* failure caused by malloc memory */ 236 | #define HI_ERR_PCIV_NOMEM HI_DEF_ERR(HI_ID_PCIV, EN_ERR_LEVEL_ERROR, EN_ERR_NOMEM) 237 | /* failure caused by malloc buffer */ 238 | #define HI_ERR_PCIV_NOBUF HI_DEF_ERR(HI_ID_PCIV, EN_ERR_LEVEL_ERROR, EN_ERR_NOBUF) 239 | /* no data in buffer */ 240 | #define HI_ERR_PCIV_BUF_EMPTY HI_DEF_ERR(HI_ID_PCIV, EN_ERR_LEVEL_ERROR, EN_ERR_BUF_EMPTY) 241 | /* no buffer for new data */ 242 | #define HI_ERR_PCIV_BUF_FULL HI_DEF_ERR(HI_ID_PCIV, EN_ERR_LEVEL_ERROR, EN_ERR_BUF_FULL) 243 | /* system is not ready,had not initialed or loaded*/ 244 | #define HI_ERR_PCIV_SYS_NOTREADY HI_DEF_ERR(HI_ID_PCIV, EN_ERR_LEVEL_ERROR, EN_ERR_SYS_NOTREADY) 245 | /* One DMA task is working, wait a minute */ 246 | #define HI_ERR_PCIV_BUSY HI_DEF_ERR(HI_ID_PCIV, EN_ERR_LEVEL_ERROR, EN_ERR_BUSY) 247 | #define HI_ERR_PCIV_TIMEOUT HI_DEF_ERR(HI_ID_PCIV, EN_ERR_LEVEL_ERROR, EN_ERR_BUTT+1) 248 | 249 | #define PCIV_TRACE(level, fmt...)\ 250 | do{ \ 251 | HI_TRACE(level, HI_ID_PCIV,"[Func]:%s [Line]:%d [Info]:", __FUNCTION__, __LINE__);\ 252 | HI_TRACE(level,HI_ID_PCIV,##fmt);\ 253 | }while(0) 254 | 255 | #define PCIV_CHECK_CHNID(ChnID)\ 256 | do{\ 257 | if(((ChnID) < 0) || ((ChnID) >= PCIV_MAX_CHN_NUM))\ 258 | {\ 259 | PCIV_TRACE(HI_DBG_ERR, "invalid chn id:%d \n", ChnID);\ 260 | return HI_ERR_PCIV_INVALID_CHNID;\ 261 | }\ 262 | }while(0) 263 | 264 | #define PCIV_CHECK_PTR(ptr)\ 265 | do{\ 266 | if(NULL == (ptr))\ 267 | {\ 268 | return HI_ERR_PCIV_NULL_PTR;\ 269 | }\ 270 | }while(0) 271 | 272 | 273 | #ifdef __cplusplus 274 | #if __cplusplus 275 | } 276 | #endif 277 | #endif /* __cplusplus */ 278 | #endif /* __HI_COMM_PCIV_H__ */ 279 | 280 | -------------------------------------------------------------------------------- /pjlib/include/hi_inc/hi_comm_region.h: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * 3 | * Copyright (C), 2001-2011, Huawei Tech. Co., Ltd. 4 | * 5 | ******************************************************************************* 6 | * File Name : hi_comm_region.h 7 | * Version : Initial Draft 8 | * Author : j00169368 9 | * Created : 2010/12/13 10 | * Last Modified : 11 | * Description : include RGN struct , Marco and Error information 12 | * Function List : 13 | * 14 | * 15 | * History: 16 | * 17 | * 1. Date : 2010/12/13 18 | * Author : j00169368 19 | * Modification : Created file 20 | * 21 | ******************************************************************************/ 22 | 23 | 24 | #ifndef __HI_COMM_REGION_H__ 25 | #define __HI_COMM_REGION_H__ 26 | 27 | #include "hi_common.h" 28 | #include "hi_comm_video.h" 29 | #include "hi_errno.h" 30 | #include "hi_defines.h" 31 | 32 | 33 | #ifdef __cplusplus 34 | #if __cplusplus 35 | extern "C"{ 36 | #endif 37 | #endif /* End of #ifdef __cplusplus */ 38 | 39 | 40 | 41 | 42 | 43 | typedef HI_U32 RGN_HANDLE; 44 | 45 | /* type of video regions */ 46 | typedef enum hiRGN_TYPE_E 47 | { 48 | OVERLAY_RGN = 0, /* video overlay region */ 49 | COVER_RGN, 50 | COVEREX_RGN, 51 | OVERLAYEX_RGN, 52 | RGN_BUTT 53 | } RGN_TYPE_E; 54 | 55 | typedef enum hiINVERT_COLOR_MODE_E 56 | { 57 | LESSTHAN_LUM_THRESH = 0, /* the lum of the video is less than the lum threshold which is set by u32LumThresh */ 58 | MORETHAN_LUM_THRESH, /* the lum of the video is more than the lum threshold which is set by u32LumThresh */ 59 | INVERT_COLOR_BUTT 60 | }INVERT_COLOR_MODE_E; 61 | 62 | typedef struct hiOVERLAY_QP_INFO_S 63 | { 64 | HI_BOOL bAbsQp; 65 | HI_S32 s32Qp; 66 | }OVERLAY_QP_INFO_S; 67 | 68 | typedef struct hiOVERLAY_INVERT_COLOR_S 69 | { 70 | SIZE_S stInvColArea; //It must be multipe of 16 but not more than 64. 71 | HI_U32 u32LumThresh; //The threshold to decide whether invert the OSD's color or not. 72 | INVERT_COLOR_MODE_E enChgMod; 73 | HI_BOOL bInvColEn; //The switch of inverting color. 74 | }OVERLAY_INVERT_COLOR_S; 75 | 76 | /* Define which feild to be attached */ 77 | typedef enum hiRGN_ATTACH_FIELD_E 78 | { 79 | RGN_ATTACH_FIELD_FRAME = 0, /* whole frame */ 80 | RGN_ATTACH_FIELD_TOP, /* top field */ 81 | RGN_ATTACH_FIELD_BOTTOM, /* bottom field */ 82 | 83 | RGN_ATTACH_FIELD_BUTT 84 | } RGN_ATTACH_FIELD_E; 85 | 86 | typedef struct hiOVERLAY_ATTR_S 87 | { 88 | /* bitmap pixel format,now only support ARGB1555 or ARGB4444 */ 89 | PIXEL_FORMAT_E enPixelFmt; 90 | 91 | /* background color, pixel format depends on "enPixelFmt" */ 92 | HI_U32 u32BgColor; 93 | 94 | /* region size,W:[4,4096],align:2,H:[4,4096],align:2 */ 95 | SIZE_S stSize; 96 | }OVERLAY_ATTR_S; 97 | 98 | typedef struct hiOVERLAY_CHN_ATTR_S 99 | { 100 | /* X:[0,4096],align:4,Y:[0,4096],align:4 */ 101 | POINT_S stPoint; 102 | 103 | /* background an foreground transparence when pixel format is ARGB1555 104 | * the pixel format is ARGB1555,when the alpha bit is 1 this alpha is value! 105 | * range:[0,128] 106 | */ 107 | HI_U32 u32FgAlpha; 108 | 109 | /* background an foreground transparence when pixel format is ARGB1555 110 | * the pixel format is ARGB1555,when the alpha bit is 0 this alpha is value! 111 | * range:[0,128] 112 | */ 113 | HI_U32 u32BgAlpha; 114 | 115 | HI_U32 u32Layer; /* OVERLAY region layer range:[0,7]*/ 116 | 117 | OVERLAY_QP_INFO_S stQpInfo; 118 | 119 | OVERLAY_INVERT_COLOR_S stInvertColor; 120 | }OVERLAY_CHN_ATTR_S; 121 | 122 | typedef struct hiCOVER_CHN_ATTR_S 123 | { 124 | RECT_S stRect; 125 | HI_U32 u32Color; 126 | HI_U32 u32Layer; /* COVER region layer range:[0,3] */ 127 | }COVER_CHN_ATTR_S; 128 | 129 | typedef struct hiCOVEREX_CHN_ATTR_S 130 | { 131 | RECT_S stRect; 132 | HI_U32 u32Color; 133 | HI_U32 u32Layer; /* COVEREX region layer range:[0,7] */ 134 | }COVEREX_CHN_ATTR_S; 135 | 136 | typedef struct hiOVERLAYEX_COMM_ATTR_S 137 | { 138 | PIXEL_FORMAT_E enPixelFmt; 139 | 140 | /* background color, pixel format depends on "enPixelFmt" */ 141 | HI_U32 u32BgColor; 142 | 143 | /* region size,W:[4,1920],align:2,H:[4,1080],align:2 */ 144 | SIZE_S stSize; 145 | }OVERLAYEX_ATTR_S; 146 | 147 | typedef struct hiOVERLAYEX_CHN_ATTR_S 148 | { 149 | /* X:[0,4096],align:4,Y:[0,4636],align:4 */ 150 | POINT_S stPoint; 151 | 152 | /* background an foreground transparence when pixel format is ARGB1555 153 | * the pixel format is ARGB1555,when the alpha bit is 1 this alpha is value! 154 | * range:[0,128] 155 | */ 156 | HI_U32 u32FgAlpha; 157 | 158 | /* background an foreground transparence when pixel format is ARGB1555 159 | * the pixel format is ARGB1555,when the alpha bit is 0 this alpha is value! 160 | * range:[0,128] 161 | */ 162 | HI_U32 u32BgAlpha; 163 | 164 | HI_U32 u32Layer; /* OVERLAYEX region layer range:[0,15]*/ 165 | }OVERLAYEX_CHN_ATTR_S; 166 | 167 | typedef union hiRGN_ATTR_U 168 | { 169 | OVERLAY_ATTR_S stOverlay; /* attribute of overlay region */ 170 | OVERLAYEX_ATTR_S stOverlayEx; /* attribute of overlayex region */ 171 | } RGN_ATTR_U; 172 | 173 | typedef union hiRGN_CHN_ATTR_U 174 | { 175 | OVERLAY_CHN_ATTR_S stOverlayChn; /* attribute of overlay region */ 176 | COVER_CHN_ATTR_S stCoverChn; /* attribute of cover region */ 177 | COVEREX_CHN_ATTR_S stCoverExChn; /* attribute of coverex region */ 178 | OVERLAYEX_CHN_ATTR_S stOverlayExChn; /* attribute of overlayex region */ 179 | } RGN_CHN_ATTR_U; 180 | 181 | /* attribute of a region */ 182 | typedef struct hiRGN_ATTR_S 183 | { 184 | RGN_TYPE_E enType; /* region type */ 185 | RGN_ATTR_U unAttr; /* region attribute */ 186 | } RGN_ATTR_S; 187 | 188 | /* attribute of a region */ 189 | typedef struct hiRGN_CHN_ATTR_S 190 | { 191 | HI_BOOL bShow; 192 | RGN_TYPE_E enType; /* region type */ 193 | RGN_CHN_ATTR_U unChnAttr; /* region attribute */ 194 | } RGN_CHN_ATTR_S; 195 | 196 | 197 | 198 | #define RGN_MAX_BMP_UPD_NUM 16 199 | 200 | typedef struct hiRGN_BMP_UPD_S 201 | { 202 | POINT_S stPoint; 203 | BITMAP_S stBmp; 204 | HI_U32 u32Stride; 205 | } RGN_BMP_UPD_S; 206 | 207 | typedef struct hiRGN_BMP_UPD_CFG_S 208 | { 209 | HI_U32 u32BmpCnt; 210 | RGN_BMP_UPD_S astBmpUpd[RGN_MAX_BMP_UPD_NUM]; 211 | } RGN_BMP_UPD_CFG_S; 212 | 213 | 214 | /* invlalid device ID */ 215 | #define HI_ERR_RGN_INVALID_DEVID HI_DEF_ERR(HI_ID_RGN, EN_ERR_LEVEL_ERROR, EN_ERR_INVALID_DEVID) 216 | /* invlalid channel ID */ 217 | #define HI_ERR_RGN_INVALID_CHNID HI_DEF_ERR(HI_ID_RGN, EN_ERR_LEVEL_ERROR, EN_ERR_INVALID_CHNID) 218 | /* at lease one parameter is illagal ,eg, an illegal enumeration value */ 219 | #define HI_ERR_RGN_ILLEGAL_PARAM HI_DEF_ERR(HI_ID_RGN, EN_ERR_LEVEL_ERROR, EN_ERR_ILLEGAL_PARAM) 220 | /* channel exists */ 221 | #define HI_ERR_RGN_EXIST HI_DEF_ERR(HI_ID_RGN, EN_ERR_LEVEL_ERROR, EN_ERR_EXIST) 222 | /*UN exist*/ 223 | #define HI_ERR_RGN_UNEXIST HI_DEF_ERR(HI_ID_RGN, EN_ERR_LEVEL_ERROR, EN_ERR_UNEXIST) 224 | /* using a NULL point */ 225 | #define HI_ERR_RGN_NULL_PTR HI_DEF_ERR(HI_ID_RGN, EN_ERR_LEVEL_ERROR, EN_ERR_NULL_PTR) 226 | /* try to enable or initialize system,device or channel, before configing attribute */ 227 | #define HI_ERR_RGN_NOT_CONFIG HI_DEF_ERR(HI_ID_RGN, EN_ERR_LEVEL_ERROR, EN_ERR_NOT_CONFIG) 228 | /* operation is not supported by NOW */ 229 | #define HI_ERR_RGN_NOT_SUPPORT HI_DEF_ERR(HI_ID_RGN, EN_ERR_LEVEL_ERROR, EN_ERR_NOT_SUPPORT) 230 | /* operation is not permitted ,eg, try to change stati attribute */ 231 | #define HI_ERR_RGN_NOT_PERM HI_DEF_ERR(HI_ID_RGN, EN_ERR_LEVEL_ERROR, EN_ERR_NOT_PERM) 232 | /* failure caused by malloc memory */ 233 | #define HI_ERR_RGN_NOMEM HI_DEF_ERR(HI_ID_RGN, EN_ERR_LEVEL_ERROR, EN_ERR_NOMEM) 234 | /* failure caused by malloc buffer */ 235 | #define HI_ERR_RGN_NOBUF HI_DEF_ERR(HI_ID_RGN, EN_ERR_LEVEL_ERROR, EN_ERR_NOBUF) 236 | /* no data in buffer */ 237 | #define HI_ERR_RGN_BUF_EMPTY HI_DEF_ERR(HI_ID_RGN, EN_ERR_LEVEL_ERROR, EN_ERR_BUF_EMPTY) 238 | /* no buffer for new data */ 239 | #define HI_ERR_RGN_BUF_FULL HI_DEF_ERR(HI_ID_RGN, EN_ERR_LEVEL_ERROR, EN_ERR_BUF_FULL) 240 | /* bad address, eg. used for copy_from_user & copy_to_user */ 241 | #define HI_ERR_RGN_BADADDR HI_DEF_ERR(HI_ID_RGN, EN_ERR_LEVEL_ERROR, EN_ERR_BADADDR) 242 | /* resource is busy, eg. destroy a venc chn without unregistering it */ 243 | #define HI_ERR_RGN_BUSY HI_DEF_ERR(HI_ID_RGN, EN_ERR_LEVEL_ERROR, EN_ERR_BUSY) 244 | 245 | /* System is not ready,maybe not initialed or loaded. 246 | * Returning the error code when opening a device file failed. 247 | */ 248 | #define HI_ERR_RGN_NOTREADY HI_DEF_ERR(HI_ID_RGN, EN_ERR_LEVEL_ERROR, EN_ERR_SYS_NOTREADY) 249 | 250 | 251 | #ifdef __cplusplus 252 | #if __cplusplus 253 | } 254 | #endif 255 | #endif /* __cplusplus */ 256 | 257 | 258 | #endif /* __HI_COMM_REGION_H__ */ 259 | 260 | 261 | 262 | -------------------------------------------------------------------------------- /pjlib/include/hi_inc/hi_comm_sys.h: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | Copyright (C), 2001-2011, Hisilicon Tech. Co., Ltd. 3 | ****************************************************************************** 4 | File Name : hi3511_sys.h 5 | Version : Initial Draft 6 | Author : Hi3511 MPP Team 7 | Created : 2007/1/30 8 | Last Modified : 9 | Description : Hi3511 chip specific configure data structure 10 | Function List : 11 | History : 12 | 1.Date : 2007/1/30 13 | Author : c42025 14 | Modification: Created file 15 | 16 | 2.Date : 2007/11/30 17 | Author : c42025 18 | Modification: modify according review comments 19 | 20 | 3.Date : 2008/03/03 21 | Author : c42025 22 | Modification: modify HI_TRACE_SYS 23 | 24 | 4.Date : 2008/03/05 25 | Author : c42025 26 | Modification: modify 'HI_LOG_LEVEL_ERROR' to 'EN_ERR_LEVEL_ERROR' 27 | 28 | ******************************************************************************/ 29 | #ifndef __HI_COMM_SYS_H__ 30 | #define __HI_COMM_SYS_H__ 31 | 32 | #include "hi_type.h" 33 | #include "hi_errno.h" 34 | #include "hi_debug.h" 35 | 36 | #ifdef __cplusplus 37 | #if __cplusplus 38 | extern "C"{ 39 | #endif 40 | #endif /* End of #ifdef __cplusplus */ 41 | 42 | #define HI_TRACE_SYS(level, fmt...) HI_TRACE(level, HI_ID_SYS,##fmt) 43 | typedef struct hiMPP_SYS_CONF_S 44 | { 45 | /* stride of picture buffer must be aligned with this value. 46 | * you can choose a value from 1 to 1024, and it must be multiple of 16. 47 | */ 48 | HI_U32 u32AlignWidth; 49 | 50 | }MPP_SYS_CONF_S; 51 | 52 | 53 | #define HI_ERR_SYS_NULL_PTR HI_DEF_ERR(HI_ID_SYS, EN_ERR_LEVEL_ERROR, EN_ERR_NULL_PTR) 54 | #define HI_ERR_SYS_NOTREADY HI_DEF_ERR(HI_ID_SYS, EN_ERR_LEVEL_ERROR, EN_ERR_SYS_NOTREADY) 55 | #define HI_ERR_SYS_NOT_PERM HI_DEF_ERR(HI_ID_SYS, EN_ERR_LEVEL_ERROR, EN_ERR_NOT_PERM) 56 | #define HI_ERR_SYS_NOMEM HI_DEF_ERR(HI_ID_SYS, EN_ERR_LEVEL_ERROR, EN_ERR_NOMEM) 57 | #define HI_ERR_SYS_ILLEGAL_PARAM HI_DEF_ERR(HI_ID_SYS, EN_ERR_LEVEL_ERROR, EN_ERR_ILLEGAL_PARAM) 58 | #define HI_ERR_SYS_BUSY HI_DEF_ERR(HI_ID_SYS, EN_ERR_LEVEL_ERROR, EN_ERR_BUSY) 59 | #define HI_ERR_SYS_NOT_SUPPORT HI_DEF_ERR(HI_ID_SYS, EN_ERR_LEVEL_ERROR, EN_ERR_NOT_SUPPORT) 60 | 61 | 62 | #ifdef __cplusplus 63 | #if __cplusplus 64 | } 65 | #endif 66 | #endif /* __cplusplus */ 67 | 68 | #endif /* __HI_COMM_SYS_H__ */ 69 | 70 | -------------------------------------------------------------------------------- /pjlib/include/hi_inc/hi_comm_vb.h: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | Copyright (C), 2001-2011, Hisilicon Tech. Co., Ltd. 3 | ****************************************************************************** 4 | File Name : hi_common.h 5 | Version : Initial Draft 6 | Author : Hi3511 MPP Team 7 | Created : 2006/11/09 8 | Last Modified : 9 | Description : The common data type defination for VB module. 10 | Function List : 11 | History : 12 | 1.Date : 2006/11/03 13 | Author : c42025 14 | Modification: Created file 15 | 16 | 2.Date : 2007/11/30 17 | Author : c42025 18 | Modification: modify according review comments 19 | 20 | 3.Date : 2008/06/18 21 | Author : c42025 22 | Modification: add VB_UID_PCIV 23 | 24 | 4.Date : 2008/10/31 25 | Author : z44949 26 | Modification : Translate the chinese comment 27 | 28 | 5.Date : 2008/10/31 29 | Author : p00123320 30 | Modification : change commentary of u32MaxPoolCnt in VB_CONF_S 31 | ******************************************************************************/ 32 | #ifndef __HI_COMM_VB_H__ 33 | #define __HI_COMM_VB_H__ 34 | 35 | #include "hi_type.h" 36 | #include "hi_errno.h" 37 | #include "hi_debug.h" 38 | 39 | #ifdef __cplusplus 40 | #if __cplusplus 41 | extern "C"{ 42 | #endif 43 | #endif /* End of #ifdef __cplusplus */ 44 | 45 | 46 | #define VB_MAX_POOLS 256 47 | #define VB_MAX_COMM_POOLS 16 48 | 49 | 50 | 51 | /* user ID for VB */ 52 | #define VB_MAX_USER 19 53 | 54 | #define VB_UID_VIU 0 55 | #define VB_UID_VOU 1 56 | #define VB_UID_DSU 2 57 | #define VB_UID_VENC 3 58 | #define VB_UID_VDEC 4 59 | #define VB_UID_VDA 5 60 | #define VB_UID_H264E 6 61 | #define VB_UID_JPEGE 7 62 | #define VB_UID_MPEG4E 8 63 | #define VB_UID_H264D 9 64 | #define VB_UID_JPEGD 10 65 | #define VB_UID_MPEG4D 11 66 | #define VB_UID_VPSS 12 67 | #define VB_UID_GRP 13 68 | #define VB_UID_MPI 14 69 | #define VB_UID_PCIV 15 70 | #define VB_UID_AI 16 71 | #define VB_UID_AENC 17 72 | #define VB_UID_RC 18 73 | 74 | #define VB_INVALID_POOLID (-1UL) 75 | #define VB_INVALID_HANDLE (-1UL) 76 | 77 | typedef HI_U32 VB_POOL; 78 | typedef HI_U32 VB_BLK; 79 | 80 | #define RESERVE_MMZ_NAME "window" 81 | 82 | 83 | typedef struct hiVB_CONF_S 84 | { 85 | HI_U32 u32MaxPoolCnt; /* max count of pools, (0,VB_MAX_POOLS] */ 86 | struct hiVB_CPOOL_S 87 | { 88 | HI_U32 u32BlkSize; 89 | HI_U32 u32BlkCnt; 90 | HI_CHAR acMmzName[MAX_MMZ_NAME_LEN]; 91 | }astCommPool[VB_MAX_COMM_POOLS]; 92 | } VB_CONF_S; 93 | 94 | 95 | typedef struct hiVB_POOL_STATUS_S 96 | { 97 | HI_U32 bIsCommPool; 98 | HI_U32 u32BlkCnt; 99 | HI_U32 u32FreeBlkCnt; 100 | }VB_POOL_STATUS_S; 101 | 102 | #define HI_ERR_VB_NULL_PTR HI_DEF_ERR(HI_ID_VB, EN_ERR_LEVEL_ERROR, EN_ERR_NULL_PTR) 103 | #define HI_ERR_VB_NOMEM HI_DEF_ERR(HI_ID_VB, EN_ERR_LEVEL_ERROR, EN_ERR_NOMEM) 104 | #define HI_ERR_VB_NOBUF HI_DEF_ERR(HI_ID_VB, EN_ERR_LEVEL_ERROR, EN_ERR_NOBUF) 105 | #define HI_ERR_VB_UNEXIST HI_DEF_ERR(HI_ID_VB, EN_ERR_LEVEL_ERROR, EN_ERR_UNEXIST) 106 | #define HI_ERR_VB_ILLEGAL_PARAM HI_DEF_ERR(HI_ID_VB, EN_ERR_LEVEL_ERROR, EN_ERR_ILLEGAL_PARAM) 107 | #define HI_ERR_VB_NOTREADY HI_DEF_ERR(HI_ID_VB, EN_ERR_LEVEL_ERROR, EN_ERR_SYS_NOTREADY) 108 | #define HI_ERR_VB_BUSY HI_DEF_ERR(HI_ID_VB, EN_ERR_LEVEL_ERROR, EN_ERR_BUSY) 109 | #define HI_ERR_VB_NOT_PERM HI_DEF_ERR(HI_ID_VB, EN_ERR_LEVEL_ERROR, EN_ERR_NOT_PERM) 110 | 111 | #define HI_ERR_VB_2MPOOLS HI_DEF_ERR(HI_ID_VB, EN_ERR_LEVEL_ERROR, EN_ERR_BUTT + 1) 112 | 113 | #define HI_TRACE_VB(level,fmt...) HI_TRACE(level, HI_ID_VB,##fmt) 114 | 115 | #ifdef __cplusplus 116 | #if __cplusplus 117 | } 118 | #endif 119 | #endif /* __cplusplus */ 120 | 121 | #endif /* __HI_COMm_VB_H_ */ 122 | 123 | -------------------------------------------------------------------------------- /pjlib/include/hi_inc/hi_comm_vda.h: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * 3 | * Copyright (C), 2001-2011, Huawei Tech. Co., Ltd. 4 | * 5 | ******************************************************************************* 6 | * File Name : hi_comm_vda.h 7 | * Version : Initial Draft 8 | * Author : j00169368,l64467 9 | * Created : 2011/1/7 10 | * Last Modified : 11 | * Description : include VDA struct , Marco and Error information 12 | * Function List : 13 | * 14 | * 15 | * History: 16 | * 17 | * 1. Date : 2011/1/7 18 | * Author : j00169368,l64467 19 | * Modification : Created file 20 | * 21 | ******************************************************************************/ 22 | 23 | #ifndef __HI_COMM_VDA_H__ 24 | #define __HI_COMM_VDA_H__ 25 | 26 | #include "hi_type.h" 27 | #include "hi_debug.h" 28 | #include "hi_comm_video.h" 29 | #include "hi_common.h" 30 | #include "hi_errno.h" 31 | #include "hi_defines.h" 32 | 33 | #ifdef __cplusplus 34 | #if __cplusplus 35 | extern "C"{ 36 | #endif 37 | #endif /* End of #ifdef __cplusplus */ 38 | 39 | 40 | /*Motion Region Data*/ 41 | typedef struct hiVDA_OBJ_S 42 | { 43 | HI_U16 u16Left; 44 | HI_U16 u16Top; 45 | HI_U16 u16Right; 46 | HI_U16 u16Bottom; 47 | }VDA_OBJ_S; 48 | 49 | /*reference pictrue mode*/ 50 | typedef enum hiVDA_REF_MODE_E 51 | { 52 | VDA_REF_MODE_DYNAMIC = 0, /*reference pictrue dynamic*/ 53 | VDA_REF_MODE_STATIC, /*reference pictrue static*/ 54 | VDA_REF_MODE_USER, /*reference pictrue user*/ 55 | VDA_REF_MODE_BUTT /*reserve*/ 56 | }VDA_REF_MODE_E; 57 | 58 | /*VDA algorithm*/ 59 | typedef enum hiVDA_ALG_E 60 | { 61 | VDA_ALG_BG = 0, /*base on background pictrue*/ 62 | VDA_ALG_REF, /*base on reference pictrue*/ 63 | VDA_ALG_BUTT 64 | }VDA_ALG_E; 65 | 66 | /*MB size*/ 67 | typedef enum hiVDA_MB_SIZE_E 68 | { 69 | VDA_MB_8PIXEL, /* 8*8 */ 70 | VDA_MB_16PIXEL, /* 16*16 */ 71 | VDA_MB_BUTT 72 | }VDA_MB_SIZE_E; 73 | 74 | /*SAD bits*/ 75 | typedef enum hiVDA_MB_SADBITS_E 76 | { 77 | VDA_MB_SAD_8BIT = 0, /*SAD precision 8bits*/ 78 | VDA_MB_SAD_16BIT, /*SAD precision 16bits*/ 79 | VDA_MB_SAD_BUTT /*reserve*/ 80 | } VDA_MB_SADBITS_E; 81 | 82 | 83 | /*OD region attribute*/ 84 | typedef struct hiVDA_OD_RGN_ATTR_S 85 | { 86 | /*static attribute*/ 87 | RECT_S stRect; /*region rect 88 | *X:[0,VDA_MAX_WIDTH),align:16 89 | *Y:[0,VDA_MAX_HEIGHT) 90 | *W:[16,VDA_MAX_WIDTH],align:16 91 | *H:[16,VDA_MAX_HEIGHT],align:16 92 | *X+W <= chunnel wight 93 | *Y+H <= chunnel height 94 | */ 95 | 96 | /*dynamic attribute*/ 97 | HI_U32 u32SadTh; /*SAD threshold,range:[0,4080]*/ 98 | HI_U32 u32AreaTh; /*alarm area threshold,range:[0,100]*/ 99 | HI_U32 u32OccCntTh; /*alarm frame count threshold,range:[1,256]*/ 100 | HI_U32 u32UnOccCntTh; /*The max uncover count,range:[0,256]*/ 101 | }VDA_OD_RGN_ATTR_S; 102 | 103 | /*MD attribute*/ 104 | typedef struct hiVDA_MD_ATTR_S 105 | { 106 | /*static attribute*/ 107 | VDA_ALG_E enVdaAlg; /*arithmetic*/ 108 | VDA_MB_SIZE_E enMbSize; /*MB size*/ 109 | VDA_MB_SADBITS_E enMbSadBits; /*MB SAD size*/ 110 | VDA_REF_MODE_E enRefMode; /*reference picture mode*/ 111 | HI_U32 u32MdBufNum; /*Result buffer number,range:[1,16]*/ 112 | 113 | /*dynamic attribute*/ 114 | HI_U32 u32VdaIntvl; /*VDA interval,range:[0,256]*/ 115 | 116 | HI_U32 u32BgUpSrcWgt; /*the source picture weight, 117 | *back ground updata totle weight 256, 118 | *range:[1,255],recommendatory value:128 119 | */ 120 | 121 | HI_U32 u32SadTh; /*SAD threshold,range:[0,4080],recommendatory value:100*/ 122 | HI_U32 u32ObjNumMax; /*max OBJ number,range:[1,128]*/ 123 | }VDA_MD_ATTR_S; 124 | 125 | 126 | #define VDA_OD_RGN_NUM_MAX 4 127 | 128 | /*OD attribute*/ 129 | typedef struct hiVDA_OD_ATTR_S 130 | { 131 | HI_U32 u32RgnNum; /*region number*/ 132 | VDA_OD_RGN_ATTR_S astOdRgnAttr[VDA_OD_RGN_NUM_MAX]; /*region attribute*/ 133 | 134 | /*static attribute*/ 135 | VDA_ALG_E enVdaAlg; /*arithmetic*/ 136 | VDA_MB_SIZE_E enMbSize; /*MB size*/ 137 | VDA_MB_SADBITS_E enMbSadBits; /*MB SAD size*/ 138 | VDA_REF_MODE_E enRefMode; /*reference picture mode*/ 139 | 140 | /*dynamic attribute*/ 141 | HI_U32 u32VdaIntvl; /*VDA interval,[0,256]*/ 142 | HI_U32 u32BgUpSrcWgt; /*back ground updata totle weight 256,the source picture weight,[1,255]*/ 143 | 144 | 145 | }VDA_OD_ATTR_S; 146 | 147 | 148 | /*work mode*/ 149 | typedef enum hiVDA_WORK_MODE_E 150 | { 151 | VDA_WORK_MODE_MD = 0, /*motion detection*/ 152 | VDA_WORK_MODE_OD, /*Occlusion detection*/ 153 | VDA_WORK_MODE_BUTT 154 | }VDA_WORK_MODE_E; 155 | 156 | 157 | /*work mode attribute*/ 158 | typedef union hiVDA_WORK_MODE_ATTR_U 159 | { 160 | VDA_MD_ATTR_S stMdAttr; /*MD attribute*/ 161 | VDA_OD_ATTR_S stOdAttr; /*OD attribute*/ 162 | }VDA_WORK_MODE_ATTR_U; 163 | 164 | 165 | /*VDA CHN attribute*/ 166 | typedef struct hiVDA_CHN_ATTR_S 167 | { 168 | VDA_WORK_MODE_E enWorkMode; /*work mode*/ 169 | VDA_WORK_MODE_ATTR_U unAttr; /*work mode attribute*/ 170 | HI_U32 u32Width; /*the width of CHNL,[16,VDA_MAX_WIDTH]*/ 171 | HI_U32 u32Height; /*the height of CHNL,[16,VDA_MAX_HEIGHT]*/ 172 | }VDA_CHN_ATTR_S; 173 | 174 | 175 | /*MB SAD data*/ 176 | typedef struct hiVDA_MB_SAD_DATA_S 177 | { 178 | HI_VOID *pAddr; /*address*/ 179 | HI_U32 u32Stride; /*stride*/ 180 | VDA_MB_SADBITS_E enMbSadBits; /*the MB SAD size*/ 181 | }VDA_MB_SAD_DATA_S; 182 | 183 | /*OBJ data*/ 184 | typedef struct hiVDA_OBJ_DATA_S 185 | { 186 | HI_U32 u32ObjNum; /*OBJ number*/ 187 | VDA_OBJ_S *pstAddr; /*OBJ data address*/ 188 | 189 | HI_U32 u32IndexOfMaxObj; /*index of max OBJ*/ 190 | HI_U32 u32SizeOfMaxObj; /*size of max OBJ*/ 191 | HI_U32 u32SizeOfTotalObj; /*total size of all OBJ*/ 192 | }VDA_OBJ_DATA_S; 193 | 194 | 195 | /*MD data*/ 196 | typedef struct hiVDA_MD_DATA_S 197 | { 198 | HI_BOOL bMbSadValid; /*SAD data is valid?*/ 199 | VDA_MB_SAD_DATA_S stMbSadData; /*MB SAD data*/ 200 | 201 | HI_BOOL bObjValid; /*OBJ data is valid?*/ 202 | VDA_OBJ_DATA_S stObjData; /*OBJ data*/ 203 | 204 | HI_BOOL bPelsNumValid; /*alarm pixel number data is valid?*/ 205 | HI_U32 u32AlarmPixCnt;/*motion pix of picture*/ 206 | }VDA_MD_DATA_S; 207 | 208 | 209 | /*OD data*/ 210 | typedef struct hiVDA_OD_DATA_S 211 | { 212 | HI_U32 u32RgnNum; /*region number*/ 213 | HI_BOOL abRgnAlarm[VDA_OD_RGN_NUM_MAX]; /*HI_TRUE:alarm*/ 214 | }VDA_OD_DATA_S; 215 | 216 | 217 | 218 | typedef union hiVDA_DATA_U 219 | { 220 | VDA_MD_DATA_S stMdData; /*MD data*/ 221 | VDA_OD_DATA_S stOdData; /*OD data*/ 222 | }VDA_DATA_U; 223 | 224 | 225 | /*VDA data*/ 226 | typedef struct hiVDA_DATA_S 227 | { 228 | VDA_WORK_MODE_E enWorkMode; /*work mode*/ 229 | VDA_DATA_U unData; /*VDA data*/ 230 | VDA_MB_SIZE_E enMbSize; /*MB size*/ 231 | HI_U32 u32MbWidth; /*VDA channle width in MB*/ 232 | HI_U32 u32MbHeight; /*VDA channle height in MB*/ 233 | HI_U64 u64Pts; /*time*/ 234 | }VDA_DATA_S; 235 | 236 | 237 | /*chnnel state*/ 238 | typedef struct hiVDA_CHN_STAT_S 239 | { 240 | HI_BOOL bStartRecvPic; /*start receive picture*/ 241 | HI_U32 u32LeftPic; /*left picture*/ 242 | HI_U32 u32LeftRst; /*left data*/ 243 | }VDA_CHN_STAT_S; 244 | 245 | /* invlalid device ID */ 246 | #define HI_ERR_VDA_INVALID_DEVID HI_DEF_ERR(HI_ID_VDA, EN_ERR_LEVEL_ERROR, EN_ERR_INVALID_DEVID) 247 | /* invlalid channel ID */ 248 | #define HI_ERR_VDA_INVALID_CHNID HI_DEF_ERR(HI_ID_VDA, EN_ERR_LEVEL_ERROR, EN_ERR_INVALID_CHNID) 249 | /* at lease one parameter is illagal ,eg, an illegal enumeration value */ 250 | #define HI_ERR_VDA_ILLEGAL_PARAM HI_DEF_ERR(HI_ID_VDA, EN_ERR_LEVEL_ERROR, EN_ERR_ILLEGAL_PARAM) 251 | /* channel exists */ 252 | #define HI_ERR_VDA_EXIST HI_DEF_ERR(HI_ID_VDA, EN_ERR_LEVEL_ERROR, EN_ERR_EXIST) 253 | /*UN exist*/ 254 | #define HI_ERR_VDA_UNEXIST HI_DEF_ERR(HI_ID_VDA, EN_ERR_LEVEL_ERROR, EN_ERR_UNEXIST) 255 | /* using a NULL point */ 256 | #define HI_ERR_VDA_NULL_PTR HI_DEF_ERR(HI_ID_VDA, EN_ERR_LEVEL_ERROR, EN_ERR_NULL_PTR) 257 | /* try to enable or initialize system,device or channel, before configing attribute */ 258 | #define HI_ERR_VDA_NOT_CONFIG HI_DEF_ERR(HI_ID_VDA, EN_ERR_LEVEL_ERROR, EN_ERR_NOT_CONFIG) 259 | /* operation is not supported by NOW */ 260 | #define HI_ERR_VDA_NOT_SUPPORT HI_DEF_ERR(HI_ID_VDA, EN_ERR_LEVEL_ERROR, EN_ERR_NOT_SUPPORT) 261 | /* operation is not permitted ,eg, try to change stati attribute */ 262 | #define HI_ERR_VDA_NOT_PERM HI_DEF_ERR(HI_ID_VDA, EN_ERR_LEVEL_ERROR, EN_ERR_NOT_PERM) 263 | /* failure caused by malloc memory */ 264 | #define HI_ERR_VDA_NOMEM HI_DEF_ERR(HI_ID_VDA, EN_ERR_LEVEL_ERROR, EN_ERR_NOMEM) 265 | /* failure caused by malloc buffer */ 266 | #define HI_ERR_VDA_NOBUF HI_DEF_ERR(HI_ID_VDA, EN_ERR_LEVEL_ERROR, EN_ERR_NOBUF) 267 | /* no data in buffer */ 268 | #define HI_ERR_VDA_BUF_EMPTY HI_DEF_ERR(HI_ID_VDA, EN_ERR_LEVEL_ERROR, EN_ERR_BUF_EMPTY) 269 | /* no buffer for new data */ 270 | #define HI_ERR_VDA_BUF_FULL HI_DEF_ERR(HI_ID_VDA, EN_ERR_LEVEL_ERROR, EN_ERR_BUF_FULL) 271 | /* bad address, eg. used for copy_from_user & copy_to_user */ 272 | #define HI_ERR_VDA_BADADDR HI_DEF_ERR(HI_ID_VDA, EN_ERR_LEVEL_ERROR, EN_ERR_BADADDR) 273 | /* resource is busy, eg. destroy a venc chn without unregistering it */ 274 | #define HI_ERR_VDA_BUSY HI_DEF_ERR(HI_ID_VDA, EN_ERR_LEVEL_ERROR, EN_ERR_BUSY) 275 | 276 | /* System is not ready,maybe not initialed or loaded. 277 | * Returning the error code when opening a device file failed. 278 | */ 279 | #define HI_ERR_VDA_NOTREADY HI_DEF_ERR(HI_ID_VDA, EN_ERR_LEVEL_ERROR, EN_ERR_SYS_NOTREADY) 280 | 281 | #ifdef __cplusplus 282 | #if __cplusplus 283 | } 284 | #endif 285 | #endif /* End of #ifdef __cplusplus */ 286 | 287 | 288 | #endif /* End of #ifndef __HI_COMM_VDA_H__ */ 289 | -------------------------------------------------------------------------------- /pjlib/include/hi_inc/hi_comm_vdec.h: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | 3 | Copyright (C), 2001-2011, Hisilicon Tech. Co., Ltd. 4 | 5 | ****************************************************************************** 6 | File Name : hi_comm_vdec.h 7 | Version : Initial Draft 8 | Author : Hisilicon multimedia software group 9 | Created : 2006/12/15 10 | Description : Common Def Of aio 11 | History : 12 | 1.Date : 2006/12/15 13 | Author : z50825 14 | Modification: Created file 15 | 2.Date : 2007/5/10 16 | Author : z50825 17 | Modification: add err code 18 | 3.Date : 2008/1/8 19 | Author : l59217 20 | Modification: add "hi_comm_video.h" and "buf reserved length 64byte"macro 21 | 4.Date : 2008/3/4 22 | Author : l59217 23 | Modification: (1)add VDEC_CAPABILITY_S for user learn decoder capabilitys 24 | (2)define max nalu size 0x80000 for h264 25 | define max ecs size 0x100000 for jpeg, mjpeg 26 | 5.Date : 2008/3/6 27 | Author : l59217 28 | Modification: change "HI_LOG_LEVEL_ERROR" to "EN_ERR_LEVEL_ERROR" 29 | 6.Date : 2008/3/7 30 | Author : l59217 31 | Modification: added "HI_ERR_VDEC_BUSY" errno 32 | 7.Date : 2009/10/12 33 | Author : c55300 34 | Modification: VDEC_CHN_STAT_S add two var. 35 | ******************************************************************************/ 36 | 37 | 38 | #ifndef __HI_COMM_VDEC_H__ 39 | #define __HI_COMM_VDEC_H__ 40 | #include "hi_type.h" 41 | #include "hi_common.h" 42 | #include "hi_errno.h" 43 | #include "hi_comm_video.h" 44 | #include "hi_defines.h" 45 | 46 | #ifdef __cplusplus 47 | #if __cplusplus 48 | extern "C"{ 49 | #endif 50 | #endif /* End of #ifdef __cplusplus */ 51 | 52 | /*vdec channel attr(user interface)*/ 53 | 54 | #define HI_IO_BLOCK HI_TRUE 55 | #define HI_IO_NOBLOCK HI_FALSE 56 | 57 | typedef enum hiVIDEO_MODE_E 58 | { 59 | VIDEO_MODE_STREAM = 0, /*send by stream*/ 60 | VIDEO_MODE_FRAME , /*send by frame*/ 61 | VIDEO_MODE_BUTT 62 | }VIDEO_MODE_E; 63 | 64 | 65 | typedef struct hiVDEC_ATTR_JPEG_S 66 | { 67 | VIDEO_MODE_E enMode; /* video stream mode select */ 68 | }VDEC_ATTR_JPEG_S,*PTR_VDEC_ATTR_JPEG_S; 69 | 70 | 71 | typedef struct hiVDEC_ATTR_VIDEO_S 72 | { 73 | HI_U32 u32RefFrameNum; /*ref pic num [1,16]*/ 74 | VIDEO_MODE_E enMode; /*send by stream or by frame*/ 75 | HI_S32 s32SupportBFrame; /*enable chnl to support BFrame decode, 0: disable support BFrame decode,1: enable support BFrame*/ 76 | }VDEC_ATTR_VIDEO_S,*PTR_VDEC_ATTR_VIDEO_S; 77 | 78 | 79 | typedef union 80 | { 81 | struct 82 | { 83 | HI_S32 IsAdvProfile; 84 | HI_S32 CodecVersion; 85 | } Vc1Ext; 86 | 87 | struct 88 | { 89 | HI_S32 bReversed; /*whether image need to reversed, 1: need resversed,0: none */ 90 | } Vp6Ext; 91 | } VDEC_STD_EXTENSION_U; 92 | 93 | 94 | typedef struct hiVDEC_CHN_ATTR_S 95 | { 96 | PAYLOAD_TYPE_E enType; /*video type to be decoded*/ 97 | HI_U32 u32BufSize ; /*stream buf size(Byte)*/ 98 | HI_U32 u32Priority ; /*priority*/ 99 | HI_U32 u32PicWidth ; /*max pic width*/ 100 | HI_U32 u32PicHeight ; /*max pic height*/ 101 | union 102 | { 103 | VDEC_ATTR_JPEG_S stVdecJpegAttr; /* structure with jpeg or mjpeg type */ 104 | VDEC_ATTR_VIDEO_S stVdecVideoAttr; /* structure with video ( h264/mpeg4/mpeg2/...) */ 105 | }; 106 | }VDEC_CHN_ATTR_S; 107 | 108 | 109 | typedef struct hiVDEC_STREAM_S 110 | { 111 | HI_U8* pu8Addr; /*stream address*/ 112 | HI_U32 u32Len; /*stream len*/ 113 | HI_U64 u64PTS; /*time stamp*/ 114 | }VDEC_STREAM_S,*PTR_VDEC_STREAM_S; 115 | 116 | typedef struct hiVDEC_USERDATA_S{ 117 | HI_U8* pu8Addr; /* userdata data vir address*/ 118 | HI_U32 u32PhyAddr; /* userdata data phy address */ 119 | HI_U32 u32Len; /* userdata data len*/ 120 | HI_BOOL bValid; /* is valid?*/ 121 | }VDEC_USERDATA_S, *PTR_VDEC_USERDATA_S; 122 | 123 | typedef struct hiVDEC_CHN_STAT_S 124 | { 125 | HI_U32 u32LeftStreamBytes;/*left stream bytes waiting for decode*/ 126 | HI_U32 u32LeftStreamFrames;/*left frames waiting for decode,only valid for H264D_MODE_FRAME*/ 127 | HI_U32 u32LeftPics;/*pics waiting for output*/ 128 | HI_BOOL bStartRecvStream;/*had started recv stream?*/ 129 | HI_U32 u32RecvStreamFrames; /* how many frames of stream has been received. valid when send by frame.*/ 130 | HI_U32 u32DecodeStreamFrames; /* how many frames of stream has been decoded. valid when send by frame.*/ 131 | }VDEC_CHN_STAT_S; 132 | 133 | /* 134 | * static parameter: must set after stop sending stream and all stream is decoded. 135 | * dynamic parameter: can be set at any time. 136 | */ 137 | typedef struct hiVDEC_CHN_PARAM_S 138 | { 139 | // HI_U32 u32FrameSizeMax; /* static parameter. 140 | // * range: [bufSize/2, bufSize*3/4] */ 141 | VDEC_STD_EXTENSION_U StdExt; /*extend info for VC1 video stream, with ap and version info */ 142 | HI_S32 s32ChanErrThr; /* threshold for stream error process, 0: discard with any error, 100 : keep data with any error*/ 143 | HI_S32 s32ChanStrmOFThr; /* threshold for stream overflow, 0~ , 0: nothing to do when stream is overflow */ 144 | HI_S32 s32DecMode; /*decode mode , 0: deocde IPB frames, 1: only decode I frame & P frame , 2: only decode I frame */ 145 | HI_S32 s32DecOrderOutput; /*frames output order ,0: the same with display order , 1: the same width decoder order */ 146 | HI_S32 s32DnrTfEnable; /* reserved */ 147 | HI_S32 s32DnrDispOutEnable; /* reserved */ 148 | }VDEC_CHN_PARAM_S; 149 | 150 | typedef struct hiVDEC_PRTCL_PARAM_S 151 | { 152 | HI_S32 s32MaxSliceNum; /*max slice num support */ 153 | HI_S32 s32MaxSpsNum; /* max sps num support */ 154 | HI_S32 s32MaxPpsNum; /* max pps num support */ 155 | HI_S32 s32SCDBufSize; /* scd buffer size */ 156 | HI_S32 s32DisplayFrameNum; /*display frame num */ 157 | }VDEC_PRTCL_PARAM_S; 158 | 159 | 160 | //structure & varibale for jpegd decoder lib 161 | /*********************************************************************************************************/ 162 | /* stream packet for jpeg */ 163 | typedef struct hiJPEGD_STREAM_PACKET_S 164 | { 165 | HI_U32 PhyAddr; 166 | HI_VOID* VirAddr; 167 | HI_U32 Length; 168 | HI_U64 Pts; 169 | HI_U32 Index; 170 | 171 | } USR_STREAM_PACKET_S; 172 | 173 | /* description structure for memory record */ 174 | typedef struct hiUSR_MEM_DESC_S 175 | { 176 | HI_S32 PhyAddr; 177 | HI_S32 Length; 178 | } USR_MEM_DESC_S; 179 | 180 | typedef struct hiVDEC_SKIPREF_PARAM_S 181 | { 182 | HI_BOOL bEnableGap; 183 | } VDEC_SKIPREF_PARAM_S; 184 | 185 | /************************************************************************************************************************/ 186 | 187 | /* invlalid device ID */ 188 | #define HI_ERR_VDEC_INVALID_DEVID HI_DEF_ERR(HI_ID_VDEC, EN_ERR_LEVEL_ERROR, EN_ERR_INVALID_DEVID) 189 | /* invlalid channel ID */ 190 | #define HI_ERR_VDEC_INVALID_CHNID HI_DEF_ERR(HI_ID_VDEC, EN_ERR_LEVEL_ERROR, EN_ERR_INVALID_CHNID) 191 | /* at lease one parameter is illagal ,eg, an illegal enumeration value */ 192 | #define HI_ERR_VDEC_ILLEGAL_PARAM HI_DEF_ERR(HI_ID_VDEC, EN_ERR_LEVEL_ERROR, EN_ERR_ILLEGAL_PARAM) 193 | /* channel exists */ 194 | #define HI_ERR_VDEC_EXIST HI_DEF_ERR(HI_ID_VDEC, EN_ERR_LEVEL_ERROR, EN_ERR_EXIST) 195 | /* using a NULL point */ 196 | #define HI_ERR_VDEC_NULL_PTR HI_DEF_ERR(HI_ID_VDEC, EN_ERR_LEVEL_ERROR, EN_ERR_NULL_PTR) 197 | /* try to enable or initialize system,device or channel, before configing attribute */ 198 | #define HI_ERR_VDEC_NOT_CONFIG HI_DEF_ERR(HI_ID_VDEC, EN_ERR_LEVEL_ERROR, EN_ERR_NOT_CONFIG) 199 | /* operation is not supported by NOW */ 200 | #define HI_ERR_VDEC_NOT_SURPPORT HI_DEF_ERR(HI_ID_VDEC, EN_ERR_LEVEL_ERROR, EN_ERR_NOT_SUPPORT) 201 | /* operation is not permitted ,eg, try to change stati attribute */ 202 | #define HI_ERR_VDEC_NOT_PERM HI_DEF_ERR(HI_ID_VDEC, EN_ERR_LEVEL_ERROR, EN_ERR_NOT_PERM) 203 | /* the channle is not existed */ 204 | #define HI_ERR_VDEC_UNEXIST HI_DEF_ERR(HI_ID_VDEC, EN_ERR_LEVEL_ERROR, EN_ERR_UNEXIST) 205 | /* failure caused by malloc memory */ 206 | #define HI_ERR_VDEC_NOMEM HI_DEF_ERR(HI_ID_VDEC, EN_ERR_LEVEL_ERROR, EN_ERR_NOMEM) 207 | /* failure caused by malloc buffer */ 208 | #define HI_ERR_VDEC_NOBUF HI_DEF_ERR(HI_ID_VDEC, EN_ERR_LEVEL_ERROR, EN_ERR_NOBUF) 209 | /* no data in buffer */ 210 | #define HI_ERR_VDEC_BUF_EMPTY HI_DEF_ERR(HI_ID_VDEC, EN_ERR_LEVEL_ERROR, EN_ERR_BUF_EMPTY) 211 | /* no buffer for new data */ 212 | #define HI_ERR_VDEC_BUF_FULL HI_DEF_ERR(HI_ID_VDEC, EN_ERR_LEVEL_ERROR, EN_ERR_BUF_FULL) 213 | /* system is not ready,had not initialed or loaded*/ 214 | #define HI_ERR_VDEC_SYS_NOTREADY HI_DEF_ERR(HI_ID_VDEC, EN_ERR_LEVEL_ERROR, EN_ERR_SYS_NOTREADY) 215 | /*system busy*/ 216 | #define HI_ERR_VDEC_BUSY HI_DEF_ERR(HI_ID_VDEC, EN_ERR_LEVEL_ERROR, EN_ERR_BUSY) 217 | 218 | /* bad address, eg. used for copy_from_user & copy_to_user */ 219 | #define HI_ERR_VDEC_BADADDR HI_DEF_ERR(HI_ID_VDEC, EN_ERR_LEVEL_ERROR, EN_ERR_BADADDR) 220 | 221 | 222 | 223 | 224 | 225 | 226 | 227 | #ifdef __cplusplus 228 | #if __cplusplus 229 | } 230 | #endif 231 | #endif /* End of #ifdef __cplusplus */ 232 | 233 | #endif /* End of #ifndef __HI_COMM_VDEC_H__ */ 234 | 235 | -------------------------------------------------------------------------------- /pjlib/include/hi_inc/hi_comm_venc.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dulton/hi35xx-pjsip/49d821d9fa23740daba04dbe881b9d358c6a50a5/pjlib/include/hi_inc/hi_comm_venc.h -------------------------------------------------------------------------------- /pjlib/include/hi_inc/hi_comm_vi.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dulton/hi35xx-pjsip/49d821d9fa23740daba04dbe881b9d358c6a50a5/pjlib/include/hi_inc/hi_comm_vi.h -------------------------------------------------------------------------------- /pjlib/include/hi_inc/hi_comm_video.h: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | Copyright (C), 2001-2011, Hisilicon Tech. Co., Ltd. 3 | 4 | ****************************************************************************** 5 | File Name : hi_comm_video.h 6 | Version : Initial Draft 7 | Author : c42025 8 | Created : 2006/11/09 9 | Description : 10 | History : 11 | 1.Date : 2006/11/03 12 | Author : c42025 13 | Modification: Created file 14 | 15 | 2.Date : 2007/12/11 16 | Author : c42025 17 | Modification: delelte all about digital watermark 18 | 19 | 3.Date : 2008/10/31 20 | Author : z44949 21 | Modification: Translate the chinese comment 22 | ******************************************************************************/ 23 | 24 | #ifndef __HI_COMM_VIDEO_H__ 25 | #define __HI_COMM_VIDEO_H__ 26 | 27 | #include "hi_type.h" 28 | #include "hi_common.h" 29 | 30 | #ifdef __cplusplus 31 | #if __cplusplus 32 | extern "C"{ 33 | #endif 34 | #endif /* __cplusplus */ 35 | 36 | 37 | typedef enum hiPIC_SIZE_E 38 | { 39 | PIC_QCIF = 0, 40 | PIC_CIF, 41 | PIC_2CIF, 42 | PIC_HD1, 43 | PIC_D1, 44 | PIC_960H, 45 | 46 | PIC_QVGA, /* 320 * 240 */ 47 | PIC_VGA, /* 640 * 480 */ 48 | PIC_XGA, /* 1024 * 768 */ 49 | PIC_SXGA, /* 1400 * 1050 */ 50 | PIC_UXGA, /* 1600 * 1200 */ 51 | PIC_QXGA, /* 2048 * 1536 */ 52 | 53 | PIC_WVGA, /* 854 * 480 */ 54 | PIC_WSXGA, /* 1680 * 1050 */ 55 | PIC_WUXGA, /* 1920 * 1200 */ 56 | PIC_WQXGA, /* 2560 * 1600 */ 57 | 58 | PIC_HD720, /* 1280 * 720 */ 59 | PIC_HD1080, /* 1920 * 1080 */ 60 | 61 | PIC_BUTT 62 | }PIC_SIZE_E; 63 | 64 | typedef enum hiVIDEO_NORM_E 65 | { 66 | VIDEO_ENCODING_MODE_PAL=0, 67 | VIDEO_ENCODING_MODE_NTSC, 68 | VIDEO_ENCODING_MODE_AUTO, 69 | VIDEO_ENCODING_MODE_BUTT 70 | } VIDEO_NORM_E; 71 | 72 | typedef enum hiVIDEO_CONTROL_MODE_E 73 | { 74 | VIDEO_CONTROL_MODE_SLAVER=0, 75 | VIDEO_CONTROL_MODE_MASTER, 76 | VIDEO_CONTROL_MODE_BUTT 77 | }VIDEO_CONTROL_MODE_E; 78 | 79 | 80 | /* we ONLY define picture format used, all unused will be deleted!*/ 81 | typedef enum hiPIXEL_FORMAT_E 82 | { 83 | PIXEL_FORMAT_RGB_1BPP = 0, 84 | PIXEL_FORMAT_RGB_2BPP, 85 | PIXEL_FORMAT_RGB_4BPP, 86 | PIXEL_FORMAT_RGB_8BPP, 87 | PIXEL_FORMAT_RGB_444, 88 | PIXEL_FORMAT_RGB_4444, 89 | PIXEL_FORMAT_RGB_555, 90 | PIXEL_FORMAT_RGB_565, 91 | PIXEL_FORMAT_RGB_1555, 92 | 93 | /* 9 reserved */ 94 | PIXEL_FORMAT_RGB_888, 95 | PIXEL_FORMAT_RGB_8888, 96 | PIXEL_FORMAT_RGB_PLANAR_888, 97 | PIXEL_FORMAT_RGB_BAYER, 98 | 99 | PIXEL_FORMAT_YUV_A422, 100 | PIXEL_FORMAT_YUV_A444, 101 | 102 | PIXEL_FORMAT_YUV_PLANAR_422, 103 | PIXEL_FORMAT_YUV_PLANAR_420, 104 | PIXEL_FORMAT_YUV_PLANAR_444, 105 | 106 | PIXEL_FORMAT_YUV_SEMIPLANAR_422, 107 | PIXEL_FORMAT_YUV_SEMIPLANAR_420, 108 | PIXEL_FORMAT_YUV_SEMIPLANAR_444, 109 | 110 | PIXEL_FORMAT_UYVY_PACKAGE_422, 111 | PIXEL_FORMAT_YUYV_PACKAGE_422, 112 | PIXEL_FORMAT_VYUY_PACKAGE_422, 113 | PIXEL_FORMAT_YCbCr_PLANAR, 114 | 115 | PIXEL_FORMAT_RGB_422, 116 | PIXEL_FORMAT_RGB_420, 117 | 118 | PIXEL_FORMAT_BUTT 119 | } PIXEL_FORMAT_E; 120 | 121 | typedef struct hiVIDEO_VBI_INFO_S 122 | { 123 | HI_U32 au32Data[VIU_MAX_VBI_LEN]; 124 | HI_U32 u32Len; 125 | }VIDEO_VBI_INFO_S; 126 | 127 | typedef enum hiVIDEO_FIELD_E 128 | { 129 | VIDEO_FIELD_TOP = 0x01, /* even field */ 130 | VIDEO_FIELD_BOTTOM = 0x02, /* odd field */ 131 | VIDEO_FIELD_INTERLACED = 0x03, /* two interlaced fields */ 132 | VIDEO_FIELD_FRAME = 0x04, /* frame */ 133 | 134 | VIDEO_FIELD_BUTT 135 | } VIDEO_FIELD_E; 136 | 137 | typedef struct hiVIDEO_FRAME_S 138 | { 139 | HI_U32 u32Width; 140 | HI_U32 u32Height; 141 | VIDEO_FIELD_E u32Field; 142 | PIXEL_FORMAT_E enPixelFormat; 143 | 144 | HI_U32 u32PhyAddr[3]; 145 | HI_VOID *pVirAddr[3]; 146 | HI_U32 u32Stride[3]; 147 | 148 | HI_U16 u16OffsetTop; /* top offset of show area */ 149 | HI_U16 u16OffsetBottom; /* bottom offset of show area */ 150 | HI_U16 u16OffsetLeft; /* left offset of show area */ 151 | HI_U16 u16OffsetRight; /* right offset of show area */ 152 | 153 | HI_U64 u64pts; 154 | HI_U32 u32TimeRef; 155 | 156 | HI_U32 u32PrivateData; 157 | //VIDEO_VBI_INFO_S astVbiInfo[VIU_MAX_VBI_NUM]; 158 | }VIDEO_FRAME_S; 159 | 160 | typedef struct hiVIDEO_FRAME_INFO_S 161 | { 162 | VIDEO_FRAME_S stVFrame; 163 | HI_U32 u32PoolId; 164 | } VIDEO_FRAME_INFO_S; 165 | 166 | typedef struct hiBITMAP_S 167 | { 168 | PIXEL_FORMAT_E enPixelFormat; /* Bitmap's pixel format */ 169 | 170 | HI_U32 u32Width; /* Bitmap's width */ 171 | HI_U32 u32Height; /* Bitmap's height */ 172 | HI_VOID *pData; /* Address of Bitmap's data */ 173 | } BITMAP_S; 174 | 175 | typedef struct HI_VPP_CFG_S 176 | { 177 | HI_BOOL bVppEn; 178 | 179 | HI_BOOL bIeEn; 180 | HI_BOOL bDnEn; 181 | HI_BOOL bSpEn; 182 | HI_BOOL bIencEn; 183 | 184 | HI_S32 s32IeSth; /* IE Strength [0,10] */ 185 | HI_S32 s32SpSth; /* SP Strength [-4,5] */ 186 | HI_S32 s32DnSfCosSth; /* coarse DN sf Strength [0,3] */ 187 | HI_S32 s32DnSfIncSth; /* Inching of DN sf Strength [0,255] */ 188 | HI_S32 s32DnTfSth; /* DN tf Strength [0,4] */ 189 | 190 | } VPP_CFG_S; 191 | 192 | typedef struct hiSCALE_CFG_S 193 | { 194 | HI_BOOL bScaleEn; 195 | 196 | HI_S32 s32DstWidth; /* the dest width after scale */ 197 | HI_S32 s32DstHeight; /* the dest height after scale */ 198 | } SCALE_CFG_S; 199 | 200 | /* Ie */ 201 | typedef struct HI_VPP_IE_EX_S 202 | { 203 | HI_U32 u32RefRange;// 204 | HI_U32 u32IeStrength;// 205 | HI_U32 u32Black; 206 | HI_U32 u32White; 207 | } VPP_IE_EX_S; 208 | 209 | /*dn*/ 210 | typedef struct 211 | { 212 | HI_U16 saMask[2]; 213 | HI_U16 weight[2]; 214 | 215 | } tVppCalcWnd; 216 | 217 | typedef struct 218 | { 219 | HI_U8 wWndX, hWndX; 220 | HI_U8 wWndY, hWndY; 221 | HI_U8 wWndC, hWndC; 222 | HI_U8 wWndD, hWndD; // 223 | 224 | HI_U16 sfyMask[2]; 225 | HI_U8 sfyRange[2]; // 226 | HI_U8 sfyStrength; // 227 | HI_U8 sfyLimitedFlag; // 228 | 229 | HI_U8 MADpExDirectSub : 1; 230 | HI_U8 MADpExMask : 4; 231 | HI_U8 _reserved_ : 3; 232 | 233 | HI_U8 sfcStrength; 234 | HI_U8 sfyMADpThresh, sfyMADpRate;/**/ 235 | HI_U16 sfyMSEiThresh[8]; 236 | 237 | HI_U8 rsfyThresh, rsfyRate, rsfyStrength, tfyStrength; 238 | HI_U8 rsfcThresh, rsfcRate, rsfcStrength, tfcStrength;/**/ 239 | 240 | HI_U8 tfyMADpThresh, tfyMADpRate; 241 | HI_U8 tfySNRpThresh, tfySNRpRate; 242 | 243 | HI_U16 tfyMSEiThresh[8]; 244 | HI_U16 tfyMSEpThresh[8]; 245 | 246 | HI_U8 tfyMaxStrength;// 247 | HI_U8 tfcMaxStrength;/**/ 248 | 249 | HI_U8 tfcMADpThresh, tfcMADpRate; 250 | HI_U16 tfcMSEiThresh[8]; 251 | 252 | HI_U16 diyMSEiThresh[8]; 253 | 254 | HI_U8 tfyLimit; 255 | HI_U8 noiseMADpThresh; 256 | HI_U16 noiseMSDpThresh; 257 | 258 | HI_U8 log2hStepMADp, log2hStepMSEi; 259 | 260 | HI_U8 histMinMADp, histMaxMADp; 261 | HI_U16 histMinMSEi, histMaxMSEi; 262 | 263 | /*---------------------------------------------*/ 264 | tVppCalcWnd yWnd[2]; 265 | tVppCalcWnd cWnd[2]; 266 | } tVppDnCfg; 267 | typedef tVppDnCfg VPP_DN_EX_S; 268 | 269 | /* Sp */ 270 | typedef struct 271 | { 272 | HI_U8 strength;// 273 | HI_U8 limit;// 274 | HI_U8 black; 275 | HI_U8 white; 276 | } tVppSharpenCfg; 277 | typedef tVppSharpenCfg VPP_SP_EX_S; 278 | 279 | 280 | typedef struct hiVPP_CFG_EX_S 281 | { 282 | VPP_IE_EX_S stIE_Ex; 283 | VPP_DN_EX_S stDN_Ex; 284 | VPP_SP_EX_S stSP_Ex; 285 | } VPP_CFG_EX_S; 286 | 287 | 288 | /* VI Mix-Capture info. */ 289 | typedef struct hiVI_MIXCAP_STAT_S 290 | { 291 | HI_BOOL bMixCapMode; /* In mix-capture mode or not. */ 292 | HI_BOOL bHasDownScale; /* VI Frame is downscaled or not. */ 293 | } VI_MIXCAP_STAT_S; 294 | 295 | /* VI output frame info. */ 296 | typedef struct hiVI_FRAME_INFO_S 297 | { 298 | VI_MIXCAP_STAT_S stMixCapState; /* VI Mix-Capture info. */ 299 | VIDEO_FRAME_INFO_S stViFrmInfo; /* Video frame info. */ 300 | HI_BOOL bFlashed; /* Flashed Video frame or not. */ 301 | }VI_FRAME_INFO_S; 302 | 303 | typedef enum hiLDC_VIEW_TYPE_E 304 | { 305 | LDC_VIEW_TYPE_ALL = 0, /* View scale all but x and y independtly, this will keep both x and y axis ,but corner maybe lost*/ 306 | LDC_VIEW_TYPE_CROP, /* Not use view scale, this will lost some side and corner */ 307 | 308 | LDC_VIEW_TYPE_BUTT, 309 | } LDC_VIEW_TYPE_E; 310 | 311 | typedef struct hiLDC_ATTR_S 312 | { 313 | LDC_VIEW_TYPE_E enViewType; 314 | 315 | HI_S32 s32CenterXOffset; /* Horizontal offset of the image distortion center relative to image center. [-28,28]. */ 316 | HI_S32 s32CenterYOffset; /* Vertical offset of the image distortion center relative to image center. [-14,14]. */ 317 | HI_S32 s32Ratio; /* Distortion ratio. [0, 511]. */ 318 | } LDC_ATTR_S; 319 | 320 | #ifdef __cplusplus 321 | #if __cplusplus 322 | } 323 | #endif 324 | #endif /* __cplusplus */ 325 | 326 | 327 | #endif /* _HI_COMM_VIDEO_H_ */ 328 | -------------------------------------------------------------------------------- /pjlib/include/hi_inc/hi_comm_vpss.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dulton/hi35xx-pjsip/49d821d9fa23740daba04dbe881b9d358c6a50a5/pjlib/include/hi_inc/hi_comm_vpss.h -------------------------------------------------------------------------------- /pjlib/include/hi_inc/hi_common.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dulton/hi35xx-pjsip/49d821d9fa23740daba04dbe881b9d358c6a50a5/pjlib/include/hi_inc/hi_common.h -------------------------------------------------------------------------------- /pjlib/include/hi_inc/hi_debug.h: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | Copyright (C), 2001-2011, Hisilicon Tech. Co., Ltd. 3 | ****************************************************************************** 4 | File Name : hi_debug.h 5 | Version : Initial Draft 6 | Author : Hisilicon multimedia software group 7 | Created : 2006/12/09 8 | Last Modified : 9 | Description : all struct and maro definition for debug 10 | Function List : 11 | History : 12 | 1.Date : 2006/11/03 13 | Author : c42025 14 | Modification: Created file 15 | 16 | 2.Date : 2008/03/03 17 | Author : c42025 18 | Modification: 1. mv definition LOG_ERRLEVEL_E to here form file "hi_errno.h", 19 | but it will be obsolete in next version. 20 | 2. add new macro definition for debug levle. 21 | 3. change macro defintion HI_TRACE 22 | 23 | 3.Date : 2008/03/05 24 | Author : c42025 25 | Modification: Change the definition of LOG_ERRLEVEL_E 26 | 27 | 4.Date : 2008/10/31 28 | Author : z44949 29 | Modification: Delete the definition of LOG_ERRLEVEL_E 30 | 31 | 5.Date : 2010/11/03 32 | Author : z44949 33 | Modification: Remove some unnecessary typedef 34 | 35 | ******************************************************************************/ 36 | #ifndef __HI_DEBUG_H__ 37 | #define __HI_DEBUG_H__ 38 | 39 | #ifndef __KERNEL__ 40 | #include 41 | #endif 42 | 43 | #include "hi_type.h" 44 | #include "hi_common.h" 45 | 46 | #ifdef __cplusplus 47 | #if __cplusplus 48 | extern "C"{ 49 | #endif 50 | #endif /* __cplusplus */ 51 | 52 | #define _EX__FILE_LINE(fxx,lxx) "[File]:"fxx"\n[Line]:"#lxx"\n[Info]:" 53 | #define EX__FILE_LINE(fxx,lxx) _EX__FILE_LINE(fxx,lxx) 54 | #define __FILE_LINE__ EX__FILE_LINE(__FILE__, __LINE__) 55 | 56 | #define HI_DBG_EMERG 0 /* system is unusable */ 57 | #define HI_DBG_ALERT 1 /* action must be taken immediately */ 58 | #define HI_DBG_CRIT 2 /* critical conditions */ 59 | #define HI_DBG_ERR 3 /* error conditions */ 60 | #define HI_DBG_WARN 4 /* warning conditions */ 61 | #define HI_DBG_NOTICE 5 /* normal but significant condition */ 62 | #define HI_DBG_INFO 6 /* informational */ 63 | #define HI_DBG_DEBUG 7 /* debug-level messages */ 64 | 65 | typedef struct hiLOG_LEVEL_CONF_S 66 | { 67 | MOD_ID_E enModId; 68 | HI_S32 s32Level; 69 | HI_CHAR cModName[16]; 70 | } LOG_LEVEL_CONF_S; 71 | 72 | #ifndef __KERNEL__ 73 | /****************************************************************************** 74 | ** For User Mode : HI_PRINT, HI_ASSERT, HI_TRACE 75 | ******************************************************************************/ 76 | 77 | #define HI_PRINT printf 78 | 79 | #ifdef HI_DEBUG 80 | /* Using samples: HI_ASSERT(x>y); */ 81 | #define HI_ASSERT(expr) \ 82 | do{ \ 83 | if (!(expr)) { \ 84 | printf("\nASSERT failed at:\n"\ 85 | " >File name: %s\n" \ 86 | " >Function : %s\n" \ 87 | " >Line No. : %d\n" \ 88 | " >Condition: %s\n", \ 89 | __FILE__,__FUNCTION__, __LINE__, #expr);\ 90 | _exit(-1);\ 91 | } \ 92 | }while(0) 93 | 94 | /* Using samples: 95 | ** HI_TRACE(HI_DBG_DEBUG, HI_ID_CMPI, "Test %d, %s\n", 12, "Test"); 96 | **/ 97 | #define HI_TRACE(level, enModId, fmt...) fprintf(stderr,##fmt) 98 | #else 99 | #define HI_ASSERT(expr) 100 | #define HI_TRACE(level, enModId, fmt...) 101 | #endif 102 | 103 | #else 104 | /****************************************************************************** 105 | ** For Linux Kernel : HI_PRINT, HI_ASSERT, HI_TRACE 106 | ******************************************************************************/ 107 | 108 | #define HI_PRINT printk 109 | 110 | extern HI_S32 HI_ChkLogLevel(HI_S32 s32Levle, MOD_ID_E enModId); 111 | asmlinkage int HI_LOG(HI_S32 level, MOD_ID_E enModId,const char *fmt, ...); 112 | 113 | #ifdef HI_DEBUG 114 | /* Using samples: HI_ASSERT(x>y); */ 115 | #define HI_ASSERT(expr) \ 116 | do{ \ 117 | if (!(expr)) { \ 118 | panic("\nASSERT failed at:\n" \ 119 | " >File name: %s\n" \ 120 | " >Function : %s\n" \ 121 | " >Line No. : %d\n" \ 122 | " >Condition: %s\n", \ 123 | __FILE__,__FUNCTION__, __LINE__, #expr);\ 124 | } \ 125 | }while(0) 126 | 127 | /* Using samples: 128 | ** HI_TRACE(HI_DBG_DEBUG, HI_ID_CMPI, "Test %d, %s\n", 12, "Test"); 129 | **/ 130 | #define HI_TRACE HI_LOG 131 | #else 132 | #define HI_ASSERT(expr) 133 | #define HI_TRACE(level, enModId, fmt...) 134 | #endif 135 | 136 | #endif /* end of __KERNEL__ */ 137 | 138 | #ifdef __cplusplus 139 | #if __cplusplus 140 | } 141 | #endif 142 | #endif /* __cplusplus */ 143 | 144 | #endif /* __HI_DEBUG_H__ */ 145 | 146 | -------------------------------------------------------------------------------- /pjlib/include/hi_inc/hi_defines.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dulton/hi35xx-pjsip/49d821d9fa23740daba04dbe881b9d358c6a50a5/pjlib/include/hi_inc/hi_defines.h -------------------------------------------------------------------------------- /pjlib/include/hi_inc/hi_errno.h: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | Copyright (C), 2001-2011, Hisilicon Tech. Co., Ltd. 3 | ****************************************************************************** 4 | File Name : hi_common.h 5 | Version : Initial Draft 6 | Author : Hi3511 MPP Team 7 | Created : 2006/11/09 8 | Last Modified : 9 | Description : define the format of error code 10 | Function List : 11 | History : 12 | 1.Date : 2007/02/14 13 | Author : c42025 14 | Modification: Created file 15 | 16 | 2.Date : 2007/12/11 17 | Author : c42025 18 | Modification: add some MOD_ID for several modules 19 | 20 | 3.Date : 2008/02/03 21 | Author : c42025 22 | Modification: reoorder MOD_ID to cleanup modules at specified order 23 | 24 | 4.Date : 2008/03/01 25 | Author : c42025 26 | Modification: move LOG_ERRLEVEL_E to hi_debug.h, and add new definion 27 | ERR_LEVLE_E, we should use this enumeration in our error code. 28 | 29 | 5.Date : 2008/04/30 30 | Author : c42025 31 | Modification: delete two error code "EN_ERR_NOCHN" and "EN_ERR_NODEV". 32 | 33 | ******************************************************************************/ 34 | #ifndef __HI_ERRNO_H__ 35 | #define __HI_ERRNO_H__ 36 | 37 | #include "hi_debug.h" 38 | 39 | #ifdef __cplusplus 40 | #if __cplusplus 41 | extern "C"{ 42 | #endif 43 | #endif /* End of #ifdef __cplusplus */ 44 | 45 | 46 | /* 1010 0000b 47 | * VTOP use APPID from 0~31 48 | * so, hisilicon use APPID based on 32 49 | */ 50 | #define HI_ERR_APPID (0x80000000L + 0x20000000L) 51 | 52 | typedef enum hiERR_LEVEL_E 53 | { 54 | EN_ERR_LEVEL_DEBUG = 0, /* debug-level */ 55 | EN_ERR_LEVEL_INFO, /* informational */ 56 | EN_ERR_LEVEL_NOTICE, /* normal but significant condition */ 57 | EN_ERR_LEVEL_WARNING, /* warning conditions */ 58 | EN_ERR_LEVEL_ERROR, /* error conditions */ 59 | EN_ERR_LEVEL_CRIT, /* critical conditions */ 60 | EN_ERR_LEVEL_ALERT, /* action must be taken immediately */ 61 | EN_ERR_LEVEL_FATAL, /* just for compatibility with previous version */ 62 | EN_ERR_LEVEL_BUTT 63 | }ERR_LEVEL_E; 64 | 65 | 66 | /****************************************************************************** 67 | |----------------------------------------------------------------| 68 | | 1 | APP_ID | MOD_ID | ERR_LEVEL | ERR_ID | 69 | |----------------------------------------------------------------| 70 | |<--><--7bits----><----8bits---><--3bits---><------13bits------->| 71 | ******************************************************************************/ 72 | 73 | #define HI_DEF_ERR( module, level, errid) \ 74 | ((HI_S32)( (HI_ERR_APPID) | ((module) << 16 ) | ((level)<<13) | (errid) )) 75 | 76 | /* NOTE! the following defined all common error code, 77 | ** all module must reserved 0~63 for their common error code 78 | */ 79 | typedef enum hiEN_ERR_CODE_E 80 | { 81 | EN_ERR_INVALID_DEVID = 1, /* invlalid device ID */ 82 | EN_ERR_INVALID_CHNID = 2, /* invlalid channel ID */ 83 | EN_ERR_ILLEGAL_PARAM = 3, /* at lease one parameter is illagal 84 | * eg, an illegal enumeration value */ 85 | EN_ERR_EXIST = 4, /* resource exists */ 86 | EN_ERR_UNEXIST = 5, /* resource unexists */ 87 | 88 | EN_ERR_NULL_PTR = 6, /* using a NULL point */ 89 | 90 | EN_ERR_NOT_CONFIG = 7, /* try to enable or initialize system, device 91 | ** or channel, before configing attribute */ 92 | 93 | EN_ERR_NOT_SUPPORT = 8, /* operation or type is not supported by NOW */ 94 | EN_ERR_NOT_PERM = 9, /* operation is not permitted 95 | ** eg, try to change static attribute */ 96 | 97 | EN_ERR_NOMEM = 12,/* failure caused by malloc memory */ 98 | EN_ERR_NOBUF = 13,/* failure caused by malloc buffer */ 99 | 100 | EN_ERR_BUF_EMPTY = 14,/* no data in buffer */ 101 | EN_ERR_BUF_FULL = 15,/* no buffer for new data */ 102 | 103 | EN_ERR_SYS_NOTREADY = 16,/* System is not ready,maybe not initialed or 104 | ** loaded. Returning the error code when opening 105 | ** a device file failed. */ 106 | 107 | EN_ERR_BADADDR = 17,/* bad address, 108 | ** eg. used for copy_from_user & copy_to_user */ 109 | 110 | EN_ERR_BUSY = 18,/* resource is busy, 111 | ** eg. destroy a venc chn without unregister it */ 112 | 113 | EN_ERR_BUTT = 63,/* maxium code, private error code of all modules 114 | ** must be greater than it */ 115 | }EN_ERR_CODE_E; 116 | 117 | 118 | /* 119 | ** following is an example for defining error code of VDA module 120 | ** #define HI_ERR_MD_INVALID_CHNID HI_DEF_ERR(HI_ID_VDA, EN_ERR_LEVEL_ERROR, EN_ERR_INVALID_CHNID) 121 | ** 122 | */ 123 | 124 | #ifdef __cplusplus 125 | #if __cplusplus 126 | } 127 | #endif 128 | #endif /* __cplusplus */ 129 | 130 | #endif /* __HI_ERRNO_H__ */ 131 | 132 | -------------------------------------------------------------------------------- /pjlib/include/hi_inc/hi_io.h: -------------------------------------------------------------------------------- 1 | #ifndef __HI_IO_H__ 2 | #define __HI_IO_H__ 3 | 4 | #include "hi_type.h" 5 | 6 | #ifdef __cplusplus 7 | extern "C" 8 | { 9 | #endif /* __cplusplus */ 10 | 11 | /* user and kernel are different. */ 12 | HI_U8 IO_READ8(HI_U32 u32Addr); 13 | HI_S32 IO_WRITE8(HI_U32 u32Addr, HI_U32 u32Value); 14 | HI_U16 IO_READ16(HI_U32 u32Addr); 15 | HI_S32 IO_WRITE16(HI_U32 u32Addr, HI_U32 u32Value); 16 | HI_U32 IO_READ32(HI_U32 u32Addr); 17 | HI_S32 IO_WRITE32(HI_U32 u32Addr, HI_U32 u32Value); 18 | HI_U32 ISP_Mmap(void); 19 | HI_U32 ISP_Munmap(void); 20 | HI_U32 ISP_GetExtRegAddr(void); 21 | 22 | #define REG_ACCESS_WIDTH 0 // 1: 16bit 2: 8bit 23 | #define EXT_REG_BASE 0x10200 24 | #define ISP_REG_BASE_ADDR 0x205a0000 25 | 26 | #define EXT_REG_BASE_ISP 0x8000 27 | #define EXT_REG_BASE_VIU 0x8400 28 | #define EXT_REG_BASE_VPP 0x8600 29 | #define EXT_REG_BASE_VEDU 0x8800 30 | #define EXT_REG_BASE_VOU 0x8A00 31 | 32 | /* Dynamic bus access functions, 4 byte align access */ 33 | //TODO: allocate dev addr (such as ISP_REG_BASE_ADDR) according to devId. 34 | #define __IO_CALC_ADDRESS_DYNAMIC(BASE, OFFSET) ((HI_U32)(((BASE >= EXT_REG_BASE)? 0 : ISP_REG_BASE_ADDR) + ((((BASE >= EXT_REG_BASE)? (BASE - EXT_REG_BASE) : BASE) + OFFSET)<y; -1 if x= 0 ? (x) : (-(x)) ) 44 | #define SIGN(x) ( (x) >= 0 ? 1 : -1 ) 45 | #define CMP(x,y) (((x) == (y)) ? 0 : (((x) > (y)) ? 1 : -1)) 46 | 47 | /****************************************************************************** 48 | ** MAX2(x,y) maximum of x and y 49 | ** MIN2(x,y) minimum of x and y 50 | ** MAX3(x,y,z) maximum of x, y and z 51 | ** MIN3(x,y,z) minimun of x, y and z 52 | ** MEDIAN(x,y,z) median of x,y,z 53 | ** MEAN2(x,y) mean of x,y 54 | ******************************************************************************/ 55 | #define MAX2(x,y) ( (x)>(y) ? (x):(y) ) 56 | #define MIN2(x,y) ( (x)<(y) ? (x):(y) ) 57 | #define MAX3(x,y,z) ( (x)>(y) ? MAX2(x,z) : MAX2(y,z) ) 58 | #define MIN3(x,y,z) ( (x)<(y) ? MIN2(x,z) : MIN2(y,z) ) 59 | #define MEDIAN(x,y,z) (((x)+(y)+(z) - MAX3(x,y,z)) - MIN3(x,y,z) ) 60 | #define MEAN2(x,y) (((x)+(y)) >> 1 ) 61 | 62 | /****************************************************************************** 63 | ** CLIP3(x,min,max) clip x within [min,max] 64 | ** WRAP_MAX(x,max,min) wrap to min if x equal max 65 | ** WRAP_MIN(x,min,max) wrap to max if x equal min 66 | ** VALUE_BETWEEN(x,min.max) True if x is between [min,max] inclusively. 67 | ******************************************************************************/ 68 | #define CLIP3(x,min,max) ( (x)< (min) ? (min) : ((x)>(max)?(max):(x)) ) 69 | #define WRAP_MAX(x,max,min) ( (x)>=(max) ? (min) : (x) ) 70 | #define WRAP_MIN(x,min,max) ( (x)<=(min) ? (max) : (x) ) 71 | #define VALUE_BETWEEN(x,min,max) (((x)>=(min)) && ((x) <= (max))) 72 | 73 | /****************************************************************************** 74 | ** MULTI_OF_2_POWER(x,a) whether x is multiple of a(a must be power of 2) 75 | ** CEILING_2_POWER(x,a) ceiling x to multiple of a(a must be power of 2) 76 | ** FLOOR_2_POWER(x,a) floor x to multiple of a(a must be power of 2) 77 | ** HIALIGN(x, a) align x to multiple of a 78 | ** 79 | ** Example: 80 | ** CEILING_2_POWER(5,4) = 8 81 | ** FLOOR_2_POWER(5,4) = 4 82 | ******************************************************************************/ 83 | #define MULTI_OF_2_POWER(x,a) (!((x) & ((a) - 1) ) ) 84 | #define CEILING_2_POWER(x,a) ( ((x) + ((a) - 1) ) & ( ~((a) - 1) ) ) 85 | #define FLOOR_2_POWER(x,a) ( (x) & (~((a) - 1) ) ) 86 | #define HIALIGN(x, a) ((a) * (((x) + (a) - 1) / (a))) 87 | #define HICEILING(x, a) (((x)+(a)-1)/(a)) 88 | 89 | /****************************************************************************** 90 | ** Get the span between two unsinged number, such as 91 | ** SPAN(HI_U32, 100, 200) is 200 - 100 = 100 92 | ** SPAN(HI_U32, 200, 100) is 0xFFFFFFFF - 200 + 100 93 | ** SPAN(HI_U64, 200, 100) is 0xFFFFFFFFFFFFFFFF - 200 + 100 94 | ******************************************************************************/ 95 | #define SPAN(type, begin, end)\ 96 | ({ \ 97 | type b = (begin); \ 98 | type e = (end); \ 99 | (type)((b >= e) ? (b - e) : (b + ((~((type)0))-e))); \ 100 | }) 101 | 102 | /****************************************************************************** 103 | ** ENDIAN32(x,y) little endian <---> big endian 104 | ** IS_LITTLE_END() whether the system is little end mode 105 | ******************************************************************************/ 106 | #define ENDIAN32( x ) \ 107 | ( ( (x) << 24 ) | \ 108 | ( ( (x) & 0x0000ff00 ) << 8 ) | \ 109 | ( ( (x) & 0x00ff0000 ) >> 8 ) | \ 110 | ( ( (x) >> 24 ) & 0x000000ff ) ) 111 | 112 | __inline static HI_BOOL IS_LITTLE_END(void) 113 | { 114 | union unEND_TEST_U 115 | { 116 | HI_CHAR cTest[4]; 117 | HI_U32 u32Test; 118 | } unEndTest; 119 | 120 | unEndTest.cTest[0] = 0x01; 121 | unEndTest.cTest[1] = 0x02; 122 | unEndTest.cTest[2] = 0x03; 123 | unEndTest.cTest[3] = 0x04; 124 | 125 | return (unEndTest.u32Test > 0x01020304) ? (HI_TRUE) : (HI_FALSE); 126 | } 127 | 128 | 129 | /****************************************************************************** 130 | ** FRACTION32(de,nu) fraction: nu(minator) / de(nominator). 131 | ** NUMERATOR32(x) of x(x is fraction) 132 | ** DENOMINATOR32(x) Denominator of x(x is fraction) 133 | 134 | ** represent fraction in 32 bit. LSB 16 is numerator, MSB 16 is denominator 135 | ** It is integer if denominator is 0. 136 | ******************************************************************************/ 137 | #define FRACTION32(de,nu) ( ((de) << 16) | (nu) ) 138 | #define NUMERATOR32(x) ( (x) & 0xffff) 139 | #define DENOMINATOR32(x) ( (x) >> 16 ) 140 | 141 | /****************************************************************************** 142 | ** RGB(r,g,b) assemble the r,g,b to 24bit color 143 | ** RGB_R(c) get RED from 24bit color 144 | ** RGB_G(c) get GREEN from 24bit color 145 | ** RGB_B(c) get BLUE from 24bit color 146 | ******************************************************************************/ 147 | #define RGB(r,g,b) ((((r) & 0xff) << 16) | (((g) & 0xff) << 8) | ((b) & 0xff)) 148 | #define RGB_R(c) ( ((c) & 0xff0000) >> 16) 149 | #define RGB_G(c) ( ((c) & 0xff00) >> 8) 150 | #define RGB_B(c) ( (c) & 0xff) 151 | 152 | /****************************************************************************** 153 | ** YUV(y,u,v) assemble the y,u,v to 24bit color 154 | ** YUV_Y(c) get Y from 24bit color 155 | ** YUV_U(c) get U from 24bit color 156 | ** YUV_V(c) get V from 24bit color 157 | ******************************************************************************/ 158 | #define YUV(y,u,v) ((((y) & 0xff) << 16) | (((u) & 0xff) << 8) | ((v) & 0xff)) 159 | #define YUV_Y(c) ( ((c) & 0xff0000) >> 16) 160 | #define YUV_U(c) ( ((c) & 0xff00) >> 8) 161 | #define YUV_V(c) ( (c) & 0xff) 162 | 163 | /****************************************************************************** 164 | ** Rgb2Yc(r, g, b, *y, *u, *u) convert r,g,b to y,u,v 165 | ** Rgb2Yuv(rgb, *yuv) convert rgb to yuv 166 | ******************************************************************************/ 167 | __inline static HI_VOID Rgb2Yc(HI_U8 r, HI_U8 g, HI_U8 b, HI_U8 * py, HI_U8 * pcb, HI_U8 * pcr) 168 | { 169 | /* Y */ 170 | *py = (HI_U8)(((r*66+g*129+b*25) >> 8) + 16); 171 | 172 | /* Cb */ 173 | *pcb = (HI_U8)((((b*112-r*38)-g*74) >> 8) + 128); 174 | 175 | /* Cr */ 176 | *pcr = (HI_U8)((((r*112-g*94)-b*18) >> 8) + 128); 177 | } 178 | 179 | __inline static HI_U32 Rgb2Yuv(HI_U32 u32Rgb) 180 | { 181 | HI_U8 y,u,v; 182 | 183 | Rgb2Yc(RGB_R(u32Rgb), RGB_G(u32Rgb), RGB_B(u32Rgb), &y, &u, &v); 184 | 185 | return YUV(y,u,v); 186 | } 187 | 188 | /****************************************************************************** 189 | ** GetYCFromRGB(rgb, *y, *cbcr) convert rgb to yyyy, uvuv, 190 | ******************************************************************************/ 191 | __inline static HI_VOID GetYCFromRGB(HI_U32 rgb, HI_U32 * pY, HI_U32 * pC) 192 | { 193 | HI_U8 y, cb, cr; 194 | HI_U32 color_y, color_c, tmp; 195 | 196 | Rgb2Yc(RGB_R(rgb), RGB_G(rgb), RGB_B(rgb), &y, &cb, &cr); 197 | 198 | tmp = y & 0xFF; 199 | color_y = (tmp<<24) + (tmp<<16) + (tmp<<8) + tmp; 200 | 201 | tmp = cb & 0xFF; 202 | color_c = (tmp<<24) + (tmp<<8); 203 | 204 | tmp = cr & 0xFF; 205 | color_c = color_c + (tmp<<16) + tmp; 206 | 207 | *pY = color_y; 208 | *pC = color_c; 209 | } 210 | 211 | /******************************************************************************* 212 | ** FpsControl Useing Sample: 213 | ** FPS_CTRL_S g_stFpsCtrl; 214 | ** 215 | ** Take 12 frame uniform in 25. 216 | ** InitFps(&g_stFpsCtrl, 25, 12); 217 | ** 218 | ** { 219 | ** if(FpsControl(&g_stFpsCtrl)) printf("Yes, this frmae should be token"); 220 | ** } 221 | ** 222 | *******************************************************************************/ 223 | typedef struct hiFPS_CTRL_S 224 | { 225 | HI_U32 u32Ffps; /* Full frame rate */ 226 | HI_U32 u32Tfps; /* Target frame rate */ 227 | HI_U32 u32FrmKey; /* update key frame */ 228 | } FPS_CTRL_S; 229 | 230 | __inline static HI_VOID InitFps(FPS_CTRL_S *pFrmCtrl, HI_U32 u32FullFps, 231 | HI_U32 u32TagFps) 232 | { 233 | pFrmCtrl->u32Ffps = u32FullFps; 234 | pFrmCtrl->u32Tfps = u32TagFps; 235 | pFrmCtrl->u32FrmKey = 0; 236 | } 237 | 238 | __inline static HI_BOOL FpsControl(FPS_CTRL_S *pFrmCtrl) 239 | { 240 | HI_BOOL bReturn = HI_FALSE; 241 | 242 | pFrmCtrl->u32FrmKey += pFrmCtrl->u32Tfps; 243 | if (pFrmCtrl->u32FrmKey >= pFrmCtrl->u32Ffps) 244 | { 245 | pFrmCtrl->u32FrmKey -= pFrmCtrl->u32Ffps; 246 | bReturn = HI_TRUE; 247 | } 248 | 249 | return bReturn; 250 | } 251 | 252 | /******************************************************************************* 253 | ** GetSysTimeBySec 254 | ** GetSysTimeByUsec 255 | *******************************************************************************/ 256 | #ifdef __KERNEL__ 257 | #include 258 | #else 259 | #include 260 | #endif 261 | __inline static HI_U32 GetSysTimeBySec(void) 262 | { 263 | struct timeval stTime; 264 | #ifdef __KERNEL__ 265 | do_gettimeofday(&stTime); 266 | #else 267 | gettimeofday(&stTime, NULL); 268 | #endif 269 | return stTime.tv_sec; 270 | } 271 | 272 | __inline static HI_U64 GetSysTimeByUsec(void) 273 | { 274 | struct timeval stTime; 275 | #ifdef __KERNEL__ 276 | do_gettimeofday(&stTime); 277 | #else 278 | gettimeofday(&stTime, NULL); 279 | #endif 280 | return (stTime.tv_sec * 1000000LLU) + stTime.tv_usec; 281 | } 282 | 283 | 284 | #ifdef __cplusplus 285 | #if __cplusplus 286 | } 287 | #endif 288 | #endif /* __cplusplus */ 289 | 290 | 291 | #endif /* __HI_MATH_H__ */ 292 | 293 | -------------------------------------------------------------------------------- /pjlib/include/hi_inc/hi_tde_errcode.h: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | Copyright (C), 2001-2011, Hisilicon Tech. Co., Ltd. 3 | ****************************************************************************** 4 | File Name : tde_errcode.h 5 | Version : Initial Draft 6 | Author : Hisilicon multimedia software group 7 | Created : 2005/4/23 8 | Last Modified : 9 | Description : err code define 10 | Function List : 11 | History : May modify the code to errcode.h FOR hi3110 12 | ******************************************************************************/ 13 | #ifndef __TDE_ERRCODE_H__ 14 | #define __TDE_ERRCODE_H__ 15 | 16 | //#include "hi_debug.h" 17 | #include "hi_common.h" 18 | 19 | #ifdef __cplusplus 20 | #if __cplusplus 21 | extern "C"{ 22 | #endif 23 | #endif /* __cplusplus */ 24 | 25 | //#define HI_ID_TDE 100 26 | /* tde start err no. */ 27 | #define HI_ERR_TDE_BASE ((HI_S32)( ((0x80UL + 0x20UL)<<24) | (100 << 16 ) | (4 << 13) | 1 )) 28 | 29 | enum 30 | { 31 | HI_ERR_TDE_DEV_NOT_OPEN = HI_ERR_TDE_BASE, /**< tde device not open yet */ 32 | HI_ERR_TDE_DEV_OPEN_FAILED, /**< open tde device failed */ 33 | HI_ERR_TDE_NULL_PTR, /**< input parameters contain null ptr */ 34 | HI_ERR_TDE_NO_MEM, /**< malloc failed */ 35 | HI_ERR_TDE_INVALID_HANDLE, /**< invalid job handle */ 36 | HI_ERR_TDE_INVALID_PARA, /**< invalid parameter */ 37 | HI_ERR_TDE_NOT_ALIGNED, /**< aligned error for position, stride, width */ 38 | HI_ERR_TDE_MINIFICATION, /**< invalid minification */ 39 | HI_ERR_TDE_CLIP_AREA, /**< clip area and operation area have no intersection */ 40 | HI_ERR_TDE_JOB_TIMEOUT, /**< blocked job wait timeout */ 41 | HI_ERR_TDE_UNSUPPORTED_OPERATION, /**< unsupported operation */ 42 | HI_ERR_TDE_QUERY_TIMEOUT /**< query time out */ 43 | }; 44 | 45 | 46 | #ifdef __cplusplus 47 | #if __cplusplus 48 | } 49 | #endif 50 | #endif /* __cplusplus */ 51 | 52 | #endif /* __TDE_ERRCODE_H__*/ 53 | 54 | 55 | -------------------------------------------------------------------------------- /pjlib/include/hi_inc/hi_tde_type.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dulton/hi35xx-pjsip/49d821d9fa23740daba04dbe881b9d358c6a50a5/pjlib/include/hi_inc/hi_tde_type.h -------------------------------------------------------------------------------- /pjlib/include/hi_inc/hi_type.h: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | Copyright (C), 2001-2011, Hisilicon Tech. Co., Ltd. 3 | ****************************************************************************** 4 | File Name : hi_type.h 5 | Version : Initial Draft 6 | Author : Hisilicon multimedia software group 7 | Created : 2005/4/23 8 | Last Modified : 9 | Description : The common data type defination 10 | Function List : 11 | History : 12 | 1.Date : 2008/06/28 13 | Author : c42025 14 | Modification: modified definition for HI_S8 15 | 16 | 2.Date : 2008/10/31 17 | Author : z44949 18 | Modification: Translate the chinese comment 19 | 20 | 3.Date : 2010/11/03 21 | Author : z44949 22 | Modification: Remove some unnecessary typedef 23 | 24 | 4.Date : 2011/01/05 25 | Author : p00123320 26 | Modification: Modify definition of HI_VOID, avoid C++ compiler warning. 27 | 28 | 29 | ******************************************************************************/ 30 | #ifndef __HI_TYPE_H__ 31 | #define __HI_TYPE_H__ 32 | 33 | 34 | #ifdef __cplusplus 35 | #if __cplusplus 36 | extern "C"{ 37 | #endif 38 | #endif /* __cplusplus */ 39 | 40 | /*----------------------------------------------* 41 | * The common data type, will be used in the whole project.* 42 | *----------------------------------------------*/ 43 | 44 | typedef unsigned char HI_U8; 45 | typedef unsigned short HI_U16; 46 | typedef unsigned int HI_U32; 47 | 48 | typedef signed char HI_S8; 49 | typedef short HI_S16; 50 | typedef int HI_S32; 51 | 52 | #ifndef _M_IX86 53 | typedef unsigned long long HI_U64; 54 | typedef long long HI_S64; 55 | #else 56 | typedef __int64 HI_U64; 57 | typedef __int64 HI_S64; 58 | #endif 59 | 60 | typedef char HI_CHAR; 61 | #define HI_VOID void 62 | 63 | /*----------------------------------------------* 64 | * const defination * 65 | *----------------------------------------------*/ 66 | typedef enum { 67 | HI_FALSE = 0, 68 | HI_TRUE = 1, 69 | } HI_BOOL; 70 | 71 | #ifndef NULL 72 | #define NULL 0L 73 | #endif 74 | 75 | #define HI_NULL 0L 76 | #define HI_SUCCESS 0 77 | #define HI_FAILURE (-1) 78 | 79 | 80 | #ifdef __cplusplus 81 | #if __cplusplus 82 | } 83 | #endif 84 | #endif /* __cplusplus */ 85 | 86 | #endif /* __HI_TYPE_H__ */ 87 | 88 | -------------------------------------------------------------------------------- /pjlib/include/hi_inc/hifb.h: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | 3 | Copyright (C), 2001-2011, Hisilicon Tech. Co., Ltd. 4 | 5 | ****************************************************************************** 6 | File Name : hifb.h 7 | Version : Initial Draft 8 | Author : Hisilicon multimedia software group 9 | Created : 10 | Description : 11 | History : 12 | 1.Date : 2009/03/12 13 | Author : 14 | Modification: Created file 15 | ******************************************************************************/ 16 | 17 | 18 | #ifndef __HIFB_H__ 19 | #define __HIFB_H__ 20 | 21 | #ifdef __cplusplus 22 | #if __cplusplus 23 | extern "C"{ 24 | #endif 25 | #endif /* __cplusplus */ 26 | 27 | #include "hi_type.h" 28 | #include 29 | /*************************** Structure Definition ****************************/ 30 | 31 | #define IOC_TYPE_HIFB 'F' 32 | /** To obtain the colorkey of an overlay layer */ 33 | #define FBIOGET_COLORKEY_HIFB _IOR(IOC_TYPE_HIFB, 90, HIFB_COLORKEY_S) 34 | /** To set the colorkey of an overlay layer */ 35 | #define FBIOPUT_COLORKEY_HIFB _IOW(IOC_TYPE_HIFB, 91, HIFB_COLORKEY_S) 36 | /** To get the alpha of an overlay layer */ 37 | #define FBIOGET_ALPHA_HIFB _IOR(IOC_TYPE_HIFB, 92, HIFB_ALPHA_S) 38 | /** To set the alpha of an overlay layer */ 39 | #define FBIOPUT_ALPHA_HIFB _IOW(IOC_TYPE_HIFB, 93, HIFB_ALPHA_S) 40 | /** To get the origin of an overlay layer on the screen */ 41 | #define FBIOGET_SCREEN_ORIGIN_HIFB _IOR(IOC_TYPE_HIFB, 94, HIFB_POINT_S) 42 | /** To set the origin of an overlay layer on the screen */ 43 | #define FBIOPUT_SCREEN_ORIGIN_HIFB _IOW(IOC_TYPE_HIFB, 95, HIFB_POINT_S) 44 | /** To obtain the anti-flicker setting of an overlay layer */ 45 | #define FBIOGET_DEFLICKER_HIFB _IOR(IOC_TYPE_HIFB, 98, HIFB_DEFLICKER_S) 46 | /** To set the anti-flicker setting of an overlay layer */ 47 | #define FBIOPUT_DEFLICKER_HIFB _IOW(IOC_TYPE_HIFB, 99, HIFB_DEFLICKER_S) 48 | /** To wait for the vertical blanking region of an overlay layer */ 49 | #define FBIOGET_VBLANK_HIFB _IO(IOC_TYPE_HIFB, 100) 50 | /** To set the display state of an overlay layer */ 51 | #define FBIOPUT_SHOW_HIFB _IOW(IOC_TYPE_HIFB, 101, HI_BOOL) 52 | /** To obtain the display state of an overlay layer */ 53 | #define FBIOGET_SHOW_HIFB _IOR(IOC_TYPE_HIFB, 102, HI_BOOL) 54 | /** to obtain the capability of an overlay layer */ 55 | #define FBIOGET_CAPABILITY_HIFB _IOR(IOC_TYPE_HIFB, 103, HIFB_CAPABILITY_S) 56 | /** set the screen output size */ 57 | #define FBIOPUT_SCREENSIZE _IOW(IOC_TYPE_HIFB, 130, HIFB_SIZE_S*) 58 | /** get the screen output size */ 59 | #define FBIOGET_SCREENSIZE _IOR(IOC_TYPE_HIFB, 131, HIFB_SIZE_S*) 60 | 61 | /** To display multiple surfaces in turn and set the alpha and colorkey attributes */ 62 | #define FBIOFLIP_SURFACE _IOW(IOC_TYPE_HIFB, 132, HIFB_SURFACEEX_S) 63 | 64 | /**To set the compression function status of an overlay layer*/ 65 | #define FBIOPUT_COMPRESSION_HIFB _IOW(IOC_TYPE_HIFB, 133, HI_BOOL) 66 | /**To obtain the compression function status of an overlay layer*/ 67 | #define FBIOGET_COMPRESSION_HIFB _IOR(IOC_TYPE_HIFB, 134, HI_BOOL) 68 | 69 | 70 | typedef struct 71 | { 72 | HI_U32 u32Width; 73 | HI_U32 u32Height; 74 | }HIFB_SIZE_S; 75 | 76 | static inline HI_U8 hifb_rgb(const struct fb_bitfield* pBit, HI_S32 color) 77 | { 78 | return ((HI_U8)((((HI_U32)color)>>pBit->offset) << (8-pBit->length)) + 79 | ((HI_U8)(((HI_U32)(color)>>pBit->offset) << (8-pBit->length)) >> pBit->length)); 80 | } 81 | 82 | static inline HI_S32 hifb_color2key(const struct fb_var_screeninfo* pVar, HI_S32 color) 83 | { 84 | if (pVar->bits_per_pixel <= 8) 85 | { 86 | return color; 87 | } 88 | else 89 | { 90 | HI_U8 r, g, b; 91 | r = hifb_rgb(&pVar->red, color); 92 | g = hifb_rgb(&pVar->green, color); 93 | b = hifb_rgb(&pVar->blue, color); 94 | return (r<<16) + (g<<8) + b; 95 | } 96 | } 97 | 98 | typedef struct 99 | { 100 | HI_BOOL bKeyEnable; /* colorkey enable flag */ 101 | HI_U32 u32Key; /* colorkey value, maybe contains alpha */ 102 | }HIFB_COLORKEY_S; 103 | 104 | typedef struct 105 | { 106 | HI_S32 x, y; 107 | HI_S32 w, h; 108 | } HIFB_RECT; 109 | 110 | typedef struct 111 | { 112 | HI_S32 s32XPos; /**< horizontal position */ 113 | HI_S32 s32YPos; /**< vertical position */ 114 | }HIFB_POINT_S; 115 | 116 | typedef struct hiHIFB_DEFLICKER_S 117 | { 118 | HI_U32 u32HDfLevel; /**< horizontal deflicker level */ 119 | HI_U32 u32VDfLevel; /**< vertical deflicker level */ 120 | HI_U8 *pu8HDfCoef; /**< horizontal deflicker coefficient */ 121 | HI_U8 *pu8VDfCoef; /**< vertical deflicker coefficient */ 122 | }HIFB_DEFLICKER_S; 123 | 124 | /** Alpha info */ 125 | typedef struct 126 | { 127 | HI_BOOL bAlphaEnable; /**< alpha enable flag */ 128 | HI_BOOL bAlphaChannel; /**< alpha channel enable flag */ 129 | HI_U8 u8Alpha0; /**< alpha0 value, used in ARGB1555 */ 130 | HI_U8 u8Alpha1; /**< alpha1 value, used in ARGB1555 */ 131 | HI_U8 u8GlobalAlpha; /**< global alpha value */ 132 | HI_U8 u8Reserved; 133 | }HIFB_ALPHA_S; 134 | 135 | typedef enum 136 | { 137 | HIFB_FMT_RGB565 = 0, 138 | HIFB_FMT_RGB888, /**< RGB888 24bpp */ 139 | 140 | HIFB_FMT_KRGB444, /**< RGB444 16bpp */ 141 | HIFB_FMT_KRGB555, /**< RGB555 16bpp */ 142 | HIFB_FMT_KRGB888, /**< RGB888 32bpp */ 143 | 144 | HIFB_FMT_ARGB4444, /**< ARGB4444 */ 145 | HIFB_FMT_ARGB1555, /**< ARGB1555 */ 146 | HIFB_FMT_ARGB8888, /**< ARGB8888 */ 147 | HIFB_FMT_ARGB8565, /**< ARGB8565 */ 148 | 149 | HIFB_FMT_RGBA4444, /**< ARGB4444 */ 150 | HIFB_FMT_RGBA5551, /**< RGBA5551 */ 151 | HIFB_FMT_RGBA5658, /**< RGBA5658 */ 152 | HIFB_FMT_RGBA8888, /**< RGBA8888 */ 153 | 154 | HIFB_FMT_BGR565, /**< BGR565 */ 155 | HIFB_FMT_BGR888, /**< BGR888 */ 156 | HIFB_FMT_ABGR4444, /**< ABGR4444 */ 157 | HIFB_FMT_ABGR1555, /**< ABGR1555 */ 158 | HIFB_FMT_ABGR8888, /**< ABGR8888 */ 159 | HIFB_FMT_ABGR8565, /**< ABGR8565 */ 160 | HIFB_FMT_KBGR444, /**< BGR444 16bpp */ 161 | HIFB_FMT_KBGR555, /**< BGR555 16bpp */ 162 | HIFB_FMT_KBGR888, /**< BGR888 32bpp */ 163 | 164 | HIFB_FMT_1BPP, /**< clut1 */ 165 | HIFB_FMT_2BPP, /**< clut2 */ 166 | HIFB_FMT_4BPP, /**< clut4 */ 167 | HIFB_FMT_8BPP, /**< clut8 */ 168 | HIFB_FMT_ACLUT44, /**< AClUT44*/ 169 | HIFB_FMT_ACLUT88, /**< ACLUT88 */ 170 | HIFB_FMT_PUYVY, /**< UYVY */ 171 | HIFB_FMT_PYUYV, /**< YUYV */ 172 | HIFB_FMT_PYVYU, /**< YVYU */ 173 | HIFB_FMT_YUV888, /**< YUV888 */ 174 | HIFB_FMT_AYUV8888, /**< AYUV8888 */ 175 | HIFB_FMT_YUVA8888, /**< YUVA8888 */ 176 | HIFB_FMT_BUTT 177 | }HIFB_COLOR_FMT_E; 178 | 179 | typedef struct 180 | { 181 | HI_BOOL bKeyRgb; 182 | HI_BOOL bKeyAlpha; /**< whether support colorkey alpha */ 183 | HI_BOOL bGlobalAlpha; /**< whether support global alpha */ 184 | HI_BOOL bCmap; /**< whether support color map */ 185 | HI_BOOL bHasCmapReg; /**< whether has color map register*/ 186 | HI_BOOL bColFmt[HIFB_FMT_BUTT]; /**< support which color format */ 187 | HI_BOOL bVoScale; /**< support vo scale*/ 188 | HI_BOOL bLayerSupported; /**< whether support a certain layer, for example:x5 HD support HIFB_SD_0 not support HIFB_SD_1*/ 189 | HI_U32 u32MaxWidth; /**< the max pixels per line */ 190 | HI_U32 u32MaxHeight; /**< the max lines */ 191 | HI_U32 u32MinWidth; /**< the min pixels per line */ 192 | HI_U32 u32MinHeight; /**< the min lines */ 193 | HI_U32 u32VDefLevel; /**< vertical deflicker level, 0 means vertical deflicker is unsupported */ 194 | HI_U32 u32HDefLevel; /**< horizontal deflicker level, 0 means horizontal deflicker is unsupported */ 195 | HI_BOOL bDcmp; 196 | HI_BOOL bPreMul; 197 | }HIFB_CAPABILITY_S; 198 | 199 | /*refresh mode*/ 200 | typedef enum 201 | { 202 | HIFB_LAYER_BUF_DOUBLE = 0x0, /**< 2 display buf in fb */ 203 | HIFB_LAYER_BUF_ONE = 0x1, /**< 1 display buf in fb */ 204 | HIFB_LAYER_BUF_NONE = 0x2, /**< no display buf in fb,the buf user refreshed will be directly set to VO*/ 205 | HIFB_LAYER_BUF_DOUBLE_IMMEDIATE=0x3, /**< 2 display buf in fb, each refresh will be displayed*/ 206 | HIFB_LAYER_BUF_BUTT 207 | } HIFB_LAYER_BUF_E; 208 | 209 | /* surface info */ 210 | typedef struct 211 | { 212 | HI_U32 u32PhyAddr; /**< start physical address */ 213 | HI_U32 u32Width; /**< width pixels */ 214 | HI_U32 u32Height; /**< height pixels */ 215 | HI_U32 u32Pitch; /**< line pixels */ 216 | HIFB_COLOR_FMT_E enFmt; /**< color format */ 217 | }HIFB_SURFACE_S; 218 | 219 | typedef struct 220 | { 221 | HI_U32 u32PhyAddr; 222 | HIFB_ALPHA_S stAlpha; 223 | HIFB_COLORKEY_S stColorkey; 224 | }HIFB_SURFACEEX_S; 225 | 226 | /* refresh surface info */ 227 | typedef struct 228 | { 229 | HIFB_SURFACE_S stCanvas; 230 | HIFB_RECT UpdateRect; /* refresh region*/ 231 | }HIFB_BUFFER_S; 232 | 233 | /* cursor info */ 234 | typedef struct 235 | { 236 | HIFB_SURFACE_S stCursor; 237 | HIFB_POINT_S stHotPos; 238 | } HIFB_CURSOR_S; 239 | 240 | /* crusor handle */ 241 | /* Attention:surface in cursor will be released by user*/ 242 | #define FBIOPUT_CURSOR_INFO _IOW(IOC_TYPE_HIFB, 104, HIFB_CURSOR_S *) 243 | #define FBIOGET_CURSOR_INFO _IOW(IOC_TYPE_HIFB, 105, HIFB_CURSOR_S *) 244 | 245 | #define FBIOPUT_CURSOR_STATE _IOW(IOC_TYPE_HIFB, 106, HI_BOOL *) 246 | #define FBIOGET_CURSOR_STATE _IOW(IOC_TYPE_HIFB, 107, HI_BOOL *) 247 | 248 | #define FBIOPUT_CURSOR_POS _IOW(IOC_TYPE_HIFB, 108, HIFB_POINT_S *) 249 | #define FBIOGET_CURSOR_POS _IOR(IOC_TYPE_HIFB, 109, HIFB_POINT_S *) 250 | 251 | #define FBIOPUT_CURSOR_COLORKEY _IOR(IOC_TYPE_HIFB, 110, HIFB_COLORKEY_S *) 252 | #define FBIOGET_CURSOR_COLORKEY _IOW(IOC_TYPE_HIFB, 111, HIFB_COLORKEY_S *) 253 | #define FBIOPUT_CURSOR_ALPHA _IOR(IOC_TYPE_HIFB, 112, HIFB_ALPHA_S *) 254 | #define FBIOGET_CURSOR_ALPHA _IOW(IOC_TYPE_HIFB, 113, HIFB_ALPHA_S *) 255 | 256 | /** cursor will be separated from attached layer automatically if you attach cursor to another layer,that means 257 | cursor can be attached to only one layer at any time*/ 258 | #define FBIOPUT_CURSOR_ATTCHCURSOR _IOW(IOC_TYPE_HIFB, 114, HI_U32 *) 259 | #define FBIOPUT_CURSOR_DETACHCURSOR _IOW(IOC_TYPE_HIFB, 115, HI_U32 *) 260 | 261 | /**antiflicker level*/ 262 | /**Auto means fb will choose a appropriate antiflicker level automatically according to the color info of map*/ 263 | typedef enum 264 | { 265 | HIFB_LAYER_ANTIFLICKER_NONE = 0x0, /**< no antiflicker*/ 266 | HIFB_LAYER_ANTIFLICKER_LOW = 0x1, /**< low level*/ 267 | HIFB_LAYER_ANTIFLICKER_MIDDLE = 0x2,/**< middle level*/ 268 | HIFB_LAYER_ANTIFLICKER_HIGH = 0x3, /**< high level*/ 269 | HIFB_LAYER_ANTIFLICKER_AUTO = 0x4, /**< auto*/ 270 | HIFB_LAYER_ANTIFLICKER_BUTT 271 | }HIFB_LAYER_ANTIFLICKER_LEVEL_E; 272 | 273 | /*layer info maskbit*/ 274 | typedef enum 275 | { 276 | HIFB_LAYERMASK_BUFMODE = 0x1, /**< BUFMODE bitmask */ 277 | HIFB_LAYERMASK_ANTIFLICKER_MODE = 0x2, /**< ANTIFLICKER_MODE bitmask */ 278 | HIFB_LAYERMASK_POS = 0x4, /**< the position bitmask */ 279 | HIFB_LAYERMASK_CANVASSIZE = 0x8, /**< canvassize bitmask */ 280 | HIFB_LAYERMASK_DISPSIZE = 0x10, /**< displaysize bitmask */ 281 | HIFB_LAYERMASK_SCREENSIZE = 0x20, /**< screensize bitmask */ 282 | HIFB_LAYERMASK_BMUL = 0x40, /**< pre-mult bitmask */ 283 | HIFB_LAYERMASK_BUTT 284 | }HIFB_LAYER_INFO_MASKBIT; 285 | 286 | /**layer info*/ 287 | typedef struct 288 | { 289 | HIFB_LAYER_BUF_E BufMode; 290 | HIFB_LAYER_ANTIFLICKER_LEVEL_E eAntiflickerLevel; 291 | HI_S32 s32XPos; /**< the x pos of origion point in screen */ 292 | HI_S32 s32YPos; /**< the y pos of origion point in screen */ 293 | HI_S32 u32CanvasWidth; /**< the width of canvas buffer */ 294 | HI_S32 u32CanvasHeight; /**< the height of canvas buffer */ 295 | HI_U32 u32DisplayWidth; /**< the width of display buf in fb.for 0 buf ,there is no display buf in fb, so it's effectless*/ 296 | HI_U32 u32DisplayHeight; /**< the height of display buf in fb. */ 297 | HI_U32 u32ScreenWidth; /**< the width of screen */ 298 | HI_U32 u32ScreenHeight; /**< the height of screen */ 299 | HI_BOOL bPreMul; /**< The data drawed in buf is premul data or not*/ 300 | HI_U32 u32Mask; /**< param modify mask bit*/ 301 | }HIFB_LAYER_INFO_S; 302 | 303 | /** To set the layer information */ 304 | #define FBIOPUT_LAYER_INFO _IOW(IOC_TYPE_HIFB, 120, HIFB_LAYER_INFO_S*) 305 | /** To get the layer information */ 306 | #define FBIOGET_LAYER_INFO _IOR(IOC_TYPE_HIFB, 121, HIFB_LAYER_INFO_S*) 307 | /** To get canvas buf */ 308 | #define FBIOGET_CANVAS_BUFFER _IOR(IOC_TYPE_HIFB, 123, HIFB_BUFFER_S*) 309 | /** To refresh the displayed contents in extended mode */ 310 | #define FBIO_REFRESH _IOW(IOC_TYPE_HIFB, 124, HIFB_BUFFER_S*) 311 | 312 | /**sync refresh*/ 313 | #define FBIO_WAITFOR_FREFRESH_DONE _IO(IOC_TYPE_HIFB, 125) 314 | 315 | 316 | 317 | #ifdef __cplusplus 318 | #if __cplusplus 319 | } 320 | #endif 321 | #endif /* __cplusplus */ 322 | 323 | 324 | #endif /* __HIFB_H__ */ 325 | 326 | -------------------------------------------------------------------------------- /pjlib/include/hi_inc/list.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) HighPoint Technologies, Inc. 3 | * All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without 6 | * modification, are permitted provided that the following conditions 7 | * are met: 8 | * 1. Redistributions of source code must retain the above copyright 9 | * notice, this list of conditions and the following disclaimer. 10 | * 2. Redistributions in binary form must reproduce the above copyright 11 | * notice, this list of conditions and the following disclaimer in the 12 | * documentation and/or other materials provided with the distribution. 13 | * 14 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND 15 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 16 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 17 | * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE 18 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 19 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 20 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 21 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 22 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 23 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 24 | * SUCH DAMAGE. 25 | * 26 | * $FreeBSD: src/sys/dev/hptrr/list.h,v 1.2.2.1.4.1 2010/06/14 02:09:06 kensmith Exp $ 27 | */ 28 | /* 29 | * $Id: list.h,v 1.6 2006/10/31 06:25:28 gmm Exp $ 30 | * Copyright (C) 2004-2005 HighPoint Technologies, Inc. All rights reserved. 31 | */ 32 | #ifndef _HPT_LIST_H_ 33 | #define _HPT_LIST_H_ 34 | 35 | #ifndef _LINUX_LIST_H 36 | 37 | #ifndef HPT_INLINE 38 | #define HPT_INLINE __inline 39 | #endif 40 | 41 | typedef unsigned long HPT_UPTR; 42 | 43 | struct list_head { 44 | struct list_head *next, *prev; 45 | }; 46 | 47 | #define LIST_HEAD_INIT(name) { &(name), &(name) } 48 | 49 | #define INIT_LIST_HEAD(ptr) do { (ptr)->next = (ptr); (ptr)->prev = (ptr); } while (0) 50 | 51 | static HPT_INLINE void __list_add(struct list_head * _new, struct list_head * prev, struct list_head * next) 52 | { 53 | next->prev = _new; 54 | _new->next = next; 55 | _new->prev = prev; 56 | prev->next = _new; 57 | } 58 | 59 | static HPT_INLINE void list_add(struct list_head *_new, struct list_head *head) 60 | { 61 | __list_add(_new, head, head->next); 62 | } 63 | 64 | static HPT_INLINE void list_add_tail(struct list_head *_new, struct list_head *head) 65 | { 66 | __list_add(_new, head->prev, head); 67 | } 68 | 69 | static HPT_INLINE void __list_del(struct list_head * prev, struct list_head * next) 70 | { 71 | next->prev = prev; 72 | prev->next = next; 73 | } 74 | 75 | static HPT_INLINE void list_del(struct list_head *entry) 76 | { 77 | __list_del(entry->prev, entry->next); 78 | } 79 | 80 | static HPT_INLINE void list_del_init(struct list_head *entry) 81 | { 82 | __list_del(entry->prev, entry->next); 83 | INIT_LIST_HEAD(entry); 84 | } 85 | 86 | static inline void list_move(struct list_head *list, struct list_head *head) 87 | { 88 | __list_del(list->prev, list->next); 89 | list_add(list, head); 90 | } 91 | 92 | static inline void list_move_tail(struct list_head *list, 93 | struct list_head *head) 94 | { 95 | __list_del(list->prev, list->next); 96 | list_add_tail(list, head); 97 | } 98 | 99 | static HPT_INLINE int list_empty(struct list_head *head) 100 | { 101 | return head->next == head; 102 | } 103 | 104 | static HPT_INLINE void __list_splice(struct list_head *list, 105 | struct list_head *head) 106 | { 107 | struct list_head *first = list->next; 108 | struct list_head *last = list->prev; 109 | struct list_head *at = head->next; 110 | 111 | first->prev = head; 112 | head->next = first; 113 | 114 | last->next = at; 115 | at->prev = last; 116 | } 117 | 118 | static HPT_INLINE void list_splice(struct list_head *list, struct list_head *head) 119 | { 120 | if (!list_empty(list)) 121 | __list_splice(list, head); 122 | } 123 | 124 | static HPT_INLINE void list_splice_init(struct list_head *list, struct list_head *head) 125 | { 126 | if (!list_empty(list)) { 127 | __list_splice(list, head); 128 | INIT_LIST_HEAD(list); 129 | } 130 | } 131 | 132 | /*#define list_entry(ptr, type, member) \ 133 | ((type *)((char *)(ptr)-(HPT_UPTR)(&((type *)0)->member))) */ 134 | #define list_entry(ptr, type, member) \ 135 | ((type *)((unsigned long)(ptr)-((unsigned long)(&((type *)1)->member) - 1))) 136 | 137 | #define list_for_each(pos, head) \ 138 | for (pos = (head)->next; pos != (head); pos = pos->next) 139 | 140 | #define list_for_each_safe(pos, n, head) \ 141 | for (pos = (head)->next, n = pos->next; pos != (head); \ 142 | pos = n, n = pos->next) 143 | 144 | #define get_first_item(attached, type, member) \ 145 | ((type *)((char *)((attached)->next)-(HPT_UPTR)(&((type *)0)->member))) 146 | 147 | #endif 148 | 149 | #endif 150 | -------------------------------------------------------------------------------- /pjlib/include/hi_inc/mpi_adec.h: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | 3 | Copyright (C), 2001-2011, Hisilicon Tech. Co., Ltd. 4 | 5 | ****************************************************************************** 6 | File Name : ai.c 7 | Version : Initial Draft 8 | Author : Hisilicon multimedia software group 9 | Created : 2009/6/15 10 | Description : 11 | History : 12 | 1.Date : 2009/6/19 13 | Author : p00123320 14 | Modification: Created file 15 | ******************************************************************************/ 16 | 17 | 18 | #ifndef _MPI_ADEC_H__ 19 | #define _MPI_ADEC_H__ 20 | 21 | #include "hi_common.h" 22 | #include "hi_comm_aio.h" 23 | #include "hi_comm_adec.h" 24 | 25 | #ifdef __cplusplus 26 | #if __cplusplus 27 | extern "C" 28 | { 29 | #endif 30 | #endif /* __cplusplus */ 31 | 32 | HI_S32 HI_MPI_ADEC_CreateChn(ADEC_CHN AdChn, ADEC_CHN_ATTR_S *pstAttr); 33 | HI_S32 HI_MPI_ADEC_DestroyChn(ADEC_CHN AdChn); 34 | 35 | HI_S32 HI_MPI_ADEC_SendStream(ADEC_CHN AdChn, const AUDIO_STREAM_S *pstStream, HI_BOOL bBlock); 36 | 37 | HI_S32 HI_MPI_ADEC_ClearChnBuf(ADEC_CHN AdChn); 38 | 39 | HI_S32 HI_MPI_ADEC_RegeisterDecoder(HI_S32 *ps32Handle, ADEC_DECODER_S *pstDecoder); 40 | HI_S32 HI_MPI_ADEC_UnRegisterDecoder(HI_S32 s32Handle); 41 | 42 | 43 | #ifdef __cplusplus 44 | #if __cplusplus 45 | } 46 | #endif 47 | #endif /* __cplusplus */ 48 | 49 | #endif 50 | 51 | -------------------------------------------------------------------------------- /pjlib/include/hi_inc/mpi_aenc.h: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | 3 | Copyright (C), 2001-2011, Hisilicon Tech. Co., Ltd. 4 | 5 | ****************************************************************************** 6 | File Name : ai.c 7 | Version : Initial Draft 8 | Author : Hisilicon multimedia software group 9 | Created : 2009/6/15 10 | Description : 11 | History : 12 | 1.Date : 2009/6/15 13 | Author : p00123320 14 | Modification: Created file 15 | ******************************************************************************/ 16 | 17 | 18 | #ifndef _MPI_AENC_H__ 19 | #define _MPI_AENC_H__ 20 | 21 | #include "hi_common.h" 22 | #include "hi_comm_aio.h" 23 | #include "hi_comm_aenc.h" 24 | 25 | #ifdef __cplusplus 26 | #if __cplusplus 27 | extern "C" 28 | { 29 | #endif 30 | #endif /* __cplusplus */ 31 | 32 | HI_S32 HI_MPI_AENC_CreateChn(AENC_CHN AeChn, const AENC_CHN_ATTR_S *pstAttr); 33 | HI_S32 HI_MPI_AENC_DestroyChn(AENC_CHN AeChn); 34 | 35 | HI_S32 HI_MPI_AENC_SendFrame(AENC_CHN AeChn, 36 | const AUDIO_FRAME_S *pstFrm, const AEC_FRAME_S *pstAecFrm); 37 | 38 | HI_S32 HI_MPI_AENC_GetStream(AENC_CHN AeChn, AUDIO_STREAM_S *pstStream, HI_BOOL bBlock); 39 | HI_S32 HI_MPI_AENC_ReleaseStream(AENC_CHN AeChn, const AUDIO_STREAM_S *pstStream); 40 | 41 | HI_S32 HI_MPI_AENC_GetFd(AENC_CHN AeChn); 42 | 43 | HI_S32 HI_MPI_AENC_RegeisterEncoder(HI_S32 *ps32Handle, AENC_ENCODER_S *pstEncoder); 44 | HI_S32 HI_MPI_AENC_UnRegisterEncoder(HI_S32 s32Handle); 45 | 46 | 47 | #ifdef __cplusplus 48 | #if __cplusplus 49 | } 50 | #endif 51 | #endif /* __cplusplus */ 52 | 53 | #endif 54 | 55 | -------------------------------------------------------------------------------- /pjlib/include/hi_inc/mpi_ai.h: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | 3 | Copyright (C), 2001-2011, Hisilicon Tech. Co., Ltd. 4 | 5 | ****************************************************************************** 6 | File Name : sio.c 7 | Version : Initial Draft 8 | Author : Hisilicon multimedia software group 9 | Created : 2009/5/5 10 | Description : 11 | History : 12 | 1.Date : 2009/5/5 13 | Author : p00123320 14 | Modification: Created file 15 | ******************************************************************************/ 16 | 17 | 18 | #ifndef _MPI_AI_H__ 19 | #define _MPI_AI_H__ 20 | 21 | #include "hi_type.h" 22 | #include "hi_common.h" 23 | #include "hi_comm_aio.h" 24 | 25 | #ifdef __cplusplus 26 | #if __cplusplus 27 | extern "C" 28 | { 29 | #endif 30 | #endif /* __cplusplus */ 31 | 32 | HI_S32 HI_MPI_AI_SetPubAttr(AUDIO_DEV AudioDevId, const AIO_ATTR_S *pstAttr); 33 | HI_S32 HI_MPI_AI_GetPubAttr(AUDIO_DEV AudioDevId, AIO_ATTR_S *pstAttr); 34 | 35 | HI_S32 HI_MPI_AI_Enable(AUDIO_DEV AudioDevId); 36 | HI_S32 HI_MPI_AI_Disable(AUDIO_DEV AudioDevId); 37 | 38 | HI_S32 HI_MPI_AI_EnableChn(AUDIO_DEV AudioDevId, AI_CHN AiChn); 39 | HI_S32 HI_MPI_AI_DisableChn(AUDIO_DEV AudioDevId, AI_CHN AiChn); 40 | 41 | HI_S32 HI_MPI_AI_GetFrame(AUDIO_DEV AudioDevId, AI_CHN AiChn, 42 | AUDIO_FRAME_S *pstFrm, AEC_FRAME_S *pstAecFrm, HI_BOOL bBlock); 43 | HI_S32 HI_MPI_AI_ReleaseFrame(AUDIO_DEV AudioDevId, AI_CHN AiChn, 44 | AUDIO_FRAME_S *pstFrm, AEC_FRAME_S *pstAecFrm); 45 | HI_S32 HI_MPI_AI_SetChnParam(AUDIO_DEV AudioDevId, AI_CHN AiChn, AI_CHN_PARAM_S *pstChnParam); 46 | HI_S32 HI_MPI_AI_GetChnParam(AUDIO_DEV AudioDevId, AI_CHN AiChn, AI_CHN_PARAM_S *pstChnParam); 47 | 48 | HI_S32 HI_MPI_AI_EnableAec(AUDIO_DEV AiDevId, AI_CHN AiChn, AUDIO_DEV AoDevId, AO_CHN AoChn); 49 | HI_S32 HI_MPI_AI_DisableAec(AUDIO_DEV AiDevId, AI_CHN AiChn); 50 | 51 | HI_S32 HI_MPI_AI_EnableReSmp(AUDIO_DEV AudioDevId, AI_CHN AiChn, AUDIO_RESAMPLE_ATTR_S *pstAttr); 52 | HI_S32 HI_MPI_AI_DisableReSmp(AUDIO_DEV AudioDevId, AI_CHN AiChn); 53 | 54 | HI_S32 HI_MPI_AI_EnableAnr(AUDIO_DEV AudioDevId, AI_CHN AiChn); 55 | HI_S32 HI_MPI_AI_DisableAnr(AUDIO_DEV AudioDevId, AI_CHN AiChn); 56 | 57 | HI_S32 HI_MPI_AI_GetFd(AUDIO_DEV AudioDevId, AI_CHN AiChn); 58 | 59 | 60 | #ifdef __cplusplus 61 | #if __cplusplus 62 | } 63 | #endif 64 | #endif /* __cplusplus */ 65 | 66 | #endif 67 | 68 | -------------------------------------------------------------------------------- /pjlib/include/hi_inc/mpi_ao.h: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | 3 | Copyright (C), 2001-2011, Hisilicon Tech. Co., Ltd. 4 | 5 | ****************************************************************************** 6 | File Name : mpi_ao.h 7 | Version : Initial Draft 8 | Author : Hisilicon multimedia software group 9 | Created : 2009/5/5 10 | Description : 11 | History : 12 | 1.Date : 2009/5/5 13 | Author : p00123320 14 | Modification: Created file 15 | ******************************************************************************/ 16 | 17 | 18 | #ifndef _MPI_AO_H__ 19 | #define _MPI_AO_H__ 20 | 21 | #include "hi_type.h" 22 | #include "hi_common.h" 23 | #include "hi_comm_aio.h" 24 | 25 | #ifdef __cplusplus 26 | #if __cplusplus 27 | extern "C" 28 | { 29 | #endif 30 | #endif /* __cplusplus */ 31 | 32 | 33 | HI_S32 HI_MPI_AO_SetPubAttr(AUDIO_DEV AudioDevId, const AIO_ATTR_S *pstAttr); 34 | HI_S32 HI_MPI_AO_GetPubAttr(AUDIO_DEV AudioDevId, AIO_ATTR_S *pstAttr); 35 | 36 | HI_S32 HI_MPI_AO_Enable(AUDIO_DEV AudioDevId); 37 | HI_S32 HI_MPI_AO_Disable(AUDIO_DEV AudioDevId); 38 | 39 | HI_S32 HI_MPI_AO_EnableChn(AUDIO_DEV AudioDevId, AO_CHN AoChn); 40 | HI_S32 HI_MPI_AO_DisableChn(AUDIO_DEV AudioDevId, AO_CHN AoChn); 41 | 42 | HI_S32 HI_MPI_AO_SendFrame(AUDIO_DEV AudioDevId, AO_CHN AoChn, 43 | const AUDIO_FRAME_S *pstData, HI_BOOL bBlock); 44 | 45 | HI_S32 HI_MPI_AO_EnableReSmp(AUDIO_DEV AudioDevId, AO_CHN AoChn, AUDIO_RESAMPLE_ATTR_S *pstAttr); 46 | HI_S32 HI_MPI_AO_DisableReSmp(AUDIO_DEV AudioDevId, AO_CHN AoChn); 47 | 48 | HI_S32 HI_MPI_AO_ClearChnBuf(AUDIO_DEV AudioDevId ,AO_CHN AoChn); 49 | HI_S32 HI_MPI_AO_QueryChnStat(AUDIO_DEV AudioDevId ,AO_CHN AoChn, AO_CHN_STATE_S *pstStatus); 50 | 51 | HI_S32 HI_MPI_AO_PauseChn(AUDIO_DEV AudioDevId, AO_CHN AoChn); 52 | HI_S32 HI_MPI_AO_ResumeChn(AUDIO_DEV AudioDevId, AO_CHN AoChn); 53 | 54 | HI_S32 HI_MPI_AO_SetVolume(AUDIO_DEV AudioDevId, AO_CHN AoChn, HI_S32 s32VolumeDb); 55 | HI_S32 HI_MPI_AO_GetVolume(AUDIO_DEV AudioDevId, AO_CHN AoChn, HI_S32 *ps32VolumeDb); 56 | 57 | HI_S32 HI_MPI_AO_GetFd(AUDIO_DEV AudioDevId, AO_CHN AoChn); 58 | 59 | 60 | #ifdef __cplusplus 61 | #if __cplusplus 62 | } 63 | #endif 64 | #endif /* __cplusplus */ 65 | 66 | #endif 67 | 68 | -------------------------------------------------------------------------------- /pjlib/include/hi_inc/mpi_hdmi.h: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | 3 | Copyright (C), 2001-2011, Hisilicon Tech. Co., Ltd. 4 | 5 | ****************************************************************************** 6 | File Name : mpi_hdmi.h 7 | Version : Initial Draft 8 | Author : Hisilicon multimedia software group 9 | Created : 2011/12/28 10 | Description : 11 | History : 12 | 1.Date : 2011/12/28 13 | Author : n00168968/q46153/l00168554 14 | Modification: Created file 15 | 16 | ******************************************************************************/ 17 | 18 | #ifndef __MPI_HDMI_H__ 19 | #define __MPI_HDMI_H__ 20 | 21 | #include "hi_comm_hdmi.h" 22 | 23 | #ifdef __cplusplus 24 | #if __cplusplus 25 | extern "C"{ 26 | #endif 27 | #endif /* End of #ifdef __cplusplus */ 28 | 29 | HI_S32 HI_MPI_HDMI_Init(HI_HDMI_INIT_PARA_S *pstHdmiPara); 30 | HI_S32 HI_MPI_HDMI_DeInit(void); 31 | HI_S32 HI_MPI_HDMI_Open(HI_HDMI_ID_E enHdmi); 32 | HI_S32 HI_MPI_HDMI_Close(HI_HDMI_ID_E enHdmi); 33 | HI_S32 HI_MPI_HDMI_GetSinkCapability(HI_HDMI_ID_E enHdmi, 34 | HI_HDMI_SINK_CAPABILITY_S *pstSinkCap); 35 | HI_S32 HI_MPI_HDMI_SetAttr(HI_HDMI_ID_E enHdmi, HI_HDMI_ATTR_S *pstAttr); 36 | HI_S32 HI_MPI_HDMI_GetAttr(HI_HDMI_ID_E enHdmi, HI_HDMI_ATTR_S *pstAttr); 37 | HI_S32 HI_MPI_HDMI_Start(HI_HDMI_ID_E enHdmi); 38 | HI_S32 HI_MPI_HDMI_Stop(HI_HDMI_ID_E enHdmi); 39 | HI_S32 HI_MPI_HDMI_SetAVMute(HI_HDMI_ID_E enHdmi, HI_BOOL bAvMute); 40 | HI_S32 HI_MPI_HDMI_Force_GetEDID(HI_HDMI_ID_E enHdmi, HI_HDMI_EDID_S *pstEdidData); 41 | 42 | /* Normally, these functions are not necessary */ 43 | HI_S32 HI_MPI_HDMI_SetDeepColor(HI_HDMI_ID_E enHdmi, HI_HDMI_DEEP_COLOR_E enDeepColor); 44 | HI_S32 HI_MPI_HDMI_GetDeepColor(HI_HDMI_ID_E enHdmi, HI_HDMI_DEEP_COLOR_E *penDeepColor); 45 | 46 | HI_S32 HI_MPI_HDMI_SetCsc(HI_HDMI_ID_E enHdmi, HI_HDMI_CSC_S *pstCsc); 47 | HI_S32 HI_MPI_HDMI_GetCsc(HI_HDMI_ID_E enHdmi, HI_HDMI_CSC_S *pstCsc); 48 | 49 | #ifdef __cplusplus 50 | #if __cplusplus 51 | } 52 | #endif 53 | #endif /* End of #ifdef __cplusplus */ 54 | 55 | #endif /*__MPI_HDMI_H__ */ 56 | 57 | -------------------------------------------------------------------------------- /pjlib/include/hi_inc/mpi_pciv.h: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | 3 | Copyright (C), 2001-2011, Hisilicon Tech. Co., Ltd. 4 | 5 | ****************************************************************************** 6 | File Name : mpi_pciv.h 7 | Version : Initial Draft 8 | Author : Hisilicon Hi3511 MPP Team 9 | Created : 2009/06/23 10 | Last Modified : 11 | Description : mpi functions declaration 12 | Function List : 13 | History : 14 | 1.Date : 2009/06/23 15 | Author : z44949 16 | Modification: Create 17 | ******************************************************************************/ 18 | #ifndef __MPI_PCIV_H__ 19 | #define __MPI_PCIV_H__ 20 | 21 | #include "hi_common.h" 22 | #include "hi_comm_video.h" 23 | #include "hi_comm_pciv.h" 24 | 25 | #ifdef __cplusplus 26 | #if __cplusplus 27 | extern "C"{ 28 | #endif 29 | #endif /* __cplusplus */ 30 | 31 | /***************************************************************************** 32 | Description : Create and initialize the pciv channel. 33 | Input : pcivChn ** The pciv channel id between [0, PCIV_MAX_CHN_NUM) 34 | pPcivAttr ** The attribute of pciv channel 35 | Output : None 36 | Return Value : HI_SUCCESS if success. 37 | HI_FAILURE if failure 38 | 39 | See Also : HI_MPI_PCIV_Destroy 40 | *****************************************************************************/ 41 | HI_S32 HI_MPI_PCIV_Create(PCIV_CHN pcivChn, PCIV_ATTR_S *pPcivAttr); 42 | 43 | /***************************************************************************** 44 | Description : Destroy the pciv channel 45 | Input : pcivChn ** The pciv channel id 46 | Output : None 47 | Return Value : HI_SUCCESS if success. 48 | HI_FAILURE if failure 49 | 50 | See Also : HI_MPI_PCIV_Create 51 | *****************************************************************************/ 52 | HI_S32 HI_MPI_PCIV_Destroy(PCIV_CHN pcivChn); 53 | 54 | /***************************************************************************** 55 | Description : Set the attribute of pciv channel 56 | Input : pcivChn ** The pciv channel id 57 | pPcivAttr ** The attribute of pciv channel 58 | Output : None 59 | Return Value : HI_SUCCESS if success. 60 | HI_FAILURE if failure 61 | 62 | See Also : HI_MPI_PCIV_GetAttr 63 | *****************************************************************************/ 64 | HI_S32 HI_MPI_PCIV_SetAttr(PCIV_CHN pcivChn, PCIV_ATTR_S *pPcivAttr); 65 | 66 | /***************************************************************************** 67 | Description : Get the attribute of pciv channel 68 | Input : pcivChn ** The pciv channel id 69 | Output : pPcivAttr ** The attribute of pciv channel 70 | Return Value : HI_SUCCESS if success. 71 | HI_FAILURE if failure 72 | 73 | See Also : HI_MPI_PCIV_SetAttr 74 | *****************************************************************************/ 75 | HI_S32 HI_MPI_PCIV_GetAttr(PCIV_CHN pcivChn, PCIV_ATTR_S *pPcivAttr); 76 | 77 | 78 | /***************************************************************************** 79 | Description : Start to send or receive video frame 80 | Input : pcivChn ** The pciv channel id 81 | Output : None 82 | Return Value : HI_SUCCESS if success. 83 | HI_FAILURE if failure 84 | 85 | See Also : HI_MPI_PCIV_Stop 86 | *****************************************************************************/ 87 | HI_S32 HI_MPI_PCIV_Start(PCIV_CHN pcivChn); 88 | 89 | /***************************************************************************** 90 | Description : Stop send or receive video frame 91 | Input : pcivChn ** The pciv channel id 92 | Output : None 93 | Return Value : HI_SUCCESS if success. 94 | HI_FAILURE if failure 95 | 96 | See Also : HI_MPI_PCIV_Start 97 | *****************************************************************************/ 98 | HI_S32 HI_MPI_PCIV_Stop(PCIV_CHN pcivChn); 99 | 100 | /***************************************************************************** 101 | Description : Create a series of dma task 102 | Input : pTask ** The task list to create 103 | Output : None 104 | Return Value : HI_SUCCESS if success. 105 | HI_FAILURE if failure 106 | 107 | See Also : None 108 | *****************************************************************************/ 109 | HI_S32 HI_MPI_PCIV_DmaTask(PCIV_DMA_TASK_S *pTask); 110 | 111 | /***************************************************************************** 112 | Description : Alloc 'u32BlkSize' bytes memory and give the physical address 113 | The memory used by PCI must be located within the PCI window, 114 | So you should call this function to alloc it. 115 | Input : u32BlkSize ** The size of each memory block 116 | u32BlkCnt ** The count of memory block 117 | Output : u32PhyAddr ** The physical address of the memory 118 | Return Value : HI_SUCCESS if success. 119 | HI_FAILURE if failure 120 | 121 | See Also : HI_MPI_PCIV_Free 122 | *****************************************************************************/ 123 | HI_U32 HI_MPI_PCIV_Malloc(HI_U32 u32BlkSize, HI_U32 u32BlkCnt, HI_U32 u32PhyAddr[]); 124 | HI_S32 HI_MPI_PCIV_Free(HI_U32 u32BlkCnt, HI_U32 u32PhyAddr[]); 125 | 126 | 127 | /***************************************************************************** 128 | Description : Get the board ID of this board 129 | Input : None 130 | Output : None 131 | Return Value : The board ID if success 132 | HI_FAILURE or HI_ERR_PCIV_SYS_NOTREADY if failure 133 | 134 | See Also : HI_MPI_PCIV_GetBaseWindow 135 | *****************************************************************************/ 136 | HI_S32 HI_MPI_PCIV_GetLocalId(HI_VOID); 137 | 138 | /***************************************************************************** 139 | Description : Enum all the connected chip.Call this function as follow. 140 | { 141 | HI_S32 s32ChipID[PCIV_MAX_CHIPNUM], i, s32Ret; 142 | 143 | s32Ret = HI_MPI_PCIV_EnumChip(s32ChipID); 144 | HI_ASSERT(HI_SUCCESS == s32Ret); 145 | 146 | for(i=0; iu32NpWinBase, 168 | pBase->u32PfWinBase, 169 | pBase->u32CfgWinBase 170 | On Slave pBase->u32PfAHBAddr 171 | Return Value : HI_SUCCESS if success. 172 | HI_FAILURE if failure 173 | 174 | See Also : HI_MPI_PCIV_GetLocalId 175 | *****************************************************************************/ 176 | HI_S32 HI_MPI_PCIV_GetBaseWindow(HI_S32 s32ChipId, PCIV_BASEWINDOW_S *pBase); 177 | 178 | /***************************************************************************** 179 | Description : Only on the slave chip, you need to create some VB Pool. 180 | Those pool will bee created on the PCI Window Zone. 181 | Input : pCfg.u32PoolCount ** The total number of pool want to create 182 | pCfg.u32BlkSize[] ** The size of each VB block 183 | pCfg.u32BlkCount[]** The number of each VB block 184 | 185 | Output : None 186 | Return Value : HI_SUCCESS if success. 187 | HI_ERR_PCIV_SYS_NOTREADY 188 | HI_ERR_PCIV_NULL_PTR 189 | HI_ERR_PCIV_NOMEM 190 | HI_ERR_PCIV_BUSY 191 | HI_ERR_PCIV_NOT_SUPPORT 192 | HI_FAILURE 193 | 194 | See Also : HI_MPI_PCIV_GetLocalId 195 | *****************************************************************************/ 196 | HI_S32 HI_MPI_PCIV_WinVbCreate(PCIV_WINVBCFG_S *pCfg); 197 | 198 | /***************************************************************************** 199 | Description : Destroy the pools which's size is equal to the pCfg.u32BlkSize[] 200 | Input : pCfg.u32PoolCount ** The total number of pool want to destroy 201 | pCfg.u32BlkSize[] ** The size of each VB block 202 | pCfg.u32BlkCount[]** Don't care this parament 203 | 204 | Output : None 205 | Return Value : HI_SUCCESS if success. 206 | HI_ERR_PCIV_SYS_NOTREADY 207 | HI_ERR_PCIV_NOT_SUPPORT 208 | HI_FAILURE 209 | 210 | See Also : HI_MPI_PCIV_GetLocalId 211 | *****************************************************************************/ 212 | HI_S32 HI_MPI_PCIV_WinVbDestroy(HI_VOID); 213 | 214 | 215 | /***************************************************************************** 216 | Description : Show the image in VO device from PCI 217 | Input : pcivChn ** The pciv channel id 218 | Output : None 219 | Return Value : 220 | *****************************************************************************/ 221 | HI_S32 HI_MPI_PCIV_Show(PCIV_CHN pcivChn); 222 | 223 | 224 | /***************************************************************************** 225 | Description : Hide the image in VO device from PCI 226 | Input : pcivChn ** The pciv channel id 227 | Output : None 228 | Return Value : 229 | *****************************************************************************/ 230 | HI_S32 HI_MPI_PCIV_Hide(PCIV_CHN pcivChn); 231 | 232 | 233 | 234 | HI_S32 HI_MPI_PCIV_GetPreProcCfg(PCIV_CHN pcivChn, PCIV_PREPROC_CFG_S *pstCfg); 235 | 236 | HI_S32 HI_MPI_PCIV_SetPreProcCfg(PCIV_CHN pcivChn, PCIV_PREPROC_CFG_S *pstCfg); 237 | 238 | 239 | 240 | 241 | #ifdef __cplusplus 242 | #if __cplusplus 243 | } 244 | #endif 245 | #endif /* __cplusplus */ 246 | 247 | #endif /* __MPI_VENC_H__ */ 248 | -------------------------------------------------------------------------------- /pjlib/include/hi_inc/mpi_region.h: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * 3 | * Copyright (C), 2001-2011, Huawei Tech. Co., Ltd. 4 | * 5 | ******************************************************************************* 6 | * File Name : mpi_region.h 7 | * Version : Initial Draft 8 | * Author : j00169368 9 | * Created : 2010/12/13 10 | * Last Modified : 11 | * Description : REGION MPI 12 | * Function List : 13 | * 14 | * 15 | * History: 16 | * 17 | * 1. Date : 2010/12/13 18 | * Author : j00169368 19 | * Modification : Created file 20 | * 21 | ******************************************************************************/ 22 | 23 | #ifndef __MPI_REGION_H__ 24 | #define __MPI_REGION_H__ 25 | 26 | #ifdef __cplusplus 27 | #if __cplusplus 28 | extern "C"{ 29 | #endif 30 | #endif /* End of #ifdef __cplusplus */ 31 | 32 | 33 | #include "hi_comm_region.h" 34 | 35 | 36 | HI_S32 HI_MPI_RGN_Create(RGN_HANDLE Handle,const RGN_ATTR_S *pstRegion); 37 | HI_S32 HI_MPI_RGN_Destroy(RGN_HANDLE Handle); 38 | 39 | HI_S32 HI_MPI_RGN_GetAttr(RGN_HANDLE Handle,RGN_ATTR_S *pstRegion); 40 | HI_S32 HI_MPI_RGN_SetAttr(RGN_HANDLE Handle,const RGN_ATTR_S *pstRegion); 41 | 42 | HI_S32 HI_MPI_RGN_SetBitMap(RGN_HANDLE Handle,const BITMAP_S *pstBitmap); 43 | 44 | HI_S32 HI_MPI_RGN_SetAttachField(RGN_HANDLE Handle, RGN_ATTACH_FIELD_E enAttachField); 45 | HI_S32 HI_MPI_RGN_GetAttachField(RGN_HANDLE Handle, RGN_ATTACH_FIELD_E *penAttachField); 46 | 47 | HI_S32 HI_MPI_RGN_AttachToChn(RGN_HANDLE Handle,const MPP_CHN_S *pstChn,const RGN_CHN_ATTR_S *pstChnAttr); 48 | HI_S32 HI_MPI_RGN_DetachFrmChn(RGN_HANDLE Handle,const MPP_CHN_S *pstChn); 49 | 50 | HI_S32 HI_MPI_RGN_SetDisplayAttr(RGN_HANDLE Handle,const MPP_CHN_S *pstChn,const RGN_CHN_ATTR_S *pstChnAttr); 51 | HI_S32 HI_MPI_RGN_GetDisplayAttr(RGN_HANDLE Handle,const MPP_CHN_S *pstChn,RGN_CHN_ATTR_S *pstChnAttr); 52 | 53 | 54 | #ifdef __cplusplus 55 | #if __cplusplus 56 | } 57 | #endif 58 | #endif /* End of #ifdef __cplusplus */ 59 | 60 | #endif /* End of #ifndef __MPI_REGION_H__ */ 61 | 62 | 63 | -------------------------------------------------------------------------------- /pjlib/include/hi_inc/mpi_sys.h: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | 3 | Copyright (C), 2001-2011, Hisilicon Tech. Co., Ltd. 4 | 5 | ****************************************************************************** 6 | File Name : mpi_sys.h 7 | Version : Initial Draft 8 | Author : Hisilicon multimedia software group 9 | Created : 2007/1/31 10 | Description : 11 | History : 12 | 1.Date : 2006/1/31 13 | Author : c42025 14 | Modification: Created file 15 | 16 | 2.Date : 2008/03/03 17 | Author : c42025 18 | Modification: add a new funtion "HI_MPI_SYS_GetVersion" 19 | 20 | ******************************************************************************/ 21 | 22 | #include "hi_type.h" 23 | #include "hi_common.h" 24 | #include "hi_comm_sys.h" 25 | 26 | #ifndef __MPI_SYS_H__ 27 | #define __MPI_SYS_H__ 28 | 29 | /******************************************/ 30 | #ifdef __cplusplus 31 | #if __cplusplus 32 | extern "C" 33 | { 34 | #endif 35 | #endif /* __cplusplus */ 36 | /******************************************/ 37 | 38 | HI_S32 HI_MPI_SYS_Init(); 39 | HI_S32 HI_MPI_SYS_Exit(); 40 | 41 | HI_S32 HI_MPI_SYS_SetConf(const MPP_SYS_CONF_S *pstSysConf); 42 | HI_S32 HI_MPI_SYS_GetConf(MPP_SYS_CONF_S *pstSysConf); 43 | 44 | HI_S32 HI_MPI_SYS_Bind(MPP_CHN_S *pstSrcChn, MPP_CHN_S *pstDestChn); 45 | 46 | HI_S32 HI_MPI_SYS_UnBind(MPP_CHN_S *pstSrcChn, MPP_CHN_S *pstDestChn); 47 | 48 | HI_S32 HI_MPI_SYS_GetBindbyDest(MPP_CHN_S *pstDestChn, MPP_CHN_S *pstSrcChn); 49 | 50 | 51 | HI_S32 HI_MPI_SYS_GetVersion(MPP_VERSION_S *pstVersion); 52 | 53 | /* Get the current PTS of this system */ 54 | HI_S32 HI_MPI_SYS_GetCurPts(HI_U64 *pu64CurPts); 55 | 56 | /* 57 | ** u64Base is the global PTS of the system. 58 | ** ADVICE: 59 | ** 1. Bester to call HI_MPI_SYS_GetCurPts on the host board to get the u64Base. 60 | ** 2. When the linux start up, call HI_MPI_SYS_InitPtsBase to set the init pts. 61 | ** 3. When media bussines is running, synchronize the PTS one time per minute. 62 | ** And should call HI_MPI_SYS_SyncPts. 63 | */ 64 | HI_S32 HI_MPI_SYS_InitPtsBase(HI_U64 u64PtsBase); 65 | HI_S32 HI_MPI_SYS_SyncPts(HI_U64 u64PtsBase); 66 | 67 | /* alloc mmz memory in user context */ 68 | HI_S32 HI_MPI_SYS_MmzAlloc(HI_U32 *pu32PhyAddr, HI_VOID **ppVirtAddr, 69 | const HI_CHAR *strMmb, const HI_CHAR *strZone, HI_U32 u32Len); 70 | 71 | /* alloc mmz memory with cache */ 72 | HI_S32 HI_MPI_SYS_MmzAlloc_Cached(HI_U32 *pu32PhyAddr, HI_VOID **ppVitAddr, 73 | const HI_CHAR *pstrMmb, const HI_CHAR *pstrZone, HI_U32 u32Len); 74 | 75 | /* free mmz memory in user context */ 76 | HI_S32 HI_MPI_SYS_MmzFree(HI_U32 u32PhyAddr, HI_VOID *pVirtAddr); 77 | 78 | /* fulsh cache */ 79 | HI_S32 HI_MPI_SYS_MmzFlushCache(HI_U32 u32PhyAddr, HI_VOID *pVitAddr, HI_U32 u32Size); 80 | 81 | /* 82 | ** Call the mmap function to map physical address to virtual address 83 | ** The system function mmap is too complicated, so we packge it. 84 | */ 85 | HI_VOID * HI_MPI_SYS_Mmap(HI_U32 u32PhyAddr, HI_U32 u32Size); 86 | HI_S32 HI_MPI_SYS_Munmap(HI_VOID* pVirAddr, HI_U32 u32Size); 87 | 88 | /* 89 | ** Access the physical address. 90 | ** You can use this function to access memory address or register address. 91 | */ 92 | HI_S32 HI_MPI_SYS_SetReg(HI_U32 u32Addr, HI_U32 u32Value); 93 | HI_S32 HI_MPI_SYS_GetReg(HI_U32 u32Addr, HI_U32 *pu32Value); 94 | 95 | 96 | HI_S32 HI_MPI_SYS_SetMemConf(MPP_CHN_S *pstMppChn,const HI_CHAR *pcMmzName); 97 | HI_S32 HI_MPI_SYS_GetMemConf(MPP_CHN_S *pstMppChn,HI_CHAR *pcMmzName); 98 | 99 | /* Get address of virtual register */ 100 | HI_S32 HI_MPI_SYS_GetVRegAddr(HI_U32 *pu32Addr); 101 | 102 | 103 | /* Close all the FD which is used by sys module */ 104 | HI_S32 HI_MPI_SYS_CloseFd(HI_VOID); 105 | 106 | 107 | /******************************************/ 108 | #ifdef __cplusplus 109 | #if __cplusplus 110 | } 111 | #endif 112 | #endif /* __cplusplus */ 113 | /******************************************/ 114 | #endif /*__MPI_SYS_H__ */ 115 | 116 | 117 | -------------------------------------------------------------------------------- /pjlib/include/hi_inc/mpi_vb.h: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | 3 | Copyright (C), 2001-2011, Hisilicon Tech. Co., Ltd. 4 | 5 | ****************************************************************************** 6 | File Name : mpi_vb.h 7 | Version : Initial Draft 8 | Author : Hisilicon multimedia software group 9 | Created : 2007/10/15 10 | Description : 11 | History : 12 | 1.Date : 2007/10/15 13 | Author : c42025 14 | Modification: Created file 15 | ******************************************************************************/ 16 | #ifndef __MPI_VB_H__ 17 | #define __MPI_VB_H__ 18 | 19 | #include "hi_comm_vb.h" 20 | 21 | /******************************************/ 22 | #ifdef __cplusplus 23 | #if __cplusplus 24 | extern "C" 25 | { 26 | #endif 27 | #endif /* __cplusplus */ 28 | /******************************************/ 29 | 30 | 31 | VB_POOL HI_MPI_VB_CreatePool(HI_U32 u32BlkSize,HI_U32 u32BlkCnt,const HI_CHAR *pcMmzName); 32 | 33 | HI_S32 HI_MPI_VB_DestroyPool(VB_POOL Pool); 34 | VB_BLK HI_MPI_VB_GetBlock(VB_POOL Pool, HI_U32 u32BlkSize,const HI_CHAR *pcMmzName); 35 | HI_S32 HI_MPI_VB_ReleaseBlock(VB_BLK Block); 36 | 37 | HI_U32 HI_MPI_VB_Handle2PhysAddr(VB_BLK Block); 38 | VB_POOL HI_MPI_VB_Handle2PoolId(VB_BLK Block); 39 | 40 | HI_S32 HI_MPI_VB_Init (HI_VOID); 41 | HI_S32 HI_MPI_VB_Exit (HI_VOID); 42 | HI_S32 HI_MPI_VB_SetConf (const VB_CONF_S *pstVbConf); 43 | HI_S32 HI_MPI_VB_GetConf (VB_CONF_S *pstVbConf); 44 | 45 | HI_S32 HI_MPI_VB_MmapPool(VB_POOL Pool); 46 | HI_S32 HI_MPI_VB_MunmapPool(VB_POOL Pool); 47 | HI_S32 HI_MPI_VB_GetBlkVirAddr(VB_POOL Pool, HI_U32 u32PhyAddr, HI_VOID **ppVirAddr); 48 | 49 | 50 | /******************************************/ 51 | #ifdef __cplusplus 52 | #if __cplusplus 53 | } 54 | #endif 55 | #endif /* __cplusplus */ 56 | /******************************************/ 57 | #endif /*__MPI_VI_H__ */ 58 | -------------------------------------------------------------------------------- /pjlib/include/hi_inc/mpi_vda.h: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * 3 | * Copyright (C), 2001-2011, Huawei Tech. Co., Ltd. 4 | * 5 | ******************************************************************************* 6 | * File Name : mpi_vda.h 7 | * Version : Initial Draft 8 | * Author : j00169368,l64467 9 | * Created : 2011/1/7 10 | * Last Modified : 11 | * Description : mpi functions declaration 12 | * Function List : 13 | * 14 | * 15 | * History: 16 | * 17 | * 1. Date : 2011/1/7 18 | * Author : j00169368,l64467 19 | * Modification : Created file 20 | * 21 | ******************************************************************************/ 22 | 23 | #ifndef __MPI_VDA_H__ 24 | #define __MPI_VDA_H__ 25 | 26 | #include "hi_comm_vda.h" 27 | 28 | #ifdef __cplusplus 29 | #if __cplusplus 30 | extern "C"{ 31 | #endif 32 | #endif /* End of #ifdef __cplusplus */ 33 | 34 | 35 | /***************************************************************************** 36 | Prototype : HI_MPI_VDA_CreateChn 37 | Description : Create the vda channel. 38 | Input : VdaChn 39 | pstAttr 40 | Output : None 41 | Return Value : 42 | Process : 43 | 44 | Note : 45 | 46 | History 47 | 1.Date : 2011/1/10 48 | Author : l64467,j00169368 49 | Modification : Created function 50 | 51 | *****************************************************************************/ 52 | HI_S32 HI_MPI_VDA_CreateChn(VDA_CHN VdaChn, const VDA_CHN_ATTR_S *pstAttr); 53 | 54 | 55 | 56 | 57 | /***************************************************************************** 58 | Prototype : HI_MPI_VDA_DestroyChn 59 | Description : Destroy the vda channel. 60 | Input : VdaChn 61 | Output : None 62 | Return Value : 63 | Process : Firstly,stop to receive image,and then unbind to vi,lastly,destroy the channel. 64 | Note : 65 | 66 | History 67 | 1.Date : 2011/1/10 68 | Author : l64467,j00169368 69 | Modification : Created function 70 | 71 | *****************************************************************************/ 72 | HI_S32 HI_MPI_VDA_DestroyChn(VDA_CHN VdaChn); 73 | 74 | 75 | 76 | 77 | 78 | /***************************************************************************** 79 | Prototype : HI_MPI_VDA_GetChnAttr 80 | Description : Get the channel's attribute. 81 | Input : VdaChn 82 | Output : pstAttr 83 | Return Value : 84 | Process : Return the chanel's attribute. 85 | Note : 86 | 87 | History 88 | 1.Date : 2011/1/10 89 | Author : l64467,j00169368 90 | Modification : Created function 91 | 92 | *****************************************************************************/ 93 | HI_S32 HI_MPI_VDA_GetChnAttr(VDA_CHN VdaChn, VDA_CHN_ATTR_S *pstAttr); 94 | 95 | 96 | 97 | 98 | /***************************************************************************** 99 | Prototype : HI_MPI_VDA_SetChnAttr 100 | Description : Set the channel's attribute,it must be used after calling HI_MPI_VDA_CreateChn. 101 | Input : VdaChn 102 | pstAttr 103 | Output : None 104 | Return Value : 105 | Process : 106 | Note : Only the dynamic attribute can be changed. 107 | 108 | History 109 | 1.Date : 2011/1/10 110 | Author : l64467,j00169368 111 | Modification : Created function 112 | 113 | *****************************************************************************/ 114 | HI_S32 HI_MPI_VDA_SetChnAttr(VDA_CHN VdaChn, const VDA_CHN_ATTR_S *pstAttr); 115 | 116 | 117 | 118 | 119 | 120 | 121 | /***************************************************************************** 122 | Prototype : HI_MPI_VDA_StartRecvPic 123 | Description : The VDA channel start to receive image. 124 | Input : VdaChn 125 | Output : None 126 | Return Value : 127 | Process : Set the flag which indicates whether the channel start to receive image to true. 128 | Note : 129 | 130 | History 131 | 1.Date : 2011/1/10 132 | Author : l64467,j00169368 133 | Modification : Created function 134 | 135 | *****************************************************************************/ 136 | HI_S32 HI_MPI_VDA_StartRecvPic(VDA_CHN VdaChn); 137 | 138 | 139 | 140 | 141 | /***************************************************************************** 142 | Prototype : HI_MPI_VDA_StopRecvPic 143 | Description : The VDA channel stop to receive image. 144 | Input : VdaChn 145 | Output : None 146 | Return Value : 147 | Process : Set the flag which indicates whether the channel start to receive image to false. 148 | Note : 149 | 150 | History 151 | 1.Date : 2011/1/10 152 | Author : l64467,j00169368 153 | Modification : Created function 154 | 155 | *****************************************************************************/ 156 | HI_S32 HI_MPI_VDA_StopRecvPic(VDA_CHN VdaChn); 157 | 158 | 159 | 160 | 161 | /***************************************************************************** 162 | Prototype : HI_MPI_VDA_GetData 163 | Description : Get the the result. 164 | Input : VdaChn 165 | u32BlockFlag 166 | Output : pstVDAData 167 | Return Value : 168 | Process : 169 | Note : 170 | 171 | History 172 | 1.Date : 2011/1/10 173 | Author : l64467,j00169368 174 | Modification : Created function 175 | 176 | *****************************************************************************/ 177 | HI_S32 HI_MPI_VDA_GetData(VDA_CHN VdaChn, VDA_DATA_S *pstVdaData, HI_BOOL bBlock); 178 | 179 | 180 | 181 | 182 | /***************************************************************************** 183 | Prototype : HI_MPI_VDA_ReleaseData 184 | Description : Release the result. 185 | Input : VdaChn 186 | pstVDAData 187 | Output : None 188 | Return Value : 189 | Process : 190 | Note : 191 | 192 | History 193 | 1.Date : 2011/1/10 194 | Author : l64467,j00169368 195 | Modification : Created function 196 | 197 | *****************************************************************************/ 198 | HI_S32 HI_MPI_VDA_ReleaseData(VDA_CHN VdaChn, const VDA_DATA_S* pstVdaData); 199 | 200 | 201 | 202 | /***************************************************************************** 203 | Prototype : HI_MPI_VDA_Reset 204 | Description : Reset OD region. 205 | Input : VdaChn 206 | s32RgnIndex 207 | Output : None 208 | Return Value : 209 | Process : 210 | Note : 211 | 212 | History 213 | 1.Date : 2011/1/10 214 | Author : l64467,j00169368 215 | Modification : Created function 216 | 217 | *****************************************************************************/ 218 | HI_S32 HI_MPI_VDA_ResetOdRegion(VDA_CHN VdaChn, HI_S32 s32RgnIndex); 219 | 220 | 221 | 222 | /***************************************************************************** 223 | Prototype : HI_MPI_VDA_Query 224 | Description : Query the state of VDA channel. 225 | Input : VdaChn 226 | Output : stChnStat 227 | Return Value : 228 | Process : 229 | Note : 230 | 231 | History 232 | 1.Date : 2011/1/10 233 | Author : l64467,j00169368 234 | Modification : Created function 235 | 236 | *****************************************************************************/ 237 | HI_S32 HI_MPI_VDA_Query(VDA_CHN VdaChn, VDA_CHN_STAT_S *pstChnStat); 238 | 239 | 240 | 241 | 242 | /***************************************************************************** 243 | Prototype : HI_MPI_VDA_GetFd 244 | Description : Get the file handle. 245 | Input : VdaChn 246 | Output : None 247 | Return Value : 248 | Process : 249 | Note : 250 | 251 | History 252 | 1.Date : 2011/1/10 253 | Author : l64467,j00169368 254 | Modification : Created function 255 | 256 | *****************************************************************************/ 257 | HI_S32 HI_MPI_VDA_GetFd(VDA_CHN VdaChn); 258 | 259 | 260 | /***************************************************************************** 261 | Prototype : HI_MPI_VDA_UpdateRef 262 | Description : Update the reference image. 263 | Input : VdaChn 264 | pstRefFrame 265 | Output : None 266 | Return Value : 267 | Process : 268 | Note : 1,Only be used when the reference mode is user mode. 269 | 270 | History 271 | 1.Date : 2011/1/10 272 | Author : l64467,j00169368 273 | Modification : Created function 274 | 275 | *****************************************************************************/ 276 | HI_S32 HI_MPI_VDA_UpdateRef(VDA_CHN VdaChn, const VIDEO_FRAME_INFO_S *pstRefFrame); 277 | 278 | 279 | /***************************************************************************** 280 | Prototype : HI_MPI_VDA_UserSendPic 281 | Description :User send image 282 | Input : VdaChn 283 | pstRefFrame 284 | bBlock 285 | u32MilliSec 286 | Output : None 287 | Return Value : 288 | Process : 289 | Note : 290 | 291 | History 292 | 1.Date : 2012/05/08 293 | Author : s00187460 294 | Modification : Created function 295 | 296 | *****************************************************************************/ 297 | HI_S32 HI_MPI_VDA_UserSendPic(VDA_CHN VdaChn, const VIDEO_FRAME_INFO_S *pstUserFrame, HI_BOOL bBlock, HI_U32 u32MilliSec); 298 | 299 | 300 | #ifdef __cplusplus 301 | #if __cplusplus 302 | } 303 | #endif 304 | #endif /* End of #ifdef __cplusplus */ 305 | 306 | 307 | #endif /* End of #ifndef __MPI_VDA_H__ */ 308 | -------------------------------------------------------------------------------- /pjlib/include/hi_inc/mpi_vdec.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dulton/hi35xx-pjsip/49d821d9fa23740daba04dbe881b9d358c6a50a5/pjlib/include/hi_inc/mpi_vdec.h -------------------------------------------------------------------------------- /pjlib/include/hi_inc/mpi_venc.h: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | 3 | Copyright (C), 2001-2012, Hisilicon Tech. Co., Ltd. 4 | 5 | ****************************************************************************** 6 | File Name : mpi_venc.h 7 | Version : Initial Draft 8 | Author : Hisilicon Hi35xx MPP Team 9 | Created : 2006/11/22 10 | Last Modified : 11 | Description : mpi functions declaration 12 | Function List : 13 | History : 14 | ******************************************************************************/ 15 | #ifndef __MPI_VENC_H__ 16 | #define __MPI_VENC_H__ 17 | 18 | #include "hi_common.h" 19 | #include "hi_comm_video.h" 20 | #include "hi_comm_venc.h" 21 | 22 | #ifdef __cplusplus 23 | #if __cplusplus 24 | extern "C"{ 25 | #endif 26 | #endif /* __cplusplus */ 27 | 28 | HI_S32 HI_MPI_VENC_CreateGroup(VENC_GRP VeGroup); 29 | HI_S32 HI_MPI_VENC_DestroyGroup(VENC_GRP VeGroup); 30 | 31 | HI_S32 HI_MPI_VENC_CreateChn(VENC_CHN VeChn, const VENC_CHN_ATTR_S *pstAttr); 32 | HI_S32 HI_MPI_VENC_DestroyChn(VENC_CHN VeChn); 33 | 34 | HI_S32 HI_MPI_VENC_RegisterChn(VENC_GRP VeGroup, VENC_CHN VeChn ); 35 | HI_S32 HI_MPI_VENC_UnRegisterChn(VENC_CHN VeChn); 36 | 37 | HI_S32 HI_MPI_VENC_StartRecvPic(VENC_CHN VeChn); 38 | HI_S32 HI_MPI_VENC_StartRecvPicEx(VENC_CHN VeChn, VENC_RECV_PIC_PARAM_S *pstRecvParam); 39 | HI_S32 HI_MPI_VENC_StopRecvPic(VENC_CHN VeChn); 40 | 41 | HI_S32 HI_MPI_VENC_Query(VENC_CHN VeChn, VENC_CHN_STAT_S *pstStat); 42 | 43 | HI_S32 HI_MPI_VENC_SetChnAttr( VENC_CHN VeChn, const VENC_CHN_ATTR_S *pstAttr); 44 | HI_S32 HI_MPI_VENC_GetChnAttr( VENC_CHN VeChn, VENC_CHN_ATTR_S *pstAttr); 45 | 46 | HI_S32 HI_MPI_VENC_GetStream(VENC_CHN VeChn, VENC_STREAM_S *pstStream, HI_BOOL bBlockFlag); 47 | HI_S32 HI_MPI_VENC_ReleaseStream(VENC_CHN VeChn, VENC_STREAM_S *pstStream); 48 | 49 | HI_S32 HI_MPI_VENC_InsertUserData(VENC_CHN VeChn, HI_U8 *pu8Data, HI_U32 u32Len); 50 | 51 | HI_S32 HI_MPI_VENC_SendFrame(VENC_GRP VeGroup, VIDEO_FRAME_INFO_S *pstFrame); 52 | 53 | HI_S32 HI_MPI_VENC_SetMaxStreamCnt(VENC_CHN VeChn, HI_U32 u32MaxStrmCnt); 54 | HI_S32 HI_MPI_VENC_GetMaxStreamCnt(VENC_CHN VeChn, HI_U32 *pu32MaxStrmCnt); 55 | 56 | HI_S32 HI_MPI_VENC_RequestIDR(VENC_CHN VeChn); 57 | 58 | HI_S32 HI_MPI_VENC_GetFd(VENC_CHN VeChn); 59 | 60 | HI_S32 HI_MPI_VENC_SetRoiCfg(VENC_CHN VeChn, VENC_ROI_CFG_S *pstVencRoiCfg); 61 | HI_S32 HI_MPI_VENC_GetRoiCfg(VENC_CHN VeChn, HI_U32 u32Index, VENC_ROI_CFG_S *pstVencRoiCfg); 62 | 63 | HI_S32 HI_MPI_VENC_SetH264SliceSplit(VENC_CHN VeChn, const VENC_PARAM_H264_SLICE_SPLIT_S *pstSliceSplit); 64 | HI_S32 HI_MPI_VENC_GetH264SliceSplit(VENC_CHN VeChn, VENC_PARAM_H264_SLICE_SPLIT_S *pstSliceSplit); 65 | 66 | HI_S32 HI_MPI_VENC_SetH264InterPred(VENC_CHN VeChn, const VENC_PARAM_H264_INTER_PRED_S *pstH264InterPred); 67 | HI_S32 HI_MPI_VENC_GetH264InterPred(VENC_CHN VeChn, VENC_PARAM_H264_INTER_PRED_S *pstH264InterPred); 68 | 69 | HI_S32 HI_MPI_VENC_SetH264IntraPred(VENC_CHN VeChn, const VENC_PARAM_H264_INTRA_PRED_S *pstH264InterPred); 70 | HI_S32 HI_MPI_VENC_GetH264IntraPred(VENC_CHN VeChn, VENC_PARAM_H264_INTRA_PRED_S *pstH264InterPred); 71 | 72 | HI_S32 HI_MPI_VENC_SetH264Trans(VENC_CHN VeChn, const VENC_PARAM_H264_TRANS_S *pstH264Trans); 73 | HI_S32 HI_MPI_VENC_GetH264Trans(VENC_CHN VeChn, VENC_PARAM_H264_TRANS_S *pstH264Trans); 74 | 75 | HI_S32 HI_MPI_VENC_SetH264Entropy(VENC_CHN VeChn, const VENC_PARAM_H264_ENTROPY_S *pstH264EntropyEnc); 76 | HI_S32 HI_MPI_VENC_GetH264Entropy(VENC_CHN VeChn, VENC_PARAM_H264_ENTROPY_S *pstH264EntropyEnc); 77 | 78 | HI_S32 HI_MPI_VENC_SetH264Poc(VENC_CHN VeChn, const VENC_PARAM_H264_POC_S *pstH264Poc); 79 | HI_S32 HI_MPI_VENC_GetH264Poc(VENC_CHN VeChn, VENC_PARAM_H264_POC_S *pstH264Poc); 80 | 81 | HI_S32 HI_MPI_VENC_SetH264Dblk(VENC_CHN VeChn, const VENC_PARAM_H264_DBLK_S *pstH264Dblk); 82 | HI_S32 HI_MPI_VENC_GetH264Dblk(VENC_CHN VeChn, VENC_PARAM_H264_DBLK_S *pstH264Dblk); 83 | 84 | HI_S32 HI_MPI_VENC_SetH264Vui(VENC_CHN VeChn, const VENC_PARAM_H264_VUI_S *pstH264Vui); 85 | HI_S32 HI_MPI_VENC_GetH264Vui(VENC_CHN VeChn, VENC_PARAM_H264_VUI_S *pstH264Vui); 86 | 87 | HI_S32 HI_MPI_VENC_SetJpegParam(VENC_CHN VeChn, const VENC_PARAM_JPEG_S *pstJpegParam); 88 | HI_S32 HI_MPI_VENC_GetJpegParam(VENC_CHN VeChn, VENC_PARAM_JPEG_S *pstJpegParam); 89 | 90 | HI_S32 HI_MPI_VENC_SetMpeg4Param(VENC_CHN VeChn, const VENC_PARAM_MPEG4_S *pstMpeg4Param); 91 | HI_S32 HI_MPI_VENC_GetMpeg4Param(VENC_CHN VeChn, VENC_PARAM_MPEG4_S *pstMpeg4Param); 92 | 93 | HI_S32 HI_MPI_VENC_SetMjpegParam(VENC_CHN VeChn, const VENC_PARAM_MJPEG_S *pstMjpegParam); 94 | HI_S32 HI_MPI_VENC_GetMjpegParam(VENC_CHN VeChn, VENC_PARAM_MJPEG_S *pstMjpegParam); 95 | 96 | HI_S32 HI_MPI_VENC_SetGrpFrmRate(VENC_GRP VeGroup, const GROUP_FRAME_RATE_S *pstGrpFrmRate); 97 | HI_S32 HI_MPI_VENC_GetGrpFrmRate(VENC_GRP VeGroup, GROUP_FRAME_RATE_S *pstGrpFrmRate); 98 | 99 | HI_S32 HI_MPI_VENC_GetRcPara(VENC_CHN VeChn, VENC_RC_PARAM_S *pstRcPara); 100 | HI_S32 HI_MPI_VENC_SetRcPara(VENC_CHN VeChn, VENC_RC_PARAM_S *pstRcPara); 101 | 102 | HI_S32 HI_MPI_VENC_SetH264eRefMode(VENC_CHN VeChn, VENC_ATTR_H264_REF_MODE_E enRefMode); 103 | HI_S32 HI_MPI_VENC_GetH264eRefMode(VENC_CHN VeChn, VENC_ATTR_H264_REF_MODE_E *penRefMode); 104 | 105 | HI_S32 HI_MPI_VENC_SetH264eRefParam( VENC_CHN VeChn, VENC_ATTR_H264_REF_PARAM_S* pstRefParam ); 106 | HI_S32 HI_MPI_VENC_GetH264eRefParam( VENC_CHN VeChn, VENC_ATTR_H264_REF_PARAM_S* pstRefParam ); 107 | 108 | HI_S32 HI_MPI_VENC_EnableIDR( VENC_CHN VeChn, HI_BOOL bEnableIDR ); 109 | 110 | HI_S32 HI_MPI_VENC_SetGrpColor2Grey(VENC_GRP VeGroup, const GROUP_COLOR2GREY_S *pstGrpColor2Grey); 111 | HI_S32 HI_MPI_VENC_GetGrpColor2Grey(VENC_GRP VeGroup, GROUP_COLOR2GREY_S *pstGrpColor2Grey); 112 | 113 | HI_S32 HI_MPI_VENC_SetColor2GreyConf(const GROUP_COLOR2GREY_CONF_S *pstGrpColor2GreyConf); 114 | HI_S32 HI_MPI_VENC_GetColor2GreyConf(GROUP_COLOR2GREY_CONF_S *pstGrpColor2GreyConf); 115 | 116 | HI_S32 HI_MPI_VENC_SetGrpCrop(VENC_GRP VeGroup, const GROUP_CROP_CFG_S *pstGrpCropCfg); 117 | HI_S32 HI_MPI_VENC_GetGrpCrop(VENC_GRP VeGroup, GROUP_CROP_CFG_S *pstGrpCropCfg); 118 | 119 | HI_S32 HI_MPI_VENC_SetJpegSnapMode(VENC_CHN VeChn, VENC_JPEG_SNAP_MODE_E enJpegSnapMode); 120 | HI_S32 HI_MPI_VENC_GetJpegSnapMode(VENC_CHN VeChn, VENC_JPEG_SNAP_MODE_E *penJpegSnapMode); 121 | 122 | #ifdef __cplusplus 123 | #if __cplusplus 124 | } 125 | #endif 126 | #endif /* __cplusplus */ 127 | 128 | #endif /* __MPI_VENC_H__ */ -------------------------------------------------------------------------------- /pjlib/include/hi_inc/mpi_vi.h: -------------------------------------------------------------------------------- 1 | #ifndef __MPI_VI_H__ 2 | #define __MPI_VI_H__ 3 | 4 | 5 | #ifdef __cplusplus 6 | #if __cplusplus 7 | extern "C" 8 | { 9 | #endif 10 | #endif /* __cplusplus */ 11 | 12 | #include "hi_comm_vi.h" 13 | 14 | HI_S32 HI_MPI_VI_SetDevAttr(VI_DEV ViDev, const VI_DEV_ATTR_S *pstDevAttr); 15 | HI_S32 HI_MPI_VI_GetDevAttr(VI_DEV ViDev, VI_DEV_ATTR_S *pstDevAttr); 16 | 17 | HI_S32 HI_MPI_VI_EnableDev(VI_DEV ViDev); 18 | HI_S32 HI_MPI_VI_DisableDev(VI_DEV ViDev); 19 | 20 | HI_S32 HI_MPI_VI_SetChnAttr(VI_CHN ViChn, const VI_CHN_ATTR_S *pstAttr); 21 | HI_S32 HI_MPI_VI_GetChnAttr(VI_CHN ViChn, VI_CHN_ATTR_S *pstAttr); 22 | 23 | /* The following 3 functions are only for vichn minor attributes */ 24 | HI_S32 HI_MPI_VI_SetChnMinorAttr(VI_CHN ViChn,const VI_CHN_ATTR_S *pstAttr); 25 | HI_S32 HI_MPI_VI_GetChnMinorAttr(VI_CHN ViChn,VI_CHN_ATTR_S *pstAttr); 26 | HI_S32 HI_MPI_VI_ClearChnMinorAttr(VI_CHN ViChn); 27 | 28 | HI_S32 HI_MPI_VI_EnableChn(VI_CHN ViChn); 29 | HI_S32 HI_MPI_VI_DisableChn(VI_CHN ViChn); 30 | 31 | HI_S32 HI_MPI_VI_GetFrame(VI_CHN ViChn, VIDEO_FRAME_INFO_S *pstFrameInfo); 32 | HI_S32 HI_MPI_VI_GetFrameTimeOut(VI_CHN ViChn, VIDEO_FRAME_INFO_S *pstFrameInfo, HI_U32 u32MilliSec); 33 | HI_S32 HI_MPI_VI_ReleaseFrame(VI_CHN ViChn, VIDEO_FRAME_INFO_S *pstFrameInfo); 34 | HI_S32 HI_MPI_VI_SetFrameDepth(VI_CHN ViChn, HI_U32 u32Depth); 35 | HI_S32 HI_MPI_VI_GetFrameDepth(VI_CHN ViChn, HI_U32 *pu32Depth); 36 | 37 | HI_S32 HI_MPI_VI_SetUserPic(VI_CHN ViChn, VI_USERPIC_ATTR_S *pstUsrPic); 38 | HI_S32 HI_MPI_VI_EnableUserPic(VI_CHN ViChn); 39 | HI_S32 HI_MPI_VI_DisableUserPic(VI_CHN ViChn); 40 | 41 | /* These functions are used to start the cascade mode. VI cascade mode can work normally Only when they have been called */ 42 | HI_S32 HI_MPI_VI_EnableCascade(VI_DEV ViDev); 43 | HI_S32 HI_MPI_VI_DisableCascade(VI_DEV ViDev); 44 | HI_S32 HI_MPI_VI_EnableCascadeChn(VI_CHN ViChn); 45 | HI_S32 HI_MPI_VI_DisableCascadeChn(VI_CHN ViChn); 46 | 47 | /* Normally, these functions are not necessary in typical business */ 48 | HI_S32 HI_MPI_VI_ChnBind(VI_CHN ViChn, const VI_CHN_BIND_ATTR_S *pstChnBindAttr); 49 | HI_S32 HI_MPI_VI_ChnUnBind(VI_CHN ViChn); 50 | HI_S32 HI_MPI_VI_GetChnBind(VI_CHN ViChn, VI_CHN_BIND_ATTR_S *pstChnBindAttr); 51 | 52 | HI_S32 HI_MPI_VI_SetDevAttrEx(VI_DEV ViDev, const VI_DEV_ATTR_EX_S *pstDevAttrEx); 53 | HI_S32 HI_MPI_VI_GetDevAttrEx(VI_DEV ViDev, VI_DEV_ATTR_EX_S *pstDevAttrEx); 54 | 55 | HI_S32 HI_MPI_VI_GetFd(VI_CHN ViChn); 56 | 57 | HI_S32 HI_MPI_VI_Query(VI_CHN ViChn, VI_CHN_STAT_S *pstStat); 58 | 59 | HI_S32 HI_MPI_VI_EnableChnInterrupt(VI_CHN ViChn); 60 | HI_S32 HI_MPI_VI_DisableChnInterrupt(VI_CHN ViChn); 61 | 62 | HI_S32 HI_MPI_VI_SetFlashConfig(VI_DEV ViDev, const VI_FLASH_CONFIG_S *pstFlashConfig); 63 | HI_S32 HI_MPI_VI_GetFlashConfig(VI_DEV ViDev, VI_FLASH_CONFIG_S *pstFlashConfig); 64 | HI_S32 HI_MPI_VI_FlashTrigger(VI_DEV ViDev, HI_BOOL bEnable); 65 | 66 | HI_S32 HI_MPI_VI_SetExtChnAttr(VI_CHN ViChn, const VI_EXT_CHN_ATTR_S *pstExtChnAttr); 67 | HI_S32 HI_MPI_VI_GetExtChnAttr(VI_CHN ViChn, VI_EXT_CHN_ATTR_S *pstExtChnAttr); 68 | 69 | HI_S32 HI_MPI_VI_SetLDCAttr(VI_CHN ViChn, const VI_LDC_ATTR_S *pstLDCAttr); 70 | HI_S32 HI_MPI_VI_GetLDCAttr(VI_CHN ViChn, VI_LDC_ATTR_S *pstLDCAttr); 71 | 72 | HI_S32 HI_MPI_VI_SetCSCAttr(VI_DEV ViDev, const VI_CSC_ATTR_S *pstCSCAttr); 73 | HI_S32 HI_MPI_VI_GetCSCAttr(VI_DEV ViDev, VI_CSC_ATTR_S *pstCSCAttr); 74 | 75 | HI_S32 HI_MPI_VI_SetRotate(VI_CHN ViChn, const ROTATE_E enRotate); 76 | HI_S32 HI_MPI_VI_GetRotate(VI_CHN ViChn, ROTATE_E *penRotate); 77 | 78 | HI_S32 HI_MPI_VI_GetChnLuma(VI_CHN ViChn, VI_CHN_LUM_S *pstLuma); 79 | 80 | #ifdef __cplusplus 81 | #if __cplusplus 82 | } 83 | #endif 84 | #endif /* __cplusplus */ 85 | 86 | #endif /*__MPI_VI_H__ */ 87 | 88 | 89 | 90 | -------------------------------------------------------------------------------- /pjlib/include/hi_inc/mpi_vo.h: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | 3 | Copyright (C), 2001-2011, Hisilicon Tech. Co., Ltd. 4 | 5 | ****************************************************************************** 6 | File Name : mpi_vo.h 7 | Version : Initial Draft 8 | Author : Hisilicon multimedia software group 9 | Created : 2011/06/28 10 | Description : Vou API 11 | History : 12 | 1.Date : 2011/06/28 13 | Author : z00185248 14 | Modification: Created file 15 | 16 | ******************************************************************************/ 17 | 18 | #ifndef __MPI_VO_H__ 19 | #define __MPI_VO_H__ 20 | 21 | #include "hi_comm_vo.h" 22 | 23 | #ifdef __cplusplus 24 | #if __cplusplus 25 | extern "C" 26 | { 27 | #endif 28 | #endif /* __cplusplus */ 29 | 30 | 31 | /* Device Settings */ 32 | 33 | HI_S32 HI_MPI_VO_Enable (VO_DEV VoDev); 34 | HI_S32 HI_MPI_VO_Disable(VO_DEV VoDev); 35 | 36 | HI_S32 HI_MPI_VO_SetPubAttr(VO_DEV VoDev, const VO_PUB_ATTR_S *pstPubAttr); 37 | HI_S32 HI_MPI_VO_GetPubAttr(VO_DEV VoDev, VO_PUB_ATTR_S *pstPubAttr); 38 | 39 | HI_S32 HI_MPI_VO_CloseFd(HI_VOID); 40 | 41 | 42 | /* Video Settings */ 43 | HI_S32 HI_MPI_VO_EnableVideoLayer (VO_DEV VoDev); 44 | HI_S32 HI_MPI_VO_DisableVideoLayer(VO_DEV VoDev); 45 | 46 | HI_S32 HI_MPI_VO_SetVideoLayerAttr(VO_DEV VoDev, const VO_VIDEO_LAYER_ATTR_S *pstLayerAttr); 47 | HI_S32 HI_MPI_VO_GetVideoLayerAttr(VO_DEV VoDev, VO_VIDEO_LAYER_ATTR_S *pstLayerAttr); 48 | 49 | /* PIP LAYER Setting */ 50 | 51 | HI_S32 HI_MPI_VO_PipLayerBindDev(VO_DEV VoTargetDev); 52 | HI_S32 HI_MPI_VO_PipLayerUnBindDev(VO_DEV VoTargetDev); 53 | 54 | HI_S32 HI_MPI_VO_SetPipLayerAttr(const VO_VIDEO_LAYER_ATTR_S *pstLayerAttr); 55 | HI_S32 HI_MPI_VO_GetPipLayerAttr(VO_VIDEO_LAYER_ATTR_S *pstLayerAttr); 56 | 57 | HI_S32 HI_MPI_VO_EnablePipLayer (HI_VOID); 58 | HI_S32 HI_MPI_VO_DisablePipLayer(HI_VOID); 59 | 60 | /* General Operation of Channel */ 61 | 62 | HI_S32 HI_MPI_VO_EnableChn (VO_DEV VoDev, VO_CHN VoChn); 63 | HI_S32 HI_MPI_VO_DisableChn(VO_DEV VoDev, VO_CHN VoChn); 64 | 65 | HI_S32 HI_MPI_VO_SetChnAttr(VO_DEV VoDev, VO_CHN VoChn, const VO_CHN_ATTR_S *pstChnAttr); 66 | HI_S32 HI_MPI_VO_GetChnAttr(VO_DEV VoDev, VO_CHN VoChn, VO_CHN_ATTR_S *pstChnAttr); 67 | 68 | HI_S32 HI_MPI_VO_SetChnDispPos(VO_DEV VoDev, VO_CHN VoChn, const POINT_S *pstDispPos); 69 | HI_S32 HI_MPI_VO_GetChnDispPos(VO_DEV VoDev, VO_CHN VoChn, POINT_S *pstDispPos); 70 | 71 | HI_S32 HI_MPI_VO_SetChnField(VO_DEV VoDev, VO_CHN VoChn, const VO_DISPLAY_FIELD_E enField); 72 | HI_S32 HI_MPI_VO_GetChnField(VO_DEV VoDev, VO_CHN VoChn, VO_DISPLAY_FIELD_E *pField); 73 | 74 | HI_S32 HI_MPI_VO_SetChnFrameRate(VO_DEV VoDev, VO_CHN VoChn, HI_S32 s32ChnFrmRate); 75 | HI_S32 HI_MPI_VO_GetChnFrameRate(VO_DEV VoDev, VO_CHN VoChn, HI_S32 *ps32ChnFrmRate); 76 | 77 | HI_S32 HI_MPI_VO_GetChnFrame (VO_DEV VoDev, VO_CHN VoChn, VIDEO_FRAME_INFO_S *pstFrame); 78 | HI_S32 HI_MPI_VO_ReleaseChnFrame(VO_DEV VoDev, VO_CHN VoChn, VIDEO_FRAME_INFO_S *pstFrame); 79 | 80 | HI_S32 HI_MPI_VO_ChnPause (VO_DEV VoDev, VO_CHN VoChn); 81 | HI_S32 HI_MPI_VO_ChnResume(VO_DEV VoDev, VO_CHN VoChn); 82 | HI_S32 HI_MPI_VO_ChnStep (VO_DEV VoDev, VO_CHN VoChn); 83 | HI_S32 HI_MPI_VO_ChnRefresh(VO_DEV VoDev, VO_CHN VoChn); 84 | 85 | HI_S32 HI_MPI_VO_ChnShow(VO_DEV VoDev, VO_CHN VoChn); 86 | HI_S32 HI_MPI_VO_ChnHide(VO_DEV VoDev, VO_CHN VoChn); 87 | 88 | HI_S32 HI_MPI_VO_SetZoomInWindow(VO_DEV VoDev, VO_CHN VoChn, const VO_ZOOM_ATTR_S *pstZoomAttr); 89 | HI_S32 HI_MPI_VO_GetZoomInWindow(VO_DEV VoDev, VO_CHN VoChn, VO_ZOOM_ATTR_S *pstZoomAttr); 90 | 91 | HI_S32 HI_MPI_VO_GetChnPts (VO_DEV VoDev, VO_CHN VoChn, HI_U64 *pu64ChnPts); 92 | HI_S32 HI_MPI_VO_QueryChnStat(VO_DEV VoDev, VO_CHN VoChn, VO_QUERY_STATUS_S *pstStatus); 93 | 94 | HI_S32 HI_MPI_VO_SendFrame(VO_DEV VoDev, VO_CHN VoChn, VIDEO_FRAME_INFO_S *pstVFrame); 95 | HI_S32 HI_MPI_VO_SendFrameTimeOut(VO_DEV VoDev, VO_CHN VoChn, VIDEO_FRAME_INFO_S *pstVFrame, HI_U32 u32MilliSec); 96 | 97 | HI_S32 HI_MPI_VO_ClearChnBuffer(VO_DEV VoDev, VO_CHN VoChn, HI_BOOL bClrAll); 98 | 99 | HI_S32 HI_MPI_VO_SetChnDispThreshold(VO_DEV VoDev, VO_CHN VoChn, HI_U32 u32Threshold); 100 | HI_S32 HI_MPI_VO_GetChnDispThreshold(VO_DEV VoDev, VO_CHN VoChn, HI_U32 *pu32Threshold); 101 | 102 | HI_S32 HI_MPI_VO_SetAttrBegin(VO_DEV VoDev); 103 | HI_S32 HI_MPI_VO_SetAttrEnd (VO_DEV VoDev); 104 | 105 | HI_S32 HI_MPI_VO_SetPlayToleration(VO_DEV VoDev, HI_U32 u32Toleration); 106 | HI_S32 HI_MPI_VO_GetPlayToleration(VO_DEV VoDev, HI_U32 *pu32Toleration); 107 | 108 | HI_S32 HI_MPI_VO_GetScreenFrame (VO_DEV VoDev, VIDEO_FRAME_INFO_S *pstVFrame); 109 | HI_S32 HI_MPI_VO_ReleaseScreenFrame(VO_DEV VoDev, VIDEO_FRAME_INFO_S *pstVFrame); 110 | 111 | HI_S32 HI_MPI_VO_SetDispBufLen(VO_DEV VoDev, HI_U32 u32BufLen); 112 | HI_S32 HI_MPI_VO_GetDispBufLen(VO_DEV VoDev, HI_U32 *pu32BufLen); 113 | 114 | HI_S32 HI_MPI_VO_EnableWbc(VO_DEV VoDev); 115 | HI_S32 HI_MPI_VO_DisableWbc(VO_DEV VoDev); 116 | 117 | HI_S32 HI_MPI_VO_SetWbcAttr(VO_DEV VoDev, const VO_WBC_ATTR_S *pstWbcAttr); 118 | HI_S32 HI_MPI_VO_GetWbcAttr(VO_DEV VoDev, VO_WBC_ATTR_S *pstWbcAttr); 119 | 120 | HI_S32 HI_MPI_VO_SetWbcMode(VO_DEV VoDev, VO_WBC_MODE_E enWbcMode); 121 | HI_S32 HI_MPI_VO_GetWbcMode(VO_DEV VoDev, VO_WBC_MODE_E *penWbcMode); 122 | 123 | HI_S32 HI_MPI_VO_SetWbcDepth(VO_DEV VoDev, HI_U32 u32Depth); 124 | HI_S32 HI_MPI_VO_GetWbcDepth(VO_DEV VoDev, HI_U32 *pu32Depth); 125 | HI_S32 HI_MPI_VO_WbcGetScreenFrame(VO_DEV VoDev, VIDEO_FRAME_INFO_S *pstVFrame); 126 | HI_S32 HI_MPI_VO_WbcReleaseScreenFrame(VO_DEV VoDev, VIDEO_FRAME_INFO_S *pstVFrame); 127 | 128 | HI_S32 HI_MPI_VO_GfxLayerBindDev(VOU_GFX_BIND_LAYER_E enGfxLayer, VO_DEV VoTargetDev); 129 | HI_S32 HI_MPI_VO_GfxLayerUnBindDev(VOU_GFX_BIND_LAYER_E enGfxLayer, VO_DEV VoTargetDev); 130 | 131 | HI_S32 HI_MPI_VO_SetGfxLayerCSC(HI_U32 u32Layer, const VO_CSC_S *pstCSC); 132 | HI_S32 HI_MPI_VO_GetGfxLayerCSC(HI_U32 u32Layer, VO_CSC_S *pstCSC); 133 | 134 | HI_S32 HI_MPI_VO_SetCascadeAttr(const VO_CAS_ATTR_S *pstCasAttr); 135 | HI_S32 HI_MPI_VO_GetCascadeAttr(VO_CAS_ATTR_S *pstCasAttr); 136 | 137 | HI_S32 HI_MPI_VO_EnableCascadeDev (VO_DEV VoCasDev); 138 | HI_S32 HI_MPI_VO_DisableCascadeDev(VO_DEV VoCasDev); 139 | 140 | HI_S32 HI_MPI_VO_SetCascadePattern(VO_DEV VoCasDev, HI_U32 u32Pattern); 141 | HI_S32 HI_MPI_VO_GetCascadePattern(VO_DEV VoCasDev, HI_U32 *pu32Pattern); 142 | 143 | HI_S32 HI_MPI_VO_CascadePosBindChn (HI_U32 u32Pos, VO_DEV VoCasDev, VO_CHN VoChn); 144 | HI_S32 HI_MPI_VO_CascadePosUnBindChn(HI_U32 u32Pos, VO_DEV VoCasDev, VO_CHN VoChn); 145 | 146 | HI_S32 HI_MPI_VO_EnableCascade (HI_VOID); 147 | HI_S32 HI_MPI_VO_DisableCascade(HI_VOID); 148 | 149 | HI_S32 HI_MPI_VO_GetDevCSC(VO_DEV VoDev, VO_CSC_S *pstDevCSC); 150 | HI_S32 HI_MPI_VO_SetDevCSC(VO_DEV VoDev, VO_CSC_S *pstDevCSC); 151 | 152 | HI_S32 HI_MPI_VO_GetVgaParam(VO_DEV VoDev, VO_VGA_PARAM_S *pstVgaParam); 153 | HI_S32 HI_MPI_VO_SetVgaParam(VO_DEV VoDev, VO_VGA_PARAM_S *pstVgaParam); 154 | 155 | #ifdef __cplusplus 156 | #if __cplusplus 157 | } 158 | #endif 159 | #endif /* __cplusplus */ 160 | #endif /*__MPI_VO_H__ */ 161 | 162 | 163 | -------------------------------------------------------------------------------- /pjlib/include/hi_inc/mpi_vpss.h: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | 3 | Copyright (C), 2001-2011, Hisilicon Tech. Co., Ltd. 4 | 5 | ****************************************************************************** 6 | File Name : mpi_vpss.h 7 | Version : Initial Draft 8 | Author : 9 | Created : 10 | Last Modified : 11 | Description : mpi functions declaration 12 | Function List : 13 | History : 14 | 1.Date : 20110616 15 | Author : l00183122 16 | Modification: Create 17 | ******************************************************************************/ 18 | #ifndef __MPI_VPSS_H__ 19 | #define __MPI_VPSS_H__ 20 | 21 | #include "hi_common.h" 22 | #include "hi_comm_video.h" 23 | #include "hi_comm_vpss.h" 24 | 25 | #ifdef __cplusplus 26 | #if __cplusplus 27 | extern "C"{ 28 | #endif 29 | #endif /* __cplusplus */ 30 | 31 | 32 | HI_S32 HI_MPI_VPSS_CreateGrp(VPSS_GRP VpssGrp, VPSS_GRP_ATTR_S *pstGrpAttr); 33 | HI_S32 HI_MPI_VPSS_DestroyGrp(VPSS_GRP VpssGrp); 34 | 35 | HI_S32 HI_MPI_VPSS_StartGrp(VPSS_GRP VpssGrp); 36 | HI_S32 HI_MPI_VPSS_StopGrp(VPSS_GRP VpssGrp); 37 | 38 | HI_S32 HI_MPI_VPSS_ResetGrp(VPSS_GRP VpssGrp); 39 | 40 | HI_S32 HI_MPI_VPSS_EnableChn(VPSS_GRP VpssGrp, VPSS_CHN s32VpssChnl); 41 | HI_S32 HI_MPI_VPSS_DisableChn(VPSS_GRP VpssGrp, VPSS_CHN s32VpssChnl); 42 | 43 | HI_S32 HI_MPI_VPSS_GetGrpAttr(VPSS_GRP VpssGrp, VPSS_GRP_ATTR_S *pstGrpAttr); 44 | HI_S32 HI_MPI_VPSS_SetGrpAttr(VPSS_GRP VpssGrp, VPSS_GRP_ATTR_S *pstGrpAttr); 45 | 46 | HI_S32 HI_MPI_VPSS_GetChnAttr(VPSS_GRP VpssGrp, VPSS_CHN VpssChn, VPSS_CHN_ATTR_S *pstChnAttr); 47 | HI_S32 HI_MPI_VPSS_SetChnAttr(VPSS_GRP VpssGrp, VPSS_CHN VpssChn, VPSS_CHN_ATTR_S *pstChnAttr); 48 | 49 | HI_S32 HI_MPI_VPSS_SetGrpParam(VPSS_GRP VpssGrp, VPSS_GRP_PARAM_S *pstVpssParam); 50 | HI_S32 HI_MPI_VPSS_GetGrpParam(VPSS_GRP VpssGrp, VPSS_GRP_PARAM_S *pstVpssParam); 51 | 52 | HI_S32 HI_MPI_VPSS_SetCropCfg(VPSS_GRP VpssGrp, VPSS_CROP_INFO_S *pstCropInfo); 53 | HI_S32 HI_MPI_VPSS_GetCropCfg(VPSS_GRP VpssGrp, VPSS_CROP_INFO_S *pstCropInfo); 54 | 55 | HI_S32 HI_MPI_VPSS_SetChnMode(VPSS_GRP VpssGrp, VPSS_CHN VpssChn, VPSS_CHN_MODE_S *pstVpssMode); 56 | HI_S32 HI_MPI_VPSS_GetChnMode(VPSS_GRP VpssGrp, VPSS_CHN VpssChn, VPSS_CHN_MODE_S *pstVpssMode); 57 | 58 | HI_S32 HI_MPI_VPSS_SetDepth(VPSS_GRP VpssGrp, VPSS_CHN VpssChn, HI_U32 u32Depth); 59 | HI_S32 HI_MPI_VPSS_GetDepth(VPSS_GRP VpssGrp, VPSS_CHN VpssChn, HI_U32 *pu32Depth); 60 | 61 | HI_S32 HI_MPI_VPSS_UserSendFrame(VPSS_GRP VpssGrp, VIDEO_FRAME_INFO_S *pstVideoFrame); 62 | HI_S32 HI_MPI_VPSS_UserSendFrameTimeout(VPSS_GRP VpssGrp, VIDEO_FRAME_INFO_S *pstVideoFrame, HI_U32 u32MilliSec); 63 | 64 | HI_S32 HI_MPI_VPSS_UserGetFrame(VPSS_GRP VpssGrp, VPSS_CHN VpssChn, VIDEO_FRAME_INFO_S *pstVideoFrame); 65 | HI_S32 HI_MPI_VPSS_UserReleaseFrame(VPSS_GRP VpssGrp, VPSS_CHN VpssChn, VIDEO_FRAME_INFO_S *pstVideoFrame); 66 | 67 | HI_S32 HI_MPI_VPSS_UserGetGrpFrame(VPSS_GRP VpssGrp, VIDEO_FRAME_INFO_S *pstVideoFrame, HI_U32 u32FrameIndex); 68 | HI_S32 HI_MPI_VPSS_UserReleaseGrpFrame(VPSS_GRP VpssGrp, VIDEO_FRAME_INFO_S *pstVideoFrame); 69 | /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// 70 | /*set&get vpss group prescale information.*/ 71 | HI_S32 HI_MPI_VPSS_SetPreScale(VPSS_GRP VpssGrp,VPSS_PRESCALE_INFO_S *pstPreScaleInfo); 72 | HI_S32 HI_MPI_VPSS_GetPreScale(VPSS_GRP VpssGrp,VPSS_PRESCALE_INFO_S *pstPreScaleInfo); 73 | 74 | /*set&get vpss group picture size filter information*/ 75 | HI_S32 HI_MPI_VPSS_SetGrpSizer(VPSS_GRP VpssGrp, VPSS_SIZER_INFO_S *pstVpssSizerInfo); 76 | HI_S32 HI_MPI_VPSS_GetGrpSizer(VPSS_GRP VpssGrp, VPSS_SIZER_INFO_S *pstVpssSizerInfo); 77 | 78 | HI_S32 HI_MPI_VPSS_SetDelay(VPSS_GRP VpssGrp, HI_U32 u32Delay); 79 | HI_S32 HI_MPI_VPSS_GetDelay(VPSS_GRP VpssGrp, HI_U32 *pu32Delay); 80 | 81 | /*set&get vpss group source picture framerate ctrl information*/ 82 | HI_S32 HI_MPI_VPSS_SetGrpFrameRate(VPSS_GRP VpssGrp, VPSS_FRAME_RATE_S *pstVpssFrameRate); 83 | HI_S32 HI_MPI_VPSS_GetGrpFrameRate(VPSS_GRP VpssGrp, VPSS_FRAME_RATE_S *pstVpssFrameRate); 84 | 85 | /*set&get vpss channel Nr(Noise Reduction) parameters.*/ 86 | HI_S32 HI_MPI_VPSS_SetChnNrParam(VPSS_GRP VpssGrp, VPSS_CHN VpssChn, VPSS_CHN_NR_PARAM_S *pstChnNrParam); 87 | HI_S32 HI_MPI_VPSS_GetChnNrParam(VPSS_GRP VpssGrp, VPSS_CHN VpssChn, VPSS_CHN_NR_PARAM_S *pstChnNrParam); 88 | 89 | /*set&get vpss channel sharpen parameters.*/ 90 | HI_S32 HI_MPI_VPSS_SetChnSpParam(VPSS_GRP VpssGrp, VPSS_CHN VpssChn, VPSS_CHN_SP_PARAM_S *pstChnSpParam); 91 | HI_S32 HI_MPI_VPSS_GetChnSpParam(VPSS_GRP VpssGrp, VPSS_CHN VpssChn, VPSS_CHN_SP_PARAM_S *pstChnSpParam); 92 | 93 | /*set&get vpss channel field information.*/ 94 | HI_S32 HI_MPI_VPSS_SetChnField(VPSS_GRP VpssGrp, VPSS_CHN VpssChn, VPSS_CAPSEL_E enCapSel); 95 | HI_S32 HI_MPI_VPSS_GetChnField(VPSS_GRP VpssGrp, VPSS_CHN VpssChn, VPSS_CAPSEL_E *enCapSel); 96 | 97 | ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// 98 | /*set&get vpss extend channel attributes*/ 99 | HI_S32 HI_MPI_VPSS_SetExtChnAttr(VPSS_GRP VpssGrp, VPSS_CHN VpssChn, VPSS_EXT_CHN_ATTR_S *pstExtChnAttr); 100 | HI_S32 HI_MPI_VPSS_GetExtChnAttr(VPSS_GRP VpssGrp, VPSS_CHN VpssChn, VPSS_EXT_CHN_ATTR_S *pstExtChnAttr); 101 | 102 | /*set&get vpss group picture rotate information*/ 103 | //HI_S32 HI_MPI_VPSS_SetRotate(VPSS_GRP VpssGrp, ROTATE_E enRotate); 104 | //HI_S32 HI_MPI_VPSS_GetRotate(VPSS_GRP VpssGrp, ROTATE_E *penRotate); 105 | 106 | #ifdef __cplusplus 107 | #if __cplusplus 108 | } 109 | #endif 110 | #endif /* __cplusplus */ 111 | 112 | #endif /* __MPI_VPSS_H__ */ 113 | 114 | -------------------------------------------------------------------------------- /pjlib/include/hi_inc/sample_comm.h: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | Hisilicon HI3531 sample programs head file. 3 | 4 | Copyright (C), 2010-2011, Hisilicon Tech. Co., Ltd. 5 | ****************************************************************************** 6 | Modification: 2011-2 Created 7 | ******************************************************************************/ 8 | 9 | #ifndef __SAMPLE_COMM_H__ 10 | #define __SAMPLE_COMM_H__ 11 | 12 | //#include "tw2865.h" 13 | //#include "tw2960.h" 14 | 15 | #include "hi_type.h" 16 | #include "hi_common.h" 17 | #include "hi_comm_sys.h" 18 | #include "hi_comm_region.h" 19 | #include "hi_comm_adec.h" 20 | #include "hi_comm_aenc.h" 21 | #include "hi_comm_ai.h" 22 | #include "hi_comm_ao.h" 23 | #include "hi_comm_aio.h" 24 | #include "hi_defines.h" 25 | 26 | #include "mpi_sys.h" 27 | #include "mpi_region.h" 28 | #include "mpi_adec.h" 29 | #include "mpi_aenc.h" 30 | #include "mpi_ai.h" 31 | #include "mpi_ao.h" 32 | #include "mpi_vb.h" 33 | //#include "tlv320aic31.h" 34 | //#include "cx26828.h" 35 | 36 | #ifdef __cplusplus 37 | #if __cplusplus 38 | extern "C"{ 39 | #endif 40 | #endif /* End of #ifdef __cplusplus */ 41 | 42 | 43 | /******************************************************* 44 | macro define 45 | *******************************************************/ 46 | #define ALIGN_BACK(x, a) ((a) * (((x) / (a)))) 47 | //#define SAMPLE_GLOBAL_NORM VIDEO_ENCODING_MODE_PAL 48 | #define SAMPLE_SYS_ALIGN_WIDTH 64 49 | #define SAMPLE_PIXEL_FORMAT PIXEL_FORMAT_YUV_SEMIPLANAR_420 50 | #define SAMPLE_COMM_VI_GetSubChn(x) x+16 51 | #define NVP1918 52 | #define TW2865_FILE "/dev/tw2865dev" 53 | #define TW2960_FILE "/dev/tw2960dev" 54 | #define TLV320_FILE "/dev/tlv320aic31" 55 | #define CX26828_FILE "/dev/cx268xx" 56 | 57 | #define D1_WIDTH 704 58 | 59 | /*** define vi chn(2/6/10/14)'s sub_chn size */ 60 | /*** vi chn(0/4/8/12)'s sub_chn size define D1 in sample program */ 61 | #define SAMPLE_VI_SUBCHN_2_W 720 62 | #define SAMPLE_VI_SUBCHN_2_H 640 63 | 64 | #if HICHIP == HI3520D_V100 || HICHIP == HI3521_V100 || HICHIP == HI3520A_V100 65 | #define SAMPLE_VO_DEV_DHD0 0 66 | #define SAMPLE_VO_DEV_DSD0 1 67 | #define SAMPLE_VO_DEV_DSD1 2 68 | #elif HICHIP == HI3531_V100 || HICHIP == HI3532_V100 69 | #define SAMPLE_VO_DEV_DHD0 0 70 | #define SAMPLE_VO_DEV_DHD1 1 71 | #define SAMPLE_VO_DEV_DSD0 2 72 | #define SAMPLE_VO_DEV_DSD1 3 73 | #define SAMPLE_VO_DEV_DSD2 4 74 | #define SAMPLE_VO_DEV_DSD3 5 75 | #define SAMPLE_VO_DEV_DSD4 6 76 | #define SAMPLE_VO_DEV_DSD5 7 77 | #else 78 | /* 79 | #error HICHIP define may be error 80 | */ 81 | #endif 82 | 83 | /*** for init global parameter ***/ 84 | #define SAMPLE_ENABLE 1 85 | #define SAMPLE_DISABLE 0 86 | #define SAMPLE_NOUSE -1 87 | 88 | #if HICHIP == HI3531_V100 89 | #define SAMPLE_AUDIO_HDMI_AO_DEV 5 90 | #elif (HICHIP == HI3521_V100 || HICHIP == HI3520A_V100) 91 | #define SAMPLE_AUDIO_HDMI_AO_DEV 3 92 | #elif (HICHIP == HI3520D_V100) 93 | #define SAMPLE_AUDIO_HDMI_AO_DEV 1 94 | #endif 95 | 96 | 97 | 98 | 99 | #define SAMPLE_PRT(fmt...) \ 100 | do {\ 101 | printf("[%s]-%d: ", __FUNCTION__, __LINE__);\ 102 | printf(fmt);\ 103 | }while(0) 104 | 105 | 106 | 107 | typedef enum 108 | { 109 | VI_DEV_BT656_D1_1MUX = 0, 110 | VI_DEV_BT656_D1_4MUX, 111 | VI_DEV_BT656_960H_1MUX, 112 | VI_DEV_BT656_960H_4MUX, 113 | VI_DEV_720P_HD_1MUX, 114 | VI_DEV_1080P_HD_1MUX, 115 | VI_DEV_BUTT 116 | }SAMPLE_VI_DEV_TYPE_E; 117 | 118 | 119 | 120 | /* 121 | typedef struct hisample_MEMBUF_S 122 | { 123 | // VB_BLK hBlock; 124 | VB_POOL hPool; 125 | HI_U32 u32PoolId; 126 | 127 | HI_U32 u32PhyAddr; 128 | HI_U8 *pVirAddr; 129 | HI_S32 s32Mdev; 130 | } SAMPLE_MEMBUF_S; 131 | */ 132 | typedef enum sample_rc_e 133 | { 134 | SAMPLE_RC_CBR = 0, 135 | SAMPLE_RC_VBR, 136 | SAMPLE_RC_FIXQP 137 | }SAMPLE_RC_E; 138 | 139 | typedef enum sample_rgn_change_type_e 140 | { 141 | RGN_CHANGE_TYPE_FGALPHA = 0, 142 | RGN_CHANGE_TYPE_BGALPHA, 143 | RGN_CHANGE_TYPE_LAYER 144 | }SAMPLE_RGN_CHANGE_TYPE_EN; 145 | 146 | 147 | 148 | /******************************************************* 149 | function announce 150 | *******************************************************/ 151 | HI_S32 SAMPLE_COMM_SYS_GetPicSize(VIDEO_NORM_E enNorm, PIC_SIZE_E enPicSize, SIZE_S *pstSize); 152 | HI_U32 SAMPLE_COMM_SYS_CalcPicVbBlkSize(VIDEO_NORM_E enNorm, PIC_SIZE_E enPicSize, PIXEL_FORMAT_E enPixFmt, HI_U32 u32AlignWidth); 153 | HI_S32 SAMPLE_COMM_SYS_MemConfig(HI_VOID); 154 | HI_VOID SAMPLE_COMM_SYS_Exit(void); 155 | HI_S32 SAMPLE_COMM_SYS_Init(VB_CONF_S *pstVbConf); 156 | HI_S32 SAMPLE_COMM_SYS_Payload2FilePostfix(PAYLOAD_TYPE_E enPayload, HI_CHAR* szFilePostfix); 157 | 158 | //HI_S32 SAMPLE_COMM_VPSS_MemConfig(); 159 | //HI_S32 SAMPLE_COMM_VPSS_Start(HI_S32 s32GrpCnt, SIZE_S *pstSize, HI_S32 s32ChnCnt,VPSS_GRP_ATTR_S *pstVpssGrpAttr); 160 | HI_S32 SAMPLE_COMM_VPSS_Stop(HI_S32 s32GrpCnt, HI_S32 s32ChnCnt) ; 161 | //HI_S32 SAMPLE_COMM_DisableVpssPreScale(VPSS_GRP VpssGrp,SIZE_S stSize); 162 | //HI_S32 SAMPLE_COMM_EnableVpssPreScale(VPSS_GRP VpssGrp,SIZE_S stSize); 163 | 164 | 165 | 166 | //HI_S32 SAMPLE_COMM_AUDIO_CreatTrdAiAo(AUDIO_DEV AoDev,AO_CHN AoChn,pjmedia_frame *frame_out); 167 | HI_S32 SAMPLE_COMM_AUDIO_CreatTrdAiAenc(AUDIO_DEV AiDev, AI_CHN AiChn, AENC_CHN AeChn); 168 | HI_S32 SAMPLE_COMM_AUDIO_CreatTrdAencAdec(AENC_CHN AeChn, ADEC_CHN AdChn, FILE *pAecFd); 169 | //HI_S32 SAMPLE_COMM_AUDIO_CreatTrdFileAdec(AO_CHN AoChn, pjmedia_frame *buf); 170 | HI_S32 SAMPLE_COMM_AUDIO_DestoryTrdAi(AUDIO_DEV AiDev, AI_CHN AiChn); 171 | HI_S32 SAMPLE_COMM_AUDIO_DestoryTrdAencAdec(AENC_CHN AeChn); 172 | HI_S32 SAMPLE_COMM_AUDIO_DestoryTrdFileAdec(ADEC_CHN AdChn); 173 | HI_S32 SAMPLE_COMM_AUDIO_AoBindAdec(AUDIO_DEV AoDev, AO_CHN AoChn, ADEC_CHN AdChn); 174 | HI_S32 SAMPLE_COMM_AUDIO_AoUnbindAdec(AUDIO_DEV AoDev, AO_CHN AoChn, ADEC_CHN AdChn); 175 | HI_S32 SAMPLE_COMM_AUDIO_AoBindAi(AUDIO_DEV AiDev, AI_CHN AiChn, AUDIO_DEV AoDev, AO_CHN AoChn); 176 | HI_S32 SAMPLE_COMM_AUDIO_AoUnbindAi(AUDIO_DEV AiDev, AI_CHN AiChn, AUDIO_DEV AoDev, AO_CHN AoChn); 177 | HI_S32 SAMPLE_COMM_AUDIO_AencBindAi(AUDIO_DEV AiDev, AI_CHN AiChn, AENC_CHN AeChn); 178 | HI_S32 SAMPLE_COMM_AUDIO_AencUnbindAi(AUDIO_DEV AiDev, AI_CHN AiChn, AENC_CHN AeChn); 179 | HI_S32 SAMPLE_COMM_AUDIO_CfgAcodec(AIO_ATTR_S *pstAioAttr, HI_BOOL bMacIn); 180 | HI_S32 SAMPLE_COMM_AUDIO_DisableAcodec(); 181 | HI_S32 SAMPLE_COMM_AUDIO_StartAi(AUDIO_DEV AiDevId, HI_S32 s32AiChnCnt, 182 | AIO_ATTR_S *pstAioAttr, HI_BOOL bAnrEn, AUDIO_RESAMPLE_ATTR_S *pstAiReSmpAttr); 183 | HI_S32 SAMPLE_COMM_AUDIO_StopAi(AUDIO_DEV AiDevId, HI_S32 s32AiChnCnt, 184 | HI_BOOL bAnrEn, HI_BOOL bResampleEn); 185 | HI_S32 SAMPLE_COMM_AUDIO_StartAo(AUDIO_DEV AoDevId, AO_CHN AoChn, 186 | AIO_ATTR_S *pstAioAttr, AUDIO_RESAMPLE_ATTR_S *pstAiReSmpAttr); 187 | HI_S32 SAMPLE_COMM_AUDIO_StopAo(AUDIO_DEV AoDevId, AO_CHN AoChn, HI_BOOL bResampleEn); 188 | HI_S32 SAMPLE_COMM_AUDIO_StartAenc(HI_S32 s32AencChnCnt, PAYLOAD_TYPE_E enType); 189 | HI_S32 SAMPLE_COMM_AUDIO_StopAenc(HI_S32 s32AencChnCnt); 190 | HI_S32 SAMPLE_COMM_AUDIO_StartAdec(ADEC_CHN AdChn, PAYLOAD_TYPE_E enType); 191 | HI_S32 SAMPLE_COMM_AUDIO_StopAdec(ADEC_CHN AdChn); 192 | HI_VOID SAMPLE_COMM_VENC_ReadOneFrame( FILE * fp, HI_U8 * pY, HI_U8 * pU, HI_U8 * pV, 193 | HI_U32 width, HI_U32 height, HI_U32 stride, HI_U32 stride2); 194 | 195 | HI_S32 SAMPLE_COMM_VENC_PlanToSemi(HI_U8 *pY, HI_S32 yStride, 196 | HI_U8 *pU, HI_S32 uStride, 197 | HI_U8 *pV, HI_S32 vStride, 198 | HI_S32 picWidth, HI_S32 picHeight); 199 | 200 | #ifdef __cplusplus 201 | #if __cplusplus 202 | } 203 | #endif 204 | #endif /* End of #ifdef __cplusplus */ 205 | 206 | 207 | #endif /* End of #ifndef __SAMPLE_COMMON_H__ */ 208 | -------------------------------------------------------------------------------- /pjmedia/src/pjmedia/0: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /pjmedia/src/pjmedia/master_port.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dulton/hi35xx-pjsip/49d821d9fa23740daba04dbe881b9d358c6a50a5/pjmedia/src/pjmedia/master_port.c -------------------------------------------------------------------------------- /pjsip-apps/src/pjsua/main.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dulton/hi35xx-pjsip/49d821d9fa23740daba04dbe881b9d358c6a50a5/pjsip-apps/src/pjsua/main.c -------------------------------------------------------------------------------- /pjsua_app.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dulton/hi35xx-pjsip/49d821d9fa23740daba04dbe881b9d358c6a50a5/pjsua_app.c --------------------------------------------------------------------------------