Files
tdesktop/Telegram/ThirdParty/tgcalls/tgcalls/FakeVideoTrackSource.h
allhaileris afb81b8278
Some checks failed
Docker. / Ubuntu (push) Has been cancelled
User-agent updater. / User-agent (push) Failing after 15s
Lock Threads / lock (push) Failing after 10s
Waiting for answer. / waiting-for-answer (push) Failing after 22s
Needs user action. / needs-user-action (push) Failing after 8s
Can't reproduce. / cant-reproduce (push) Failing after 8s
Close stale issues and PRs / stale (push) Has been cancelled
init
2026-02-16 15:50:16 +03:00

35 lines
783 B
C++

#pragma once
#include <functional>
#include <memory>
#include <string>
namespace webrtc {
class VideoTrackSourceInterface;
class VideoFrame;
}
namespace tgcalls {
class FrameSource {
public:
struct Info {
int32_t width;
int32_t height;
};
virtual ~FrameSource() = default;
virtual Info info() const = 0;
virtual webrtc::VideoFrame next_frame();
static void video_frame_to_rgb0(const webrtc::VideoFrame &src, char *dest);
virtual void next_frame_rgb0(char *buf, double *pt_in_seconds) = 0;
static std::unique_ptr<FrameSource> chess();
static std::unique_ptr<FrameSource> from_file(std::string path);
};
class FakeVideoTrackSource {
public:
static std::function<webrtc::VideoTrackSourceInterface*()> create(std::unique_ptr<FrameSource> source);
};
}