blob: c378458993398657aaa71f1117768922d63ed4d2 [file] [log] [blame]
pbos@webrtc.org08f3ca92013-05-23 12:37:11 +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_VIDEO_ENGINE_TEST_COMMON_FRAME_GENERATOR_H_
11#define WEBRTC_VIDEO_ENGINE_TEST_COMMON_FRAME_GENERATOR_H_
12
13#include "webrtc/common_video/interface/i420_video_frame.h"
14#include "webrtc/typedefs.h"
pbos@webrtc.org08f3ca92013-05-23 12:37:11 +000015
16namespace webrtc {
17
18class Clock;
19
pbos@webrtc.org2f02da82013-07-09 08:02:33 +000020class VideoSendStreamInput;
pbos@webrtc.org2f02da82013-07-09 08:02:33 +000021
pbos@webrtc.org08f3ca92013-05-23 12:37:11 +000022namespace test {
23
24// A set of classes that generate sequences of I420VideoFrames for testing
25// without using the webcam.
26class FrameGenerator {
27 public:
28 static FrameGenerator* Create(size_t width, size_t height, Clock* clock);
29 virtual ~FrameGenerator() {}
30
pbos@webrtc.orgc1797062013-08-23 09:19:30 +000031 void InsertFrame(VideoSendStreamInput* input);
pbos@webrtc.org08f3ca92013-05-23 12:37:11 +000032
33 protected:
34 FrameGenerator(size_t width, size_t height, Clock* clock);
35 virtual void GenerateNextFrame() = 0;
36
37 size_t width_, height_;
38 I420VideoFrame frame_;
39 Clock* clock_;
40};
41
42class BlackFrameGenerator : public FrameGenerator {
43 public:
44 BlackFrameGenerator(size_t width, size_t height, Clock* clock);
45
46 private:
47 virtual void GenerateNextFrame() OVERRIDE;
48};
49
50class WhiteFrameGenerator : public FrameGenerator {
51 public:
52 WhiteFrameGenerator(size_t width, size_t height, Clock* clock);
53
54 private:
55 virtual void GenerateNextFrame() OVERRIDE;
56};
57
58class ChromaFrameGenerator : public FrameGenerator {
59 public:
60 ChromaFrameGenerator(size_t width, size_t height, Clock* clock);
61
62 private:
63 virtual void GenerateNextFrame() OVERRIDE;
64};
65} // test
66} // webrtc
67
68#endif // WEBRTC_VIDEO_ENGINE_TEST_COMMON_FRAME_GENERATOR_H_