1
0

avi_adpcm_decoder.h 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. #pragma once
  2. #include "../Plugins/Input/in_avi/svc_avidecoder.h"
  3. #include "../Plugins/Input/in_avi/ifc_aviaudiodecoder.h"
  4. // {E0BCBBDF-F1DC-4459-8C0A-4F3FFECFC80E}
  5. static const GUID avi_adpcm_guid =
  6. { 0xe0bcbbdf, 0xf1dc, 0x4459, { 0x8c, 0xa, 0x4f, 0x3f, 0xfe, 0xcf, 0xc8, 0xe } };
  7. struct ms_adpcm_format;
  8. class AVIDecoder : public svc_avidecoder
  9. {
  10. public:
  11. static const char *getServiceName() { return "ADPCM AVI Decoder"; }
  12. static GUID getServiceGuid() { return avi_adpcm_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 MS_ADPCM_AVIDecoder : public ifc_aviaudiodecoder
  18. {
  19. public:
  20. MS_ADPCM_AVIDecoder(const ms_adpcm_format *adpcmformat, const nsavi::STRH *stream_header);
  21. protected:
  22. RECVS_DISPATCH;
  23. private:
  24. /* ifc_aviaudiodecoder implementation */
  25. int OutputFrameSize(size_t *frame_size);
  26. int GetOutputProperties(unsigned int *sampleRate, unsigned int *channels, unsigned int *bitsPerSample, bool *isFloat);
  27. int DecodeChunk(uint16_t type, void **inputBuffer, size_t *inputBufferBytes, void *outputBuffer, size_t *outputBufferBytes);
  28. void Close();
  29. private:
  30. const ms_adpcm_format *adpcmformat;
  31. const nsavi::STRH *stream_header;
  32. };