hi_comm_dis.h 5.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108
  1. /******************************************************************************
  2. Copyright (C), 2017-2018, Hisilicon Tech. Co., Ltd.
  3. ******************************************************************************
  4. File Name : hi_comm_dis.h
  5. Version : Initial Draft
  6. Author : Hisilicon multimedia software group
  7. Created : 2016/08/23
  8. Description : hi_comm_dis.h header file
  9. History :
  10. ******************************************************************************/
  11. #ifndef __HI_COMM_DIS_H__
  12. #define __HI_COMM_DIS_H__
  13. #ifdef __cplusplus
  14. #if __cplusplus
  15. extern "C"{
  16. #endif
  17. #endif /* End of #ifdef __cplusplus */
  18. #include "hi_type.h"
  19. #include "hi_common.h"
  20. #include "hi_errno.h"
  21. #include "hi_comm_video.h"
  22. /* failure caused by malloc buffer */
  23. #define HI_ERR_DIS_NOBUF HI_DEF_ERR(HI_ID_DIS, EN_ERR_LEVEL_ERROR, EN_ERR_NOBUF)
  24. #define HI_ERR_DIS_BUF_EMPTY HI_DEF_ERR(HI_ID_DIS, EN_ERR_LEVEL_ERROR, EN_ERR_BUF_EMPTY)
  25. #define HI_ERR_DIS_NULL_PTR HI_DEF_ERR(HI_ID_DIS, EN_ERR_LEVEL_ERROR, EN_ERR_NULL_PTR)
  26. #define HI_ERR_DIS_ILLEGAL_PARAM HI_DEF_ERR(HI_ID_DIS, EN_ERR_LEVEL_ERROR, EN_ERR_ILLEGAL_PARAM)
  27. #define HI_ERR_DIS_BUF_FULL HI_DEF_ERR(HI_ID_DIS, EN_ERR_LEVEL_ERROR, EN_ERR_BUF_FULL)
  28. #define HI_ERR_DIS_SYS_NOTREADY HI_DEF_ERR(HI_ID_DIS, EN_ERR_LEVEL_ERROR, EN_ERR_SYS_NOTREADY)
  29. #define HI_ERR_DIS_NOT_SUPPORT HI_DEF_ERR(HI_ID_DIS, EN_ERR_LEVEL_ERROR, EN_ERR_NOT_SUPPORT)
  30. #define HI_ERR_DIS_NOT_PERMITTED HI_DEF_ERR(HI_ID_DIS, EN_ERR_LEVEL_ERROR, EN_ERR_NOT_PERM)
  31. #define HI_ERR_DIS_BUSY HI_DEF_ERR(HI_ID_DIS, EN_ERR_LEVEL_ERROR, EN_ERR_BUSY)
  32. #define HI_ERR_DIS_INVALID_CHNID HI_DEF_ERR(HI_ID_DIS, EN_ERR_LEVEL_ERROR, EN_ERR_INVALID_CHNID)
  33. #define HI_ERR_DIS_CHN_UNEXIST HI_DEF_ERR(HI_ID_DIS, EN_ERR_LEVEL_ERROR, EN_ERR_UNEXIST)
  34. /* Different mode of DIS */
  35. typedef enum hiDIS_MODE_E
  36. {
  37. DIS_MODE_4_DOF_GME = 0, /* Only use with GME in 4 dof */
  38. DIS_MODE_6_DOF_GME, /* Only use with GME in 6 dof */
  39. DIS_MODE_GYRO, /* Only use with gryo in 6 dof */
  40. DIS_MODE_HYBRID, /* Both use with GME and gyro in 6 dof */
  41. DIS_MODE_DOF_BUTT,
  42. } DIS_MODE_E;
  43. /* The motion level of camera */
  44. typedef enum hiDIS_MOTION_LEVEL_E
  45. {
  46. DIS_MOTION_LEVEL_LOW = 0, /* Low motion level*/
  47. DIS_MOTION_LEVEL_NORMAL, /* Normal motion level */
  48. DIS_MOTION_LEVEL_HIGH, /* High motion level */
  49. DIS_MOTION_LEVEL_BUTT
  50. }DIS_MOTION_LEVEL_E;
  51. /* Different product type used DIS */
  52. typedef enum hiDIS_PDT_TYPE_E
  53. {
  54. DIS_PDT_TYPE_IPC = 0, /* IPC product type */
  55. DIS_PDT_TYPE_DV, /* DV product type */
  56. DIS_PDT_TYPE_DRONE, /* DRONE product type */
  57. DIS_PDT_TYPE_BUTT
  58. } DIS_PDT_TYPE_E;
  59. /* The Attribute of DIS */
  60. typedef struct hiDIS_ATTR_S
  61. {
  62. HI_BOOL bEnable; /* RW; DIS enable */
  63. HI_BOOL bGdcBypass; /* RW; gdc correction process , DIS = GME&GDC correction*/
  64. HI_U32 u32MovingSubjectLevel; /* RW; Range:[0,6]; Moving Subject level */
  65. HI_S32 s32RollingShutterCoef; /* RW; Range:[-1000,1000]; Rolling shutter coefficients */
  66. HI_U32 u32Timelag; /* RW; Range:[0,200000]; Timestamp delay between Gyro and Frame PTS */
  67. HI_U32 u32ViewAngle; /* RW; Range:[100,1380]; The horizontal view angle of the captured video */
  68. HI_U32 u32HorizontalLimit; /* RW; Range:[0,1000]; Parameter to limit horizontal drift by large foreground */
  69. HI_U32 u32VerticalLimit; /* RW; Range:[0,1000]; Parameter to limit vertical drift by large foreground */
  70. HI_BOOL bStillCrop; /* RW; The stabilization will be not working ,but the output image still be cropped */
  71. }DIS_ATTR_S;
  72. /* The Config of DIS */
  73. typedef struct hiDIS_CONFIG_S
  74. {
  75. DIS_MODE_E enMode; /* RW; DIS Mode */
  76. DIS_MOTION_LEVEL_E enMotionLevel; /* RW; DIS Motion level of the camera */
  77. DIS_PDT_TYPE_E enPdtType; /* RW; DIS product type*/
  78. HI_U32 u32BufNum; /* RW; Range:[5,10]; Buf num for DIS */
  79. HI_U32 u32CropRatio; /* RW; Range:[50,98]; Crop ratio of output image */
  80. HI_U32 u32FrameRate; /* RW; Range:[25,120]; The input framerate */
  81. HI_U32 u32GyroOutputRange; /* RW; Range:[0,360]; The range of Gyro output in degree */
  82. HI_U32 u32GyroDataBitWidth; /* RW; Range:[0,32]; The bits used for gyro angular velocity output */
  83. HI_BOOL bCameraSteady; /* RW; The camera is steady or not */
  84. HI_BOOL bScale; /* RW; Scale output image or not*/
  85. }DIS_CONFIG_S;
  86. #ifdef __cplusplus
  87. #if __cplusplus
  88. }
  89. #endif
  90. #endif /* End of #ifdef __cplusplus */
  91. #endif /* End of #ifndef __HI_COMM_DIS_H__ */