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