OLD | NEW |
---|---|
1 /* | 1 /* |
2 * Copyright (c) 2004 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2004 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 | 10 |
(...skipping 11 matching lines...) Expand all Loading... | |
22 #include "webrtc/media/base/videoframe.h" | 22 #include "webrtc/media/base/videoframe.h" |
23 #ifdef HAVE_WEBRTC_VIDEO | 23 #ifdef HAVE_WEBRTC_VIDEO |
24 #include "webrtc/media/engine/webrtcvideoframefactory.h" | 24 #include "webrtc/media/engine/webrtcvideoframefactory.h" |
25 #endif | 25 #endif |
26 | 26 |
27 namespace cricket { | 27 namespace cricket { |
28 | 28 |
29 // Fake video capturer that allows the test to manually pump in frames. | 29 // Fake video capturer that allows the test to manually pump in frames. |
30 class FakeVideoCapturer : public cricket::VideoCapturer { | 30 class FakeVideoCapturer : public cricket::VideoCapturer { |
31 public: | 31 public: |
32 FakeVideoCapturer(bool is_screencast) | 32 explicit FakeVideoCapturer(bool is_screencast) |
33 : running_(false), | 33 : running_(false), |
34 initial_timestamp_(rtc::TimeNanos()), | 34 initial_timestamp_(rtc::TimeNanos()), |
35 next_timestamp_(rtc::kNumNanosecsPerMillisec), | 35 next_timestamp_(rtc::kNumNanosecsPerMillisec), |
36 is_screencast_(is_screencast), | 36 is_screencast_(is_screencast), |
37 rotation_(webrtc::kVideoRotation_0) { | 37 rotation_(webrtc::kVideoRotation_0) { |
38 #ifdef HAVE_WEBRTC_VIDEO | 38 #ifdef HAVE_WEBRTC_VIDEO |
39 set_frame_factory(new cricket::WebRtcVideoFrameFactory()); | 39 set_frame_factory(new cricket::WebRtcVideoFrameFactory()); |
40 #endif | 40 #endif |
41 // Default supported formats. Use ResetSupportedFormats to over write. | 41 // Default supported formats. Use ResetSupportedFormats to over write. |
42 std::vector<cricket::VideoFormat> formats; | 42 std::vector<cricket::VideoFormat> formats; |
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
117 return true; | 117 return true; |
118 } | 118 } |
119 | 119 |
120 void SignalCapturedFrame(cricket::CapturedFrame* frame) { | 120 void SignalCapturedFrame(cricket::CapturedFrame* frame) { |
121 SignalFrameCaptured(this, frame); | 121 SignalFrameCaptured(this, frame); |
122 } | 122 } |
123 | 123 |
124 sigslot::signal1<FakeVideoCapturer*> SignalDestroyed; | 124 sigslot::signal1<FakeVideoCapturer*> SignalDestroyed; |
125 | 125 |
126 cricket::CaptureState Start(const cricket::VideoFormat& format) override { | 126 cricket::CaptureState Start(const cricket::VideoFormat& format) override { |
127 cricket::VideoFormat supported; | 127 cricket::VideoFormat supported; |
sprang_webrtc
2016/09/22 13:06:16
Not needed anymore?
perkj_webrtc
2016/09/26 12:09:42
Done.
| |
128 if (GetBestCaptureFormat(format, &supported)) { | 128 SetCaptureFormat(&format); |
129 SetCaptureFormat(&supported); | |
130 } | |
131 running_ = true; | 129 running_ = true; |
132 SetCaptureState(cricket::CS_RUNNING); | 130 SetCaptureState(cricket::CS_RUNNING); |
133 return cricket::CS_RUNNING; | 131 return cricket::CS_RUNNING; |
134 } | 132 } |
135 void Stop() override { | 133 void Stop() override { |
136 running_ = false; | 134 running_ = false; |
137 SetCaptureFormat(NULL); | 135 SetCaptureFormat(NULL); |
138 SetCaptureState(cricket::CS_STOPPED); | 136 SetCaptureState(cricket::CS_STOPPED); |
139 } | 137 } |
140 bool IsRunning() override { return running_; } | 138 bool IsRunning() override { return running_; } |
(...skipping 22 matching lines...) Expand all Loading... | |
163 int64_t initial_timestamp_; | 161 int64_t initial_timestamp_; |
164 int64_t next_timestamp_; | 162 int64_t next_timestamp_; |
165 const bool is_screencast_; | 163 const bool is_screencast_; |
166 rtc::Optional<bool> needs_denoising_; | 164 rtc::Optional<bool> needs_denoising_; |
167 webrtc::VideoRotation rotation_; | 165 webrtc::VideoRotation rotation_; |
168 }; | 166 }; |
169 | 167 |
170 } // namespace cricket | 168 } // namespace cricket |
171 | 169 |
172 #endif // WEBRTC_MEDIA_BASE_FAKEVIDEOCAPTURER_H_ | 170 #endif // WEBRTC_MEDIA_BASE_FAKEVIDEOCAPTURER_H_ |
OLD | NEW |