1
0

FLVAACDecoder.h 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. #pragma once
  2. #include "../Plugins/Input/in_flv/svc_flvdecoder.h"
  3. #include "../Plugins/Input/in_flv/FLVAudioHeader.h"
  4. #include "../Plugins/Input/in_flv/ifc_flvaudiodecoder.h"
  5. #include "MFTDecoder.h"
  6. // {B670EC35-1313-460a-A2EA-C7120AD18BAD}
  7. static const GUID flv_aac_guid =
  8. { 0xb670ec35, 0x1313, 0x460a, { 0xa2, 0xea, 0xc7, 0x12, 0xa, 0xd1, 0x8b, 0xad } };
  9. class FLVDecoder : public svc_flvdecoder
  10. {
  11. public:
  12. static const char *getServiceName() { return "MFT AAC FLV Decoder"; }
  13. static GUID getServiceGuid() { return flv_aac_guid; }
  14. int CreateAudioDecoder(int stereo, int bits, int sample_rate, int format, ifc_flvaudiodecoder **decoder);
  15. int HandlesAudio(int format_type);
  16. protected:
  17. RECVS_DISPATCH;
  18. };
  19. class FLVAAC : public ifc_flvaudiodecoder
  20. {
  21. public:
  22. FLVAAC();
  23. int GetOutputFormat(unsigned int *sample_rate, unsigned int *channels, unsigned int *bits);
  24. int DecodeSample(const void *input_buffer, size_t input_buffer_bytes, void *samples, size_t *samples_size_bytes, double *bitrate);
  25. void Flush();
  26. void Close();
  27. int Ready();
  28. void SetPreferences(unsigned int max_channels, unsigned int preferred_bits);
  29. private:
  30. /* data */
  31. MFTDecoder decoder;
  32. unsigned int bps;
  33. size_t preDelay;
  34. bool got_decoder_config;
  35. protected:
  36. RECVS_DISPATCH;
  37. };