andresp@webrtc.org | ab65495 | 2013-09-19 12:14:03 +0000 | [diff] [blame] | 1 | /* |
| 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.org | 131bea8 | 2015-02-18 12:46:06 +0000 | [diff] [blame] | 13 | #include <string> |
| 14 | #include <vector> |
| 15 | |
andresp@webrtc.org | ab65495 | 2013-09-19 12:14:03 +0000 | [diff] [blame] | 16 | #include "webrtc/common_video/interface/i420_video_frame.h" |
| 17 | #include "webrtc/typedefs.h" |
| 18 | |
| 19 | namespace webrtc { |
| 20 | namespace test { |
| 21 | |
| 22 | class FrameGenerator { |
| 23 | public: |
| 24 | FrameGenerator() {} |
| 25 | virtual ~FrameGenerator() {} |
| 26 | |
| 27 | // Returns video frame that remains valid until next call. |
pbos@webrtc.org | 724947b | 2013-12-11 16:26:16 +0000 | [diff] [blame] | 28 | virtual I420VideoFrame* NextFrame() = 0; |
andresp@webrtc.org | ab65495 | 2013-09-19 12:14:03 +0000 | [diff] [blame] | 29 | |
sprang@webrtc.org | 131bea8 | 2015-02-18 12:46:06 +0000 | [diff] [blame] | 30 | // 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.org | 25dd1db | 2015-03-02 11:55:45 +0000 | [diff] [blame^] | 36 | // with 1 = show each frame once, etc. |
sprang@webrtc.org | 131bea8 | 2015-02-18 12:46:06 +0000 | [diff] [blame] | 37 | static FrameGenerator* CreateFromYuvFile(std::vector<std::string> files, |
andresp@webrtc.org | ab65495 | 2013-09-19 12:14:03 +0000 | [diff] [blame] | 38 | size_t width, |
sprang@webrtc.org | 131bea8 | 2015-02-18 12:46:06 +0000 | [diff] [blame] | 39 | size_t height, |
| 40 | int frame_repeat_count); |
andresp@webrtc.org | ab65495 | 2013-09-19 12:14:03 +0000 | [diff] [blame] | 41 | }; |
| 42 | } // namespace test |
| 43 | } // namespace webrtc |
| 44 | |
| 45 | #endif // WEBRTC_COMMON_VIDEO_TEST_FRAME_GENERATOR_H_ |