blob: b6e62a4d9785cbf1675e961280e19943107ac38d [file] [log] [blame]
Artem Titov503d7232019-12-04 12:37:13 +01001/*
2 * Copyright (c) 2019 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 */
10
11#include "api/test/create_frame_generator.h"
12
13#include <utility>
14
15#include "test/frame_generator.h"
16
17namespace webrtc {
18namespace test {
19
20std::unique_ptr<FrameGeneratorInterface> CreateSquareFrameGenerator(
21 int width,
22 int height,
23 absl::optional<FrameGeneratorInterface::OutputType> type,
24 absl::optional<int> num_squares) {
25 return FrameGenerator::CreateSquareGenerator(width, height, type,
26 num_squares);
27}
28
29std::unique_ptr<FrameGeneratorInterface> CreateFromYuvFileFrameGenerator(
30 std::vector<std::string> files,
31 size_t width,
32 size_t height,
33 int frame_repeat_count) {
34 return FrameGenerator::CreateFromYuvFile(std::move(files), width, height,
35 frame_repeat_count);
36}
37
38std::unique_ptr<FrameGeneratorInterface>
39CreateScrollingInputFromYuvFilesFrameGenerator(
40 Clock* clock,
41 std::vector<std::string> filenames,
42 size_t source_width,
43 size_t source_height,
44 size_t target_width,
45 size_t target_height,
46 int64_t scroll_time_ms,
47 int64_t pause_time_ms) {
48 return FrameGenerator::CreateScrollingInputFromYuvFiles(
49 clock, std::move(filenames), source_width, source_height, target_width,
50 target_height, scroll_time_ms, pause_time_ms);
51}
52
53std::unique_ptr<FrameGeneratorInterface>
54CreateSlideFrameGenerator(int width, int height, int frame_repeat_count) {
55 return FrameGenerator::CreateSlideGenerator(width, height,
56 frame_repeat_count);
57}
58
59} // namespace test
60} // namespace webrtc