Nagram/TMessagesProj/jni/voip/tgcalls/VideoCaptureInterface.h

50 lines
1.0 KiB
C
Raw Normal View History

2020-08-14 16:58:22 +00:00
#ifndef TGCALLS_VIDEO_CAPTURE_INTERFACE_H
#define TGCALLS_VIDEO_CAPTURE_INTERFACE_H
2020-10-01 01:59:32 +00:00
#include <string>
2020-08-14 16:58:22 +00:00
#include <memory>
namespace rtc {
template <typename VideoFrameT>
class VideoSinkInterface;
} // namespace rtc
namespace webrtc {
class VideoFrame;
} // namespace webrtc
namespace tgcalls {
class PlatformContext;
enum class VideoState {
Inactive,
Paused,
Active,
};
class VideoCaptureInterface {
protected:
VideoCaptureInterface() = default;
public:
2020-10-01 01:59:32 +00:00
static std::unique_ptr<VideoCaptureInterface> Create(
std::string deviceId = std::string(),
std::shared_ptr<PlatformContext> platformContext = nullptr);
2020-08-14 16:58:22 +00:00
virtual ~VideoCaptureInterface();
2020-10-01 01:59:32 +00:00
virtual void switchToDevice(std::string deviceId) = 0;
2020-08-14 16:58:22 +00:00
virtual void setState(VideoState state) = 0;
virtual void setPreferredAspectRatio(float aspectRatio) = 0;
virtual void setOutput(std::shared_ptr<rtc::VideoSinkInterface<webrtc::VideoFrame>> sink) = 0;
2020-08-21 23:59:49 +00:00
virtual std::shared_ptr<PlatformContext> getPlatformContext() {
return nullptr;
}
2020-08-14 16:58:22 +00:00
};
} // namespace tgcalls
#endif