| #include <memory> |
| 6 |
| 7 | namespace rtc { |
| 8 | template <typename VideoFrameT> |
| 9 | class VideoSinkInterface; |
| 10 | } // namespace rtc |
| 11 |
| 12 | namespace webrtc { |
| 13 | class VideoFrame; |
| 14 | } // namespace webrtc |
| 15 |
| 16 | namespace tgcalls { |
| 17 |
| 18 | class PlatformContext; |
| 19 |
| 20 | enum class VideoState { |
| 21 | Inactive, |
| 22 | Paused, |
| 23 | Active, |
| 24 | }; |
| 25 |
| 26 | class VideoCaptureInterface { |
| 27 | protected: |
| 28 | VideoCaptureInterface() = default; |
| 29 |
| 30 | public: |
| 31 | static std::unique_ptr<VideoCaptureInterface> Create( |
| 32 | std::string deviceId = std::string(), |
| 33 | std::shared_ptr<PlatformContext> platformContext = nullptr); |
| 34 |
| 35 | virtual ~VideoCaptureInterface(); |
| 36 |
| 37 | virtual void switchToDevice(std::string deviceId) = 0; |
| 38 | virtual void setState(VideoState state) = 0; |
| 39 | virtual void setPreferredAspectRatio(float aspectRatio) = 0; |
| 40 | virtual void setOutput(std::shared_ptr<rtc::VideoSinkInterface<webrtc::VideoFrame>> sink) = 0; |
| 41 | virtual std::shared_ptr<PlatformContext> getPlatformContext() { |
| 42 | return nullptr; |
| 43 | } |
| 44 |
| 45 | }; |
| 46 |
| 47 | } // namespace tgcalls |
| 48 |
| 49 | #endif |
| 50 |