VideoCapturerFactory.cpp 672 B

12345678910111213141516171819202122232425262728
  1. #include "VideoCapturerFactory.h"
  2. #include "GdiCapturer.h"
  3. #include "DxgiCapturer.h"
  4. #include "WgcCapturer.h"
  5. namespace avrecorder {
  6. namespace video {
  7. std::unique_ptr<IVideoCapturer> VideoCapturerFactory::create(CaptureMethod method) {
  8. #ifdef PLATFORM_WINDOWS
  9. switch (method) {
  10. case CaptureMethod::GDI:
  11. return std::make_unique<GdiCapturer>();
  12. case CaptureMethod::DXGI:
  13. return std::make_unique<DxgiCapturer>();
  14. case CaptureMethod::WGC:
  15. return std::make_unique<WgcCapturer>();
  16. default:
  17. return nullptr;
  18. }
  19. #else
  20. // 其他平台可扩展
  21. return nullptr;
  22. #endif
  23. }
  24. } // namespace video
  25. } // namespace avrecorder