#ifndef TGCALLS_VIDEO_CAPTURE_INTERFACE_H #define TGCALLS_VIDEO_CAPTURE_INTERFACE_H #include #include #include namespace rtc { template class VideoSinkInterface; } // namespace rtc namespace webrtc { class VideoFrame; } // namespace webrtc namespace tgcalls { class PlatformContext; class Threads; enum class VideoState { Inactive, Paused, Active, }; class VideoCaptureInterface { protected: VideoCaptureInterface() = default; public: static std::unique_ptr Create( std::shared_ptr threads, std::string deviceId = std::string(), bool isScreenCapture = false, std::shared_ptr platformContext = nullptr); virtual ~VideoCaptureInterface(); virtual void switchToDevice(std::string deviceId, bool isScreenCapture) = 0; virtual void setState(VideoState state) = 0; virtual void setPreferredAspectRatio(float aspectRatio) = 0; virtual void setOutput(std::shared_ptr> sink) = 0; virtual void setOnFatalError(std::function error) { // TODO: make this function pure virtual when everybody implements it. } virtual void setOnPause(std::function pause) { // TODO: make this function pure virtual when everybody implements it. } virtual void setOnIsActiveUpdated(std::function onIsActiveUpdated) { // TODO: make this function pure virtual when everybody implements it. } virtual void withNativeImplementation(std::function completion) { completion(nullptr); } virtual std::shared_ptr getPlatformContext() { return nullptr; } }; } // namespace tgcalls #endif