1 // 2 // DesktopCaptureSourceManager.h 3 // TgVoipWebrtc 4 // 5 // Created by Mikhail Filimonov on 28.12.2020. 6 // Copyright © 2020 Mikhail Filimonov. All rights reserved. 7 // 8 #ifndef TGCALLS_DESKTOP_CAPTURE_SOURCE_MANAGER_H__ 9 #define TGCALLS_DESKTOP_CAPTURE_SOURCE_MANAGER_H__ 10 11 #include "tgcalls/desktop_capturer/DesktopCaptureSource.h" 12 #include "tgcalls/desktop_capturer/DesktopCaptureSourceHelper.h" 13 14 #include <map> 15 #include <vector> 16 17 namespace webrtc { 18 class DesktopCapturer; 19 class DesktopCaptureOptions; 20 } // namespace webrtc 21 22 namespace tgcalls { 23 24 enum class DesktopCaptureType { 25 Screen, 26 Window, 27 }; 28 29 class DesktopCaptureSourceManager { 30 public: 31 explicit DesktopCaptureSourceManager(DesktopCaptureType type); 32 ~DesktopCaptureSourceManager(); 33 34 std::vector<DesktopCaptureSource> sources(); 35 36 private: 37 static webrtc::DesktopCaptureOptions OptionsForType( 38 DesktopCaptureType type); 39 static std::unique_ptr<webrtc::DesktopCapturer> CreateForType( 40 DesktopCaptureType type); 41 42 std::unique_ptr<webrtc::DesktopCapturer> _capturer; 43 DesktopCaptureType _type = DesktopCaptureType::Screen; 44 45 }; 46 47 } // namespace tgcalls 48 49 #endif // TGCALLS_DESKTOP_CAPTURE_SOURCE_MANAGER_H__ 50