1
0

flv_adpcm_decoder.h 1.1 KB

1234567891011121314151617181920212223242526272829303132333435
  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. // {A1249BA5-97F3-4820-9E3B-EB883AE7D19A}
  6. static const GUID flv_adpcm_guid =
  7. { 0xa1249ba5, 0x97f3, 0x4820, { 0x9e, 0x3b, 0xeb, 0x88, 0x3a, 0xe7, 0xd1, 0x9a } };
  8. class FLVDecoderCreator : public svc_flvdecoder
  9. {
  10. public:
  11. static const char *getServiceName() { return "ADPCM FLV Decoder"; }
  12. static GUID getServiceGuid() { return flv_adpcm_guid; }
  13. int CreateAudioDecoder(int stereo, int bits, int sample_rate, int format, ifc_flvaudiodecoder **decoder);
  14. int HandlesAudio(int format_type);
  15. protected:
  16. RECVS_DISPATCH;
  17. };
  18. class FLVADPCM : public ifc_flvaudiodecoder
  19. {
  20. public:
  21. FLVADPCM(unsigned int channels);
  22. int GetOutputFormat(unsigned int *sample_rate, unsigned int *channels, unsigned int *bits);
  23. int DecodeSample(const void *input_buffer, size_t input_buffer_bytes, void *samples, size_t *samples_size_bytes, double *bitrate);
  24. void Close();
  25. private:
  26. /* data */
  27. unsigned int channels;
  28. protected:
  29. RECVS_DISPATCH;
  30. };