avi_mp4v_decoder.h 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. #pragma once
  2. #include "../Plugins/Input/in_avi/ifc_avivideodecoder.h"
  3. #include "../Plugins/Input/in_avi/svc_avidecoder.h"
  4. #include "MFTDecoder.h"
  5. // {3E450454-0286-4ad8-811F-60A49C933E9B}
  6. static const GUID avi_mp4v_guid =
  7. { 0x3e450454, 0x286, 0x4ad8, { 0x81, 0x1f, 0x60, 0xa4, 0x9c, 0x93, 0x3e, 0x9b } };
  8. class AVIDecoderCreator : public svc_avidecoder
  9. {
  10. public:
  11. static const char *getServiceName() { return "MPEG-4 Part 2 AVI Decoder"; }
  12. static GUID getServiceGuid() { return avi_mp4v_guid; }
  13. int CreateVideoDecoder(const nsavi::AVIH *avi_header, const nsavi::STRH *stream_header, const nsavi::STRF *stream_format, const nsavi::STRD *stream_data, ifc_avivideodecoder **decoder);
  14. protected:
  15. RECVS_DISPATCH;
  16. };
  17. class AVIMP4V : public ifc_avivideodecoder
  18. {
  19. public:
  20. AVIMP4V(MFTDecoder *decoder, const nsavi::STRH *stream_header, const nsavi::video_format *stream_format);
  21. ~AVIMP4V();
  22. int GetOutputProperties(int *x, int *y, int *color_format, double *aspect_ratio, int *flip);
  23. int DecodeChunk(uint16_t type, const void *inputBuffer, size_t inputBufferBytes);
  24. void Flush();
  25. int GetPicture(void **data, void **decoder_data);
  26. void FreePicture(void *data, void *decoder_data);
  27. void EndOfStream();
  28. void HurryUp(int state);
  29. void Close();
  30. private:
  31. MFTDecoder *decoder;
  32. const nsavi::STRH *stream_header;
  33. const nsavi::video_format *stream_format;
  34. protected:
  35. RECVS_DISPATCH;
  36. };