blob: 03afaccc3067765e24b7e6bc9fb2921e7a558620 [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 */
10#ifndef WEBRTC_COMMON_VIDEO_TEST_FRAME_GENERATOR_H_
11#define WEBRTC_COMMON_VIDEO_TEST_FRAME_GENERATOR_H_
12
sprang@webrtc.org131bea82015-02-18 12:46:06 +000013#include <string>
14#include <vector>
15
andresp@webrtc.orgab654952013-09-19 12:14:03 +000016#include "webrtc/typedefs.h"
Thiago Farina9bfe3da2015-04-10 12:52:13 +020017#include "webrtc/video_frame.h"
andresp@webrtc.orgab654952013-09-19 12:14:03 +000018
19namespace webrtc {
20namespace test {
21
22class FrameGenerator {
23 public:
24 FrameGenerator() {}
25 virtual ~FrameGenerator() {}
26
27 // Returns video frame that remains valid until next call.
Miguel Casas-Sanchez47650702015-05-29 17:21:40 -070028 virtual VideoFrame* NextFrame() = 0;
andresp@webrtc.orgab654952013-09-19 12:14:03 +000029
sprang@webrtc.org131bea82015-02-18 12:46:06 +000030 // Creates a test frame generator that creates fully saturated frames with
31 // varying U, V values over time.
32 static FrameGenerator* CreateChromaGenerator(size_t width, size_t height);
33
34 // Creates a frame generator that repeatedly plays a set of yuv files.
35 // The frame_repeat_count determines how many times each frame is shown,
sprang@webrtc.org25dd1db2015-03-02 11:55:45 +000036 // with 1 = show each frame once, etc.
sprang@webrtc.org131bea82015-02-18 12:46:06 +000037 static FrameGenerator* CreateFromYuvFile(std::vector<std::string> files,
andresp@webrtc.orgab654952013-09-19 12:14:03 +000038 size_t width,
sprang@webrtc.org131bea82015-02-18 12:46:06 +000039 size_t height,
40 int frame_repeat_count);
andresp@webrtc.orgab654952013-09-19 12:14:03 +000041};
42} // namespace test
43} // namespace webrtc
44
45#endif // WEBRTC_COMMON_VIDEO_TEST_FRAME_GENERATOR_H_