hi_comm_aenc.h 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125
  1. /******************************************************************************
  2. Copyright (C), 2001-2018, Hisilicon Tech. Co., Ltd.
  3. ******************************************************************************
  4. File Name : hi_comm_aenc.h
  5. Version : Initial Draft
  6. Author : Hisilicon multimedia software group
  7. Created : 2006/12/15
  8. Last Modified :
  9. Description :
  10. Function List :
  11. History :
  12. 1.Date : 2006/12/15
  13. Author : z50825
  14. Modification : Created file
  15. 2.Date : 2007/5/10
  16. Author : z50825
  17. Modification : add err code
  18. ******************************************************************************/
  19. #ifndef __HI_COMM_AENC_H__
  20. #define __HI_COMM_AENC_H__
  21. #include "hi_type.h"
  22. #include "hi_common.h"
  23. #include "hi_comm_aio.h"
  24. #ifdef __cplusplus
  25. #if __cplusplus
  26. extern "C"{
  27. #endif
  28. #endif /* End of #ifdef __cplusplus */
  29. typedef struct hiAENC_ATTR_G711_S
  30. {
  31. HI_U32 resv; /*reserve item*/
  32. }AENC_ATTR_G711_S;
  33. typedef struct hiAENC_ATTR_G726_S
  34. {
  35. G726_BPS_E enG726bps;
  36. }AENC_ATTR_G726_S;
  37. typedef struct hiAENC_ATTR_ADPCM_S
  38. {
  39. ADPCM_TYPE_E enADPCMType;
  40. }AENC_ATTR_ADPCM_S;
  41. typedef struct hiAENC_ATTR_LPCM_S
  42. {
  43. HI_U32 resv; /*reserve item*/
  44. }AENC_ATTR_LPCM_S;
  45. typedef struct hiAENC_ENCODER_S
  46. {
  47. PAYLOAD_TYPE_E enType;
  48. HI_U32 u32MaxFrmLen;
  49. HI_CHAR aszName[17]; /* encoder type,be used to print proc information */
  50. HI_S32 (*pfnOpenEncoder)(HI_VOID *pEncoderAttr, HI_VOID **ppEncoder); /* pEncoder is the handle to control the encoder */
  51. HI_S32 (*pfnEncodeFrm)(HI_VOID *pEncoder, const AUDIO_FRAME_S *pstData,
  52. HI_U8 *pu8Outbuf,HI_U32 *pu32OutLen);
  53. HI_S32 (*pfnCloseEncoder)(HI_VOID *pEncoder);
  54. } AENC_ENCODER_S;
  55. typedef struct hiAENC_CHN_ATTR_S
  56. {
  57. PAYLOAD_TYPE_E enType; /*payload type ()*/
  58. HI_U32 u32PtNumPerFrm;
  59. HI_U32 u32BufSize; /*buf size [2~MAX_AUDIO_FRAME_NUM]*/
  60. HI_VOID ATTRIBUTE *pValue; /*point to attribute of definite audio encoder*/
  61. }AENC_CHN_ATTR_S;
  62. typedef enum hiEN_AENC_ERR_CODE_E
  63. {
  64. AENC_ERR_ENCODER_ERR = 64 ,
  65. AENC_ERR_VQE_ERR = 65 ,
  66. } EN_AENC_ERR_CODE_E;
  67. /* invlalid device ID */
  68. #define HI_ERR_AENC_INVALID_DEVID HI_DEF_ERR(HI_ID_AENC, EN_ERR_LEVEL_ERROR, EN_ERR_INVALID_DEVID)
  69. /* invlalid channel ID */
  70. #define HI_ERR_AENC_INVALID_CHNID HI_DEF_ERR(HI_ID_AENC, EN_ERR_LEVEL_ERROR, EN_ERR_INVALID_CHNID)
  71. /* at lease one parameter is illagal ,eg, an illegal enumeration value */
  72. #define HI_ERR_AENC_ILLEGAL_PARAM HI_DEF_ERR(HI_ID_AENC, EN_ERR_LEVEL_ERROR, EN_ERR_ILLEGAL_PARAM)
  73. /* channel exists */
  74. #define HI_ERR_AENC_EXIST HI_DEF_ERR(HI_ID_AENC, EN_ERR_LEVEL_ERROR, EN_ERR_EXIST)
  75. /* channel unexists */
  76. #define HI_ERR_AENC_UNEXIST HI_DEF_ERR(HI_ID_AENC, EN_ERR_LEVEL_ERROR, EN_ERR_UNEXIST)
  77. /* using a NULL point */
  78. #define HI_ERR_AENC_NULL_PTR HI_DEF_ERR(HI_ID_AENC, EN_ERR_LEVEL_ERROR, EN_ERR_NULL_PTR)
  79. /* try to enable or initialize system,device or channel, before configing attribute */
  80. #define HI_ERR_AENC_NOT_CONFIG HI_DEF_ERR(HI_ID_AENC, EN_ERR_LEVEL_ERROR, EN_ERR_NOT_CONFIG)
  81. /* operation is not supported by NOW */
  82. #define HI_ERR_AENC_NOT_SUPPORT HI_DEF_ERR(HI_ID_AENC, EN_ERR_LEVEL_ERROR, EN_ERR_NOT_SUPPORT)
  83. /* operation is not permitted ,eg, try to change static attribute */
  84. #define HI_ERR_AENC_NOT_PERM HI_DEF_ERR(HI_ID_AENC, EN_ERR_LEVEL_ERROR, EN_ERR_NOT_PERM)
  85. /* failure caused by malloc memory */
  86. #define HI_ERR_AENC_NOMEM HI_DEF_ERR(HI_ID_AENC, EN_ERR_LEVEL_ERROR, EN_ERR_NOMEM)
  87. /* failure caused by malloc buffer */
  88. #define HI_ERR_AENC_NOBUF HI_DEF_ERR(HI_ID_AENC, EN_ERR_LEVEL_ERROR, EN_ERR_NOBUF)
  89. /* no data in buffer */
  90. #define HI_ERR_AENC_BUF_EMPTY HI_DEF_ERR(HI_ID_AENC, EN_ERR_LEVEL_ERROR, EN_ERR_BUF_EMPTY)
  91. /* no buffer for new data */
  92. #define HI_ERR_AENC_BUF_FULL HI_DEF_ERR(HI_ID_AENC, EN_ERR_LEVEL_ERROR, EN_ERR_BUF_FULL)
  93. /* system is not ready,had not initialed or loaded*/
  94. #define HI_ERR_AENC_SYS_NOTREADY HI_DEF_ERR(HI_ID_AENC, EN_ERR_LEVEL_ERROR, EN_ERR_SYS_NOTREADY)
  95. /* encoder internal err */
  96. #define HI_ERR_AENC_ENCODER_ERR HI_DEF_ERR(HI_ID_AENC, EN_ERR_LEVEL_ERROR, AENC_ERR_ENCODER_ERR)
  97. /* vqe internal err */
  98. #define HI_ERR_AENC_VQE_ERR HI_DEF_ERR(HI_ID_AENC, EN_ERR_LEVEL_ERROR, AENC_ERR_VQE_ERR)
  99. #ifdef __cplusplus
  100. #if __cplusplus
  101. }
  102. #endif
  103. #endif /* End of #ifdef __cplusplus */
  104. #endif/* End of #ifndef __HI_COMM_AENC_H__*/