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

Side by Side Diff: webrtc/video/end_to_end_tests.cc

Issue 2407163002: Make sure VideoReceiveStream can be restarted (Closed)
Patch Set: Created 4 years, 2 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
« no previous file with comments | « no previous file | webrtc/video/video_receive_stream.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 #include <algorithm> 10 #include <algorithm>
(...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after
154 CreateMatchingReceiveConfigs(&transport); 154 CreateMatchingReceiveConfigs(&transport);
155 155
156 CreateVideoStreams(); 156 CreateVideoStreams();
157 157
158 video_receive_streams_[0]->Stop(); 158 video_receive_streams_[0]->Stop();
159 video_receive_streams_[0]->Stop(); 159 video_receive_streams_[0]->Stop();
160 160
161 DestroyStreams(); 161 DestroyStreams();
162 } 162 }
163 163
164 TEST_F(EndToEndTest, ReceiverCanBeStoppedAndRestarted) {
165 CreateCalls(Call::Config(&event_log_), Call::Config(&event_log_));
166
167 test::NullTransport transport;
168 CreateSendConfig(1, 0, &transport);
169 CreateMatchingReceiveConfigs(&transport);
170
171 CreateVideoStreams();
172
173 video_receive_streams_[0]->Stop();
174 video_receive_streams_[0]->Start();
175 video_receive_streams_[0]->Stop();
176
177 DestroyStreams();
178 }
179
164 TEST_F(EndToEndTest, RendersSingleDelayedFrame) { 180 TEST_F(EndToEndTest, RendersSingleDelayedFrame) {
165 static const int kWidth = 320; 181 static const int kWidth = 320;
166 static const int kHeight = 240; 182 static const int kHeight = 240;
167 // This constant is chosen to be higher than the timeout in the video_render 183 // This constant is chosen to be higher than the timeout in the video_render
168 // module. This makes sure that frames aren't dropped if there are no other 184 // module. This makes sure that frames aren't dropped if there are no other
169 // frames in the queue. 185 // frames in the queue.
170 static const int kDelayRenderCallbackMs = 1000; 186 static const int kDelayRenderCallbackMs = 1000;
171 187
172 class Renderer : public rtc::VideoSinkInterface<VideoFrame> { 188 class Renderer : public rtc::VideoSinkInterface<VideoFrame> {
173 public: 189 public:
(...skipping 3753 matching lines...) Expand 10 before | Expand all | Expand 10 after
3927 std::unique_ptr<VideoEncoder> encoder_; 3943 std::unique_ptr<VideoEncoder> encoder_;
3928 std::unique_ptr<VideoDecoder> decoder_; 3944 std::unique_ptr<VideoDecoder> decoder_;
3929 rtc::CriticalSection crit_; 3945 rtc::CriticalSection crit_;
3930 int recorded_frames_ GUARDED_BY(crit_); 3946 int recorded_frames_ GUARDED_BY(crit_);
3931 } test(this); 3947 } test(this);
3932 3948
3933 RunBaseTest(&test); 3949 RunBaseTest(&test);
3934 } 3950 }
3935 3951
3936 } // namespace webrtc 3952 } // namespace webrtc
OLDNEW
« no previous file with comments | « no previous file | webrtc/video/video_receive_stream.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698