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

52 lines
1.1 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;
2021-03-19 10:25:58 +00:00
class Threads;
2020-08-14 16:58:22 +00:00
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(
2021-03-19 10:25:58 +00:00
std::shared_ptr<Threads> threads,
std::string deviceId = std::string(),
2020-10-01 01:59:32 +00:00
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