1
0

MFTDecoder.h 691 B

123456789101112131415161718192021222324
  1. #pragma once
  2. #include <mftransform.h>
  3. #include <bfc/platform/types.h>
  4. // generic API for use by all decoder flavors (MP4, MKV, etc)
  5. class MFTDecoder
  6. {
  7. public:
  8. MFTDecoder();
  9. ~MFTDecoder();
  10. HRESULT Open(const void *asc, size_t asc_bytes);
  11. HRESULT Open();
  12. void Flush();
  13. HRESULT GetOutputProperties(uint32_t *sampleRate, uint32_t *channels);
  14. HRESULT Feed(const void *buffer, size_t bufferBytes);
  15. HRESULT Decode(void *outputBuffer, size_t *outputBufferBytes, unsigned int bitsPerSample, bool useFloat, double gain);
  16. HRESULT OutputBlockSizeSamples(size_t *frameSize);
  17. bool AcceptingInput();
  18. private:
  19. IMFTransform *decoder;
  20. IMFMediaBuffer *output_buffer;
  21. IMFSample *output_sample;
  22. };