VideoRenderer.h 782 B

12345678910111213141516171819202122232425
  1. #pragma once
  2. class CVideoRenderer
  3. {
  4. public:
  5. CVideoRenderer();
  6. void SetRenderWindow(HWND wnd, int32_t width, int32_t height);
  7. void OnArgb32FrameReady(const void* data, const int stride, const int frame_width, const int frame_height);
  8. static LRESULT PaintProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lparam, UINT_PTR uIdSubclass,
  9. DWORD_PTR dwRefData);
  10. LRESULT OnPaintProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lparam, UINT_PTR uIdSubclass);
  11. void StartRender(bool bStart);
  12. static void FrameCallback(void* user_data,
  13. void* data,
  14. const int stride,
  15. const int frame_width,
  16. const int frame_height);
  17. private:
  18. void SetSize(int32_t width, int32_t height);
  19. HWND wnd_;
  20. BITMAPINFO bmi_;
  21. std::unique_ptr<uint8_t> image_;
  22. std::mutex buffer_lock_;
  23. bool start_;
  24. };