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

Side by Side Diff: webrtc/call/bitrate_estimator_tests.cc

Issue 2348533002: Reland Replace interface VideoCapturerInput with VideoSinkInterface. (Closed)
Patch Set: Fix rtp timestamp in quality test. 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
« no previous file with comments | « no previous file | webrtc/media/engine/fakewebrtccall.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 <functional> 10 #include <functional>
(...skipping 159 matching lines...) Expand 10 before | Expand all | Expand 10 after
170 frame_generator_capturer_(), 170 frame_generator_capturer_(),
171 fake_encoder_(Clock::GetRealTimeClock()), 171 fake_encoder_(Clock::GetRealTimeClock()),
172 fake_decoder_() { 172 fake_decoder_() {
173 test_->video_send_config_.rtp.ssrcs[0]++; 173 test_->video_send_config_.rtp.ssrcs[0]++;
174 test_->video_send_config_.encoder_settings.encoder = &fake_encoder_; 174 test_->video_send_config_.encoder_settings.encoder = &fake_encoder_;
175 send_stream_ = test_->sender_call_->CreateVideoSendStream( 175 send_stream_ = test_->sender_call_->CreateVideoSendStream(
176 test_->video_send_config_.Copy(), 176 test_->video_send_config_.Copy(),
177 test_->video_encoder_config_.Copy()); 177 test_->video_encoder_config_.Copy());
178 RTC_DCHECK_EQ(1u, test_->video_encoder_config_.streams.size()); 178 RTC_DCHECK_EQ(1u, test_->video_encoder_config_.streams.size());
179 frame_generator_capturer_.reset(test::FrameGeneratorCapturer::Create( 179 frame_generator_capturer_.reset(test::FrameGeneratorCapturer::Create(
180 send_stream_->Input(), test_->video_encoder_config_.streams[0].width, 180 test_->video_encoder_config_.streams[0].width,
181 test_->video_encoder_config_.streams[0].height, 30, 181 test_->video_encoder_config_.streams[0].height, 30,
182 Clock::GetRealTimeClock())); 182 Clock::GetRealTimeClock()));
183 send_stream_->SetSource(frame_generator_capturer_.get());
183 send_stream_->Start(); 184 send_stream_->Start();
184 frame_generator_capturer_->Start(); 185 frame_generator_capturer_->Start();
185 186
186 if (receive_audio) { 187 if (receive_audio) {
187 AudioReceiveStream::Config receive_config; 188 AudioReceiveStream::Config receive_config;
188 receive_config.rtp.remote_ssrc = test_->video_send_config_.rtp.ssrcs[0]; 189 receive_config.rtp.remote_ssrc = test_->video_send_config_.rtp.ssrcs[0];
189 // Bogus non-default id to prevent hitting a RTC_DCHECK when creating 190 // Bogus non-default id to prevent hitting a RTC_DCHECK when creating
190 // the AudioReceiveStream. Every receive stream has to correspond to 191 // the AudioReceiveStream. Every receive stream has to correspond to
191 // an underlying channel id. 192 // an underlying channel id.
192 receive_config.voe_channel_id = 0; 193 receive_config.voe_channel_id = 0;
(...skipping 16 matching lines...) Expand all
209 test_->receive_config_.rtp.local_ssrc++; 210 test_->receive_config_.rtp.local_ssrc++;
210 video_receive_stream_ = test_->receiver_call_->CreateVideoReceiveStream( 211 video_receive_stream_ = test_->receiver_call_->CreateVideoReceiveStream(
211 test_->receive_config_.Copy()); 212 test_->receive_config_.Copy());
212 video_receive_stream_->Start(); 213 video_receive_stream_->Start();
213 } 214 }
214 is_sending_receiving_ = true; 215 is_sending_receiving_ = true;
215 } 216 }
216 217
217 ~Stream() { 218 ~Stream() {
218 EXPECT_FALSE(is_sending_receiving_); 219 EXPECT_FALSE(is_sending_receiving_);
220 test_->sender_call_->DestroyVideoSendStream(send_stream_);
219 frame_generator_capturer_.reset(nullptr); 221 frame_generator_capturer_.reset(nullptr);
220 test_->sender_call_->DestroyVideoSendStream(send_stream_);
221 send_stream_ = nullptr; 222 send_stream_ = nullptr;
222 if (audio_receive_stream_) { 223 if (audio_receive_stream_) {
223 test_->receiver_call_->DestroyAudioReceiveStream(audio_receive_stream_); 224 test_->receiver_call_->DestroyAudioReceiveStream(audio_receive_stream_);
224 audio_receive_stream_ = nullptr; 225 audio_receive_stream_ = nullptr;
225 } 226 }
226 if (video_receive_stream_) { 227 if (video_receive_stream_) {
227 test_->receiver_call_->DestroyVideoReceiveStream(video_receive_stream_); 228 test_->receiver_call_->DestroyVideoReceiveStream(video_receive_stream_);
228 video_receive_stream_ = nullptr; 229 video_receive_stream_ = nullptr;
229 } 230 }
230 } 231 }
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after
323 RtpExtension(RtpExtension::kTimestampOffsetUri, kTOFExtensionId); 324 RtpExtension(RtpExtension::kTimestampOffsetUri, kTOFExtensionId);
324 receiver_log_.PushExpectedLogLine(kAbsSendTimeLog); 325 receiver_log_.PushExpectedLogLine(kAbsSendTimeLog);
325 receiver_log_.PushExpectedLogLine( 326 receiver_log_.PushExpectedLogLine(
326 "WrappingBitrateEstimator: Switching to transmission time offset RBE."); 327 "WrappingBitrateEstimator: Switching to transmission time offset RBE.");
327 streams_.push_back(new Stream(this, false)); 328 streams_.push_back(new Stream(this, false));
328 streams_[0]->StopSending(); 329 streams_[0]->StopSending();
329 streams_[1]->StopSending(); 330 streams_[1]->StopSending();
330 EXPECT_TRUE(receiver_log_.Wait()); 331 EXPECT_TRUE(receiver_log_.Wait());
331 } 332 }
332 } // namespace webrtc 333 } // namespace webrtc
OLDNEW
« no previous file with comments | « no previous file | webrtc/media/engine/fakewebrtccall.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698