gdi_capturer.h 502 B

1234567891011121314151617181920212223242526
  1. #ifndef __GDI_CAPTURER_H__
  2. #define __GDI_CAPTURER_H__
  3. #include "basic/frame.h"
  4. #include <Windows.h>
  5. class GdiCapturer {
  6. public:
  7. bool Open(HWND hwnd, int width, int height);
  8. HDC GetHdc(int borderWidth, int borderHeight);
  9. AVFrame* GetFrame();
  10. void Close();
  11. ~GdiCapturer();
  12. private:
  13. HDC _srcHdc = nullptr;
  14. HDC _dstHdc = nullptr;
  15. HBITMAP _bitmap = nullptr;
  16. BITMAPINFO _bitmapInfo;
  17. int m_width = 0;
  18. int m_height = 0;
  19. AVFrame* _frame = nullptr;
  20. };
  21. #endif