Files
tgcalls/tools/cli/fake_video_source.h
isaacandClaude Opus 4.7 aaa583f1a9 feat: add testbench (CLI tool, Go SFU, Dockerfile, docs)
Brings the testbench source into the submodule:
- tools/cli/ — C++ CLI test tool (P2P, reflector, group, group-churn modes)
- tools/go_sfu/ — Go/Pion SFU library, c-archive linked into tgcalls_cli
- Dockerfile — multi-stage Linux container build
- CLAUDE.md (top-level), tools/cli/CLAUDE.md, tools/go_sfu/CLAUDE.md — docs

Bazel build glue (.bazelrc, MODULE.bazel, third-party BUILD edits, tgcalls_core
target) remains in the outer repo since the dependency stack lives there;
labels and paths in this repo reference the outer-repo workspace root.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-30 19:00:55 +02:00

39 lines
1.1 KiB
C++

#pragma once
#include "api/video/i420_buffer.h"
#include "media/base/adapted_video_track_source.h"
#include "rtc_base/ref_counted_object.h"
#include <atomic>
#include <thread>
// Generates 640x360 I420 frames at 30fps with per-participant color tint
// and an incrementing frame counter rendered as block digits.
class FakeVideoTrackSource : public rtc::AdaptedVideoTrackSource {
public:
static rtc::scoped_refptr<FakeVideoTrackSource> Create(int participantId);
~FakeVideoTrackSource() override;
void Stop();
// VideoTrackSourceInterface
SourceState state() const override { return kLive; }
bool remote() const override { return false; }
bool is_screencast() const override { return false; }
absl::optional<bool> needs_denoising() const override { return false; }
protected:
explicit FakeVideoTrackSource(int participantId);
private:
void GenerateThread();
void RenderDigits(uint8_t* yPlane, int strideY, int frameNumber);
int participantId_;
uint8_t uTint_;
uint8_t vTint_;
std::atomic<bool> running_{true};
std::thread thread_;
};