1 #ifndef TGCALLS_VIDEO_CAPTURER_INTERFACE_H 2 #define TGCALLS_VIDEO_CAPTURER_INTERFACE_H 3 4 #include "Instance.h" 5 6 #include <memory> 7 #include <functional> 8 9 namespace rtc { 10 template <typename VideoFrameT> 11 class VideoSinkInterface; 12 } // namespace rtc 13 14 namespace webrtc { 15 class VideoFrame; 16 } // namespace webrtc 17 18 namespace tgcalls { 19 20 class VideoCapturerInterface { 21 public: 22 virtual ~VideoCapturerInterface() = default; 23 24 virtual void setState(VideoState state) = 0; 25 virtual void setPreferredCaptureAspectRatio(float aspectRatio) = 0; 26 virtual void setUncroppedOutput(std::shared_ptr<rtc::VideoSinkInterface<webrtc::VideoFrame>> sink) = 0; 27 virtual int getRotation() = 0; setOnFatalError(std::function<void ()> error)28 virtual void setOnFatalError(std::function<void()> error) { 29 // TODO: make this function pure virtual when everybody implements it. 30 } setOnPause(std::function<void (bool)> pause)31 virtual void setOnPause(std::function<void(bool)> pause) { 32 // TODO: make this function pure virtual when everybody implements it. 33 } withNativeImplementation(std::function<void (void *)> completion)34 virtual void withNativeImplementation(std::function<void(void *)> completion) { 35 completion(nullptr); 36 } 37 38 }; 39 40 } // namespace tgcalls 41 42 #endif 43