blob: 859bc0066bfda46b0fe5b41cd85331d25fb741c7 [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"
Artem Titovfd76b5f2019-12-04 23:06:35 +010016#include "test/testsupport/ivf_video_frame_generator.h"
Artem Titov503d7232019-12-04 12:37:13 +010017
18namespace webrtc {
19namespace test {
20
21std::unique_ptr<FrameGeneratorInterface> CreateSquareFrameGenerator(
22 int width,
23 int height,
24 absl::optional<FrameGeneratorInterface::OutputType> type,
25 absl::optional<int> num_squares) {
26 return FrameGenerator::CreateSquareGenerator(width, height, type,
27 num_squares);
28}
29
30std::unique_ptr<FrameGeneratorInterface> CreateFromYuvFileFrameGenerator(
31 std::vector<std::string> files,
32 size_t width,
33 size_t height,
34 int frame_repeat_count) {
35 return FrameGenerator::CreateFromYuvFile(std::move(files), width, height,
36 frame_repeat_count);
37}
38
Artem Titov78782a82019-12-05 10:38:05 +010039std::unique_ptr<FrameGeneratorInterface> CreateFromIvfFileFrameGenerator(
Artem Titovfd76b5f2019-12-04 23:06:35 +010040 std::string file) {
41 return std::make_unique<IvfVideoFrameGenerator>(std::move(file));
42}
43
Artem Titov503d7232019-12-04 12:37:13 +010044std::unique_ptr<FrameGeneratorInterface>
45CreateScrollingInputFromYuvFilesFrameGenerator(
46 Clock* clock,
47 std::vector<std::string> filenames,
48 size_t source_width,
49 size_t source_height,
50 size_t target_width,
51 size_t target_height,
52 int64_t scroll_time_ms,
53 int64_t pause_time_ms) {
54 return FrameGenerator::CreateScrollingInputFromYuvFiles(
55 clock, std::move(filenames), source_width, source_height, target_width,
56 target_height, scroll_time_ms, pause_time_ms);
57}
58
59std::unique_ptr<FrameGeneratorInterface>
60CreateSlideFrameGenerator(int width, int height, int frame_repeat_count) {
61 return FrameGenerator::CreateSlideGenerator(width, height,
62 frame_repeat_count);
63}
64
65} // namespace test
66} // namespace webrtc