libvideorender.h 764 B

123456789101112131415161718192021222324252627282930313233343536373839
  1. #pragma once
  2. #include "ivideorenderinterface.h"
  3. #include <SDL2/SDL.h>
  4. #include <SDL2/SDL_video.h>
  5. #include <SDL2/SDL_render.h>
  6. #include <SDL2/SDL_rect.h>
  7. #include <SDL2/SDL_mutex.h>
  8. class VideoRenderImpl : public IVideoRender
  9. {
  10. public:
  11. VideoRenderImpl(IRenderCallback* pCallback);
  12. ~VideoRenderImpl();
  13. int VideoRenderSetParam();
  14. int StartVideoRender();
  15. int StopVideoRender();
  16. void VideoRenderDestroy();
  17. int ShowVideoWindow();
  18. int HideVideoWindow();
  19. int RenderVideoFrame(video_frame* pframe);
  20. private:
  21. SDL_Window* m_sdl_window;
  22. SDL_Texture* m_rending_texture;
  23. SDL_Renderer* m_renderer;
  24. IRenderCallback* m_callback;
  25. int m_cx;
  26. int m_cy;
  27. uint32_t m_videowidth;
  28. uint32_t m_videoheight;
  29. uint32_t m_width;
  30. uint32_t m_height;
  31. uint32_t m_flags;
  32. };