| #include <string> |
| 6 |
| 7 | namespace webrtc { |
| 8 | class VideoTrackSourceInterface; |
| 9 | class VideoFrame; |
| 10 | } |
| 11 |
| 12 | namespace tgcalls { |
| 13 | class FrameSource { |
| 14 | public: |
| 15 | struct Info { |
| 16 | int32_t width; |
| 17 | int32_t height; |
| 18 | }; |
| 19 |
| 20 | virtual ~FrameSource() = default; |
| 21 |
| 22 | virtual Info info() const = 0; |
| 23 | virtual webrtc::VideoFrame next_frame(); |
| 24 | static void video_frame_to_rgb0(const webrtc::VideoFrame &src, char *dest); |
| 25 | virtual void next_frame_rgb0(char *buf, double *pt_in_seconds) = 0; |
| 26 |
| 27 | static std::unique_ptr<FrameSource> chess(); |
| 28 | static std::unique_ptr<FrameSource> from_file(std::string path); |
| 29 | }; |
| 30 |
| 31 | class FakeVideoTrackSource { |
| 32 | public: |
| 33 | static std::function<webrtc::VideoTrackSourceInterface*()> create(std::unique_ptr<FrameSource> source); |
| 34 | }; |
| 35 | } |