VideoPlayer.h 410 B

1234567891011121314151617181920
  1. #pragma once
  2. extern "C" {
  3. #include <libavutil/frame.h>
  4. }
  5. class VideoPlayer {
  6. public:
  7. VideoPlayer();
  8. ~VideoPlayer();
  9. void init(AVFrame* frame);
  10. void render(AVFrame* frame, void* renderFunc, void* renderContext);
  11. void setKeepAspectRatio(bool keep);
  12. bool keepAspectRatio() const;
  13. private:
  14. int m_width = 0;
  15. int m_height = 0;
  16. int m_format = 0;
  17. bool m_keepAspect = true;
  18. };