├── include ├── cv300 │ ├── hi_comm_venc.h │ ├── hi_i2c.h │ ├── hi_spi.h │ ├── pwm.h │ ├── hi_comm_ai.h │ ├── hi_comm_ao.h │ ├── hi_af_comm.h │ ├── vou_exp.h │ ├── hi_isp_debug.h │ ├── hi_rtc.h │ ├── hi_sns_ctrl.h │ ├── hi_md.h │ ├── mpi_adec.h │ ├── mpi_aenc.h │ ├── mpi_region.h │ ├── mpi_af.h │ ├── viu_ext.h │ ├── mpi_vb.h │ ├── hi_isp_bin.h │ ├── watchdog.h │ ├── hiir.h │ ├── mpi_awb.h │ ├── isp_dehaze.h │ ├── mpi_ae.h │ ├── mod_ext.h │ ├── mpi_ao.h │ └── mpi_ai.h ├── SDL │ ├── SDL_name.h │ ├── SDL_types.h │ ├── SDL_getenv.h │ ├── SDL_byteorder.h │ ├── close_code.h │ ├── SDL_error.h │ ├── SDL_active.h │ ├── SDL_quit.h │ ├── SDL_cpuinfo.h │ ├── SDL_version.h │ ├── SDL_loadso.h │ ├── SDL_platform.h │ ├── SDL_main.h │ └── SDL.h ├── hi_ssp.h ├── vou_exp.h ├── hi_comm_ai.h ├── 3536d │ ├── hi_comm_ai.h │ ├── hi_comm_ao.h │ ├── jconfig.h │ ├── mpi_adec.h │ ├── mpi_vda.h │ ├── mpi_aenc.h │ ├── mpi_region.h │ ├── mpi_vb.h │ ├── hi_tde_errcode.h │ ├── hi_type.h │ ├── mpi_hdmi.h │ ├── acodec.h │ ├── hi_io.h │ ├── mpi_ai.h │ ├── mkp │ │ └── mod_ext.h │ ├── mpi_ao.h │ ├── mpi_vdec.h │ ├── mpi_vi.h │ ├── hi_comm_sys.h │ ├── mpi_sys.h │ └── hi_comm_vb.h ├── hi_af_comm.h ├── hi_comm_ao.h ├── hi_isp_debug.h ├── hi_vqe_register_api.h ├── freetype2 │ └── freetype │ │ ├── config │ │ └── ftmodule.h │ │ ├── ttunpat.h │ │ └── ftsynth.h ├── mpi_snap.h ├── hi_adc.h ├── hi_i2c.h ├── mpi_region.h ├── hi_common_qr.h ├── hi_md.h ├── mpi_vb.h ├── hi_tde_errcode.h ├── hi_isp_bin.h ├── hi_types.h ├── mpi_vgs.h ├── hi_audio_bcd.h ├── watchdog.h ├── hi_common_cipher.h ├── hi_ivs_qr.h ├── mpi_awb.h ├── list.h ├── hi_comm_snap.h ├── mpi_ae.h └── hi_type.h ├── .gitignore ├── LICENSE ├── README.md ├── .github └── workflows │ └── cmake.yml ├── src ├── hi_osd.h └── sdl.c ├── CMakeLists.txt └── common ├── loadbmp.h └── cv300 └── loadbmp.h /include/cv300/hi_comm_venc.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenIPC/hi_osd/main/include/cv300/hi_comm_venc.h -------------------------------------------------------------------------------- /include/cv300/hi_i2c.h: -------------------------------------------------------------------------------- 1 | #ifndef _HI_I2C_H 2 | #define _HI_I2C_H 3 | 4 | #ifdef __HuaweiLite__ 5 | #include 6 | #else 7 | #include 8 | #endif 9 | 10 | #endif 11 | -------------------------------------------------------------------------------- /include/SDL/SDL_name.h: -------------------------------------------------------------------------------- 1 | 2 | #ifndef _SDLname_h_ 3 | #define _SDLname_h_ 4 | 5 | #if defined(__STDC__) || defined(__cplusplus) 6 | #define NeedFunctionPrototypes 1 7 | #endif 8 | 9 | #define SDL_NAME(X) SDL_##X 10 | 11 | #endif /* _SDLname_h_ */ 12 | -------------------------------------------------------------------------------- /include/cv300/hi_spi.h: -------------------------------------------------------------------------------- 1 | #ifndef __HI_SPI_H__ 2 | #define __HI_SPI_H__ 3 | 4 | typedef unsigned long long __u64; 5 | typedef unsigned int __u32; 6 | typedef unsigned short __u16; 7 | typedef unsigned char __u8; 8 | 9 | #ifdef __HuaweiLite__ 10 | #include 11 | #else 12 | #include 13 | #endif 14 | 15 | #endif /* __HI_SPI_H__ */ 16 | -------------------------------------------------------------------------------- /include/hi_ssp.h: -------------------------------------------------------------------------------- 1 | /* 2 | * extdrv/include/hi_ssp.h for Linux . 3 | * 4 | * History: 5 | * 2006-4-11 create this file 6 | */ 7 | 8 | #ifndef __HI_SSP_H__ 9 | #define __HI_SSP_H__ 10 | 11 | #define SSP_READ_ALT 0x1 12 | #define SSP_WRITE_ALT 0X3 13 | 14 | typedef struct hiSPI_DATA_S 15 | { 16 | unsigned int spi_no; 17 | unsigned char dev_addr; 18 | unsigned int dev_byte_num; 19 | unsigned int reg_addr; 20 | unsigned int addr_byte_num; 21 | unsigned int data; 22 | unsigned int data_byte_num; 23 | }SPI_DATA_S; 24 | 25 | 26 | #endif 27 | 28 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Prerequisites 2 | *.d 3 | 4 | # Object files 5 | *.o 6 | *.ko 7 | *.obj 8 | *.elf 9 | 10 | # Linker output 11 | *.ilk 12 | *.map 13 | *.exp 14 | 15 | # Precompiled Headers 16 | *.gch 17 | *.pch 18 | 19 | # Libraries 20 | *.lib 21 | *.a 22 | *.la 23 | *.lo 24 | 25 | # Shared objects (inc. Windows DLLs) 26 | *.dll 27 | *.so 28 | *.so.* 29 | *.dylib 30 | 31 | # Executables 32 | *.exe 33 | *.out 34 | *.app 35 | *.i*86 36 | *.x86_64 37 | *.hex 38 | 39 | # Debug files 40 | *.dSYM/ 41 | *.su 42 | *.idb 43 | *.pdb 44 | 45 | # Kernel Module Compile Results 46 | *.mod* 47 | *.cmd 48 | .tmp_versions/ 49 | modules.order 50 | Module.symvers 51 | Mkfile.old 52 | dkms.conf 53 | 54 | build.sh 55 | -------------------------------------------------------------------------------- /include/cv300/pwm.h: -------------------------------------------------------------------------------- 1 | #ifndef __HI_PWM_H__ 2 | #define __HI_PWM_H__ 3 | 4 | #ifdef __cplusplus 5 | #if __cplusplus 6 | extern "C" { 7 | #endif 8 | #endif /* __cplusplus */ 9 | 10 | typedef struct hiPWM_DATA_S 11 | { 12 | unsigned char pwm_num; //0:PWM0,1:PWM1,2:PWM2,3:PWMII0,4:PWMII1,5:PWMII2 13 | unsigned int duty; 14 | unsigned int period; 15 | unsigned char enable; 16 | 17 | } PWM_DATA_S; 18 | 19 | #define PWM_CMD_WRITE 0x01 20 | #define PWM_CMD_READ 0x03 21 | 22 | int PWM_DRV_Write(unsigned char pwm_num, unsigned int duty, unsigned int period, unsigned char enable); 23 | 24 | #ifdef __cplusplus 25 | #if __cplusplus 26 | } 27 | #endif 28 | #endif /* __cplusplus */ 29 | 30 | #endif /* __HI_PWM_H__ */ 31 | -------------------------------------------------------------------------------- /include/vou_exp.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) Hisilicon Technologies Co., Ltd. 2012-2019. All rights reserved. 3 | * Description: 4 | * Author: Hisilicon multimedia software group 5 | * Create: 2011/06/28 6 | */ 7 | #include "hi_common.h" 8 | 9 | #ifndef __HI_VOU_EXP_H__ 10 | #define __HI_VOU_EXP_H__ 11 | 12 | typedef struct hiVOU_EXPORT_CALLBACK_S { 13 | void (*pfnVoNotify)(int module_id, int vodev); 14 | } VOU_EXPORT_CALLBACK_S; 15 | 16 | typedef HI_S32 FN_VO_RegisterExternCallback(VOU_EXPORT_CALLBACK_S *pstExpCallback); 17 | 18 | typedef struct hiVOU_EXPORT_SYMBOL_S { 19 | FN_VO_RegisterExternCallback *pfnVoRegisterExpCallback; 20 | } VOU_EXPORT_SYMBOL_S; 21 | 22 | #endif /* __HI_VOU_EXP_H__ */ 23 | 24 | 25 | -------------------------------------------------------------------------------- /include/hi_comm_ai.h: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | 3 | Copyright (C), 2001-2018, 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 | -------------------------------------------------------------------------------- /include/3536d/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 | -------------------------------------------------------------------------------- /include/cv300/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 | -------------------------------------------------------------------------------- /include/hi_af_comm.h: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | 3 | Copyright (C), 2016, Hisilicon Tech. Co., Ltd. 4 | 5 | ****************************************************************************** 6 | File Name : hi_af_comm.h 7 | Version : Initial Draft 8 | Author : Hisilicon multimedia software group 9 | Created : 2012/12/20 10 | Description : 11 | History : 12 | 1.Date : 2012/12/20 13 | Author : 14 | Modification: Created file 15 | 16 | ******************************************************************************/ 17 | #ifndef __HI_AF_COMM_H__ 18 | #define __HI_AF_COMM_H__ 19 | 20 | #include "hi_type.h" 21 | 22 | #ifdef __cplusplus 23 | #if __cplusplus 24 | extern "C" { 25 | #endif 26 | #endif /* End of #ifdef __cplusplus */ 27 | 28 | #define HI_AF_LIB_NAME "hisi_af_lib" 29 | 30 | #ifdef __cplusplus 31 | #if __cplusplus 32 | } 33 | #endif 34 | #endif /* End of #ifdef __cplusplus */ 35 | 36 | #endif 37 | -------------------------------------------------------------------------------- /include/hi_comm_ao.h: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | 3 | Copyright (C), 2001-2018, 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 | -------------------------------------------------------------------------------- /include/3536d/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 | -------------------------------------------------------------------------------- /include/cv300/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 | -------------------------------------------------------------------------------- /include/cv300/hi_af_comm.h: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | 3 | Copyright (C), 2001-2011, Hisilicon Tech. Co., Ltd. 4 | 5 | ****************************************************************************** 6 | File Name : hi_af_comm.h 7 | Version : Initial Draft 8 | Author : Hisilicon multimedia software group 9 | Created : 2012/12/20 10 | Description : 11 | History : 12 | 1.Date : 2012/12/20 13 | Author : n00168968 14 | Modification: Created file 15 | 16 | ******************************************************************************/ 17 | #ifndef __HI_AF_COMM_H__ 18 | #define __HI_AF_COMM_H__ 19 | 20 | #include "hi_type.h" 21 | 22 | #ifdef __cplusplus 23 | #if __cplusplus 24 | extern "C"{ 25 | #endif 26 | #endif /* End of #ifdef __cplusplus */ 27 | 28 | #define HI_AF_LIB_NAME "hisi_af_lib" 29 | 30 | #ifdef __cplusplus 31 | #if __cplusplus 32 | } 33 | #endif 34 | #endif /* End of #ifdef __cplusplus */ 35 | 36 | #endif 37 | -------------------------------------------------------------------------------- /include/SDL/SDL_types.h: -------------------------------------------------------------------------------- 1 | /* 2 | SDL - Simple DirectMedia Layer 3 | Copyright (C) 1997-2012 Sam Lantinga 4 | 5 | This library is free software; you can redistribute it and/or 6 | modify it under the terms of the GNU Lesser General Public 7 | License as published by the Free Software Foundation; either 8 | version 2.1 of the License, or (at your option) any later version. 9 | 10 | This library is distributed in the hope that it will be useful, 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | Lesser General Public License for more details. 14 | 15 | You should have received a copy of the GNU Lesser General Public 16 | License along with this library; if not, write to the Free Software 17 | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 18 | 19 | Sam Lantinga 20 | slouken@libsdl.org 21 | */ 22 | 23 | /** @file SDL_types.h 24 | * @deprecated Use SDL_stdinc.h instead. 25 | */ 26 | 27 | /* DEPRECATED */ 28 | #include "SDL_stdinc.h" 29 | -------------------------------------------------------------------------------- /include/SDL/SDL_getenv.h: -------------------------------------------------------------------------------- 1 | /* 2 | SDL - Simple DirectMedia Layer 3 | Copyright (C) 1997-2012 Sam Lantinga 4 | 5 | This library is free software; you can redistribute it and/or 6 | modify it under the terms of the GNU Lesser General Public 7 | License as published by the Free Software Foundation; either 8 | version 2.1 of the License, or (at your option) any later version. 9 | 10 | This library is distributed in the hope that it will be useful, 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | Lesser General Public License for more details. 14 | 15 | You should have received a copy of the GNU Lesser General Public 16 | License along with this library; if not, write to the Free Software 17 | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 18 | 19 | Sam Lantinga 20 | slouken@libsdl.org 21 | */ 22 | 23 | /** @file SDL_getenv.h 24 | * @deprecated Use SDL_stdinc.h instead 25 | */ 26 | 27 | /* DEPRECATED */ 28 | #include "SDL_stdinc.h" 29 | -------------------------------------------------------------------------------- /include/SDL/SDL_byteorder.h: -------------------------------------------------------------------------------- 1 | /* 2 | SDL - Simple DirectMedia Layer 3 | Copyright (C) 1997-2012 Sam Lantinga 4 | 5 | This library is free software; you can redistribute it and/or 6 | modify it under the terms of the GNU Lesser General Public 7 | License as published by the Free Software Foundation; either 8 | version 2.1 of the License, or (at your option) any later version. 9 | 10 | This library is distributed in the hope that it will be useful, 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | Lesser General Public License for more details. 14 | 15 | You should have received a copy of the GNU Lesser General Public 16 | License along with this library; if not, write to the Free Software 17 | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 18 | 19 | Sam Lantinga 20 | slouken@libsdl.org 21 | */ 22 | 23 | /** 24 | * @file SDL_byteorder.h 25 | * @deprecated Use SDL_endian.h instead 26 | */ 27 | 28 | /* DEPRECATED */ 29 | #include "SDL_endian.h" 30 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2021 OpenIPC 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /include/hi_isp_debug.h: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | 3 | Copyright (C), 2016, Hisilicon Tech. Co., Ltd. 4 | 5 | ****************************************************************************** 6 | File Name : hi_isp_debug.h 7 | Version : Initial Draft 8 | Author : Hisilicon multimedia software group 9 | Created : 2010/08/30 10 | Description : 11 | History : 12 | 1.Date : 2010/08/30 13 | Author : 14 | Modification: Created file 15 | 16 | ******************************************************************************/ 17 | 18 | #ifndef __HI_ISP_DEBUG_H__ 19 | #define __HI_ISP_DEBUG_H__ 20 | 21 | #include "hi_debug.h" 22 | #define ISP_TRACE(level, fmt, ...)\ 23 | do{ \ 24 | HI_TRACE(level, HI_ID_ISP,"[Func]:%s [Line]:%d [Info]:"fmt,__FUNCTION__, __LINE__,##__VA_ARGS__);\ 25 | }while(0) 26 | 27 | /* To avoid divide-0 exception in code. */ 28 | #define DIV_0_TO_1(a) ( ((a) == 0) ? 1 : (a) ) 29 | #define DIV_0_TO_1_FLOAT(a) ((((a) < 1E-10) && ((a) > -1E-10)) ? 1 : (a)) 30 | 31 | #endif /* __HI_ISP_DEBUG_H__ */ 32 | -------------------------------------------------------------------------------- /include/hi_vqe_register_api.h: -------------------------------------------------------------------------------- 1 | #ifndef __HI_VQE_REGISTER_API_H__ 2 | #define __HI_VQE_REGISTER_API_H__ 3 | 4 | #include "hi_type.h" 5 | 6 | #ifdef __cplusplus 7 | #if __cplusplus 8 | extern "C" { 9 | #endif 10 | #endif /* __cplusplus */ 11 | 12 | /* VQE module function api, return pointer to handle of VQE module */ 13 | 14 | //record 15 | HI_VOID * HI_VQE_RECORD_GetHandle(HI_VOID); 16 | //HPF 17 | HI_VOID * HI_VQE_HPF_GetHandle(HI_VOID); 18 | //AEC 19 | HI_VOID * HI_VQE_AEC_GetHandle(HI_VOID); 20 | //ANR 21 | HI_VOID * HI_VQE_ANR_GetHandle(HI_VOID); 22 | //RNR 23 | HI_VOID * HI_VQE_RNR_GetHandle(HI_VOID); 24 | //HDR 25 | HI_VOID * HI_VQE_HDR_GetHandle(HI_VOID); 26 | //DRC 27 | HI_VOID * HI_VQE_DRC_GetHandle(HI_VOID); 28 | //PEQ 29 | HI_VOID * HI_VQE_PEQ_GetHandle(HI_VOID); 30 | //AGC 31 | HI_VOID * HI_VQE_AGC_GetHandle(HI_VOID); 32 | //EQ 33 | HI_VOID * HI_VQE_EQ_GetHandle(HI_VOID); 34 | //RESAMPLE 35 | HI_VOID * HI_VQE_RESAMPLE_GetHandle(HI_VOID); 36 | //GAIN 37 | HI_VOID * HI_VQE_GAIN_GetHandle(HI_VOID); 38 | 39 | #ifdef __cplusplus 40 | #if __cplusplus 41 | } 42 | #endif 43 | #endif /* __cplusplus */ 44 | 45 | #endif /* __HI_VQE_REGISTER_H__ */ 46 | 47 | -------------------------------------------------------------------------------- /include/freetype2/freetype/config/ftmodule.h: -------------------------------------------------------------------------------- 1 | /* This is a generated file. */ 2 | FT_USE_MODULE( FT_Driver_ClassRec, tt_driver_class ) 3 | FT_USE_MODULE( FT_Driver_ClassRec, t1_driver_class ) 4 | FT_USE_MODULE( FT_Driver_ClassRec, cff_driver_class ) 5 | FT_USE_MODULE( FT_Driver_ClassRec, t1cid_driver_class ) 6 | FT_USE_MODULE( FT_Driver_ClassRec, pfr_driver_class ) 7 | FT_USE_MODULE( FT_Driver_ClassRec, t42_driver_class ) 8 | FT_USE_MODULE( FT_Driver_ClassRec, winfnt_driver_class ) 9 | FT_USE_MODULE( FT_Driver_ClassRec, pcf_driver_class ) 10 | FT_USE_MODULE( FT_Driver_ClassRec, bdf_driver_class ) 11 | FT_USE_MODULE( FT_Module_Class, sfnt_module_class ) 12 | FT_USE_MODULE( FT_Module_Class, autofit_module_class ) 13 | FT_USE_MODULE( FT_Module_Class, pshinter_module_class ) 14 | FT_USE_MODULE( FT_Renderer_Class, ft_raster1_renderer_class ) 15 | FT_USE_MODULE( FT_Renderer_Class, ft_smooth_renderer_class ) 16 | FT_USE_MODULE( FT_Renderer_Class, ft_smooth_lcd_renderer_class ) 17 | FT_USE_MODULE( FT_Renderer_Class, ft_smooth_lcdv_renderer_class ) 18 | FT_USE_MODULE( FT_Module_Class, psaux_module_class ) 19 | FT_USE_MODULE( FT_Module_Class, psnames_module_class ) 20 | /* EOF */ 21 | -------------------------------------------------------------------------------- /include/cv300/vou_exp.h: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | 3 | Copyright (C), 2001-2011, Hisilicon Tech. Co., Ltd. 4 | 5 | ****************************************************************************** 6 | File Name : vou_ext.h 7 | Version : Initial Draft 8 | Author : Hisilicon multimedia software group 9 | Created : 2011/06/28 10 | Description : 11 | History : 12 | 1.Date : 2011/06/28 13 | Author : n00168968/z00185248/l00181524 14 | Modification: Created file 15 | 16 | ******************************************************************************/ 17 | 18 | #ifndef __HI_VOU_EXP_H__ 19 | #define __HI_VOU_EXP_H__ 20 | 21 | typedef struct hiVOU_EXTERN_CALLBACK_S 22 | { 23 | void (*pfnVoNotify) (int module_id, int vodev); 24 | } VOU_EXTERN_CALLBACK_S; 25 | 26 | typedef HI_S32 FN_VO_RegisterExternCallBack(VOU_EXTERN_CALLBACK_S *pstExternCb); 27 | 28 | typedef struct hiVOU_EXTERN_FUNC_S 29 | { 30 | FN_VO_RegisterExternCallBack *pfnVoRegisterExternCallBack; 31 | }VOU_EXTERN_FUNC_S; 32 | 33 | 34 | #endif /* __HI_VOU_EXP_H__ */ 35 | 36 | -------------------------------------------------------------------------------- /include/cv300/hi_isp_debug.h: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | 3 | Copyright (C), 2001-2011, Hisilicon Tech. Co., Ltd. 4 | 5 | ****************************************************************************** 6 | File Name : hi_isp_debug.h 7 | Version : Initial Draft 8 | Author : Hisilicon multimedia software group 9 | Created : 2010/08/30 10 | Description : 11 | History : 12 | 1.Date : 2010/08/30 13 | Author : x00100808 14 | Modification: Created file 15 | 16 | ******************************************************************************/ 17 | 18 | #ifndef __HI_ISP_DEBUG_H__ 19 | #define __HI_ISP_DEBUG_H__ 20 | 21 | #include "hi_debug.h" 22 | 23 | #if 0 24 | #define PRINT_DEBUG_INFO 25 | #endif 26 | 27 | #if 0 28 | #define PRINT_INFO_2FILE 29 | #endif 30 | 31 | #define ISP_TRACE(level, fmt...)\ 32 | do{ \ 33 | HI_TRACE(level,HI_ID_ISP,"[Func]:%s [Line]:%d [Info]:",__FUNCTION__, __LINE__);\ 34 | HI_TRACE(level,HI_ID_ISP,##fmt);\ 35 | }while(0) 36 | 37 | /* To avoid divide-0 exception in code. */ 38 | #define DIV_0_TO_1(a) ( (0 == (a)) ? 1 : (a) ) 39 | 40 | #endif /* __HI_ISP_DEBUG_H__ */ 41 | 42 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # hi_osd 2 | Used to create additional VPSS regions and overlay bitmap content over them 3 | 4 | Just a PoC/Demo! SDL-1.2 is statically linked, thus increasing binary size drastically 5 | 6 | Tested on XiongMai-based hardware 7 | 8 | # Building 9 | 10 | Only Hi3516CV300 and Hi3516EV200 families are supported. 11 | 12 | Requires arm-himix100-linux toolchain. 13 | 14 | ```mkdir -p build && cd build && rm -rf *``` 15 | 16 | ```cmake -DCROSS_COMPILE=arm-himix100-linux- ..``` 17 | 18 | ```make clean && make``` 19 | 20 | 21 | # Usage 22 | ## Requirements: 23 | Place any TTF font named `font.ttf` in the executable dir 24 | 25 | ## Command line arguments 26 | [-n channel] (0 - main, 1 - extra) 27 | [-h handle] (use to add multiple regions; 0,1,8,9,16,17 - are reserved!) 28 | [-c command] (text2osd,logo2osd,loop2osd) 29 | [-t value] (text,path,etc) 30 | [-x X] (X-coordinate) 31 | [-y Y] (Y-coordinate) 32 | [-s N] (font size, optional) 33 | 34 | # Examples 35 | `./hi_osd -n 0 -h 5 -c text2osd -t TEST -x 1320 -y 980 -s 46` 36 | 37 | `./hi_osd -n 0 -h 5 -c logo2osd -t ./logo.bmp -x 980 -y 720 -s 46` 38 | 39 | `./hi_osd -n 0 -h 5 -c loop2osd -x 1320 -y 980 -s 46` 40 | -------------------------------------------------------------------------------- /include/cv300/hi_rtc.h: -------------------------------------------------------------------------------- 1 | /* 2 | * include/hi_rtc.h for Linux . 3 | * 4 | * This file defines hi_rtc micro-definitions for driver developer. 5 | * 6 | * History: 7 | * 10-April-2006 create this file 8 | */ 9 | 10 | #ifndef __HI_RTC__ 11 | #define __HI_RTC__ 12 | 13 | typedef struct { 14 | unsigned int year; 15 | unsigned int month; 16 | unsigned int date; 17 | unsigned int hour; 18 | unsigned int minute; 19 | unsigned int second; 20 | unsigned int weekday; 21 | } rtc_time_t; 22 | 23 | typedef struct { 24 | unsigned char reg_index; 25 | unsigned char val; 26 | } reg_data_t; 27 | 28 | typedef struct { 29 | unsigned int freq_l; 30 | } rtc_freq_t; 31 | 32 | #define HI_RTC_AIE_ON _IO('p', 0x01) 33 | #define HI_RTC_AIE_OFF _IO('p', 0x02) 34 | 35 | #define HI_RTC_GET_FREQ _IOR('P', 0x05, rtc_freq_t) 36 | #define HI_RTC_SET_FREQ _IOW('p', 0x06, rtc_freq_t) 37 | 38 | #define HI_RTC_ALM_SET _IOW('p', 0x07, rtc_time_t) 39 | #define HI_RTC_ALM_READ _IOR('p', 0x08, rtc_time_t) 40 | #define HI_RTC_RD_TIME _IOR('p', 0x09, rtc_time_t) 41 | #define HI_RTC_SET_TIME _IOW('p', 0x0a, rtc_time_t) 42 | #define HI_RTC_RESET _IO('p', 0x0b) 43 | #define HI_RTC_REG_SET _IOW('p', 0x0c, reg_data_t) 44 | #define HI_RTC_REG_READ _IOWR('p', 0x0d, reg_data_t) 45 | 46 | #endif 47 | 48 | -------------------------------------------------------------------------------- /include/mpi_snap.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) Hisilicon Technologies Co., Ltd. 2012-2018. All rights reserved. 3 | * Description: mpi_snap.h 4 | * Author: 5 | * Create: 2017-06-16 6 | */ 7 | 8 | #ifndef __MPI_SNAP_H__ 9 | #define __MPI_SNAP_H__ 10 | 11 | #include "hi_comm_video.h" 12 | #include "hi_comm_snap.h" 13 | 14 | #ifdef __cplusplus 15 | #if __cplusplus 16 | extern "C" { 17 | #endif 18 | #endif /* __cplusplus */ 19 | 20 | HI_S32 HI_MPI_SNAP_SetPipeAttr(VI_PIPE ViPipe, const SNAP_ATTR_S *pstSnapAttr); 21 | HI_S32 HI_MPI_SNAP_GetPipeAttr(VI_PIPE ViPipe, SNAP_ATTR_S *pstSnapAttr); 22 | HI_S32 HI_MPI_SNAP_EnablePipe(VI_PIPE ViPipe); 23 | HI_S32 HI_MPI_SNAP_DisablePipe(VI_PIPE ViPipe); 24 | HI_S32 HI_MPI_SNAP_TriggerPipe(VI_PIPE ViPipe); 25 | 26 | HI_S32 HI_MPI_SNAP_MultiTrigger(VI_STITCH_GRP StitchGrp); 27 | 28 | /* HDR */ 29 | HI_S32 HI_MPI_SNAP_SetProSharpenParam(VI_PIPE ViPipe, const ISP_PRO_SHARPEN_PARAM_S *pstIspShpParam); 30 | HI_S32 HI_MPI_SNAP_GetProSharpenParam(VI_PIPE ViPipe, ISP_PRO_SHARPEN_PARAM_S *pstIspShpParam); 31 | HI_S32 HI_MPI_SNAP_SetProBNRParam(VI_PIPE ViPipe, const ISP_PRO_BNR_PARAM_S *pstNrParma); 32 | HI_S32 HI_MPI_SNAP_GetProBNRParam(VI_PIPE ViPipe, ISP_PRO_BNR_PARAM_S *pstNrParma); 33 | 34 | #ifdef __cplusplus 35 | #if __cplusplus 36 | } 37 | #endif 38 | #endif /* __cplusplus */ 39 | 40 | #endif /* __MPI_SNAP_H__ */ 41 | 42 | 43 | -------------------------------------------------------------------------------- /include/3536d/jconfig.h: -------------------------------------------------------------------------------- 1 | /* jconfig.h. Generated automatically by configure. */ 2 | /* jconfig.cfg --- source file edited by configure script */ 3 | /* see jconfig.doc for explanations */ 4 | 5 | #define HAVE_PROTOTYPES 6 | #define HAVE_UNSIGNED_CHAR 7 | #define HAVE_UNSIGNED_SHORT 8 | #undef void 9 | #undef const 10 | #undef CHAR_IS_UNSIGNED 11 | #define HAVE_STDDEF_H 12 | #define HAVE_STDLIB_H 13 | #undef NEED_BSD_STRINGS 14 | #undef NEED_SYS_TYPES_H 15 | #undef NEED_FAR_POINTERS 16 | #undef NEED_SHORT_EXTERNAL_NAMES 17 | /* Define this if you get warnings about undefined structures. */ 18 | #undef INCOMPLETE_TYPES_BROKEN 19 | 20 | #ifdef JPEG_INTERNALS 21 | 22 | #undef RIGHT_SHIFT_IS_UNSIGNED 23 | #define INLINE __inline__ 24 | /* These are for configuring the JPEG memory manager. */ 25 | #undef DEFAULT_MAX_MEM 26 | #undef NO_MKTEMP 27 | 28 | #endif /* JPEG_INTERNALS */ 29 | 30 | #ifdef JPEG_CJPEG_DJPEG 31 | 32 | #define BMP_SUPPORTED /* BMP image file format */ 33 | #define GIF_SUPPORTED /* GIF image file format */ 34 | #define PPM_SUPPORTED /* PBMPLUS PPM/PGM image file format */ 35 | #undef RLE_SUPPORTED /* Utah RLE image file format */ 36 | #define TARGA_SUPPORTED /* Targa image file format */ 37 | 38 | #undef TWO_FILE_COMMANDLINE 39 | #undef NEED_SIGNAL_CATCHER 40 | #undef DONT_USE_B_MODE 41 | 42 | /* Define this if you want percent-done progress reports from cjpeg/djpeg. */ 43 | #undef PROGRESS_REPORT 44 | 45 | #endif /* JPEG_CJPEG_DJPEG */ 46 | -------------------------------------------------------------------------------- /include/cv300/hi_sns_ctrl.h: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | 3 | Copyright (C), 2001-2011, Hisilicon Tech. Co., Ltd. 4 | 5 | ****************************************************************************** 6 | File Name : hi_sns_ctrl.h 7 | Version : Initial Draft 8 | Author : Hisilicon multimedia software group 9 | Created : 2011/01/10 10 | Description : 11 | History : 12 | 1.Date : 2011/01/10 13 | Author : x00100808 14 | Modification: Created file 15 | 16 | ******************************************************************************/ 17 | 18 | #ifndef __HI_SNS_CTRL_H__ 19 | #define __HI_SNS_CTRL_H__ 20 | 21 | #include "hi_type.h" 22 | #include "hi_comm_isp.h" 23 | 24 | #ifdef __cplusplus 25 | #if __cplusplus 26 | extern "C"{ 27 | #endif 28 | #endif /* End of #ifdef __cplusplus */ 29 | 30 | void sensor_init(void); 31 | void sensor_exit(void); 32 | 33 | void sensor_prog(int *rom); 34 | int sensor_write_register(int addr, int data); 35 | int sensor_read_register(int addr); 36 | int sensor_write_register_bit(int addr, int data, int mask); 37 | int sensor_register_callback(void); 38 | int sensor_unregister_callback(void); 39 | int sensor_set_inifile_path(const HI_CHAR *pcPath); 40 | int sensor_set_init(ISP_INIT_ATTR_S *pstInitAttr); 41 | 42 | #ifdef __cplusplus 43 | #if __cplusplus 44 | } 45 | #endif 46 | #endif /* End of #ifdef __cplusplus */ 47 | 48 | #endif /* __HI_SNS_CTRL_H__ */ 49 | 50 | -------------------------------------------------------------------------------- /.github/workflows/cmake.yml: -------------------------------------------------------------------------------- 1 | name: CMake 2 | 3 | on: 4 | push: 5 | branches: [ main ] 6 | pull_request: 7 | branches: [ main ] 8 | 9 | env: 10 | # Customize the CMake build type here (Release, Debug, RelWithDebInfo, etc.) 11 | BUILD_TYPE: Release 12 | 13 | jobs: 14 | build: 15 | # The CMake configure and build commands are platform agnostic and should work equally 16 | # well on Windows or Mac. You can convert this to a matrix build if you need 17 | # cross-platform coverage. 18 | # See: https://docs.github.com/en/free-pro-team@latest/actions/learn-github-actions/managing-complex-workflows#using-a-build-matrix 19 | runs-on: ubuntu-latest 20 | 21 | steps: 22 | - uses: actions/checkout@v2 23 | 24 | - name: Configure CMake 25 | # Configure CMake in a 'build' subdirectory. `CMAKE_BUILD_TYPE` is only required if you are using a single-configuration generator such as make. 26 | # See https://cmake.org/cmake/help/latest/variable/CMAKE_BUILD_TYPE.html?highlight=cmake_build_type 27 | run: cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} 28 | 29 | - name: Build 30 | # Build your program with the given configuration 31 | run: cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}} 32 | 33 | - name: Test 34 | working-directory: ${{github.workspace}}/build 35 | # Execute tests defined by the CMake configuration. 36 | # See https://cmake.org/cmake/help/latest/manual/ctest.1.html for more detail 37 | run: ctest -C ${{env.BUILD_TYPE}} 38 | 39 | -------------------------------------------------------------------------------- /src/hi_osd.h: -------------------------------------------------------------------------------- 1 | //#define __16CV300__ 2 | //#define __16EV200__ 3 | 4 | #include 5 | #include 6 | #include 7 | #include 8 | #include 9 | #include 10 | #include 11 | #include 12 | #include 13 | #include 14 | #include 15 | 16 | #ifdef __16CV300__ 17 | #include "cv300/hi_common.h" 18 | #include "cv300/mpi_region.h" 19 | #include "cv300/hi_math.h" 20 | #include "cv300/loadbmp.h" 21 | #else 22 | #include "hi_common.h" 23 | #include "mpi_region.h" 24 | #include "hi_math.h" 25 | #include "loadbmp.h" 26 | #endif 27 | 28 | #define FontFile "./font.ttf" 29 | int FontSize = 32; 30 | 31 | BITMAP_S SDL_OSDtoBMP(); 32 | 33 | #ifdef __16CV300__ 34 | 35 | #define PIXEL_FORMAT_4444 PIXEL_FORMAT_RGB_4444 36 | #define PIXEL_FORMAT_1555 PIXEL_FORMAT_RGB_1555 37 | #define PIXEL_FORMAT_2BPP PIXEL_FORMAT_RGB_2BPP 38 | #define PIXEL_FORMAT_8888 PIXEL_FORMAT_RGB_8888 39 | #else 40 | #define PIXEL_FORMAT_4444 PIXEL_FORMAT_ARGB_4444 41 | #define PIXEL_FORMAT_1555 PIXEL_FORMAT_ARGB_1555 42 | #define PIXEL_FORMAT_2BPP PIXEL_FORMAT_ARGB_2BPP 43 | #define PIXEL_FORMAT_8888 PIXEL_FORMAT_ARGB_8888 44 | #endif 45 | 46 | typedef enum hi_WORK_MODE{ 47 | VI_OSDEX_TASK = 0, 48 | VI_COVEREX_TASK, 49 | VPSS_OSDEX_TASK, 50 | VPSS_COVEREX_TASK, 51 | VPSS_COVER_TASK, 52 | VPSS_MOSAIC_TASK, 53 | VO_OSDEX_TASK, 54 | VO_COVEREX_TASK, 55 | VENC_OSD_TASK, 56 | }WORK_MODE_E; 57 | WORK_MODE_E Work_Mode; 58 | 59 | HI_U32 g_u32DisBufLen = 3; 60 | HI_CHAR* Path_BMP = HI_NULL; 61 | -------------------------------------------------------------------------------- /include/hi_adc.h: -------------------------------------------------------------------------------- 1 | /* 2 | * 3 | * Copyright (c) 2017 Hisilicon Co., Ltd. 4 | * 5 | * This program is free software; you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation; either version 2 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * 16 | */ 17 | 18 | #ifndef __HI_ADC_H__ 19 | #define __HI_ADC_H__ 20 | 21 | 22 | #define LSADC_IOCTL_BASE 'A' 23 | 24 | typedef enum hiIOC_NR_LSADC_E 25 | { 26 | IOC_NR_LSADC_MODEL_SEL = 0, 27 | IOC_NR_LSADC_CHN_ENABLE, 28 | IOC_NR_LSADC_CHN_DISABLE, 29 | IOC_NR_LSADC_START, 30 | IOC_NR_LSADC_STOP, 31 | IOC_NR_LSADC_GET_CHNVAL, 32 | IOC_NR_LSADC_BUTT 33 | }IOC_NR_LSADC_E; 34 | 35 | #define LSADC_IOC_MODEL_SEL _IOWR(LSADC_IOCTL_BASE, IOC_NR_LSADC_MODEL_SEL, int) 36 | #define LSADC_IOC_CHN_ENABLE _IOW(LSADC_IOCTL_BASE, IOC_NR_LSADC_CHN_ENABLE, int) 37 | #define LSADC_IOC_CHN_DISABLE _IOW(LSADC_IOCTL_BASE, IOC_NR_LSADC_CHN_DISABLE, int) 38 | #define LSADC_IOC_START _IO(LSADC_IOCTL_BASE, IOC_NR_LSADC_START) 39 | #define LSADC_IOC_STOP _IO(LSADC_IOCTL_BASE, IOC_NR_LSADC_STOP) 40 | #define LSADC_IOC_GET_CHNVAL _IOWR(LSADC_IOCTL_BASE, IOC_NR_LSADC_GET_CHNVAL, int) 41 | 42 | 43 | 44 | 45 | #endif /* __HI_ADC_H__ */ 46 | 47 | -------------------------------------------------------------------------------- /include/hi_i2c.h: -------------------------------------------------------------------------------- 1 | #ifndef _HI_I2C_H 2 | #define _HI_I2C_H 3 | 4 | 5 | 6 | /* /dev/i2c-X ioctl commands. The ioctl's parameter is always an 7 | * unsigned long, except for: 8 | * - I2C_FUNCS, takes pointer to an unsigned long 9 | * - I2C_RDWR, takes pointer to struct i2c_rdwr_ioctl_data 10 | * - I2C_SMBUS, takes pointer to struct i2c_smbus_ioctl_data 11 | */ 12 | #define I2C_RETRIES 0x0701 /* number of times a device address should 13 | be polled when not acknowledging */ 14 | #define I2C_TIMEOUT 0x0702 /* set timeout in units of 10 ms */ 15 | 16 | /* NOTE: Slave address is 7 or 10 bits, but 10-bit addresses 17 | * are NOT supported! (due to code brokenness) 18 | */ 19 | #define I2C_SLAVE 0x0703 /* Use this slave address */ 20 | #define I2C_SLAVE_FORCE 0x0706 /* Use this slave address, even if it 21 | is already in use by a driver! */ 22 | #define I2C_TENBIT 0x0704 /* 0 for 7 bit addrs, != 0 for 10 bit */ 23 | 24 | #define I2C_FUNCS 0x0705 /* Get the adapter functionality mask */ 25 | 26 | #define I2C_RDWR 0x0707 /* Combined R/W transfer (one STOP only) */ 27 | 28 | #define I2C_PEC 0x0708 /* != 0 to use PEC with SMBus */ 29 | #define I2C_SMBUS 0x0720 /* SMBus transfer */ 30 | #define I2C_16BIT_REG 0x0709 /* 16BIT REG WIDTH */ 31 | #define I2C_16BIT_DATA 0x070a /* 16BIT DATA WIDTH */ 32 | 33 | typedef struct hiI2C_DATA_S 34 | { 35 | unsigned char dev_addr; 36 | unsigned int reg_addr; 37 | unsigned int addr_byte_num; 38 | unsigned int data; 39 | unsigned int data_byte_num; 40 | }I2C_DATA_S; 41 | 42 | #endif 43 | 44 | -------------------------------------------------------------------------------- /include/mpi_region.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) Hisilicon Technologies Co., Ltd. 2016-2019. All rights reserved. 3 | * Description: mpi_region.h 4 | * Author: 5 | * Create: 2016-11-15 6 | */ 7 | #ifndef __MPI_REGION_H__ 8 | #define __MPI_REGION_H__ 9 | 10 | #include "hi_comm_region.h" 11 | 12 | #ifdef __cplusplus 13 | #if __cplusplus 14 | extern "C" { 15 | #endif 16 | #endif 17 | 18 | HI_S32 HI_MPI_RGN_Create(RGN_HANDLE Handle, const RGN_ATTR_S *pstRegion); 19 | HI_S32 HI_MPI_RGN_Destroy(RGN_HANDLE Handle); 20 | 21 | HI_S32 HI_MPI_RGN_GetAttr(RGN_HANDLE Handle, RGN_ATTR_S *pstRegion); 22 | HI_S32 HI_MPI_RGN_SetAttr(RGN_HANDLE Handle, const RGN_ATTR_S *pstRegion); 23 | 24 | HI_S32 HI_MPI_RGN_SetBitMap(RGN_HANDLE Handle, const BITMAP_S *pstBitmap); 25 | 26 | HI_S32 HI_MPI_RGN_AttachToChn(RGN_HANDLE Handle, const MPP_CHN_S *pstChn, const RGN_CHN_ATTR_S *pstChnAttr); 27 | HI_S32 HI_MPI_RGN_DetachFromChn(RGN_HANDLE Handle, const MPP_CHN_S *pstChn); 28 | 29 | HI_S32 HI_MPI_RGN_SetDisplayAttr(RGN_HANDLE Handle, const MPP_CHN_S *pstChn, const RGN_CHN_ATTR_S *pstChnAttr); 30 | HI_S32 HI_MPI_RGN_GetDisplayAttr(RGN_HANDLE Handle, const MPP_CHN_S *pstChn, RGN_CHN_ATTR_S *pstChnAttr); 31 | 32 | HI_S32 HI_MPI_RGN_GetCanvasInfo(RGN_HANDLE Handle, RGN_CANVAS_INFO_S *pstCanvasInfo); 33 | HI_S32 HI_MPI_RGN_UpdateCanvas(RGN_HANDLE Handle); 34 | 35 | HI_S32 HI_MPI_RGN_BatchBegin(RGN_HANDLEGROUP *pu32Group, HI_U32 u32Num, const RGN_HANDLE handle[]); 36 | HI_S32 HI_MPI_RGN_BatchEnd(RGN_HANDLEGROUP u32Group); 37 | 38 | HI_S32 HI_MPI_RGN_GetFd(HI_VOID); 39 | 40 | #ifdef __cplusplus 41 | #if __cplusplus 42 | } 43 | #endif 44 | #endif 45 | 46 | #endif 47 | -------------------------------------------------------------------------------- /include/SDL/close_code.h: -------------------------------------------------------------------------------- 1 | /* 2 | SDL - Simple DirectMedia Layer 3 | Copyright (C) 1997-2012 Sam Lantinga 4 | 5 | This library is free software; you can redistribute it and/or 6 | modify it under the terms of the GNU Library General Public 7 | License as published by the Free Software Foundation; either 8 | version 2 of the License, or (at your option) any later version. 9 | 10 | This library is distributed in the hope that it will be useful, 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | Library General Public License for more details. 14 | 15 | You should have received a copy of the GNU Library General Public 16 | License along with this library; if not, write to the Free 17 | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 18 | 19 | Sam Lantinga 20 | slouken@libsdl.org 21 | */ 22 | 23 | /** 24 | * @file close_code.h 25 | * This file reverses the effects of begin_code.h and should be included 26 | * after you finish any function and structure declarations in your headers 27 | */ 28 | 29 | #ifndef _begin_code_h 30 | #error close_code.h included without matching begin_code.h 31 | #endif 32 | #undef _begin_code_h 33 | 34 | /* Reset structure packing at previous byte alignment */ 35 | #if defined(_MSC_VER) || defined(__MWERKS__) || defined(__BORLANDC__) 36 | #ifdef __BORLANDC__ 37 | #pragma nopackwarning 38 | #endif 39 | #if (defined(__MWERKS__) && defined(__MACOS__)) 40 | #pragma options align=reset 41 | #pragma enumsalwaysint reset 42 | #else 43 | #pragma pack(pop) 44 | #endif 45 | #endif /* Compiler needs structure packing set */ 46 | -------------------------------------------------------------------------------- /include/cv300/hi_md.h: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | 3 | Copyright (C), 2001-2015, Hisilicon Tech. Co., Ltd. 4 | 5 | ****************************************************************************** 6 | File Name : hi_md.h 7 | Version : Initial Draft 8 | Author : Hisilicon multimedia software (IVE) group 9 | Created : 2014/11/10 10 | Description : 11 | History : 12 | 1.Date : 2014/11/10 13 | Author : 14 | Modification: Created file 15 | 2.Date : 2015/11/24 16 | Author : 17 | Modification: Modify MD_ATTR_S 18 | ******************************************************************************/ 19 | #ifndef _HI_MD_H_ 20 | #define _HI_MD_H_ 21 | 22 | #include "hi_ive.h" 23 | 24 | #ifdef __cplusplus 25 | #if __cplusplus 26 | extern "C"{ 27 | #endif 28 | #endif 29 | /* 30 | * Definition md algorithm mode 31 | */ 32 | typedef enum hiMD_ALG_MODE_E 33 | { 34 | MD_ALG_MODE_BG = 0x0,/*Base on background image*/ 35 | MD_ALG_MODE_REF = 0x1,/*Base on reference image*/ 36 | 37 | MD_ALG_MODE_BUTT 38 | }MD_ALG_MODE_E; 39 | /* 40 | * Definition of md attribute 41 | */ 42 | typedef struct hiMD_ATTR_S 43 | { 44 | MD_ALG_MODE_E enAlgMode; /*Md algorithm mode*/ 45 | IVE_SAD_MODE_E enSadMode; /*Sad mode*/ 46 | IVE_SAD_OUT_CTRL_E enSadOutCtrl; /*Sad output ctrl*/ 47 | HI_U16 u16Width; /*Image width*/ 48 | HI_U16 u16Height; /*Image height*/ 49 | HI_U16 u16SadThr; /*Sad thresh*/ 50 | IVE_CCL_CTRL_S stCclCtrl; /*Ccl ctrl*/ 51 | IVE_ADD_CTRL_S stAddCtrl; /*Add ctrl*/ 52 | }MD_ATTR_S; 53 | 54 | #ifdef __cplusplus 55 | #if __cplusplus 56 | } 57 | #endif 58 | #endif 59 | 60 | #endif/*_HI_MD_H_*/ -------------------------------------------------------------------------------- /include/hi_common_qr.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) Hisilicon Technologies Co., Ltd. 2019. All rights reserved. 3 | * Description: definition of hi_common_qr.h 4 | * Author: Hisilicon multimedia software (SVP) group 5 | * Create: 2019-09-02 6 | */ 7 | #ifndef _HI_COMMOM_QR_H_ 8 | #define _HI_COMMOM_QR_H_ 9 | 10 | #include "hi_type.h" 11 | #include "hi_errno.h" 12 | 13 | #ifdef __cplusplus 14 | #if __cplusplus 15 | extern "C"{ 16 | #endif 17 | #endif 18 | 19 | #define HI_QR_MAX_PAYLOAD_LEN 256 20 | 21 | typedef enum { 22 | HI_QR_STATE_DECODE_SUCCESS = 0x00, 23 | HI_QR_STATE_NON_EXISTENT = 0x01, 24 | HI_QR_STATE_DECODE_FAIL = 0x02, 25 | HI_QR_STATE_DATA_OVERFLOW = 0x03, 26 | HI_QR_STATE_BUTT 27 | } hi_qr_decode_state; 28 | 29 | #define HI_ERR_QR_ILLEGAL_PARAM HI_DEF_ERR(HI_ID_QR, EN_ERR_LEVEL_ERROR, EN_ERR_ILLEGAL_PARAM) 30 | #define HI_ERR_QR_EXIST HI_DEF_ERR(HI_ID_QR, EN_ERR_LEVEL_ERROR, EN_ERR_EXIST) 31 | #define HI_ERR_QR_NULL_PTR HI_DEF_ERR(HI_ID_QR, EN_ERR_LEVEL_ERROR, EN_ERR_NULL_PTR) 32 | #define HI_ERR_QR_NO_MEM HI_DEF_ERR(HI_ID_QR, EN_ERR_LEVEL_ERROR, EN_ERR_NOMEM) 33 | #define HI_ERR_QR_NOT_READY HI_DEF_ERR(HI_ID_QR, EN_ERR_LEVEL_ERROR, EN_ERR_SYS_NOTREADY) 34 | 35 | typedef struct { 36 | hi_qr_decode_state state; 37 | hi_s32 version; 38 | hi_s32 ecc_level; 39 | hi_s32 mask; 40 | hi_s32 data_type; 41 | hi_s32 payload_len; 42 | hi_u32 eci; 43 | hi_u8 payload[HI_QR_MAX_PAYLOAD_LEN]; 44 | } hi_qr_info; 45 | 46 | typedef struct { 47 | hi_u64 phys_addr; 48 | hi_u64 virt_addr; 49 | hi_u32 mem_size; 50 | } hi_qr_mem_info; 51 | 52 | #ifdef __cplusplus 53 | #if __cplusplus 54 | } 55 | #endif 56 | #endif 57 | #endif /* _HI_COMMON_QR_H_ */ 58 | -------------------------------------------------------------------------------- /include/3536d/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 | #ifndef __MPI_ADEC_H__ 17 | #define __MPI_ADEC_H__ 18 | 19 | #include "hi_common.h" 20 | #include "hi_comm_aio.h" 21 | #include "hi_comm_adec.h" 22 | 23 | #ifdef __cplusplus 24 | #if __cplusplus 25 | extern "C" 26 | { 27 | #endif 28 | #endif /* __cplusplus */ 29 | 30 | HI_S32 HI_MPI_ADEC_CreateChn(ADEC_CHN AdChn, ADEC_CHN_ATTR_S* pstAttr); 31 | HI_S32 HI_MPI_ADEC_DestroyChn(ADEC_CHN AdChn); 32 | 33 | HI_S32 HI_MPI_ADEC_SendStream(ADEC_CHN AdChn, const AUDIO_STREAM_S* pstStream, HI_BOOL bBlock); 34 | 35 | HI_S32 HI_MPI_ADEC_ClearChnBuf(ADEC_CHN AdChn); 36 | 37 | HI_S32 HI_MPI_ADEC_RegeisterDecoder(HI_S32* ps32Handle, ADEC_DECODER_S* pstDecoder); 38 | HI_S32 HI_MPI_ADEC_UnRegisterDecoder(HI_S32 s32Handle); 39 | 40 | HI_S32 HI_MPI_ADEC_GetFrame(ADEC_CHN AdChn, AUDIO_FRAME_INFO_S* pstFrmInfo, HI_BOOL bBlock); 41 | HI_S32 HI_MPI_ADEC_ReleaseFrame(ADEC_CHN AdChn, AUDIO_FRAME_INFO_S* pstFrmInfo); 42 | HI_S32 HI_MPI_ADEC_SendEndOfStream(ADEC_CHN AdChn, HI_BOOL bInstant); 43 | 44 | 45 | 46 | #ifdef __cplusplus 47 | #if __cplusplus 48 | } 49 | #endif 50 | #endif /* __cplusplus */ 51 | 52 | #endif /* __MPI_ADEC_H__ */ 53 | 54 | -------------------------------------------------------------------------------- /include/cv300/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 | #ifndef __MPI_ADEC_H__ 17 | #define __MPI_ADEC_H__ 18 | 19 | #include "hi_common.h" 20 | #include "hi_comm_aio.h" 21 | #include "hi_comm_adec.h" 22 | 23 | #ifdef __cplusplus 24 | #if __cplusplus 25 | extern "C" 26 | { 27 | #endif 28 | #endif /* __cplusplus */ 29 | 30 | HI_S32 HI_MPI_ADEC_CreateChn(ADEC_CHN AdChn, ADEC_CHN_ATTR_S* pstAttr); 31 | HI_S32 HI_MPI_ADEC_DestroyChn(ADEC_CHN AdChn); 32 | 33 | HI_S32 HI_MPI_ADEC_SendStream(ADEC_CHN AdChn, const AUDIO_STREAM_S* pstStream, HI_BOOL bBlock); 34 | 35 | HI_S32 HI_MPI_ADEC_ClearChnBuf(ADEC_CHN AdChn); 36 | 37 | HI_S32 HI_MPI_ADEC_RegeisterDecoder(HI_S32* ps32Handle, ADEC_DECODER_S* pstDecoder); 38 | HI_S32 HI_MPI_ADEC_UnRegisterDecoder(HI_S32 s32Handle); 39 | 40 | HI_S32 HI_MPI_ADEC_GetFrame(ADEC_CHN AdChn, AUDIO_FRAME_INFO_S* pstFrmInfo, HI_BOOL bBlock); 41 | HI_S32 HI_MPI_ADEC_ReleaseFrame(ADEC_CHN AdChn, AUDIO_FRAME_INFO_S* pstFrmInfo); 42 | HI_S32 HI_MPI_ADEC_SendEndOfStream(ADEC_CHN AdChn, HI_BOOL bInstant); 43 | 44 | 45 | 46 | #ifdef __cplusplus 47 | #if __cplusplus 48 | } 49 | #endif 50 | #endif /* __cplusplus */ 51 | 52 | #endif /* __MPI_ADEC_H__ */ 53 | 54 | -------------------------------------------------------------------------------- /include/hi_md.h: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | 3 | Copyright (C), 2001-2015, Hisilicon Tech. Co., Ltd. 4 | 5 | ****************************************************************************** 6 | File Name : hi_md.h 7 | Version : Initial Draft 8 | Author : Hisilicon multimedia software (IVE) group 9 | Created : 2014/11/10 10 | Description : 11 | History : 12 | 1.Date : 2014/11/10 13 | Author : 14 | Modification: Created file 15 | 2.Date : 2015/11/24 16 | Author : 17 | Modification: Modify MD_ATTR_S 18 | ******************************************************************************/ 19 | #ifndef _HI_MD_H_ 20 | #define _HI_MD_H_ 21 | 22 | #include "hi_ive.h" 23 | 24 | #ifdef __cplusplus 25 | #if __cplusplus 26 | extern "C" { 27 | #endif 28 | #endif 29 | /* 30 | * Definition md algorithm mode 31 | */ 32 | typedef enum hiMD_ALG_MODE_E { 33 | MD_ALG_MODE_BG = 0x0, /* Base on background image */ 34 | MD_ALG_MODE_REF = 0x1, /* Base on reference image */ 35 | 36 | MD_ALG_MODE_BUTT 37 | } MD_ALG_MODE_E; 38 | /* 39 | * Definition of md attribute 40 | */ 41 | typedef struct hiMD_ATTR_S { 42 | MD_ALG_MODE_E enAlgMode; /* Md algorithm mode */ 43 | IVE_SAD_MODE_E enSadMode; /* Sad mode */ 44 | IVE_SAD_OUT_CTRL_E enSadOutCtrl; /* Sad output ctrl */ 45 | HI_U32 u32Width; /* Image width */ 46 | HI_U32 u32Height; /* Image height */ 47 | HI_U16 u16SadThr; /* Sad thresh */ 48 | IVE_CCL_CTRL_S stCclCtrl; /* Ccl ctrl */ 49 | IVE_ADD_CTRL_S stAddCtrl; /* Add ctrl */ 50 | } MD_ATTR_S; 51 | 52 | #ifdef __cplusplus 53 | #if __cplusplus 54 | } 55 | #endif 56 | #endif 57 | 58 | #endif /* _HI_MD_H_ */ -------------------------------------------------------------------------------- /include/mpi_vb.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) Hisilicon Technologies Co., Ltd. 2012-2019. All rights reserved. 3 | * Description: 4 | * Author: Hisilicon multimedia software group 5 | * Create: 2011/06/28 6 | */ 7 | 8 | 9 | #ifndef __MPI_VB_H__ 10 | #define __MPI_VB_H__ 11 | 12 | #include "hi_comm_vb.h" 13 | #include "hi_comm_video.h" 14 | 15 | #ifdef __cplusplus 16 | #if __cplusplus 17 | extern "C" { 18 | #endif 19 | #endif 20 | 21 | VB_POOL HI_MPI_VB_CreatePool(VB_POOL_CONFIG_S *pstVbPoolCfg); 22 | HI_S32 HI_MPI_VB_DestroyPool(VB_POOL Pool); 23 | 24 | VB_BLK HI_MPI_VB_GetBlock(VB_POOL Pool, HI_U64 u64BlkSize, const HI_CHAR *pcMmzName); 25 | HI_S32 HI_MPI_VB_ReleaseBlock(VB_BLK Block); 26 | 27 | VB_BLK HI_MPI_VB_PhysAddr2Handle(HI_U64 u64PhyAddr); 28 | HI_U64 HI_MPI_VB_Handle2PhysAddr(VB_BLK Block); 29 | VB_POOL HI_MPI_VB_Handle2PoolId(VB_BLK Block); 30 | 31 | HI_S32 HI_MPI_VB_InquireUserCnt(VB_BLK Block); 32 | 33 | HI_S32 HI_MPI_VB_GetSupplementAddr(VB_BLK Block, VIDEO_SUPPLEMENT_S *pstSupplement); 34 | HI_S32 HI_MPI_VB_SetSupplementConfig(const VB_SUPPLEMENT_CONFIG_S *pstSupplementConfig); 35 | HI_S32 HI_MPI_VB_GetSupplementConfig(VB_SUPPLEMENT_CONFIG_S *pstSupplementConfig); 36 | 37 | HI_S32 HI_MPI_VB_Init(HI_VOID); 38 | HI_S32 HI_MPI_VB_Exit(HI_VOID); 39 | HI_S32 HI_MPI_VB_SetConfig(const VB_CONFIG_S *pstVbConfig); 40 | HI_S32 HI_MPI_VB_GetConfig(VB_CONFIG_S *pstVbConfig); 41 | 42 | HI_S32 HI_MPI_VB_MmapPool(VB_POOL Pool); 43 | HI_S32 HI_MPI_VB_MunmapPool(VB_POOL Pool); 44 | 45 | HI_S32 HI_MPI_VB_GetBlockVirAddr(VB_POOL Pool, HI_U64 u64PhyAddr, HI_VOID **ppVirAddr); 46 | 47 | HI_S32 HI_MPI_VB_InitModCommPool(VB_UID_E enVbUid); 48 | HI_S32 HI_MPI_VB_ExitModCommPool(VB_UID_E enVbUid); 49 | 50 | HI_S32 HI_MPI_VB_SetModPoolConfig(VB_UID_E enVbUid, const VB_CONFIG_S *pstVbConfig); 51 | HI_S32 HI_MPI_VB_GetModPoolConfig(VB_UID_E enVbUid, VB_CONFIG_S *pstVbConfig); 52 | 53 | #ifdef __cplusplus 54 | #if __cplusplus 55 | } 56 | #endif 57 | #endif 58 | 59 | #endif /* __MPI_VI_H__ */ 60 | 61 | -------------------------------------------------------------------------------- /include/3536d/mpi_vda.h: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | 3 | Copyright (C), 2001-2011, Hisilicon Tech. Co., Ltd. 4 | 5 | ****************************************************************************** 6 | File Name : mpi_vda.h 7 | Version : Initial Draft 8 | Author : Hisilicon multimedia software group 9 | Created : 2013/05/09 10 | Description : 11 | History : 12 | 1.Date : 2013/05/09 13 | Author : x00100808 14 | Modification: Created file 15 | 16 | ******************************************************************************/ 17 | #ifndef __MPI_VDA_H__ 18 | #define __MPI_VDA_H__ 19 | 20 | #include "hi_comm_vda.h" 21 | 22 | #ifdef __cplusplus 23 | #if __cplusplus 24 | extern "C"{ 25 | #endif 26 | #endif /* End of #ifdef __cplusplus */ 27 | 28 | HI_S32 HI_MPI_VDA_CreateChn(VDA_CHN VdaChn, const VDA_CHN_ATTR_S *pstAttr); 29 | HI_S32 HI_MPI_VDA_DestroyChn(VDA_CHN VdaChn); 30 | 31 | HI_S32 HI_MPI_VDA_GetChnAttr(VDA_CHN VdaChn, VDA_CHN_ATTR_S *pstAttr); 32 | HI_S32 HI_MPI_VDA_SetChnAttr(VDA_CHN VdaChn, const VDA_CHN_ATTR_S *pstAttr); 33 | 34 | HI_S32 HI_MPI_VDA_StartRecvPic(VDA_CHN VdaChn); 35 | HI_S32 HI_MPI_VDA_StopRecvPic(VDA_CHN VdaChn); 36 | 37 | HI_S32 HI_MPI_VDA_GetData(VDA_CHN VdaChn, VDA_DATA_S *pstVdaData, HI_S32 s32MilliSec); 38 | HI_S32 HI_MPI_VDA_ReleaseData(VDA_CHN VdaChn, const VDA_DATA_S* pstVdaData); 39 | 40 | HI_S32 HI_MPI_VDA_ResetOdRegion(VDA_CHN VdaChn, HI_S32 s32RgnIndex); 41 | 42 | HI_S32 HI_MPI_VDA_Query(VDA_CHN VdaChn, VDA_CHN_STAT_S *pstChnStat); 43 | 44 | HI_S32 HI_MPI_VDA_GetFd(VDA_CHN VdaChn); 45 | 46 | HI_S32 HI_MPI_VDA_UpdateRef(VDA_CHN VdaChn, const VIDEO_FRAME_INFO_S *pstRefFrame); 47 | 48 | HI_S32 HI_MPI_VDA_SendPic(VDA_CHN VdaChn, const VIDEO_FRAME_INFO_S *pstUserFrame, HI_S32 s32MilliSec); 49 | 50 | 51 | #ifdef __cplusplus 52 | #if __cplusplus 53 | } 54 | #endif 55 | #endif /* End of #ifdef __cplusplus */ 56 | 57 | #endif /* End of #ifndef __MPI_VDA_H__ */ 58 | 59 | -------------------------------------------------------------------------------- /include/3536d/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 | #ifndef __MPI_AENC_H__ 17 | #define __MPI_AENC_H__ 18 | 19 | #include "hi_common.h" 20 | #include "hi_comm_aio.h" 21 | #include "hi_comm_aenc.h" 22 | 23 | #ifdef __cplusplus 24 | #if __cplusplus 25 | extern "C" 26 | { 27 | #endif 28 | #endif /* __cplusplus */ 29 | 30 | #define AENC_ADAPT_MAGIC 0Xfcfcfcfc 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, const AUDIO_FRAME_S* pstFrm, const AEC_FRAME_S* pstAecFrm); 36 | 37 | HI_S32 HI_MPI_AENC_GetStream(AENC_CHN AeChn, AUDIO_STREAM_S* pstStream, HI_S32 s32MilliSec); 38 | HI_S32 HI_MPI_AENC_ReleaseStream(AENC_CHN AeChn, const AUDIO_STREAM_S* pstStream); 39 | 40 | HI_S32 HI_MPI_AENC_GetFd(AENC_CHN AeChn); 41 | 42 | HI_S32 HI_MPI_AENC_RegeisterEncoder(HI_S32* ps32Handle, AENC_ENCODER_S* pstEncoder); 43 | HI_S32 HI_MPI_AENC_UnRegisterEncoder(HI_S32 s32Handle); 44 | 45 | HI_S32 HI_MPI_AENC_SaveFile(AENC_CHN AeChn, AUDIO_SAVE_FILE_INFO_S* pstSaveFileInfo); 46 | HI_S32 HI_MPI_AENC_QueryFileStatus(AENC_CHN AeChn, AUDIO_FILE_STATUS_S* pstFileStatus); 47 | 48 | HI_S32 HI_MPI_AENC_GetStreamBufInfo(AENC_CHN AeChn, HI_U32* pu32PhysAddr, HI_U32* pu32Size); 49 | 50 | 51 | #ifdef __cplusplus 52 | #if __cplusplus 53 | } 54 | #endif 55 | #endif /* __cplusplus */ 56 | 57 | #endif /* __MPI_AENC_H__ */ 58 | 59 | -------------------------------------------------------------------------------- /include/cv300/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 | #ifndef __MPI_AENC_H__ 17 | #define __MPI_AENC_H__ 18 | 19 | #include "hi_common.h" 20 | #include "hi_comm_aio.h" 21 | #include "hi_comm_aenc.h" 22 | 23 | #ifdef __cplusplus 24 | #if __cplusplus 25 | extern "C" 26 | { 27 | #endif 28 | #endif /* __cplusplus */ 29 | 30 | #define AENC_ADAPT_MAGIC 0Xfcfcfcfc 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, const AUDIO_FRAME_S* pstFrm, const AEC_FRAME_S* pstAecFrm); 36 | 37 | HI_S32 HI_MPI_AENC_GetStream(AENC_CHN AeChn, AUDIO_STREAM_S* pstStream, HI_S32 s32MilliSec); 38 | HI_S32 HI_MPI_AENC_ReleaseStream(AENC_CHN AeChn, const AUDIO_STREAM_S* pstStream); 39 | 40 | HI_S32 HI_MPI_AENC_GetFd(AENC_CHN AeChn); 41 | 42 | HI_S32 HI_MPI_AENC_RegeisterEncoder(HI_S32* ps32Handle, AENC_ENCODER_S* pstEncoder); 43 | HI_S32 HI_MPI_AENC_UnRegisterEncoder(HI_S32 s32Handle); 44 | 45 | HI_S32 HI_MPI_AENC_SaveFile(AENC_CHN AeChn, AUDIO_SAVE_FILE_INFO_S* pstSaveFileInfo); 46 | HI_S32 HI_MPI_AENC_QueryFileStatus(AENC_CHN AeChn, AUDIO_FILE_STATUS_S* pstFileStatus); 47 | 48 | HI_S32 HI_MPI_AENC_GetStreamBufInfo(AENC_CHN AeChn, HI_U32* pu32PhysAddr, HI_U32* pu32Size); 49 | 50 | 51 | #ifdef __cplusplus 52 | #if __cplusplus 53 | } 54 | #endif 55 | #endif /* __cplusplus */ 56 | 57 | #endif /* __MPI_AENC_H__ */ 58 | 59 | -------------------------------------------------------------------------------- /include/SDL/SDL_error.h: -------------------------------------------------------------------------------- 1 | /* 2 | SDL - Simple DirectMedia Layer 3 | Copyright (C) 1997-2012 Sam Lantinga 4 | 5 | This library is free software; you can redistribute it and/or 6 | modify it under the terms of the GNU Lesser General Public 7 | License as published by the Free Software Foundation; either 8 | version 2.1 of the License, or (at your option) any later version. 9 | 10 | This library is distributed in the hope that it will be useful, 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | Lesser General Public License for more details. 14 | 15 | You should have received a copy of the GNU Lesser General Public 16 | License along with this library; if not, write to the Free Software 17 | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 18 | 19 | Sam Lantinga 20 | slouken@libsdl.org 21 | */ 22 | 23 | /** 24 | * @file SDL_error.h 25 | * Simple error message routines for SDL 26 | */ 27 | 28 | #ifndef _SDL_error_h 29 | #define _SDL_error_h 30 | 31 | #include "SDL_stdinc.h" 32 | 33 | #include "begin_code.h" 34 | /* Set up for C function definitions, even when using C++ */ 35 | #ifdef __cplusplus 36 | extern "C" { 37 | #endif 38 | 39 | /** 40 | * @name Public functions 41 | */ 42 | /*@{*/ 43 | extern DECLSPEC void SDLCALL SDL_SetError(const char *fmt, ...); 44 | extern DECLSPEC char * SDLCALL SDL_GetError(void); 45 | extern DECLSPEC void SDLCALL SDL_ClearError(void); 46 | /*@}*/ 47 | 48 | /** 49 | * @name Private functions 50 | * @internal Private error message function - used internally 51 | */ 52 | /*@{*/ 53 | #define SDL_OutOfMemory() SDL_Error(SDL_ENOMEM) 54 | #define SDL_Unsupported() SDL_Error(SDL_UNSUPPORTED) 55 | typedef enum { 56 | SDL_ENOMEM, 57 | SDL_EFREAD, 58 | SDL_EFWRITE, 59 | SDL_EFSEEK, 60 | SDL_UNSUPPORTED, 61 | SDL_LASTERROR 62 | } SDL_errorcode; 63 | extern DECLSPEC void SDLCALL SDL_Error(SDL_errorcode code); 64 | /*@}*/ 65 | 66 | /* Ends C function definitions when using C++ */ 67 | #ifdef __cplusplus 68 | } 69 | #endif 70 | #include "close_code.h" 71 | 72 | #endif /* _SDL_error_h */ 73 | -------------------------------------------------------------------------------- /include/hi_tde_errcode.h: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | Copyright (C), 2016-2018, Hisilicon Tech. Co., Ltd. 3 | ****************************************************************************** 4 | File Name : tde_errcode.h 5 | Version : Initial Draft 6 | Author : sdk 7 | Created : 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_type.h" 17 | 18 | #ifdef __cplusplus 19 | #if __cplusplus 20 | extern "C" { 21 | #endif 22 | #endif /* __cplusplus */ 23 | 24 | /* tde start err no. */ 25 | #define HI_ERR_TDE_BASE ((HI_S32)( ((0x80UL + 0x20UL)<<24) | (100 << 16 ) | (4 << 13) | 1 )) 26 | 27 | enum 28 | { 29 | HI_ERR_TDE_DEV_NOT_OPEN = HI_ERR_TDE_BASE, /**< tde device not open yet */ 30 | HI_ERR_TDE_DEV_OPEN_FAILED, /**< open tde device failed */ 31 | HI_ERR_TDE_NULL_PTR, /**< input parameters contain null ptr */ 32 | HI_ERR_TDE_NO_MEM, /**< malloc failed */ 33 | HI_ERR_TDE_INVALID_HANDLE, /**< invalid job handle */ 34 | HI_ERR_TDE_INVALID_PARA, /**< invalid parameter */ 35 | HI_ERR_TDE_NOT_ALIGNED, /**< aligned error for position, stride, width */ 36 | HI_ERR_TDE_MINIFICATION, /**< invalid minification */ 37 | HI_ERR_TDE_CLIP_AREA, /**< clip area and operation area have no intersection */ 38 | HI_ERR_TDE_JOB_TIMEOUT, /**< blocked job wait timeout */ 39 | HI_ERR_TDE_UNSUPPORTED_OPERATION, /**< unsupported operation */ 40 | HI_ERR_TDE_QUERY_TIMEOUT, /**< query time out */ 41 | HI_ERR_TDE_INTERRUPT /* blocked job was interrupted */ 42 | }; 43 | 44 | 45 | #ifdef __cplusplus 46 | #if __cplusplus 47 | } 48 | #endif 49 | #endif /* __cplusplus */ 50 | 51 | #endif /* __TDE_ERRCODE_H__*/ 52 | 53 | 54 | -------------------------------------------------------------------------------- /CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 2.8) 2 | project(hi_osd C) 3 | 4 | if ("${CROSS_COMPILE}" STREQUAL "") 5 | set(CROSS_COMPILE "arm-himix100-linux-") 6 | endif() 7 | 8 | set(CMAKE_AR ${CROSS_COMPILE}ar) 9 | set(CMAKE_C_COMPILER ${CROSS_COMPILE}gcc) 10 | set(CMAKE_LINKER ${CROSS_COMPILE}ld) 11 | set(CMAKE_OBJCOPY ${CROSS_COMPILE}objcopy) 12 | set(CMAKE_RANLIB ${CROSS_COMPILE}ranlib) 13 | set(CMAKE_SIZE ${CROSS_COMPILE}size) 14 | set(CMAKE_STRIP ${CROSS_COMPILE}strip) 15 | 16 | set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER) 17 | set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY) 18 | set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY) 19 | set(CMAKE_FIND_ROOT_PATH_MODE_PACKAGE ONLY) 20 | 21 | #set(CMAKE_LINK_WHAT_YOU_USE "1") 22 | set(CMAKE_C_FLAGS "-std=gnu99") 23 | set(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE}") 24 | set(CMAKE_PREFIX_PATH ".") 25 | 26 | include_directories( 27 | ${CMAKE_SOURCE_DIR}/include 28 | ${CMAKE_SOURCE_DIR}/common 29 | ) 30 | 31 | link_directories( 32 | ${CMAKE_SOURCE_DIR}/lib 33 | ) 34 | 35 | set(SDLLIBS 36 | # SDL SDL_ttf freetype 37 | ${CMAKE_SOURCE_DIR}/lib/libSDL.a 38 | ${CMAKE_SOURCE_DIR}/lib/libSDL_ttf.a 39 | ${CMAKE_SOURCE_DIR}/lib/libfreetype.a 40 | ) 41 | 42 | set(HILIBS 43 | pthread m dl 44 | mpi upvqe dnvqe VoiceEngine securec 45 | 46 | ) 47 | 48 | set(HILIBS_CV300 49 | pthread m dl 50 | ${CMAKE_SOURCE_DIR}/lib/cv300/libmpi.a 51 | ) 52 | 53 | set(SRC 54 | src/hi_osd.c 55 | common/loadbmp.c 56 | src/sdl.c 57 | ) 58 | 59 | include_directories("../lib/SDL") 60 | 61 | add_executable(${CMAKE_PROJECT_NAME} ${SRC}) 62 | add_executable(${CMAKE_PROJECT_NAME}_cv300 ${SRC}) 63 | 64 | target_compile_definitions(${CMAKE_PROJECT_NAME}_cv300 PRIVATE __16CV300__) 65 | target_compile_definitions(${CMAKE_PROJECT_NAME} PRIVATE __16EV200__) 66 | 67 | target_link_libraries(${CMAKE_PROJECT_NAME} ${HILIBS} ${SDLLIBS}) 68 | target_link_libraries(${CMAKE_PROJECT_NAME}_cv300 ${HILIBS_CV300} ${SDLLIBS}) 69 | 70 | add_custom_command(TARGET ${CMAKE_PROJECT_NAME} POST_BUILD COMMAND "${CMAKE_STRIP}" "hi_osd") 71 | add_custom_command(TARGET ${CMAKE_PROJECT_NAME}_cv300 POST_BUILD COMMAND "${CMAKE_STRIP}" "hi_osd_cv300") 72 | 73 | -------------------------------------------------------------------------------- /include/SDL/SDL_active.h: -------------------------------------------------------------------------------- 1 | /* 2 | SDL - Simple DirectMedia Layer 3 | Copyright (C) 1997-2012 Sam Lantinga 4 | 5 | This library is free software; you can redistribute it and/or 6 | modify it under the terms of the GNU Lesser General Public 7 | License as published by the Free Software Foundation; either 8 | version 2.1 of the License, or (at your option) any later version. 9 | 10 | This library is distributed in the hope that it will be useful, 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | Lesser General Public License for more details. 14 | 15 | You should have received a copy of the GNU Lesser General Public 16 | License along with this library; if not, write to the Free Software 17 | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 18 | 19 | Sam Lantinga 20 | slouken@libsdl.org 21 | */ 22 | 23 | /** 24 | * @file SDL_active.h 25 | * Include file for SDL application focus event handling 26 | */ 27 | 28 | #ifndef _SDL_active_h 29 | #define _SDL_active_h 30 | 31 | #include "SDL_stdinc.h" 32 | #include "SDL_error.h" 33 | 34 | #include "begin_code.h" 35 | /* Set up for C function definitions, even when using C++ */ 36 | #ifdef __cplusplus 37 | extern "C" { 38 | #endif 39 | 40 | /** @name The available application states */ 41 | /*@{*/ 42 | #define SDL_APPMOUSEFOCUS 0x01 /**< The app has mouse coverage */ 43 | #define SDL_APPINPUTFOCUS 0x02 /**< The app has input focus */ 44 | #define SDL_APPACTIVE 0x04 /**< The application is active */ 45 | /*@}*/ 46 | 47 | /* Function prototypes */ 48 | /** 49 | * This function returns the current state of the application, which is a 50 | * bitwise combination of SDL_APPMOUSEFOCUS, SDL_APPINPUTFOCUS, and 51 | * SDL_APPACTIVE. If SDL_APPACTIVE is set, then the user is able to 52 | * see your application, otherwise it has been iconified or disabled. 53 | */ 54 | extern DECLSPEC Uint8 SDLCALL SDL_GetAppState(void); 55 | 56 | 57 | /* Ends C function definitions when using C++ */ 58 | #ifdef __cplusplus 59 | } 60 | #endif 61 | #include "close_code.h" 62 | 63 | #endif /* _SDL_active_h */ 64 | -------------------------------------------------------------------------------- /include/3536d/mpi_region.h: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | 3 | Copyright (C), 2001-2011, Hisilicon Tech. Co., Ltd. 4 | 5 | ****************************************************************************** 6 | File Name : mpi_region.h 7 | Version : Initial Draft 8 | Author : Hisilicon multimedia software group 9 | Created : 2013/05/07 10 | Description : 11 | History : 12 | 1.Date : 2013/05/07 13 | Author : c00191088 14 | Modification: Created file 15 | 16 | ******************************************************************************/ 17 | #ifndef __MPI_REGION_H__ 18 | #define __MPI_REGION_H__ 19 | 20 | #include "hi_comm_region.h" 21 | 22 | #ifdef __cplusplus 23 | #if __cplusplus 24 | extern "C"{ 25 | #endif 26 | #endif /* End of #ifdef __cplusplus */ 27 | 28 | HI_S32 HI_MPI_RGN_Create(RGN_HANDLE Handle, const RGN_ATTR_S *pstRegion); 29 | HI_S32 HI_MPI_RGN_Destroy(RGN_HANDLE Handle); 30 | 31 | HI_S32 HI_MPI_RGN_GetAttr(RGN_HANDLE Handle, RGN_ATTR_S *pstRegion); 32 | HI_S32 HI_MPI_RGN_SetAttr(RGN_HANDLE Handle, const RGN_ATTR_S *pstRegion); 33 | 34 | HI_S32 HI_MPI_RGN_SetBitMap(RGN_HANDLE Handle, const BITMAP_S *pstBitmap); 35 | 36 | HI_S32 HI_MPI_RGN_AttachToChn(RGN_HANDLE Handle, const MPP_CHN_S *pstChn, const RGN_CHN_ATTR_S *pstChnAttr); 37 | HI_S32 HI_MPI_RGN_DetachFromChn(RGN_HANDLE Handle, const MPP_CHN_S *pstChn); 38 | 39 | HI_S32 HI_MPI_RGN_SetDisplayAttr(RGN_HANDLE Handle, const MPP_CHN_S *pstChn, const RGN_CHN_ATTR_S *pstChnAttr); 40 | HI_S32 HI_MPI_RGN_GetDisplayAttr(RGN_HANDLE Handle, const MPP_CHN_S *pstChn, RGN_CHN_ATTR_S *pstChnAttr); 41 | 42 | HI_S32 HI_MPI_RGN_SetAttachField(RGN_HANDLE Handle, VIDEO_FIELD_E enAttachField); 43 | HI_S32 HI_MPI_RGN_GetAttachField(RGN_HANDLE Handle, VIDEO_FIELD_E *penAttachField); 44 | 45 | HI_S32 HI_MPI_RGN_GetCanvasInfo(RGN_HANDLE Handle, RGN_CANVAS_INFO_S *pstCanvasInfo); 46 | HI_S32 HI_MPI_RGN_UpdateCanvas(RGN_HANDLE Handle); 47 | 48 | 49 | #ifdef __cplusplus 50 | #if __cplusplus 51 | } 52 | #endif 53 | #endif /* End of #ifdef __cplusplus */ 54 | 55 | #endif /* End of #ifndef __MPI_REGION_H__ */ 56 | 57 | -------------------------------------------------------------------------------- /include/cv300/mpi_region.h: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | 3 | Copyright (C), 2001-2011, Hisilicon Tech. Co., Ltd. 4 | 5 | ****************************************************************************** 6 | File Name : mpi_region.h 7 | Version : Initial Draft 8 | Author : Hisilicon multimedia software group 9 | Created : 2013/05/07 10 | Description : 11 | History : 12 | 1.Date : 2013/05/07 13 | Author : c00191088 14 | Modification: Created file 15 | 16 | ******************************************************************************/ 17 | #ifndef __MPI_REGION_H__ 18 | #define __MPI_REGION_H__ 19 | 20 | #include "hi_comm_region.h" 21 | 22 | #ifdef __cplusplus 23 | #if __cplusplus 24 | extern "C"{ 25 | #endif 26 | #endif /* End of #ifdef __cplusplus */ 27 | 28 | HI_S32 HI_MPI_RGN_Create(RGN_HANDLE Handle, const RGN_ATTR_S *pstRegion); 29 | HI_S32 HI_MPI_RGN_Destroy(RGN_HANDLE Handle); 30 | 31 | HI_S32 HI_MPI_RGN_GetAttr(RGN_HANDLE Handle, RGN_ATTR_S *pstRegion); 32 | HI_S32 HI_MPI_RGN_SetAttr(RGN_HANDLE Handle, const RGN_ATTR_S *pstRegion); 33 | 34 | HI_S32 HI_MPI_RGN_SetBitMap(RGN_HANDLE Handle, const BITMAP_S *pstBitmap); 35 | 36 | HI_S32 HI_MPI_RGN_AttachToChn(RGN_HANDLE Handle, const MPP_CHN_S *pstChn, const RGN_CHN_ATTR_S *pstChnAttr); 37 | HI_S32 HI_MPI_RGN_DetachFromChn(RGN_HANDLE Handle, const MPP_CHN_S *pstChn); 38 | 39 | HI_S32 HI_MPI_RGN_SetDisplayAttr(RGN_HANDLE Handle, const MPP_CHN_S *pstChn, const RGN_CHN_ATTR_S *pstChnAttr); 40 | HI_S32 HI_MPI_RGN_GetDisplayAttr(RGN_HANDLE Handle, const MPP_CHN_S *pstChn, RGN_CHN_ATTR_S *pstChnAttr); 41 | 42 | HI_S32 HI_MPI_RGN_SetAttachField(RGN_HANDLE Handle, VIDEO_FIELD_E enAttachField); 43 | HI_S32 HI_MPI_RGN_GetAttachField(RGN_HANDLE Handle, VIDEO_FIELD_E *penAttachField); 44 | 45 | HI_S32 HI_MPI_RGN_GetCanvasInfo(RGN_HANDLE Handle, RGN_CANVAS_INFO_S *pstCanvasInfo); 46 | HI_S32 HI_MPI_RGN_UpdateCanvas(RGN_HANDLE Handle); 47 | 48 | 49 | #ifdef __cplusplus 50 | #if __cplusplus 51 | } 52 | #endif 53 | #endif /* End of #ifdef __cplusplus */ 54 | 55 | #endif /* End of #ifndef __MPI_REGION_H__ */ 56 | 57 | -------------------------------------------------------------------------------- /include/SDL/SDL_quit.h: -------------------------------------------------------------------------------- 1 | /* 2 | SDL - Simple DirectMedia Layer 3 | Copyright (C) 1997-2012 Sam Lantinga 4 | 5 | This library is free software; you can redistribute it and/or 6 | modify it under the terms of the GNU Lesser General Public 7 | License as published by the Free Software Foundation; either 8 | version 2.1 of the License, or (at your option) any later version. 9 | 10 | This library is distributed in the hope that it will be useful, 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | Lesser General Public License for more details. 14 | 15 | You should have received a copy of the GNU Lesser General Public 16 | License along with this library; if not, write to the Free Software 17 | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 18 | 19 | Sam Lantinga 20 | slouken@libsdl.org 21 | */ 22 | 23 | /** @file SDL_quit.h 24 | * Include file for SDL quit event handling 25 | */ 26 | 27 | #ifndef _SDL_quit_h 28 | #define _SDL_quit_h 29 | 30 | #include "SDL_stdinc.h" 31 | #include "SDL_error.h" 32 | 33 | /** @file SDL_quit.h 34 | * An SDL_QUITEVENT is generated when the user tries to close the application 35 | * window. If it is ignored or filtered out, the window will remain open. 36 | * If it is not ignored or filtered, it is queued normally and the window 37 | * is allowed to close. When the window is closed, screen updates will 38 | * complete, but have no effect. 39 | * 40 | * SDL_Init() installs signal handlers for SIGINT (keyboard interrupt) 41 | * and SIGTERM (system termination request), if handlers do not already 42 | * exist, that generate SDL_QUITEVENT events as well. There is no way 43 | * to determine the cause of an SDL_QUITEVENT, but setting a signal 44 | * handler in your application will override the default generation of 45 | * quit events for that signal. 46 | */ 47 | 48 | /** @file SDL_quit.h 49 | * There are no functions directly affecting the quit event 50 | */ 51 | 52 | #define SDL_QuitRequested() \ 53 | (SDL_PumpEvents(), SDL_PeepEvents(NULL,0,SDL_PEEKEVENT,SDL_QUITMASK)) 54 | 55 | #endif /* _SDL_quit_h */ 56 | -------------------------------------------------------------------------------- /include/hi_isp_bin.h: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | 3 | Copyright (C), 2016, Hisilicon Tech. Co., Ltd. 4 | 5 | ****************************************************************************** 6 | File Name : hi_isp_bin.h 7 | Version : Initial Draft 8 | Author : Hisilicon multimedia software group 9 | Created : 2015/01/14 10 | Description : 11 | History : 12 | 1.Date : 2015/01/14 13 | Author : 14 | Modification: Created file 15 | 16 | ******************************************************************************/ 17 | 18 | #ifndef __HI_ISP_BIN_H__ 19 | #define __HI_ISP_BIN_H__ 20 | 21 | #include "hi_type.h" 22 | #include "hi_comm_isp.h" 23 | 24 | #ifdef __cplusplus 25 | #if __cplusplus 26 | extern "C" { 27 | #endif 28 | #endif /* End of #ifdef __cplusplus */ 29 | 30 | /**************************************************************************** 31 | * MACRO DEFINITION * 32 | ****************************************************************************/ 33 | #define MAX_BIN_REG_NUM 5 34 | 35 | /**************************************************************************** 36 | * GENERAL STRUCTURES * 37 | ****************************************************************************/ 38 | typedef struct hiISP_BIN_REG_ATTR_S { 39 | HI_U32 u32Addr; /* register addr */ 40 | HI_U8 u8StartBit; /* start bit of register addr */ 41 | HI_U8 u8EndBit; /* end bit of register addr */ 42 | } ISP_BIN_REG_ATTR_S; 43 | 44 | /* -------------------------------------------* 45 | The base addr of ISP logic register 46 | The base addr of ISP ext register 47 | The base addr of Hisi AE ext register 48 | The base addr of Hisi AWB ext register 49 | * ------------------------------------------- */ 50 | 51 | ISP_BIN_REG_ATTR_S g_astIspBinRegAttr[ISP_MAX_PIPE_NUM][MAX_BIN_REG_NUM] = { 52 | [0 ...(ISP_MAX_PIPE_NUM - 1)] = {0} 53 | }; 54 | 55 | 56 | #ifdef __cplusplus 57 | #if __cplusplus 58 | } 59 | #endif 60 | #endif /* End of #ifdef __cplusplus */ 61 | 62 | #endif /* __HI_ISP_BIN_H__ */ 63 | -------------------------------------------------------------------------------- /include/3536d/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 | #ifdef __cplusplus 22 | #if __cplusplus 23 | extern "C"{ 24 | #endif 25 | #endif /* End of #ifdef __cplusplus */ 26 | 27 | VB_POOL HI_MPI_VB_CreatePool(HI_U32 u32BlkSize,HI_U32 u32BlkCnt,const HI_CHAR *pcMmzName); 28 | HI_S32 HI_MPI_VB_DestroyPool(VB_POOL Pool); 29 | 30 | VB_BLK HI_MPI_VB_GetBlock(VB_POOL Pool, HI_U32 u32BlkSize,const HI_CHAR *pcMmzName); 31 | HI_S32 HI_MPI_VB_ReleaseBlock(VB_BLK Block); 32 | 33 | HI_U32 HI_MPI_VB_Handle2PhysAddr(VB_BLK Block); 34 | VB_POOL HI_MPI_VB_Handle2PoolId(VB_BLK Block); 35 | HI_S32 HI_MPI_VB_InquireUserCnt(VB_BLK Block); 36 | 37 | HI_S32 HI_MPI_VB_Init(HI_VOID); 38 | HI_S32 HI_MPI_VB_Exit(HI_VOID); 39 | HI_S32 HI_MPI_VB_SetConf(const VB_CONF_S *pstVbConf); 40 | HI_S32 HI_MPI_VB_GetConf(VB_CONF_S *pstVbConf); 41 | 42 | HI_S32 HI_MPI_VB_MmapPool(VB_POOL Pool); 43 | HI_S32 HI_MPI_VB_MunmapPool(VB_POOL Pool); 44 | 45 | HI_S32 HI_MPI_VB_GetBlkVirAddr(VB_POOL Pool, HI_U32 u32PhyAddr, HI_VOID **ppVirAddr); 46 | 47 | HI_S32 HI_MPI_VB_InitModCommPool(VB_UID_E enVbUid); 48 | HI_S32 HI_MPI_VB_ExitModCommPool(VB_UID_E enVbUid); 49 | 50 | HI_S32 HI_MPI_VB_SetModPoolConf(VB_UID_E enVbUid, const VB_CONF_S *pstVbConf); 51 | HI_S32 HI_MPI_VB_GetModPoolConf(VB_UID_E enVbUid, VB_CONF_S *pstVbConf); 52 | 53 | VB_POOL HI_MPI_VB_CreateVirtualVbPool(HI_U32 u32BlkCnt, const HI_CHAR *pcMmzName); 54 | VB_BLK HI_MPI_VB_AddBlock(VB_POOL Pool , HI_U32 u32PhyAddr, HI_U32 u32Size); 55 | 56 | #ifdef __cplusplus 57 | #if __cplusplus 58 | } 59 | #endif 60 | #endif /* End of #ifdef __cplusplus */ 61 | 62 | #endif /*__MPI_VI_H__ */ 63 | 64 | -------------------------------------------------------------------------------- /include/cv300/mpi_af.h: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | 3 | Copyright (C), 2001-2011, Hisilicon Tech. Co., Ltd. 4 | 5 | ****************************************************************************** 6 | File Name : mpi_af.h 7 | Version : Initial Draft 8 | Author : Hisilicon multimedia software group 9 | Created : 2012/12/19 10 | Description : 11 | History : 12 | 1.Date : 2012/12/19 13 | Author : n00168968 14 | Modification: Created file 15 | 16 | ******************************************************************************/ 17 | #ifndef __MPI_AF_H__ 18 | #define __MPI_AF_H__ 19 | 20 | #include "hi_comm_isp.h" 21 | #include "hi_comm_3a.h" 22 | #include "hi_af_comm.h" 23 | 24 | #ifdef __cplusplus 25 | #if __cplusplus 26 | extern "C"{ 27 | #endif 28 | #endif /* End of #ifdef __cplusplus */ 29 | 30 | /* The interface of af lib register to isp. */ 31 | HI_S32 HI_MPI_AF_Register(ISP_DEV IspDev, ALG_LIB_S *pstAfLib); 32 | HI_S32 HI_MPI_AF_UnRegister(ISP_DEV IspDev, ALG_LIB_S *pstAfLib); 33 | 34 | #if 0 35 | /* The callback function of sensor register to af lib. */ 36 | HI_S32 hi_af_sensor_register_cb(ALG_LIB_S *pstAfLib, SENSOR_ID SensorId, 37 | CMOS_ISP_AF_DEFAULT_S *pstSnsDft, SENSOR_AF_EXP_FUNC_S *pstSnsExp); 38 | #endif 39 | 40 | /* The new awb lib is compatible with the old mpi interface. */ 41 | HI_S32 HI_MPI_ISP_SetFocusType(ISP_DEV IspDev, ISP_OP_TYPE_E enFocusType); //not support yet 42 | HI_S32 HI_MPI_ISP_GetFocusType(ISP_DEV IspDev, ISP_OP_TYPE_E *penFocusType); //not support yet 43 | 44 | HI_S32 HI_MPI_ISP_SetAFAttr(ISP_DEV IspDev, const ISP_AF_ATTR_S *pstAFAttr); //not support yet 45 | HI_S32 HI_MPI_ISP_GetAFAttr(ISP_DEV IspDev, ISP_AF_ATTR_S *pstAFAttr); //not support yet 46 | 47 | HI_S32 HI_MPI_ISP_SetMFAttr(ISP_DEV IspDev, const ISP_MF_ATTR_S *pstMFAttr); //not support yet 48 | HI_S32 HI_MPI_ISP_GetMFAttr(ISP_DEV IspDev, ISP_MF_ATTR_S *pstMFAttr); //not support yet 49 | 50 | HI_S32 HI_MPI_ISP_ManualFocusMove(ISP_DEV IspDev, HI_S32 s32MoveSteps); //not support yet 51 | 52 | 53 | #ifdef __cplusplus 54 | #if __cplusplus 55 | } 56 | #endif 57 | #endif /* End of #ifdef __cplusplus */ 58 | 59 | #endif 60 | 61 | -------------------------------------------------------------------------------- /include/cv300/viu_ext.h: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | 3 | Copyright (C), 2001-2011, Hisilicon Tech. Co., Ltd. 4 | 5 | ****************************************************************************** 6 | File Name : viu_ext.h 7 | Version : Initial Draft 8 | Author : Hisilicon multimedia software group 9 | Created : 2015/01/15 10 | Description : 11 | History : 12 | 1.Date : 2015/01/15 13 | Author : w00250866 14 | Modification: Created file 15 | 16 | ******************************************************************************/ 17 | #ifndef __VIU_EXT_H__ 18 | #define __VIU_EXT_H__ 19 | 20 | #include "hi_type.h" 21 | 22 | #ifdef __cplusplus 23 | #if __cplusplus 24 | extern "C"{ 25 | #endif 26 | #endif /* End of #ifdef __cplusplus */ 27 | 28 | typedef struct hiVIU_FLASH_CALLBACK_S 29 | { 30 | HI_S32 (*pfnViuGetFlashStatus) (HI_VOID); 31 | } VIU_FLASH_CALLBACK_S; 32 | 33 | typedef struct hiVIU_DUMPRAW_CALLBACK_S 34 | { 35 | HI_S32 (*pfnViuGetRawStatus) (HI_S32 ViDev,VIDEO_FRAME_INFO_S *pstFrameInfo); 36 | } VIU_DUMPRAW_CALLBACK_S; 37 | 38 | typedef HI_S32 FN_VI_RegisterFlashCallBack(HI_S32 ViDev, VIU_FLASH_CALLBACK_S *pstFlashCb); 39 | typedef HI_S32 FN_VI_RegisterDumpRawCallBack(HI_S32 ViDev, VIU_DUMPRAW_CALLBACK_S *pstDumpRawCb); 40 | 41 | 42 | typedef struct hiVIU_EXPORT_FUNC_S 43 | { 44 | FN_VI_RegisterFlashCallBack *pfnViRegisterFlashCallBack; 45 | FN_VI_RegisterDumpRawCallBack *pfnViRegisterDumpRawCallBack; 46 | }VIU_EXPORT_FUNC_S; 47 | 48 | 49 | extern VIU_EXPORT_FUNC_S g_stViuExpFunc; 50 | 51 | #define CKFN_VIU_RegisterFlashCallBack()\ 52 | (NULL != g_stViuExpFunc.pfnViRegisterFlashCallBack) 53 | #define CALL_VIU_RegisterFlashCallBack(ViDev,pstFlashCb)\ 54 | g_stViuExpFunc.pfnViRegisterFlashCallBack(ViDev,pstFlashCb) 55 | 56 | 57 | #define CKFN_VIU_RegisterDumpRawCallBack()\ 58 | (NULL != g_stViuExpFunc.pfnViRegisterDumpRawCallBack) 59 | #define CALL_VIU_RegisterDumpRawCallBack(ViDev,pstDumpRawCb)\ 60 | g_stViuExpFunc.pfnViRegisterDumpRawCallBack(ViDev,pstDumpRawCb) 61 | 62 | #ifdef __cplusplus 63 | #if __cplusplus 64 | } 65 | #endif 66 | #endif /* End of #ifdef __cplusplus */ 67 | 68 | #endif 69 | 70 | -------------------------------------------------------------------------------- /src/sdl.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include 5 | #include 6 | #include 7 | #include 8 | #include 9 | #include 10 | #include 11 | #include "sample_comm.h" 12 | #include "SDL/SDL.h" 13 | #include "SDL/SDL_ttf.h" 14 | #include "loadbmp.h" 15 | static char tmp[64]; 16 | static TTF_Font *font; 17 | static SDL_Surface *text, *temp; 18 | static SDL_Rect bounds; 19 | static BITMAP_S stBitmap; 20 | extern int FontSize; 21 | 22 | BITMAP_S SDL_OSDtoBMP(HI_S32 HandleNum, char *FontFile, int FontSize, char *tmp) 23 | { 24 | int s32Ret; 25 | static unsigned char Count=0; 26 | if (TTF_Init() < 0 ) 27 | { 28 | fprintf(stderr, "Couldn't initialize TTF: %s\n",SDL_GetError()); 29 | SDL_Quit(); 30 | } 31 | font = TTF_OpenFont(FontFile, FontSize); 32 | if ( font == NULL ) 33 | { 34 | fprintf(stderr, "Couldn't load %d pt font from %s: %s\n", 35 | "ptsize", 18, SDL_GetError()); 36 | } 37 | SDL_Color fgcolor= { 0xFF, 0xFF, 0xFF, 0x00 }, bgcolor= {0x00, 0xff, 0xff, 0xff}; 38 | //TTF_SetFontOutline(font, 1); 39 | TTF_SetFontHinting(font, TTF_HINTING_NORMAL); 40 | //TTF_SetFontStyle(font, TTF_STYLE_BOLD); 41 | //text = TTF_RenderUTF8_Solid(font, tmp, fgcolor); 42 | text = TTF_RenderUTF8_Shaded(font, tmp, fgcolor,bgcolor); 43 | SDL_PixelFormat *fmt; 44 | fmt = (SDL_PixelFormat*)malloc(sizeof(SDL_PixelFormat)); 45 | memset(fmt,0,sizeof(SDL_PixelFormat)); 46 | fmt->BitsPerPixel = 16; 47 | fmt->BytesPerPixel = 2; 48 | fmt->colorkey = 0xffffffff; 49 | fmt->alpha = 0xff; 50 | SDL_Surface *temp = SDL_ConvertSurface(text,fmt,0); 51 | SDL_SaveBMP(temp, "sys_time.bmp"); 52 | stBitmap.u32Width = temp->pitch/2; 53 | stBitmap.u32Height = temp->h; 54 | stBitmap.pData= temp->pixels; 55 | stBitmap.enPixelFormat= PIXEL_FORMAT_ARGB_1555; 56 | s32Ret = HI_MPI_RGN_SetBitMap(HandleNum,&stBitmap); 57 | if(s32Ret != HI_SUCCESS) { 58 | printf("HI_MPI_RGN_SetBitMap failed with %#x!\n", s32Ret); 59 | } 60 | SDL_FreeSurface(text); 61 | SDL_FreeSurface(temp); 62 | TTF_CloseFont(font); 63 | TTF_Quit(); 64 | return stBitmap; 65 | } 66 | -------------------------------------------------------------------------------- /include/3536d/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_type.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 | HI_ERR_TDE_INTERRUPT /**< blocked job was interrupted */ 44 | }; 45 | 46 | 47 | #ifdef __cplusplus 48 | #if __cplusplus 49 | } 50 | #endif 51 | #endif /* __cplusplus */ 52 | 53 | #endif /* __TDE_ERRCODE_H__*/ 54 | 55 | 56 | -------------------------------------------------------------------------------- /include/hi_types.h: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | Copyright (C), 2001-2011, Hisilicon Tech. Co., Ltd. 3 | ****************************************************************************** 4 | File Name : hi_types.h 5 | Version : Initial Draft 6 | Author : Hisilicon multimedia software group 7 | Created : 2005/4/23 8 | Last Modified : 9 | Description : Common data types of the system. 10 | Function List : 11 | History : 12 | ******************************************************************************/ 13 | #ifndef __HI_TYPES_H__ 14 | #define __HI_TYPES_H__ 15 | 16 | #include "hi_type.h" 17 | 18 | #ifdef __cplusplus 19 | #if __cplusplus 20 | extern "C" { 21 | #endif 22 | #endif /* __cplusplus */ 23 | 24 | /*--------------------------------------------------------------------------------------------------------------* 25 | * Defintion of basic data types. The data types are applicable to both the application layer and kernel codes. * 26 | *--------------------------------------------------------------------------------------------------------------*/ 27 | /*************************** Structure Definition ****************************/ 28 | /** \addtogroup Common_TYPE */ 29 | /** @{ */ /** |<--- 8bit --->|<--- 8bit --->| 36 | |--------------------------------------------------------------| 37 | | HI_MOD_ID_E | mod defined data | chnID | 38 | |--------------------------------------------------------------| 39 | 40 | mod defined data: private data define by each module(for example: sub-mod id), usually, set to 0. 41 | */ 42 | 43 | #define HI_HANDLE_MAKEHANDLE(mod, privatedata, chnid) (hi_handle)( (((mod)& 0xffff) << 16) | ((((privatedata)& 0xff) << 8) ) | (((chnid) & 0xff)) ) 44 | 45 | #define HI_HANDLE_GET_MODID(handle) (((handle) >> 16) & 0xffff) 46 | #define HI_HANDLE_GET_PriDATA(handle) (((handle) >> 8) & 0xff) 47 | #define HI_HANDLE_GET_CHNID(handle) (((handle)) & 0xff) 48 | 49 | 50 | /** @} */ /**