OLD | NEW |
1 /* | 1 /* |
2 * Copyright (c) 2014 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2014 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 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
79 // possible to test that the media processors are indeed being called when | 79 // possible to test that the media processors are indeed being called when |
80 // registered. | 80 // registered. |
81 template<class T> | 81 template<class T> |
82 class VideoEngineOverride : public T { | 82 class VideoEngineOverride : public T { |
83 public: | 83 public: |
84 VideoEngineOverride() : T() { | 84 VideoEngineOverride() : T() { |
85 } | 85 } |
86 virtual ~VideoEngineOverride() { | 86 virtual ~VideoEngineOverride() { |
87 } | 87 } |
88 bool is_camera_on() const { return T::GetVideoCapturer()->IsRunning(); } | 88 bool is_camera_on() const { return T::GetVideoCapturer()->IsRunning(); } |
| 89 void set_has_senders(bool has_senders) { |
| 90 cricket::VideoCapturer* video_capturer = T::GetVideoCapturer(); |
| 91 if (has_senders) { |
| 92 video_capturer->SignalVideoFrame.connect(this, |
| 93 &VideoEngineOverride<T>::OnLocalFrame); |
| 94 } else { |
| 95 video_capturer->SignalVideoFrame.disconnect(this); |
| 96 } |
| 97 } |
| 98 void OnLocalFrame(cricket::VideoCapturer*, |
| 99 const cricket::VideoFrame*) { |
| 100 } |
| 101 void OnLocalFrameFormat(cricket::VideoCapturer*, |
| 102 const cricket::VideoFormat*) { |
| 103 } |
89 | 104 |
90 void TriggerMediaFrame(uint32_t ssrc, | 105 void TriggerMediaFrame(uint32_t ssrc, |
91 cricket::VideoFrame* frame, | 106 cricket::VideoFrame* frame, |
92 bool* drop_frame) { | 107 bool* drop_frame) { |
93 T::SignalMediaFrame(ssrc, frame, drop_frame); | 108 T::SignalMediaFrame(ssrc, frame, drop_frame); |
94 } | 109 } |
95 }; | 110 }; |
96 | 111 |
97 template<class E, class C> | 112 template<class E, class C> |
98 class VideoMediaChannelTest : public testing::Test, | 113 class VideoMediaChannelTest : public testing::Test, |
(...skipping 1083 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1182 rtc::scoped_ptr<C> channel_; | 1197 rtc::scoped_ptr<C> channel_; |
1183 cricket::FakeNetworkInterface network_interface_; | 1198 cricket::FakeNetworkInterface network_interface_; |
1184 cricket::FakeVideoRenderer renderer_; | 1199 cricket::FakeVideoRenderer renderer_; |
1185 cricket::VideoMediaChannel::Error media_error_; | 1200 cricket::VideoMediaChannel::Error media_error_; |
1186 | 1201 |
1187 // Used by test cases where 2 streams are run on the same channel. | 1202 // Used by test cases where 2 streams are run on the same channel. |
1188 cricket::FakeVideoRenderer renderer2_; | 1203 cricket::FakeVideoRenderer renderer2_; |
1189 }; | 1204 }; |
1190 | 1205 |
1191 #endif // WEBRTC_MEDIA_BASE_VIDEOENGINE_UNITTEST_H_ NOLINT | 1206 #endif // WEBRTC_MEDIA_BASE_VIDEOENGINE_UNITTEST_H_ NOLINT |
OLD | NEW |