blob: eff2ec237d9a1c920027e30ae7fbaa65557a6512 [file] [log] [blame]
andresp@webrtc.orgab654952013-09-19 12:14:03 +00001/*
2 * Copyright (c) 2013 The WebRTC project authors. All Rights Reserved.
3 *
4 * Use of this source code is governed by a BSD-style license
5 * that can be found in the LICENSE file in the root of the source
6 * tree. An additional intellectual property rights grant can be found
7 * in the file PATENTS. All contributing project authors may
8 * be found in the AUTHORS file in the root of the source tree.
9 */
pbos@webrtc.org724947b2013-12-11 16:26:16 +000010#include "webrtc/test/frame_generator.h"
andresp@webrtc.orgab654952013-09-19 12:14:03 +000011
pbos@webrtc.org266c7b32013-10-15 09:15:47 +000012#include <math.h>
andresp@webrtc.orgab654952013-09-19 12:14:03 +000013#include <stdio.h>
pbos@webrtc.org266c7b32013-10-15 09:15:47 +000014#include <string.h>
andresp@webrtc.orgab654952013-09-19 12:14:03 +000015
kwibergbfefb032016-05-01 14:53:46 -070016#include <memory>
17
nisseaf916892017-01-10 07:44:26 -080018#include "webrtc/api/video/i420_buffer.h"
nisseaf916892017-01-10 07:44:26 -080019#include "webrtc/common_video/include/video_frame_buffer.h"
andresp@webrtc.orgab654952013-09-19 12:14:03 +000020#include "webrtc/common_video/libyuv/include/webrtc_libyuv.h"
Edward Lemurc20978e2017-07-06 19:44:34 +020021#include "webrtc/rtc_base/checks.h"
22#include "webrtc/rtc_base/keep_ref_until_done.h"
23#include "webrtc/rtc_base/random.h"
Henrik Kjellander98f53512015-10-28 18:17:40 +010024#include "webrtc/system_wrappers/include/clock.h"
nisse115bd152016-09-30 04:14:07 -070025#include "webrtc/test/frame_utils.h"
andresp@webrtc.orgab654952013-09-19 12:14:03 +000026
27namespace webrtc {
28namespace test {
29namespace {
30
perkja8ba1952017-02-27 06:52:10 -080031// SquareGenerator is a FrameGenerator that draws 10 randomly sized and colored
32// squares. Between each new generated frame, the squares are moved slightly
33// towards the lower right corner.
34class SquareGenerator : public FrameGenerator {
pbos@webrtc.org266c7b32013-10-15 09:15:47 +000035 public:
perkja8ba1952017-02-27 06:52:10 -080036 SquareGenerator(int width, int height) {
perkjfa10b552016-10-02 23:45:26 -070037 ChangeResolution(width, height);
perkja8ba1952017-02-27 06:52:10 -080038 for (int i = 0; i < 10; ++i) {
39 squares_.emplace_back(new Square(width, height, i + 1));
40 }
perkjfa10b552016-10-02 23:45:26 -070041 }
42
43 void ChangeResolution(size_t width, size_t height) override {
44 rtc::CritScope lock(&crit_);
perkja8ba1952017-02-27 06:52:10 -080045 width_ = static_cast<int>(width);
46 height_ = static_cast<int>(height);
nisse1996e3f2016-09-19 00:34:46 -070047 RTC_CHECK(width_ > 0);
48 RTC_CHECK(height_ > 0);
pbos@webrtc.org266c7b32013-10-15 09:15:47 +000049 }
50
Miguel Casas-Sanchez47650702015-05-29 17:21:40 -070051 VideoFrame* NextFrame() override {
perkjfa10b552016-10-02 23:45:26 -070052 rtc::CritScope lock(&crit_);
pbos@webrtc.org266c7b32013-10-15 09:15:47 +000053
Magnus Jedvert90e31902017-06-07 11:32:50 +020054 rtc::scoped_refptr<I420Buffer> buffer(I420Buffer::Create(width_, height_));
55
56 memset(buffer->MutableDataY(), 127, height_ * buffer->StrideY());
57 memset(buffer->MutableDataU(), 127,
58 buffer->ChromaHeight() * buffer->StrideU());
59 memset(buffer->MutableDataV(), 127,
60 buffer->ChromaHeight() * buffer->StrideV());
nisse1996e3f2016-09-19 00:34:46 -070061
perkja8ba1952017-02-27 06:52:10 -080062 for (const auto& square : squares_)
63 square->Draw(buffer);
nisse1996e3f2016-09-19 00:34:46 -070064
65 frame_.reset(new VideoFrame(buffer, 0, 0, webrtc::kVideoRotation_0));
66 return frame_.get();
pbos@webrtc.org266c7b32013-10-15 09:15:47 +000067 }
68
69 private:
perkja8ba1952017-02-27 06:52:10 -080070 class Square {
71 public:
72 Square(int width, int height, int seed)
73 : random_generator_(seed),
74 x_(random_generator_.Rand(0, width)),
75 y_(random_generator_.Rand(0, height)),
76 length_(random_generator_.Rand(1, width > 4 ? width / 4 : 1)),
77 yuv_y_(random_generator_.Rand(0, 255)),
78 yuv_u_(random_generator_.Rand(0, 255)),
79 yuv_v_(random_generator_.Rand(0, 255)) {}
80
81 void Draw(const rtc::scoped_refptr<I420Buffer>& buffer) {
82 x_ = (x_ + random_generator_.Rand(0, 4)) % (buffer->width() - length_);
83 y_ = (y_ + random_generator_.Rand(0, 4)) % (buffer->height() - length_);
perkja8ba1952017-02-27 06:52:10 -080084 for (int y = y_; y < y_ + length_; ++y) {
perkjc8b08652017-03-22 04:57:53 -070085 uint8_t* pos_y =
86 (buffer->MutableDataY() + x_ + y * buffer->StrideY());
87 memset(pos_y, yuv_y_, length_);
perkja8ba1952017-02-27 06:52:10 -080088 }
perkjc8b08652017-03-22 04:57:53 -070089
90 for (int y = y_; y < y_ + length_; y = y + 2) {
91 uint8_t* pos_u =
92 (buffer->MutableDataU() + x_ / 2 + y / 2 * buffer->StrideU());
93 memset(pos_u, yuv_u_, length_ / 2);
94 uint8_t* pos_v =
95 (buffer->MutableDataV() + x_ / 2 + y / 2 * buffer->StrideV());
96 memset(pos_v, yuv_v_, length_ / 2);
97 }
perkja8ba1952017-02-27 06:52:10 -080098 }
99
100 private:
101 Random random_generator_;
102 int x_;
103 int y_;
104 const int length_;
105 const uint8_t yuv_y_;
106 const uint8_t yuv_u_;
107 const uint8_t yuv_v_;
108 };
109
perkjfa10b552016-10-02 23:45:26 -0700110 rtc::CriticalSection crit_;
danilchapa37de392017-09-09 04:17:22 -0700111 int width_ RTC_GUARDED_BY(&crit_);
112 int height_ RTC_GUARDED_BY(&crit_);
113 std::vector<std::unique_ptr<Square>> squares_ RTC_GUARDED_BY(&crit_);
114 std::unique_ptr<VideoFrame> frame_ RTC_GUARDED_BY(&crit_);
pbos@webrtc.org266c7b32013-10-15 09:15:47 +0000115};
116
andresp@webrtc.orgab654952013-09-19 12:14:03 +0000117class YuvFileGenerator : public FrameGenerator {
118 public:
sprang@webrtc.org131bea82015-02-18 12:46:06 +0000119 YuvFileGenerator(std::vector<FILE*> files,
120 size_t width,
121 size_t height,
122 int frame_repeat_count)
123 : file_index_(0),
124 files_(files),
125 width_(width),
126 height_(height),
nisseeb44b392017-04-28 07:18:05 -0700127 frame_size_(CalcBufferSize(VideoType::kI420,
sprang@webrtc.org131bea82015-02-18 12:46:06 +0000128 static_cast<int>(width_),
129 static_cast<int>(height_))),
130 frame_buffer_(new uint8_t[frame_size_]),
131 frame_display_count_(frame_repeat_count),
132 current_display_count_(0) {
kwibergb890c95c2016-11-29 05:30:40 -0800133 RTC_DCHECK_GT(width, 0);
134 RTC_DCHECK_GT(height, 0);
135 RTC_DCHECK_GT(frame_repeat_count, 0);
andresp@webrtc.orgab654952013-09-19 12:14:03 +0000136 }
137
138 virtual ~YuvFileGenerator() {
sprang@webrtc.org131bea82015-02-18 12:46:06 +0000139 for (FILE* file : files_)
140 fclose(file);
andresp@webrtc.orgab654952013-09-19 12:14:03 +0000141 }
142
Miguel Casas-Sanchez47650702015-05-29 17:21:40 -0700143 VideoFrame* NextFrame() override {
sprang@webrtc.org25dd1db2015-03-02 11:55:45 +0000144 if (current_display_count_ == 0)
145 ReadNextFrame();
146 if (++current_display_count_ >= frame_display_count_)
147 current_display_count_ = 0;
andresp@webrtc.orgab654952013-09-19 12:14:03 +0000148
nisse1996e3f2016-09-19 00:34:46 -0700149 temp_frame_.reset(
150 new VideoFrame(last_read_buffer_, 0, 0, webrtc::kVideoRotation_0));
151 return temp_frame_.get();
sprang@webrtc.org131bea82015-02-18 12:46:06 +0000152 }
pbos@webrtc.org724947b2013-12-11 16:26:16 +0000153
sprang@webrtc.org131bea82015-02-18 12:46:06 +0000154 void ReadNextFrame() {
nisse115bd152016-09-30 04:14:07 -0700155 last_read_buffer_ =
156 test::ReadI420Buffer(static_cast<int>(width_),
157 static_cast<int>(height_),
158 files_[file_index_]);
159 if (!last_read_buffer_) {
sprang@webrtc.org131bea82015-02-18 12:46:06 +0000160 // No more frames to read in this file, rewind and move to next file.
161 rewind(files_[file_index_]);
162 file_index_ = (file_index_ + 1) % files_.size();
nisse115bd152016-09-30 04:14:07 -0700163 last_read_buffer_ =
164 test::ReadI420Buffer(static_cast<int>(width_),
165 static_cast<int>(height_),
166 files_[file_index_]);
167 RTC_CHECK(last_read_buffer_);
sprang@webrtc.org131bea82015-02-18 12:46:06 +0000168 }
andresp@webrtc.orgab654952013-09-19 12:14:03 +0000169 }
170
171 private:
sprang@webrtc.org131bea82015-02-18 12:46:06 +0000172 size_t file_index_;
173 const std::vector<FILE*> files_;
174 const size_t width_;
175 const size_t height_;
176 const size_t frame_size_;
kwibergbfefb032016-05-01 14:53:46 -0700177 const std::unique_ptr<uint8_t[]> frame_buffer_;
sprang@webrtc.org131bea82015-02-18 12:46:06 +0000178 const int frame_display_count_;
179 int current_display_count_;
nisse1996e3f2016-09-19 00:34:46 -0700180 rtc::scoped_refptr<I420Buffer> last_read_buffer_;
181 std::unique_ptr<VideoFrame> temp_frame_;
andresp@webrtc.orgab654952013-09-19 12:14:03 +0000182};
sprangd6358952015-07-29 07:58:13 -0700183
erikvarga579de6f2017-08-29 09:12:57 -0700184// SlideGenerator works similarly to YuvFileGenerator but it fills the frames
185// with randomly sized and colored squares instead of reading their content
186// from files.
187class SlideGenerator : public FrameGenerator {
188 public:
189 SlideGenerator(int width, int height, int frame_repeat_count)
190 : width_(width),
191 height_(height),
192 frame_display_count_(frame_repeat_count),
193 current_display_count_(0),
194 random_generator_(1234) {
195 RTC_DCHECK_GT(width, 0);
196 RTC_DCHECK_GT(height, 0);
197 RTC_DCHECK_GT(frame_repeat_count, 0);
198 }
199
200 VideoFrame* NextFrame() override {
201 if (current_display_count_ == 0)
202 GenerateNewFrame();
203 if (++current_display_count_ >= frame_display_count_)
204 current_display_count_ = 0;
205
206 frame_.reset(
207 new VideoFrame(buffer_, 0, 0, webrtc::kVideoRotation_0));
208 return frame_.get();
209 }
210
211 // Generates some randomly sized and colored squares scattered
212 // over the frame.
213 void GenerateNewFrame() {
214 // The squares should have a varying order of magnitude in order
215 // to simulate variation in the slides' complexity.
216 const int kSquareNum = 1 << (4 + (random_generator_.Rand(0, 3) * 4));
217
218 buffer_ = I420Buffer::Create(width_, height_);
219 memset(buffer_->MutableDataY(), 127, height_ * buffer_->StrideY());
220 memset(buffer_->MutableDataU(), 127,
221 buffer_->ChromaHeight() * buffer_->StrideU());
222 memset(buffer_->MutableDataV(), 127,
223 buffer_->ChromaHeight() * buffer_->StrideV());
224
225 for (int i = 0; i < kSquareNum; ++i) {
226 int length = random_generator_.Rand(1, width_ > 4 ? width_ / 4 : 1);
227 // Limit the length of later squares so that they don't overwrite the
228 // previous ones too much.
229 length = (length * (kSquareNum - i)) / kSquareNum;
230
231 int x = random_generator_.Rand(0, width_ - length);
232 int y = random_generator_.Rand(0, height_ - length);
233 uint8_t yuv_y = random_generator_.Rand(0, 255);
234 uint8_t yuv_u = random_generator_.Rand(0, 255);
235 uint8_t yuv_v = random_generator_.Rand(0, 255);
236
237 for (int yy = y; yy < y + length; ++yy) {
238 uint8_t* pos_y =
239 (buffer_->MutableDataY() + x + yy * buffer_->StrideY());
240 memset(pos_y, yuv_y, length);
241 }
242 for (int yy = y; yy < y + length; yy += 2) {
243 uint8_t* pos_u =
244 (buffer_->MutableDataU() + x / 2 + yy / 2 * buffer_->StrideU());
245 memset(pos_u, yuv_u, length / 2);
246 uint8_t* pos_v =
247 (buffer_->MutableDataV() + x / 2 + yy / 2 * buffer_->StrideV());
248 memset(pos_v, yuv_v, length / 2);
249 }
250 }
251 }
252
253 private:
254 const int width_;
255 const int height_;
256 const int frame_display_count_;
257 int current_display_count_;
258 Random random_generator_;
259 rtc::scoped_refptr<I420Buffer> buffer_;
260 std::unique_ptr<VideoFrame> frame_;
261};
262
sprangd6358952015-07-29 07:58:13 -0700263class ScrollingImageFrameGenerator : public FrameGenerator {
264 public:
265 ScrollingImageFrameGenerator(Clock* clock,
266 const std::vector<FILE*>& files,
267 size_t source_width,
268 size_t source_height,
269 size_t target_width,
270 size_t target_height,
271 int64_t scroll_time_ms,
272 int64_t pause_time_ms)
273 : clock_(clock),
274 start_time_(clock->TimeInMilliseconds()),
275 scroll_time_(scroll_time_ms),
276 pause_time_(pause_time_ms),
277 num_frames_(files.size()),
nissef122a852016-10-04 23:27:30 -0700278 target_width_(static_cast<int>(target_width)),
279 target_height_(static_cast<int>(target_height)),
sprangd6358952015-07-29 07:58:13 -0700280 current_frame_num_(num_frames_ - 1),
281 current_source_frame_(nullptr),
282 file_generator_(files, source_width, source_height, 1) {
henrikg91d6ede2015-09-17 00:24:34 -0700283 RTC_DCHECK(clock_ != nullptr);
kwibergaf476c72016-11-28 15:21:39 -0800284 RTC_DCHECK_GT(num_frames_, 0);
henrikg91d6ede2015-09-17 00:24:34 -0700285 RTC_DCHECK_GE(source_height, target_height);
286 RTC_DCHECK_GE(source_width, target_width);
287 RTC_DCHECK_GE(scroll_time_ms, 0);
288 RTC_DCHECK_GE(pause_time_ms, 0);
289 RTC_DCHECK_GT(scroll_time_ms + pause_time_ms, 0);
sprangd6358952015-07-29 07:58:13 -0700290 }
291
292 virtual ~ScrollingImageFrameGenerator() {}
293
294 VideoFrame* NextFrame() override {
295 const int64_t kFrameDisplayTime = scroll_time_ + pause_time_;
296 const int64_t now = clock_->TimeInMilliseconds();
297 int64_t ms_since_start = now - start_time_;
298
299 size_t frame_num = (ms_since_start / kFrameDisplayTime) % num_frames_;
300 UpdateSourceFrame(frame_num);
301
302 double scroll_factor;
303 int64_t time_into_frame = ms_since_start % kFrameDisplayTime;
304 if (time_into_frame < scroll_time_) {
305 scroll_factor = static_cast<double>(time_into_frame) / scroll_time_;
306 } else {
307 scroll_factor = 1.0;
308 }
309 CropSourceToScrolledImage(scroll_factor);
310
nissedf2ceb82016-12-15 06:29:53 -0800311 return current_frame_ ? &*current_frame_ : nullptr;
sprangd6358952015-07-29 07:58:13 -0700312 }
313
314 void UpdateSourceFrame(size_t frame_num) {
315 while (current_frame_num_ != frame_num) {
316 current_source_frame_ = file_generator_.NextFrame();
317 current_frame_num_ = (current_frame_num_ + 1) % num_frames_;
318 }
henrikg91d6ede2015-09-17 00:24:34 -0700319 RTC_DCHECK(current_source_frame_ != nullptr);
sprangd6358952015-07-29 07:58:13 -0700320 }
321
322 void CropSourceToScrolledImage(double scroll_factor) {
nissef122a852016-10-04 23:27:30 -0700323 int scroll_margin_x = current_source_frame_->width() - target_width_;
sprangd6358952015-07-29 07:58:13 -0700324 int pixels_scrolled_x =
325 static_cast<int>(scroll_margin_x * scroll_factor + 0.5);
nissef122a852016-10-04 23:27:30 -0700326 int scroll_margin_y = current_source_frame_->height() - target_height_;
sprangd6358952015-07-29 07:58:13 -0700327 int pixels_scrolled_y =
328 static_cast<int>(scroll_margin_y * scroll_factor + 0.5);
329
Magnus Jedvert90e31902017-06-07 11:32:50 +0200330 rtc::scoped_refptr<I420BufferInterface> i420_buffer =
331 current_source_frame_->video_frame_buffer()->ToI420();
332 int offset_y =
333 (i420_buffer->StrideY() * pixels_scrolled_y) + pixels_scrolled_x;
334 int offset_u = (i420_buffer->StrideU() * (pixels_scrolled_y / 2)) +
sprangd6358952015-07-29 07:58:13 -0700335 (pixels_scrolled_x / 2);
Magnus Jedvert90e31902017-06-07 11:32:50 +0200336 int offset_v = (i420_buffer->StrideV() * (pixels_scrolled_y / 2)) +
sprangd6358952015-07-29 07:58:13 -0700337 (pixels_scrolled_x / 2);
338
nissedf2ceb82016-12-15 06:29:53 -0800339 current_frame_ = rtc::Optional<webrtc::VideoFrame>(webrtc::VideoFrame(
nissef0a7c5a2016-10-31 05:48:07 -0700340 new rtc::RefCountedObject<webrtc::WrappedI420Buffer>(
Magnus Jedvert90e31902017-06-07 11:32:50 +0200341 target_width_, target_height_, &i420_buffer->DataY()[offset_y],
342 i420_buffer->StrideY(), &i420_buffer->DataU()[offset_u],
343 i420_buffer->StrideU(), &i420_buffer->DataV()[offset_v],
344 i420_buffer->StrideV(), KeepRefUntilDone(i420_buffer)),
nissedf2ceb82016-12-15 06:29:53 -0800345 kVideoRotation_0, 0));
sprangd6358952015-07-29 07:58:13 -0700346 }
347
348 Clock* const clock_;
349 const int64_t start_time_;
350 const int64_t scroll_time_;
351 const int64_t pause_time_;
352 const size_t num_frames_;
nissef122a852016-10-04 23:27:30 -0700353 const int target_width_;
354 const int target_height_;
355
sprangd6358952015-07-29 07:58:13 -0700356 size_t current_frame_num_;
357 VideoFrame* current_source_frame_;
nissedf2ceb82016-12-15 06:29:53 -0800358 rtc::Optional<VideoFrame> current_frame_;
sprangd6358952015-07-29 07:58:13 -0700359 YuvFileGenerator file_generator_;
360};
361
andresp@webrtc.orgab654952013-09-19 12:14:03 +0000362} // namespace
363
perkja49cbd32016-09-16 07:53:41 -0700364FrameForwarder::FrameForwarder() : sink_(nullptr) {}
sprangb1ca0732017-02-01 08:38:12 -0800365FrameForwarder::~FrameForwarder() {}
perkja49cbd32016-09-16 07:53:41 -0700366
367void FrameForwarder::IncomingCapturedFrame(const VideoFrame& video_frame) {
368 rtc::CritScope lock(&crit_);
369 if (sink_)
370 sink_->OnFrame(video_frame);
371}
372
373void FrameForwarder::AddOrUpdateSink(rtc::VideoSinkInterface<VideoFrame>* sink,
374 const rtc::VideoSinkWants& wants) {
375 rtc::CritScope lock(&crit_);
376 RTC_DCHECK(!sink_ || sink_ == sink);
377 sink_ = sink;
perkj803d97f2016-11-01 11:45:46 -0700378 sink_wants_ = wants;
perkja49cbd32016-09-16 07:53:41 -0700379}
380
381void FrameForwarder::RemoveSink(rtc::VideoSinkInterface<VideoFrame>* sink) {
382 rtc::CritScope lock(&crit_);
383 RTC_DCHECK_EQ(sink, sink_);
384 sink_ = nullptr;
385}
386
perkj803d97f2016-11-01 11:45:46 -0700387rtc::VideoSinkWants FrameForwarder::sink_wants() const {
388 rtc::CritScope lock(&crit_);
389 return sink_wants_;
390}
391
392bool FrameForwarder::has_sinks() const {
393 rtc::CritScope lock(&crit_);
394 return sink_ != nullptr;
395}
396
perkja8ba1952017-02-27 06:52:10 -0800397std::unique_ptr<FrameGenerator> FrameGenerator::CreateSquareGenerator(
398 int width,
399 int height) {
400 return std::unique_ptr<FrameGenerator>(new SquareGenerator(width, height));
pbos@webrtc.org266c7b32013-10-15 09:15:47 +0000401}
402
erikvarga579de6f2017-08-29 09:12:57 -0700403std::unique_ptr<FrameGenerator> FrameGenerator::CreateSlideGenerator(
404 int width, int height, int frame_repeat_count) {
405 return std::unique_ptr<FrameGenerator>(new SlideGenerator(
406 width, height, frame_repeat_count));
407}
408
perkja8ba1952017-02-27 06:52:10 -0800409std::unique_ptr<FrameGenerator> FrameGenerator::CreateFromYuvFile(
sprang@webrtc.org131bea82015-02-18 12:46:06 +0000410 std::vector<std::string> filenames,
411 size_t width,
412 size_t height,
413 int frame_repeat_count) {
kwibergb890c95c2016-11-29 05:30:40 -0800414 RTC_DCHECK(!filenames.empty());
sprang@webrtc.org131bea82015-02-18 12:46:06 +0000415 std::vector<FILE*> files;
416 for (const std::string& filename : filenames) {
417 FILE* file = fopen(filename.c_str(), "rb");
henrikg91d6ede2015-09-17 00:24:34 -0700418 RTC_DCHECK(file != nullptr);
sprang@webrtc.org131bea82015-02-18 12:46:06 +0000419 files.push_back(file);
420 }
421
perkja8ba1952017-02-27 06:52:10 -0800422 return std::unique_ptr<FrameGenerator>(
423 new YuvFileGenerator(files, width, height, frame_repeat_count));
andresp@webrtc.orgab654952013-09-19 12:14:03 +0000424}
425
perkja8ba1952017-02-27 06:52:10 -0800426std::unique_ptr<FrameGenerator>
427FrameGenerator::CreateScrollingInputFromYuvFiles(
sprangd6358952015-07-29 07:58:13 -0700428 Clock* clock,
429 std::vector<std::string> filenames,
430 size_t source_width,
431 size_t source_height,
432 size_t target_width,
433 size_t target_height,
434 int64_t scroll_time_ms,
435 int64_t pause_time_ms) {
kwibergb890c95c2016-11-29 05:30:40 -0800436 RTC_DCHECK(!filenames.empty());
sprangd6358952015-07-29 07:58:13 -0700437 std::vector<FILE*> files;
438 for (const std::string& filename : filenames) {
439 FILE* file = fopen(filename.c_str(), "rb");
henrikg91d6ede2015-09-17 00:24:34 -0700440 RTC_DCHECK(file != nullptr);
sprangd6358952015-07-29 07:58:13 -0700441 files.push_back(file);
442 }
443
perkja8ba1952017-02-27 06:52:10 -0800444 return std::unique_ptr<FrameGenerator>(new ScrollingImageFrameGenerator(
sprangd6358952015-07-29 07:58:13 -0700445 clock, files, source_width, source_height, target_width, target_height,
perkja8ba1952017-02-27 06:52:10 -0800446 scroll_time_ms, pause_time_ms));
sprangd6358952015-07-29 07:58:13 -0700447}
448
andresp@webrtc.orgab654952013-09-19 12:14:03 +0000449} // namespace test
450} // namespace webrtc