1
0

NSVAACDecoder.h 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. #pragma once
  2. #include "../nsv/dec_if.h"
  3. #include "MFTDecoder.h"
  4. #include <bfc/platform/types.h>
  5. //#include "ADTSHeader.h"
  6. #include "../nsv/svc_nsvFactory.h"
  7. // {E890E15C-A6D8-4ed9-9204-85C77AB80C53}
  8. static const GUID NSV_AAC_GUID =
  9. { 0xe890e15c, 0xa6d8, 0x4ed9, { 0x92, 0x4, 0x85, 0xc7, 0x7a, 0xb8, 0xc, 0x53 } };
  10. class NSVDecoder : public svc_nsvFactory
  11. {
  12. public:
  13. static const char *getServiceName() { return "MFT AAC NSV Decoder"; }
  14. static GUID getServiceGuid() { return NSV_AAC_GUID; }
  15. IAudioDecoder *CreateAudioDecoder(FOURCC format, IAudioOutput **output) override;
  16. protected:
  17. RECVS_DISPATCH;
  18. };
  19. class NSVAACDecoder : public IAudioDecoder
  20. {
  21. public:
  22. static NSVAACDecoder *CreateDecoder();
  23. NSVAACDecoder();
  24. ~NSVAACDecoder();
  25. void Initialize();
  26. int decode(void *in, int in_len, void *out, int *out_len, unsigned int out_fmt[8]);
  27. void flush();
  28. bool OK();
  29. private:
  30. void FillOutputFormat(unsigned int out_fmt[8]);
  31. void CopyToOutput(void *out, int *out_len);
  32. private:
  33. /* data */
  34. MFTDecoder decoder;
  35. int in_position;
  36. int out_left;
  37. size_t source_position;
  38. };