hi_comm_dpu_rect.h 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110
  1. /******************************************************************************
  2. Copyright (C), 2017-2018, Hisilicon Tech. Co., Ltd.
  3. ******************************************************************************
  4. File Name : hi_comm_rect.h
  5. Version : Initial Draft
  6. Author : Hisilicon multimedia software group
  7. Created : 2017/09/20
  8. Description :
  9. History :
  10. 1.Date : 2017/09/20
  11. Modification: Created file
  12. ******************************************************************************/
  13. #ifndef __HI_COMM_RECT_H__
  14. #define __HI_COMM_RECT_H__
  15. #ifdef __cplusplus
  16. #if __cplusplus
  17. extern "C"{
  18. #endif
  19. #endif /* __cplusplus */
  20. #include "hi_common.h"
  21. #include "hi_errno.h"
  22. #include "hi_defines.h"
  23. #include "hi_comm_video.h"
  24. #define DPU_RECT_LEFT_PIPE 0
  25. #define DPU_RECT_RIGHT_PIPE 1
  26. #define DPU_RECT_LEFT_CHN 0
  27. #define DPU_RECT_RIGHT_CHN 1
  28. typedef enum hiEN_DPU_RECT_ERR_CODE_E
  29. {
  30. ERR_DPU_RECT_SYS_TIMEOUT = 0x40, /* DPU RECT process timeout */
  31. ERR_DPU_RECT_OPEN_FILE = 0x41, /* DPU RECT open file error */
  32. ERR_DPU_RECT_READ_FILE = 0x42, /* DPU RECT read file error */
  33. ERR_DPU_RECT_WRITE_FILE = 0x43, /* DPU RECT write file error */
  34. ERR_DPU_RECT_BUTT
  35. }EN_DPU_RECT_ERR_CODE_E;
  36. #define HI_ERR_DPU_RECT_NULL_PTR HI_DEF_ERR(HI_ID_DPU_RECT, EN_ERR_LEVEL_ERROR, EN_ERR_NULL_PTR)
  37. #define HI_ERR_DPU_RECT_NOTREADY HI_DEF_ERR(HI_ID_DPU_RECT, EN_ERR_LEVEL_ERROR, EN_ERR_SYS_NOTREADY)
  38. #define HI_ERR_DPU_RECT_INVALID_DEVID HI_DEF_ERR(HI_ID_DPU_RECT, EN_ERR_LEVEL_ERROR, EN_ERR_INVALID_DEVID)
  39. #define HI_ERR_DPU_RECT_INVALID_CHNID HI_DEF_ERR(HI_ID_DPU_RECT, EN_ERR_LEVEL_ERROR, EN_ERR_INVALID_CHNID)
  40. #define HI_ERR_DPU_RECT_EXIST HI_DEF_ERR(HI_ID_DPU_RECT, EN_ERR_LEVEL_ERROR, EN_ERR_EXIST)
  41. #define HI_ERR_DPU_RECT_UNEXIST HI_DEF_ERR(HI_ID_DPU_RECT, EN_ERR_LEVEL_ERROR, EN_ERR_UNEXIST)
  42. #define HI_ERR_DPU_RECT_NOT_SUPPORT HI_DEF_ERR(HI_ID_DPU_RECT, EN_ERR_LEVEL_ERROR, EN_ERR_NOT_SUPPORT)
  43. #define HI_ERR_DPU_RECT_NOT_PERM HI_DEF_ERR(HI_ID_DPU_RECT, EN_ERR_LEVEL_ERROR, EN_ERR_NOT_PERM)
  44. #define HI_ERR_DPU_RECT_NOMEM HI_DEF_ERR(HI_ID_DPU_RECT, EN_ERR_LEVEL_ERROR, EN_ERR_NOMEM)
  45. #define HI_ERR_DPU_RECT_NOBUF HI_DEF_ERR(HI_ID_DPU_RECT, EN_ERR_LEVEL_ERROR, EN_ERR_NOBUF)
  46. #define HI_ERR_DPU_RECT_ILLEGAL_PARAM HI_DEF_ERR(HI_ID_DPU_RECT, EN_ERR_LEVEL_ERROR, EN_ERR_ILLEGAL_PARAM)
  47. #define HI_ERR_DPU_RECT_BUSY HI_DEF_ERR(HI_ID_DPU_RECT, EN_ERR_LEVEL_ERROR, EN_ERR_BUSY)
  48. #define HI_ERR_DPU_RECT_BUF_EMPTY HI_DEF_ERR(HI_ID_DPU_RECT, EN_ERR_LEVEL_ERROR, EN_ERR_BUF_EMPTY)
  49. #define HI_ERR_DPU_RECT_SYS_TIMEOUT HI_DEF_ERR(HI_ID_DPU_RECT, EN_ERR_LEVEL_ERROR, ERR_DPU_RECT_SYS_TIMEOUT)
  50. #define HI_ERR_DPU_RECT_OPEN_FILE HI_DEF_ERR(HI_ID_DPU_RECT, EN_ERR_LEVEL_ERROR, ERR_DPU_RECT_OPEN_FILE)
  51. #define HI_ERR_DPU_RECT_READ_FILE HI_DEF_ERR(HI_ID_DPU_RECT, EN_ERR_LEVEL_ERROR, ERR_DPU_RECT_READ_FILE)
  52. #define HI_ERR_DPU_RECT_WRITE_FILE HI_DEF_ERR(HI_ID_DPU_RECT, EN_ERR_LEVEL_ERROR, ERR_DPU_RECT_WRITE_FILE)
  53. typedef HI_S32 DPU_RECT_LUT_ID;
  54. typedef HI_S32 DPU_RECT_GRP;
  55. typedef HI_S32 DPU_RECT_PIPE;
  56. typedef HI_S32 DPU_RECT_CHN;
  57. typedef struct hiDPU_RECT_MEM_INFO_S
  58. {
  59. HI_U64 u64PhyAddr;
  60. HI_U64 u64VirAddr;
  61. HI_U32 u32Size;
  62. }DPU_RECT_MEM_INFO_S;
  63. typedef enum hiDPU_RECT_MODE_E
  64. {
  65. DPU_RECT_MODE_SINGLE = 0x0, /* only channel 0 work */
  66. DPU_RECT_MODE_DOUBLE = 0x1, /* two channel work */
  67. DPU_RECT_MODE_BUTT
  68. }DPU_RECT_MODE_E;
  69. typedef struct hiDPU_RECT_GRP_ATTR_S
  70. {
  71. DPU_RECT_MODE_E enRectMode; /* Rectification mode, it can not be changed dynamic */
  72. SIZE_S stLeftImageSize; /* Left image size. */
  73. SIZE_S stRightImageSize; /* Right image size. */
  74. DPU_RECT_LUT_ID LeftLutId; /* Left image rectification lut */
  75. DPU_RECT_LUT_ID RightLutId; /* Right image rectification lut */
  76. HI_U32 u32Depth; /* The depth of user image queue for getting Rectification output image,
  77. it can not be changed dynamic. Range:[0,8] */
  78. HI_BOOL bNeedSrcFrame; /* The flag of getting source videoframe. */
  79. FRAME_RATE_CTRL_S stFrameRate; /* Grp frame rate contrl. */
  80. }DPU_RECT_GRP_ATTR_S;
  81. typedef struct hiDPU_RECT_CHN_ATTR_S
  82. {
  83. SIZE_S stImageSize; /* Rectify output image size */
  84. }DPU_RECT_CHN_ATTR_S;
  85. #ifdef __cplusplus
  86. #if __cplusplus
  87. }
  88. #endif
  89. #endif /* __cplusplus */
  90. #endif /* __HI_COMM_DPU_RECT_H__ */