1 /* GPL-2.0 WITH Linux-syscall-note OR Apache 2.0 */ 2 /* Copyright (c) 2021 Fuzhou Rockchip Electronics Co., Ltd */ 3 4 #ifndef INCLUDE_RT_MPI_RK_COMMON_SYS_H_ 5 #define INCLUDE_RT_MPI_RK_COMMON_SYS_H_ 6 7 #include "rk_type.h" 8 #include "rk_errno.h" 9 // #include "rk_debug.h" 10 #include "rk_comm_video.h" 11 12 #ifdef __cplusplus 13 #if __cplusplus 14 extern "C" { 15 #endif 16 #endif /* End of #ifdef __cplusplus */ 17 18 #define BIND_DEST_MAXNUM 64 19 20 #define RK_TRACE_SYS(level, fmt, ...) \ 21 do { \ 22 RK_TRACE(level, RK_ID_SYS, "[Func]:%s [Line]:%d [Info]:" fmt, __FUNCTION__, __LINE__, ##__VA_ARGS__); \ 23 } while (0) 24 25 typedef struct rkVPSS_VENC_WRAP_PARAM_S { 26 RK_BOOL bAllOnline; 27 /* 28 * Input frame rate of VIPROC(linear/Frame mode WDR is the 29 * sensor frame rate, and the line mode WDR is the frame 30 * rate after synthesis) 31 */ 32 RK_U32 u32FrameRate; 33 RK_U32 u32FullLinesStd; /* Total height of sensor, include of VBlank */ 34 35 SIZE_S stLargeStreamSize; /* VENC Large Stream Size */ 36 SIZE_S stSmallStreamSize; /* VENC Small Stream Size */ 37 } VPSS_VENC_WRAP_PARAM_S; 38 39 typedef struct rkMPP_SYS_CONFIG_S { 40 RK_U32 u32Align; 41 } MPP_SYS_CONFIG_S; 42 43 typedef struct rkSYS_VIRMEM_INFO_S { 44 RK_U64 u64PhyAddr; 45 RK_BOOL bCached; 46 } SYS_VIRMEM_INFO_S; 47 48 typedef struct rkMPP_BIND_DEST_S { 49 RK_U32 u32Num; 50 MPP_CHN_S astMppChn[BIND_DEST_MAXNUM]; 51 } MPP_BIND_DEST_S; 52 53 typedef enum rkSCALE_RANGE_E { 54 SCALE_RANGE_0 = 0, /* scale range < 8/64 */ 55 SCALE_RANGE_1, /* scale range >= 8/64 */ 56 SCALE_RANGE_2, /* scale range >= 10/64 */ 57 SCALE_RANGE_3, /* scale range >= 15/64 */ 58 SCALE_RANGE_4, /* scale range >= 19/64 */ 59 SCALE_RANGE_5, /* scale range >= 24/64 */ 60 SCALE_RANGE_6, /* scale range >= 29/64 */ 61 SCALE_RANGE_7, /* scale range >= 33/64 */ 62 SCALE_RANGE_8, /* scale range >= 35/64 */ 63 SCALE_RANGE_9, /* scale range >= 38/64 */ 64 SCALE_RANGE_10, /* scale range >= 42/64 */ 65 SCALE_RANGE_11, /* scale range >= 45/64 */ 66 SCALE_RANGE_12, /* scale range >= 48/64 */ 67 SCALE_RANGE_13, /* scale range >= 51/64 */ 68 SCALE_RANGE_14, /* scale range >= 53/64 */ 69 SCALE_RANGE_15, /* scale range >= 55/64 */ 70 SCALE_RANGE_16, /* scale range >= 57/64 */ 71 SCALE_RANGE_17, /* scale range >= 60/64 */ 72 SCALE_RANGE_18, /* scale range > 1 */ 73 SCALE_RANGE_BUTT, 74 } SCALE_RANGE_E; 75 76 typedef enum rkCOEFF_LEVEL_E { 77 COEFF_LEVEL_0 = 0, /* coefficient level 0 */ 78 COEFF_LEVEL_1, /* coefficient level 1 */ 79 COEFF_LEVEL_2, /* coefficient level 2 */ 80 COEFF_LEVEL_3, /* coefficient level 3 */ 81 COEFF_LEVEL_4, /* coefficient level 4 */ 82 COEFF_LEVEL_5, /* coefficient level 5 */ 83 COEFF_LEVEL_6, /* coefficient level 6 */ 84 COEFF_LEVEL_7, /* coefficient level 7 */ 85 COEFF_LEVEL_8, /* coefficient level 8 */ 86 COEFF_LEVEL_9, /* coefficient level 9 */ 87 COEFF_LEVEL_10, /* coefficient level 10 */ 88 COEFF_LEVEL_11, /* coefficient level 11 */ 89 COEFF_LEVEL_12, /* coefficient level 12 */ 90 COEFF_LEVEL_13, /* coefficient level 13 */ 91 COEFF_LEVEL_14, /* coefficient level 14 */ 92 COEFF_LEVEL_15, /* coefficient level 15 */ 93 COEFF_LEVEL_16, /* coefficient level 16 */ 94 COEFF_LEVEL_17, /* coefficient level 17 */ 95 COEFF_LEVEL_18, /* coefficient level 18 */ 96 COEFF_LEVEL_BUTT, 97 } COEFF_LEVEL_E; 98 99 typedef struct rkSCALE_COEFF_LEVEL_S { 100 COEFF_LEVEL_E enHorLum; /* horizontal luminance coefficient level */ 101 COEFF_LEVEL_E enHorChr; /* horizontal chrominance coefficient level */ 102 COEFF_LEVEL_E enVerLum; /* vertical luminance coefficient level */ 103 COEFF_LEVEL_E enVerChr; /* vertical chrominance coefficient level */ 104 } SCALE_COEFF_LEVEL_S; 105 106 typedef struct rkSCALE_RANGE_S { 107 SCALE_RANGE_E enHorizontal; 108 SCALE_RANGE_E enVertical; 109 } SCALE_RANGE_S; 110 111 typedef struct rkSCALE_COEFF_INFO_S { 112 SCALE_RANGE_S stScaleRange; 113 SCALE_COEFF_LEVEL_S stScaleCoeffLevel; 114 } SCALE_COEFF_INFO_S; 115 116 typedef struct rkGPS_INFO_S { 117 /* 118 * GPS LatitudeRef Indicates whether the latitude 119 * is north or south latitude,'N'/'S', default 'N' 120 */ 121 RK_CHAR chGPSLatitudeRef; 122 /* 123 * GPS Latitude is expressed as degrees, minutes and 124 * seconds,a typical format like "dd/1,mm/1,ss/1", 125 * default 0/0, 0/0, 0/0 126 */ 127 RK_U32 au32GPSLatitude[3][2]; 128 /* 129 * GPS LongitudeRef Indicates whether the longitude 130 * is east or west longitude, 'E'/'W', default 'E' 131 */ 132 RK_CHAR chGPSLongitudeRef; 133 /* 134 * GPS Longitude is expressed as degrees, minutes 135 * and seconds,a typical format like "dd/1,mm/1,ss/1", 136 * default 0/0, 0/0, 0/0 137 */ 138 RK_U32 au32GPSLongitude[3][2]; 139 /* 140 * GPS AltitudeRef Indicates the reference altitude 141 * used, 0 - above sea level, 1 - below sea level 142 * default 0 143 */ 144 RK_U8 u8GPSAltitudeRef; 145 /* 146 * GPS AltitudeRef Indicates the altitude based on 147 * the reference u8GPSAltitudeRef, the reference unit 148 * is meters, default 0/0 149 */ 150 RK_U32 au32GPSAltitude[2]; 151 } GPS_INFO_S; 152 153 typedef enum rkCHN_INPUT_MODE_E { 154 CHN_INPUT_MODE_NORMAL, /* CHN receive all packet */ 155 CHN_INPUT_MODE_REMAIN_NEWEST, /* CHN remain newest packet */ 156 CHN_INPUT_MODE_DROP_ALWAYS, /* CHN drop all packet */ 157 CHN_INPUT_MODE_BUTT 158 } CHN_INPUT_MODE_E; 159 160 typedef struct rkRAW_FRAME_COMPRESS_PARAM_S { 161 RK_U32 u32CompRatio_10Bit; /* compression ratio of 10 bit */ 162 RK_U32 u32CompRatio_12Bit; /* compression ratio of 12 bit */ 163 RK_U32 u32CompRatio_14Bit; /* compression ratio of 14 bit */ 164 } RAW_FRAME_COMPRESS_PARAM_S; 165 166 #define RK_ERR_SYS_NULL_PTR RK_DEF_ERR(RK_ID_SYS, RK_ERR_LEVEL_ERROR, RK_ERR_NULL_PTR) 167 #define RK_ERR_SYS_NOTREADY RK_DEF_ERR(RK_ID_SYS, RK_ERR_LEVEL_ERROR, RK_ERR_NOTREADY) 168 #define RK_ERR_SYS_NOT_PERM RK_DEF_ERR(RK_ID_SYS, RK_ERR_LEVEL_ERROR, RK_ERR_NOT_PERM) 169 #define RK_ERR_SYS_NOMEM RK_DEF_ERR(RK_ID_SYS, RK_ERR_LEVEL_ERROR, RK_ERR_NOMEM) 170 #define RK_ERR_SYS_ILLEGAL_PARAM RK_DEF_ERR(RK_ID_SYS, RK_ERR_LEVEL_ERROR, RK_ERR_ILLEGAL_PARAM) 171 #define RK_ERR_SYS_BUSY RK_DEF_ERR(RK_ID_SYS, RK_ERR_LEVEL_ERROR, RK_ERR_BUSY) 172 #define RK_ERR_SYS_NOT_SUPPORT RK_DEF_ERR(RK_ID_SYS, RK_ERR_LEVEL_ERROR, RK_ERR_NOT_SUPPORT) 173 174 #ifdef __cplusplus 175 #if __cplusplus 176 } 177 #endif 178 #endif /* __cplusplus */ 179 180 #endif /* INCLUDE_RT_MPI_RK_COMMON_SYS_H_ */ 181 182