| 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_TEST_FRAME_GENERATOR_H_ | 10 #ifndef WEBRTC_TEST_FRAME_GENERATOR_H_ |
| (...skipping 11 matching lines...) Expand all Loading... |
| 22 class Clock; | 22 class Clock; |
| 23 namespace test { | 23 namespace test { |
| 24 | 24 |
| 25 // FrameForwarder can be used as an implementation | 25 // FrameForwarder can be used as an implementation |
| 26 // of rtc::VideoSourceInterface<VideoFrame> where the caller controls when | 26 // of rtc::VideoSourceInterface<VideoFrame> where the caller controls when |
| 27 // a frame should be forwarded to its sink. | 27 // a frame should be forwarded to its sink. |
| 28 // Currently this implementation only support one sink. | 28 // Currently this implementation only support one sink. |
| 29 class FrameForwarder : public rtc::VideoSourceInterface<VideoFrame> { | 29 class FrameForwarder : public rtc::VideoSourceInterface<VideoFrame> { |
| 30 public: | 30 public: |
| 31 FrameForwarder(); | 31 FrameForwarder(); |
| 32 virtual ~FrameForwarder(); |
| 32 // Forwards |video_frame| to the registered |sink_|. | 33 // Forwards |video_frame| to the registered |sink_|. |
| 33 void IncomingCapturedFrame(const VideoFrame& video_frame); | 34 virtual void IncomingCapturedFrame(const VideoFrame& video_frame); |
| 34 rtc::VideoSinkWants sink_wants() const; | 35 rtc::VideoSinkWants sink_wants() const; |
| 35 bool has_sinks() const; | 36 bool has_sinks() const; |
| 36 | 37 |
| 37 private: | 38 protected: |
| 38 void AddOrUpdateSink(rtc::VideoSinkInterface<VideoFrame>* sink, | 39 void AddOrUpdateSink(rtc::VideoSinkInterface<VideoFrame>* sink, |
| 39 const rtc::VideoSinkWants& wants) override; | 40 const rtc::VideoSinkWants& wants) override; |
| 40 void RemoveSink(rtc::VideoSinkInterface<VideoFrame>* sink) override; | 41 void RemoveSink(rtc::VideoSinkInterface<VideoFrame>* sink) override; |
| 41 | 42 |
| 42 rtc::CriticalSection crit_; | 43 rtc::CriticalSection crit_; |
| 43 rtc::VideoSinkInterface<VideoFrame>* sink_ GUARDED_BY(crit_); | 44 rtc::VideoSinkInterface<VideoFrame>* sink_ GUARDED_BY(crit_); |
| 44 rtc::VideoSinkWants sink_wants_ GUARDED_BY(crit_); | 45 rtc::VideoSinkWants sink_wants_ GUARDED_BY(crit_); |
| 45 }; | 46 }; |
| 46 | 47 |
| 47 class FrameGenerator { | 48 class FrameGenerator { |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 84 size_t source_height, | 85 size_t source_height, |
| 85 size_t target_width, | 86 size_t target_width, |
| 86 size_t target_height, | 87 size_t target_height, |
| 87 int64_t scroll_time_ms, | 88 int64_t scroll_time_ms, |
| 88 int64_t pause_time_ms); | 89 int64_t pause_time_ms); |
| 89 }; | 90 }; |
| 90 } // namespace test | 91 } // namespace test |
| 91 } // namespace webrtc | 92 } // namespace webrtc |
| 92 | 93 |
| 93 #endif // WEBRTC_TEST_FRAME_GENERATOR_H_ | 94 #endif // WEBRTC_TEST_FRAME_GENERATOR_H_ |
| OLD | NEW |