mp4AudioDecIfc.h 7.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160
  1. /***************************************************************************\
  2. *
  3. * (C) copyright Fraunhofer - IIS (2001)
  4. * All Rights Reserved
  5. *
  6. * $Header: /cvs/root/winamp/aacdec/incs/mp4AudioDecIfc.h,v 1.3 2012/05/08 20:16:49 audiodsp Exp $
  7. * project : MPEG-4 Audio Decoder
  8. * contents/description: interface to mpeg-4 audio decoder
  9. *
  10. * This software and/or program is protected by copyright law and
  11. * international treaties. Any reproduction or distribution of this
  12. * software and/or program, or any portion of it, may result in severe
  13. * civil and criminal penalties, and will be prosecuted to the maximum
  14. * extent possible under law.
  15. *
  16. \***************************************************************************/
  17. #ifndef __MP4AUDIODECIFC_H__
  18. #define __MP4AUDIODECIFC_H__
  19. #include "mp4dec_helpers/err_code.h"
  20. #include "mp4dec_asc/audiospecificconfig_c.h"
  21. #include "mp4dec_helpers/usrparam.h"
  22. #include "mp4dec_helpers/aubuffer_c.h"
  23. #include "mp4dec_helpers/cubuffer_c.h"
  24. #ifdef __cplusplus
  25. extern "C" {
  26. #endif /* __cplusplus */
  27. #if defined(WIN32) || defined(WIN64)
  28. #pragma pack(push, 8)
  29. #endif
  30. /* data types */
  31. typedef struct mp4AudioDecoder_VersionInfo {
  32. char dateTime[80];
  33. char versionNo[40];
  34. char options[1024];
  35. char options_ext[4096];
  36. } mp4AudioDecoder_VersionInfo;
  37. /* Opaque declaration of decoder handle */
  38. struct mp4AudioDecoder;
  39. typedef struct mp4AudioDecoder* mp4AudioDecoderHandle;
  40. /* mandatory decoder functions */
  41. mp4AudioDecoderHandle MP4AUDIODECAPI mp4AudioDecoder_Create(
  42. const struct CSAudioSpecificConfig * const asc[],
  43. const unsigned int noOfLayers
  44. );
  45. MP4_RESULT MP4AUDIODECAPI mp4AudioDecoder_SetParam(
  46. const mp4AudioDecoderHandle self,
  47. const unsigned int param,
  48. const float value
  49. );
  50. MP4_RESULT MP4AUDIODECAPI mp4AudioDecoder_DecodeFrame(
  51. mp4AudioDecoderHandle self,
  52. struct CAccessUnit* auBuffer[],
  53. struct CCompositionUnit* cuBuffer
  54. );
  55. MP4_RESULT MP4AUDIODECAPI mp4AudioDecoder_Destroy(mp4AudioDecoderHandle* self);
  56. /* utility functions */
  57. MP4_RESULT MP4AUDIODECAPI mp4AudioDecoder_Reset(
  58. mp4AudioDecoderHandle self,
  59. const unsigned int param,
  60. int value
  61. );
  62. MP4_RESULT MP4AUDIODECAPI mp4AudioDecoder_Flush(
  63. mp4AudioDecoderHandle self,
  64. struct CCompositionUnit* cuBuffer
  65. );
  66. MP4_RESULT MP4AUDIODECAPI mp4AudioDecoder_GetBufferFullness(
  67. const mp4AudioDecoderHandle self,
  68. const unsigned int layer,
  69. unsigned int* bufferfullness
  70. );
  71. MP4_RESULT MP4AUDIODECAPI mp4AudioDecoder_GetSamplesPerFrame(
  72. const mp4AudioDecoderHandle self,
  73. unsigned int* spf
  74. );
  75. MP4_RESULT MP4AUDIODECAPI mp4AudioDecoder_SetOutputLayer(
  76. const mp4AudioDecoderHandle self,
  77. const unsigned int outputLayer
  78. );
  79. /* MP4_RESULT MP4AUDIODECAPI mp4AudioDecoder_SetSpeedPitch( */
  80. /* const mp4AudioDecoderHandle self, */
  81. /* const float speedChangeFactor, */
  82. /* const float pitchChangeFactor */
  83. /* ); */
  84. MP4_RESULT MP4AUDIODECAPI mp4AudioDecoder_GetLastError(const mp4AudioDecoderHandle self);
  85. MP4_RESULT MP4AUDIODECAPI mp4AudioDecoder_GetLibraryVersion(mp4AudioDecoder_VersionInfo* versionInfo);
  86. MP4_RESULT MP4AUDIODECAPI mp4AudioDecoder_ascParse(
  87. const unsigned char* decSpecificInfoBuf,
  88. const unsigned int decSpecificInfoBuf_len,
  89. struct CSAudioSpecificConfig* asc
  90. );
  91. MP4_RESULT MP4AUDIODECAPI mp4AudioDecoder_ascParseStream(
  92. const unsigned char* decSpecificInfoBuf,
  93. struct CSAudioSpecificConfig* asc,
  94. int* bitsRead
  95. );
  96. MP4_RESULT MP4AUDIODECAPI mp4AudioDecoder_ascParseExt(
  97. const unsigned char* const decSpecificInfoBuf[],
  98. const unsigned int decSpecificInfoBuf_len[],
  99. const unsigned int avgBitrate[],
  100. const unsigned int streams,
  101. unsigned int* layers, /* out */
  102. struct CSAudioSpecificConfig* asc[], /* out */
  103. unsigned int streamsPerLayer[] /* out */
  104. );
  105. MP4_RESULT MP4AUDIODECAPI mp4AudioDecoder_ascPrint(
  106. unsigned int layers, /* in */
  107. struct CSAudioSpecificConfig* asc[], /* in */
  108. unsigned int stringLen, /* in */
  109. unsigned char string[] /* ptr in, content out */
  110. );
  111. MP4_RESULT MP4AUDIODECAPI mp4AudioDecoder_GetPcmWidth(
  112. const unsigned char* const decSpecificInfoBuf[],
  113. const unsigned int decSpecificInfoBuf_len[],
  114. const unsigned int streams,
  115. unsigned int* pcmwidth /* out */
  116. );
  117. #if defined(WIN32) || defined(WIN64)
  118. #pragma pack(pop)
  119. #endif
  120. #ifdef __cplusplus
  121. }
  122. #endif
  123. #endif /* __MP4AUDIODECIFC_H__ */