Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(246)

Side by Side Diff: webrtc/test/frame_generator.h

Issue 2257413002: Replace interface VideoCapturerInput with VideoSinkInterface. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Addressed review comments Created 4 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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> {
26 public:
27 void IncomingCapturedFrame(const VideoFrame& video_frame);
28
29 private:
30 void AddOrUpdateSink(rtc::VideoSinkInterface<VideoFrame>* sink,
31 const rtc::VideoSinkWants& wants) override;
32 void RemoveSink(rtc::VideoSinkInterface<VideoFrame>* sink) override;
33
34 rtc::CriticalSection crit_;
35 rtc::VideoSinkInterface<VideoFrame>* sink_ GUARDED_BY(crit_) = nullptr;
36 };
37
23 class FrameGenerator { 38 class FrameGenerator {
24 public: 39 public:
25 FrameGenerator() {} 40 FrameGenerator() {}
26 virtual ~FrameGenerator() {} 41 virtual ~FrameGenerator() {}
27 42
28 // Returns video frame that remains valid until next call. 43 // Returns video frame that remains valid until next call.
29 virtual VideoFrame* NextFrame() = 0; 44 virtual VideoFrame* NextFrame() = 0;
30 45
31 // Creates a test frame generator that creates fully saturated frames with 46 // Creates a test frame generator that creates fully saturated frames with
32 // varying U, V values over time. 47 // varying U, V values over time.
(...skipping 21 matching lines...) Expand all
54 size_t source_width, 69 size_t source_width,
55 size_t source_height, 70 size_t source_height,
56 size_t target_width, 71 size_t target_width,
57 size_t target_height, 72 size_t target_height,
58 int64_t scroll_time_ms, 73 int64_t scroll_time_ms,
59 int64_t pause_time_ms); 74 int64_t pause_time_ms);
60 }; 75 };
61 } // namespace test 76 } // namespace test
62 } // namespace webrtc 77 } // namespace webrtc
63 78
64 #endif // WEBRTC_COMMON_VIDEO_TEST_FRAME_GENERATOR_H_ 79 #endif // WEBRTC_TEST_FRAME_GENERATOR_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698