blob: 969a358ffb53182cf4b50848379f598ebd5055b9 [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/common_video/interface/i420_video_frame.h"
17#include "webrtc/typedefs.h"
18
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.
pbos@webrtc.org724947b2013-12-11 16:26:16 +000028 virtual I420VideoFrame* 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_