1
0

AVIAACDecoder.h 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. #pragma once
  2. #include "../Plugins/Input/in_avi/svc_avidecoder.h"
  3. #include "../Plugins/Input/in_avi/ifc_aviaudiodecoder.h"
  4. #include "MFTDecoder.h"
  5. // {D6DB50A7-5E2F-4374-97B0-67CA707EB3CD}
  6. static const GUID avi_aac_guid =
  7. { 0xd6db50a7, 0x5e2f, 0x4374, { 0x97, 0xb0, 0x67, 0xca, 0x70, 0x7e, 0xb3, 0xcd } };
  8. class AVIDecoder : public svc_avidecoder
  9. {
  10. public:
  11. static const char *getServiceName() { return "MFT AAC AVI Decoder"; }
  12. static GUID getServiceGuid() { return avi_aac_guid; }
  13. int CreateAudioDecoder(const nsavi::AVIH *avi_header, const nsavi::STRH *stream_header, const nsavi::STRF *stream_format, const nsavi::STRD *stream_data, unsigned int preferred_bits, unsigned int max_channels, bool floating_point, ifc_aviaudiodecoder **decoder);
  14. protected:
  15. RECVS_DISPATCH;
  16. };
  17. class AVIAACDecoder : public ifc_aviaudiodecoder
  18. {
  19. public:
  20. AVIAACDecoder(unsigned int bps, bool floating_point);
  21. static AVIAACDecoder *Create(const nsavi::audio_format *stream_format, unsigned int preferred_bits, unsigned int max_channels, bool floating_point);
  22. protected:
  23. RECVS_DISPATCH;
  24. private:
  25. /* ifc_aviaudiodecoder implementation */
  26. int OutputFrameSize(size_t *frame_size);
  27. int GetOutputProperties(unsigned int *sampleRate, unsigned int *channels, unsigned int *bitsPerSample, bool *isFloat);
  28. int DecodeChunk(uint16_t type, void **inputBuffer, size_t *inputBufferBytes, void *outputBuffer, size_t *outputBufferBytes);
  29. void Flush();
  30. void Close();
  31. /* data */
  32. MFTDecoder decoder;
  33. unsigned int bps;
  34. bool floating_point;
  35. };