1
0

avi_pcm_decoder.h 1.3 KB

123456789101112131415161718192021222324252627282930313233343536
  1. #pragma once
  2. #include "../Plugins/Input/in_avi/svc_avidecoder.h"
  3. #include "../Plugins/Input/in_avi/ifc_aviaudiodecoder.h"
  4. // {739A9D4E-2235-4298-AA4F-2E9F1B5DE8EC}
  5. static const GUID avi_pcm_guid =
  6. { 0x739a9d4e, 0x2235, 0x4298, { 0xaa, 0x4f, 0x2e, 0x9f, 0x1b, 0x5d, 0xe8, 0xec } };
  7. class AVIDecoder : public svc_avidecoder
  8. {
  9. public:
  10. static const char *getServiceName() { return "PCM AVI Decoder"; }
  11. static GUID getServiceGuid() { return avi_pcm_guid; }
  12. 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);
  13. protected:
  14. RECVS_DISPATCH;
  15. };
  16. class AVIPCMDecoder : public ifc_aviaudiodecoder
  17. {
  18. public:
  19. AVIPCMDecoder(const nsavi::audio_format *waveformat);
  20. protected:
  21. RECVS_DISPATCH;
  22. private:
  23. /* ifc_aviaudiodecoder implementation */
  24. int OutputFrameSize(size_t *frame_size);
  25. int GetOutputProperties(unsigned int *sampleRate, unsigned int *channels, unsigned int *bitsPerSample, bool *isFloat);
  26. int DecodeChunk(uint16_t type, void **inputBuffer, size_t *inputBufferBytes, void *outputBuffer, size_t *outputBufferBytes);
  27. void Close();
  28. private:
  29. const nsavi::audio_format *waveformat;
  30. };