api_aacplusdecoder.h 5.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117
  1. #ifndef __WASABI_API_AACPLUSDECODER_H
  2. #define __WASABI_API_AACPLUSDECODER_H
  3. #include <bfc/dispatch.h>
  4. #include "aacplusdectypes.h"
  5. #include <bfc/platform/types.h>
  6. class NOVTABLE api_aacplusdecoder : public Dispatchable
  7. {
  8. protected:
  9. api_aacplusdecoder() {}
  10. ~api_aacplusdecoder() {}
  11. public:
  12. DISPATCH_CODES
  13. {
  14. AACPLUSDECODER_EASY_OPEN = 10,
  15. AACPLUSDECODER_CLOSE = 20,
  16. AACPLUSDECODER_RESTART = 30,
  17. AACPLUSDECODER_READ_CONFIG_STREAM = 40,
  18. AACPLUSDECODER_GET_DECODER_SETTINGS_HANDLE = 50,
  19. AACPLUSDECODER_SET_DECODER_SETTINGS = 60,
  20. AACPLUSDECODER_GET_STREAM_PROPERTIES_HANDLE = 70,
  21. AACPLUSDECODER_STREAM_FEED =80,
  22. AACPLUSDECODER_STREAM_DECODE=90,
  23. AACPLUSDECODER_FRAME_DECODE=100,
  24. };
  25. AACPLUSDEC_ERROR EasyOpen(AACPLUSDEC_OUTPUTFORMAT outputFormat, int nMaxAudioChannels);
  26. void Close();
  27. AACPLUSDEC_ERROR Restart();
  28. AACPLUSDEC_ERROR ReadConfigStream(unsigned char *pucConfigStreamBufferIn, AACPLUSDEC_BITSTREAMBUFFERINFO *hConfigStreamBufferInfoInOut, AACPLUSDEC_CONFIGTYPE nConfigTypeIn, int bConfigStreamInBand, AACPLUSDEC_BITSTREAMFORMAT bitstreamFormatIn);
  29. AACPLUSDEC_EXPERTSETTINGS *GetDecoderSettingsHandle();
  30. AACPLUSDEC_ERROR SetDecoderSettings();
  31. AACPLUSDEC_STREAMPROPERTIES *GetStreamPropertiesHandle();
  32. AACPLUSDEC_ERROR StreamFeed(unsigned char *pucBitstrmBufIn, AACPLUSDEC_BITSTREAMBUFFERINFO *hBitstrmBufInfoInOut);
  33. AACPLUSDEC_ERROR StreamDecode(void *pPcmAudioBufOut, AACPLUSDEC_AUDIOBUFFERINFO *hPcmAudioBufInfoInOut, unsigned char *pucDataStreamBufOut, AACPLUSDEC_DATASTREAMBUFFERINFO *hDataStreamBufInfoInOut);
  34. AACPLUSDEC_ERROR FrameDecode( void *pPcmAudioBufOut,
  35. AACPLUSDEC_AUDIOBUFFERINFO *hPcmAudioBufInfoInOut,
  36. unsigned char *pucFrameBufferIn,
  37. AACPLUSDEC_BITSTREAMBUFFERINFO *hFrameBufferInfoInOut,
  38. int bFrameCorrupt,
  39. unsigned char *pucDataStreamBufOut,
  40. AACPLUSDEC_DATASTREAMBUFFERINFO *hDataStreamBufInfoInOut);
  41. };
  42. inline AACPLUSDEC_ERROR api_aacplusdecoder::EasyOpen(AACPLUSDEC_OUTPUTFORMAT outputFormat, int nMaxAudioChannels)
  43. {
  44. return _call(AACPLUSDECODER_EASY_OPEN, (AACPLUSDEC_ERROR)AACPLUSDEC_ERROR_GENERALERROR, outputFormat, nMaxAudioChannels);
  45. }
  46. inline void api_aacplusdecoder::Close()
  47. {
  48. _voidcall(AACPLUSDECODER_CLOSE);
  49. }
  50. inline AACPLUSDEC_ERROR api_aacplusdecoder::Restart()
  51. {
  52. return _call(AACPLUSDECODER_RESTART, (AACPLUSDEC_ERROR)AACPLUSDEC_ERROR_GENERALERROR);
  53. }
  54. inline AACPLUSDEC_EXPERTSETTINGS *api_aacplusdecoder::GetDecoderSettingsHandle()
  55. {
  56. return _call(AACPLUSDECODER_GET_DECODER_SETTINGS_HANDLE, (AACPLUSDEC_EXPERTSETTINGS *)0);
  57. }
  58. inline AACPLUSDEC_ERROR api_aacplusdecoder::SetDecoderSettings()
  59. {
  60. return _call(AACPLUSDECODER_SET_DECODER_SETTINGS, (AACPLUSDEC_ERROR)AACPLUSDEC_ERROR_GENERALERROR);
  61. }
  62. inline AACPLUSDEC_STREAMPROPERTIES *api_aacplusdecoder::GetStreamPropertiesHandle()
  63. {
  64. return _call(AACPLUSDECODER_GET_STREAM_PROPERTIES_HANDLE, (AACPLUSDEC_STREAMPROPERTIES *)0); }
  65. inline AACPLUSDEC_ERROR api_aacplusdecoder::StreamFeed(unsigned char *pucBitstrmBufIn, AACPLUSDEC_BITSTREAMBUFFERINFO *hBitstrmBufInfoInOut)
  66. {
  67. return _call(AACPLUSDECODER_STREAM_FEED, (AACPLUSDEC_ERROR)AACPLUSDEC_ERROR_GENERALERROR, pucBitstrmBufIn, hBitstrmBufInfoInOut);
  68. }
  69. inline AACPLUSDEC_ERROR api_aacplusdecoder::StreamDecode(void *pPcmAudioBufOut, AACPLUSDEC_AUDIOBUFFERINFO *hPcmAudioBufInfoInOut, unsigned char *pucDataStreamBufOut, AACPLUSDEC_DATASTREAMBUFFERINFO *hDataStreamBufInfoInOut)
  70. {
  71. return _call(AACPLUSDECODER_STREAM_DECODE, (AACPLUSDEC_ERROR)AACPLUSDEC_ERROR_GENERALERROR, pPcmAudioBufOut, hPcmAudioBufInfoInOut, pucDataStreamBufOut, hDataStreamBufInfoInOut);
  72. }
  73. inline AACPLUSDEC_ERROR api_aacplusdecoder::ReadConfigStream(unsigned char *pucConfigStreamBufferIn, AACPLUSDEC_BITSTREAMBUFFERINFO *hConfigStreamBufferInfoInOut, AACPLUSDEC_CONFIGTYPE nConfigTypeIn, int bConfigStreamInBand, AACPLUSDEC_BITSTREAMFORMAT bitstreamFormatIn)
  74. {
  75. return _call(AACPLUSDECODER_READ_CONFIG_STREAM, (AACPLUSDEC_ERROR)AACPLUSDEC_ERROR_GENERALERROR, pucConfigStreamBufferIn, hConfigStreamBufferInfoInOut, nConfigTypeIn, bConfigStreamInBand, bitstreamFormatIn);
  76. }
  77. inline AACPLUSDEC_ERROR api_aacplusdecoder::FrameDecode(void *pPcmAudioBufOut,
  78. AACPLUSDEC_AUDIOBUFFERINFO *hPcmAudioBufInfoInOut,
  79. unsigned char *pucFrameBufferIn,
  80. AACPLUSDEC_BITSTREAMBUFFERINFO *hFrameBufferInfoInOut,
  81. int bFrameCorrupt,
  82. unsigned char *pucDataStreamBufOut,
  83. AACPLUSDEC_DATASTREAMBUFFERINFO *hDataStreamBufInfoInOut )
  84. {
  85. return _call(AACPLUSDECODER_FRAME_DECODE, (AACPLUSDEC_ERROR)AACPLUSDEC_ERROR_GENERALERROR, pPcmAudioBufOut,
  86. hPcmAudioBufInfoInOut,
  87. pucFrameBufferIn,
  88. hFrameBufferInfoInOut,
  89. bFrameCorrupt, pucDataStreamBufOut,
  90. hDataStreamBufInfoInOut );
  91. }
  92. // {257C56BD-90CD-4f1f-9A27-3C73BCCCDE4E}
  93. static const GUID aacPlusDecoderGUID=
  94. { 0x257c56bd, 0x90cd, 0x4f1f, { 0x9a, 0x27, 0x3c, 0x73, 0xbc, 0xcc, 0xde, 0x4e } };
  95. #endif