Add a new frame generator that cycles through randomly generated slides.
Like YuvFileGenerator, this also updates the display with a new slide on every Nth frame, but it generates the slides itself instead of reading them from files.
BUG=webrtc:8138
Review-Url: https://codereview.webrtc.org/3003193002
Cr-Commit-Position: refs/heads/master@{#19585}
diff --git a/webrtc/test/frame_generator_capturer.cc b/webrtc/test/frame_generator_capturer.cc
index 4f1937b..095a2043 100644
--- a/webrtc/test/frame_generator_capturer.cc
+++ b/webrtc/test/frame_generator_capturer.cc
@@ -114,6 +114,22 @@
return capturer.release();
}
+FrameGeneratorCapturer* FrameGeneratorCapturer::CreateSlideGenerator(
+ int width,
+ int height,
+ int frame_repeat_count,
+ int target_fps,
+ Clock* clock) {
+ std::unique_ptr<FrameGeneratorCapturer> capturer(new FrameGeneratorCapturer(
+ clock, FrameGenerator::CreateSlideGenerator(width, height,
+ frame_repeat_count),
+ target_fps));
+ if (!capturer->Init())
+ return nullptr;
+
+ return capturer.release();
+}
+
FrameGeneratorCapturer::FrameGeneratorCapturer(
Clock* clock,
std::unique_ptr<FrameGenerator> frame_generator,