|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#ifndef __VPU_H__ |
|
#define __VPU_H__ |
|
|
|
#ifdef __cplusplus |
|
extern "C" { |
|
#endif |
|
|
|
#include "rk_type.h" |
|
|
|
#define VPU_SUCCESS (0) |
|
#define VPU_FAILURE (-1) |
|
|
|
#define VPU_HW_WAIT_OK VPU_SUCCESS |
|
#define VPU_HW_WAIT_ERROR VPU_FAILURE |
|
#define VPU_HW_WAIT_TIMEOUT 1 |
|
|
|
|
|
#define VPU_REG_NUM_DEC (60) |
|
|
|
#define VPU_REG_NUM_PP (41) |
|
|
|
#define VPU_REG_NUM_DEC_PP (VPU_REG_NUM_DEC+VPU_REG_NUM_PP) |
|
|
|
#define VPU_REG_NUM_ENC (96) |
|
|
|
typedef enum { |
|
VPU_ENC = 0x0, |
|
VPU_DEC = 0x1, |
|
VPU_PP = 0x2, |
|
VPU_DEC_PP = 0x3, |
|
VPU_DEC_HEVC = 0x4, |
|
VPU_DEC_RKV = 0x5, |
|
VPU_ENC_RKV = 0x6, |
|
VPU_DEC_AVSPLUS = 0x7, |
|
VPU_ENC_VEPU22 = 0x8, |
|
VPU_TYPE_BUTT , |
|
} VPU_CLIENT_TYPE; |
|
|
|
|
|
|
|
typedef struct VPUHwDecConfig { |
|
RK_U32 maxDecPicWidth; |
|
RK_U32 maxPpOutPicWidth; |
|
RK_U32 h264Support; |
|
RK_U32 jpegSupport; |
|
RK_U32 mpeg4Support; |
|
RK_U32 customMpeg4Support; |
|
RK_U32 vc1Support; |
|
RK_U32 mpeg2Support; |
|
RK_U32 ppSupport; |
|
RK_U32 ppConfig; |
|
RK_U32 sorensonSparkSupport; |
|
RK_U32 refBufSupport; |
|
RK_U32 vp6Support; |
|
RK_U32 vp7Support; |
|
RK_U32 vp8Support; |
|
RK_U32 avsSupport; |
|
RK_U32 jpegESupport; |
|
RK_U32 rvSupport; |
|
RK_U32 mvcSupport; |
|
} VPUHwDecConfig_t; |
|
|
|
|
|
|
|
typedef struct VPUHwEndConfig { |
|
RK_U32 maxEncodedWidth; |
|
RK_U32 h264Enabled; |
|
RK_U32 jpegEnabled; |
|
RK_U32 mpeg4Enabled; |
|
RK_U32 vsEnabled; |
|
RK_U32 rgbEnabled; |
|
RK_U32 reg_size; |
|
RK_U32 reserv[2]; |
|
} VPUHwEncConfig_t; |
|
|
|
typedef enum { |
|
|
|
VPU_CMD_REGISTER , |
|
VPU_CMD_REGISTER_ACK_OK , |
|
VPU_CMD_REGISTER_ACK_FAIL , |
|
VPU_CMD_UNREGISTER , |
|
|
|
VPU_SEND_CONFIG , |
|
VPU_SEND_CONFIG_ACK_OK , |
|
VPU_SEND_CONFIG_ACK_FAIL , |
|
|
|
VPU_GET_HW_INFO , |
|
VPU_GET_HW_INFO_ACK_OK , |
|
VPU_GET_HW_INFO_ACK_FAIL , |
|
|
|
VPU_CMD_BUTT , |
|
} VPU_CMD_TYPE; |
|
|
|
int VPUClientInit(VPU_CLIENT_TYPE type); |
|
RK_S32 VPUClientRelease(int socket); |
|
RK_S32 VPUClientSendReg(int socket, RK_U32 *regs, RK_U32 nregs); |
|
RK_S32 VPUClientSendReg2(RK_S32 socket, RK_S32 offset, RK_S32 size, void *param); |
|
RK_S32 VPUClientWaitResult(int socket, RK_U32 *regs, RK_U32 nregs, VPU_CMD_TYPE *cmd, RK_S32 *len); |
|
RK_S32 VPUClientGetHwCfg(int socket, RK_U32 *cfg, RK_U32 cfg_size); |
|
RK_S32 VPUClientGetIOMMUStatus(); |
|
RK_U32 VPUCheckSupportWidth(); |
|
|
|
#ifdef __cplusplus |
|
} |
|
#endif |
|
|
|
#endif |
|
|