1
0

nsv_vp8_decoder.h 1.0 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. #pragma once
  2. #include "../nsv/svc_nsvFactory.h"
  3. #include "../nsv/dec_if.h"
  4. #define VPX_CODEC_DISABLE_COMPAT 1
  5. #include <vpx/vpx_decoder.h>
  6. #include <vpx/vp8dx.h>
  7. // {9CF1837B-4A88-433d-B54B-9C783D39974F}
  8. static const GUID vp8_nsv_guid =
  9. { 0x9cf1837b, 0x4a88, 0x433d, { 0xb5, 0x4b, 0x9c, 0x78, 0x3d, 0x39, 0x97, 0x4f } };
  10. class NSVFactory : public svc_nsvFactory
  11. {
  12. public:
  13. static const char *getServiceName() { return "VP8 NSV Decoder"; }
  14. static GUID getServiceGuid() { return vp8_nsv_guid; }
  15. IVideoDecoder *CreateVideoDecoder(int w, int h, double framerate, unsigned int fmt, int *flip);
  16. protected:
  17. RECVS_DISPATCH;
  18. };
  19. class VP8_Decoder : public IVideoDecoder
  20. {
  21. public:
  22. VP8_Decoder(int w, int h);
  23. ~VP8_Decoder();
  24. int decode(int need_kf,
  25. void *in, int in_len,
  26. void **out, // out is set to a pointer to data
  27. unsigned int *out_type, // 'Y','V','1','2' is currently defined
  28. int *is_kf);
  29. void flush() { }
  30. private:
  31. vpx_codec_ctx_t decoder;
  32. YV12_PLANES planes;
  33. };