Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 /* | 1 /* |
| 2 * Copyright (c) 2013 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2013 The WebRTC project authors. All Rights Reserved. |
| 3 * | 3 * |
| 4 * Use of this source code is governed by a BSD-style license | 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 | 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 | 6 * tree. An additional intellectual property rights grant can be found |
| 7 * in the file PATENTS. All contributing project authors may | 7 * in the file PATENTS. All contributing project authors may |
| 8 * be found in the AUTHORS file in the root of the source tree. | 8 * be found in the AUTHORS file in the root of the source tree. |
| 9 */ | 9 */ |
| 10 #ifndef WEBRTC_COMMON_VIDEO_TEST_FRAME_GENERATOR_H_ | 10 #ifndef WEBRTC_TEST_FRAME_GENERATOR_H_ |
| 11 #define WEBRTC_COMMON_VIDEO_TEST_FRAME_GENERATOR_H_ | 11 #define WEBRTC_TEST_FRAME_GENERATOR_H_ |
| 12 | 12 |
| 13 #include <string> | 13 #include <string> |
| 14 #include <vector> | 14 #include <vector> |
| 15 | 15 |
| 16 #include "webrtc/base/criticalsection.h" | |
| 17 #include "webrtc/media/base/videosourceinterface.h" | |
| 16 #include "webrtc/typedefs.h" | 18 #include "webrtc/typedefs.h" |
| 17 #include "webrtc/video_frame.h" | 19 #include "webrtc/video_frame.h" |
| 18 | 20 |
| 19 namespace webrtc { | 21 namespace webrtc { |
| 20 class Clock; | 22 class Clock; |
| 21 namespace test { | 23 namespace test { |
| 22 | 24 |
| 25 class FrameForwarder : public rtc::VideoSourceInterface<VideoFrame> { | |
|
stefan-webrtc
2016/09/13 09:26:43
A short comment on the purpose of this class would
perkj_webrtc
2016/09/14 14:20:22
Done.
| |
| 26 public: | |
| 27 FrameForwarder(); | |
| 28 void IncomingCapturedFrame(const VideoFrame& video_frame); | |
| 29 | |
| 30 private: | |
| 31 void AddOrUpdateSink(rtc::VideoSinkInterface<VideoFrame>* sink, | |
| 32 const rtc::VideoSinkWants& wants) override; | |
| 33 void RemoveSink(rtc::VideoSinkInterface<VideoFrame>* sink) override; | |
| 34 | |
| 35 rtc::CriticalSection crit_; | |
| 36 rtc::VideoSinkInterface<VideoFrame>* sink_ GUARDED_BY(crit_); | |
| 37 }; | |
| 38 | |
| 23 class FrameGenerator { | 39 class FrameGenerator { |
| 24 public: | 40 public: |
| 25 FrameGenerator() {} | 41 FrameGenerator() {} |
| 26 virtual ~FrameGenerator() {} | 42 virtual ~FrameGenerator() {} |
| 27 | 43 |
| 28 // Returns video frame that remains valid until next call. | 44 // Returns video frame that remains valid until next call. |
| 29 virtual VideoFrame* NextFrame() = 0; | 45 virtual VideoFrame* NextFrame() = 0; |
| 30 | 46 |
| 31 // Creates a test frame generator that creates fully saturated frames with | 47 // Creates a test frame generator that creates fully saturated frames with |
| 32 // varying U, V values over time. | 48 // varying U, V values over time. |
| (...skipping 21 matching lines...) Expand all Loading... | |
| 54 size_t source_width, | 70 size_t source_width, |
| 55 size_t source_height, | 71 size_t source_height, |
| 56 size_t target_width, | 72 size_t target_width, |
| 57 size_t target_height, | 73 size_t target_height, |
| 58 int64_t scroll_time_ms, | 74 int64_t scroll_time_ms, |
| 59 int64_t pause_time_ms); | 75 int64_t pause_time_ms); |
| 60 }; | 76 }; |
| 61 } // namespace test | 77 } // namespace test |
| 62 } // namespace webrtc | 78 } // namespace webrtc |
| 63 | 79 |
| 64 #endif // WEBRTC_COMMON_VIDEO_TEST_FRAME_GENERATOR_H_ | 80 #endif // WEBRTC_TEST_FRAME_GENERATOR_H_ |
| OLD | NEW |