DxgiCapturer.h 678 B

12345678910111213141516171819202122232425262728
  1. #ifndef DXGICAPTURER_H
  2. #define DXGICAPTURER_H
  3. #include "IVideoCapturer.h"
  4. #include <d3d11.h>
  5. #include <dxgi1_2.h>
  6. namespace avrecorder {
  7. namespace video {
  8. class DxgiCapturer : public IVideoCapturer {
  9. public:
  10. DxgiCapturer();
  11. ~DxgiCapturer() override;
  12. bool open(const CaptureTarget& target, int width, int height) override;
  13. void close() override;
  14. AVFrame* getFrame() override;
  15. void setDrawCursor(bool enable) override { m_drawCursor = enable; }
  16. private:
  17. class DxgiCapturerPrivate* d;
  18. bool m_drawCursor = true;
  19. int m_left = 0, m_top = 0, m_width = 0, m_height = 0;
  20. };
  21. } // namespace video
  22. } // namespace avrecorder
  23. #endif // DXGICAPTURER_H