| 12345678910111213141516171819202122232425262728 |
- #include "VideoCapturerFactory.h"
- #include "GdiCapturer.h"
- #include "DxgiCapturer.h"
- #include "WgcCapturer.h"
- namespace avrecorder {
- namespace video {
- std::unique_ptr<IVideoCapturer> VideoCapturerFactory::create(CaptureMethod method) {
- #ifdef PLATFORM_WINDOWS
- switch (method) {
- case CaptureMethod::GDI:
- return std::make_unique<GdiCapturer>();
- case CaptureMethod::DXGI:
- return std::make_unique<DxgiCapturer>();
- case CaptureMethod::WGC:
- return std::make_unique<WgcCapturer>();
- default:
- return nullptr;
- }
- #else
- // 其他平台可扩展
- return nullptr;
- #endif
- }
- } // namespace video
- } // namespace avrecorder
|