1 /* GPL-2.0 WITH Linux-syscall-note OR Apache 2.0 */ 2 /* Copyright (c) 2022 Fuzhou Rockchip Electronics Co., Ltd */ 3 4 #ifndef INCLUDE_RT_MPI_RK_COMM_PVS_H_ 5 6 #define INCLUDE_RT_MPI_RK_COMM_PVS_H_ 7 #include "rk_type.h" 8 #include "rk_errno.h" 9 #include "rk_common.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 typedef RK_S32 PVS_DEV; 19 typedef RK_S32 PVS_CHN; 20 #define PVS_MAX_DEV_NUM 16 21 #define PVS_MAX_CHN_NUM 128 22 23 typedef enum rkPVS_STITCH_MODE_E { 24 STITCH_MODE_PREVIEW = 0, 25 STITCH_MODE_PLAYBACK, 26 STITCH_MODE_BUTT 27 } PVS_STITCH_MODE_E; 28 29 typedef struct rkPVS_POINT_S { 30 RK_S32 s32X; 31 RK_S32 s32Y; 32 } PVS_POINT_S; 33 34 typedef struct rkPVS_SIZE_S { 35 RK_U32 u32Width; 36 RK_U32 u32Height; 37 } PVS_SIZE_S; 38 39 typedef struct rkPVS_RECT_S { 40 RK_S32 s32X; 41 RK_S32 s32Y; 42 RK_U32 u32Width; 43 RK_U32 u32Height; 44 } PVS_RECT_S; 45 46 typedef struct rkPVS_CHN_ATTR_S { 47 PVS_RECT_S stRect; 48 } PVS_CHN_ATTR_S; 49 50 typedef struct rkPVS_CHN_PARAM_S { 51 RK_S32 s32ChnFrmRate; 52 RK_S32 s32RecvThreshold; 53 PVS_STITCH_MODE_E enStitchMod; 54 } PVS_CHN_PARAM_S; 55 56 typedef struct rkPVS_DEV_ATTR_S { 57 PVS_SIZE_S stSize; 58 PIXEL_FORMAT_E enPixelFormat; 59 COMPRESS_MODE_E enCompMode; 60 RK_S32 s32StitchFrmRt; 61 } PVS_DEV_ATTR_S; 62 63 /* invalid device ID */ 64 #define RK_ERR_PVS_INVALID_DEVID RK_DEF_ERR(RK_ID_PVS, RK_ERR_LEVEL_ERROR, RK_ERR_INVALID_DEVID) 65 /* invalid channel ID */ 66 #define RK_ERR_PVS_INVALID_CHNID RK_DEF_ERR(RK_ID_PVS, RK_ERR_LEVEL_ERROR, RK_ERR_INVALID_CHNID) 67 /* at lease one parameter is illegal ,eg, an illegal enumeration value */ 68 #define RK_ERR_PVS_ILLEGAL_PARAM RK_DEF_ERR(RK_ID_PVS, RK_ERR_LEVEL_ERROR, RK_ERR_ILLEGAL_PARAM) 69 /* unexist device or channel */ 70 #define RK_ERR_PVS_UNEXIST RK_DEF_ERR(RK_ID_PVS, RK_ERR_LEVEL_ERROR, RK_ERR_UNEXIST) 71 /* using a NULL point */ 72 #define RK_ERR_PVS_NULL_PTR RK_DEF_ERR(RK_ID_PVS, RK_ERR_LEVEL_ERROR, RK_ERR_NULL_PTR) 73 /* attr or params not config */ 74 #define RK_ERR_PVS_NOT_CONFIG RK_DEF_ERR(RK_ID_PVS, RK_ERR_LEVEL_ERROR, RK_ERR_NOT_CONFIG) 75 /* failure caused by malloc buffer */ 76 #define RK_ERR_PVS_NOBUF RK_DEF_ERR(RK_ID_PVS, RK_ERR_LEVEL_ERROR, RK_ERR_NOBUF) 77 /* no data in buffer */ 78 #define RK_ERR_PVS_BUF_EMPTY RK_DEF_ERR(RK_ID_PVS, RK_ERR_LEVEL_ERROR, RK_ERR_BUF_EMPTY) 79 /* no buffer for new data */ 80 #define RK_ERR_PVS_BUF_FULL RK_DEF_ERR(RK_ID_PVS, RK_ERR_LEVEL_ERROR, RK_ERR_BUF_FULL) 81 82 #ifdef __cplusplus 83 #if __cplusplus 84 } 85 #endif 86 #endif /* __cplusplus */ 87 88 #endif /* INCLUDE_RT_MPI_RK_COMMON_PVS_H_ */ 89