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

Side by Side Diff: webrtc/test/call_test.cc

Issue 2974453002: Protected streams report RTP messages directly to the FlexFec streams (Closed)
Patch Set: Appease lint. Created 3 years, 4 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 | « webrtc/test/call_test.h ('k') | webrtc/video/rtp_video_stream_receiver.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) 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 318 matching lines...) Expand 10 before | Expand all | Expand 10 after
329 RTC_DCHECK(video_receive_streams_.empty()); 329 RTC_DCHECK(video_receive_streams_.empty());
330 RTC_DCHECK(audio_send_stream_ == nullptr); 330 RTC_DCHECK(audio_send_stream_ == nullptr);
331 RTC_DCHECK(audio_receive_streams_.empty()); 331 RTC_DCHECK(audio_receive_streams_.empty());
332 332
333 video_send_stream_ = sender_call_->CreateVideoSendStream( 333 video_send_stream_ = sender_call_->CreateVideoSendStream(
334 video_send_config_.Copy(), video_encoder_config_.Copy()); 334 video_send_config_.Copy(), video_encoder_config_.Copy());
335 for (size_t i = 0; i < video_receive_configs_.size(); ++i) { 335 for (size_t i = 0; i < video_receive_configs_.size(); ++i) {
336 video_receive_streams_.push_back(receiver_call_->CreateVideoReceiveStream( 336 video_receive_streams_.push_back(receiver_call_->CreateVideoReceiveStream(
337 video_receive_configs_[i].Copy())); 337 video_receive_configs_[i].Copy()));
338 } 338 }
339
340 AssociateFlexfecStreamsWithVideoStreams();
339 } 341 }
340 342
341 void CallTest::SetFakeVideoCaptureRotation(VideoRotation rotation) { 343 void CallTest::SetFakeVideoCaptureRotation(VideoRotation rotation) {
342 frame_generator_capturer_->SetFakeRotation(rotation); 344 frame_generator_capturer_->SetFakeRotation(rotation);
343 } 345 }
344 346
345 void CallTest::CreateAudioStreams() { 347 void CallTest::CreateAudioStreams() {
346 audio_send_stream_ = sender_call_->CreateAudioSendStream(audio_send_config_); 348 audio_send_stream_ = sender_call_->CreateAudioSendStream(audio_send_config_);
347 for (size_t i = 0; i < audio_receive_configs_.size(); ++i) { 349 for (size_t i = 0; i < audio_receive_configs_.size(); ++i) {
348 audio_receive_streams_.push_back( 350 audio_receive_streams_.push_back(
349 receiver_call_->CreateAudioReceiveStream(audio_receive_configs_[i])); 351 receiver_call_->CreateAudioReceiveStream(audio_receive_configs_[i]));
350 } 352 }
351 } 353 }
352 354
353 void CallTest::CreateFlexfecStreams() { 355 void CallTest::CreateFlexfecStreams() {
354 for (size_t i = 0; i < flexfec_receive_configs_.size(); ++i) { 356 for (size_t i = 0; i < flexfec_receive_configs_.size(); ++i) {
355 flexfec_receive_streams_.push_back( 357 flexfec_receive_streams_.push_back(
356 receiver_call_->CreateFlexfecReceiveStream( 358 receiver_call_->CreateFlexfecReceiveStream(
357 flexfec_receive_configs_[i])); 359 flexfec_receive_configs_[i]));
358 } 360 }
361
362 AssociateFlexfecStreamsWithVideoStreams();
363 }
364
365 void CallTest::AssociateFlexfecStreamsWithVideoStreams() {
366 // All FlexFEC streams protect all of the video streams.
367 for (FlexfecReceiveStream* flexfec_recv_stream : flexfec_receive_streams_) {
368 for (VideoReceiveStream* video_recv_stream : video_receive_streams_) {
369 video_recv_stream->AddSecondarySink(flexfec_recv_stream);
370 }
371 }
372 }
373
374 void CallTest::DissociateFlexfecStreamsFromVideoStreams() {
375 for (FlexfecReceiveStream* flexfec_recv_stream : flexfec_receive_streams_) {
376 for (VideoReceiveStream* video_recv_stream : video_receive_streams_) {
377 video_recv_stream->RemoveSecondarySink(flexfec_recv_stream);
378 }
379 }
359 } 380 }
360 381
361 void CallTest::DestroyStreams() { 382 void CallTest::DestroyStreams() {
383 DissociateFlexfecStreamsFromVideoStreams();
384
362 if (audio_send_stream_) 385 if (audio_send_stream_)
363 sender_call_->DestroyAudioSendStream(audio_send_stream_); 386 sender_call_->DestroyAudioSendStream(audio_send_stream_);
364 audio_send_stream_ = nullptr; 387 audio_send_stream_ = nullptr;
365 for (AudioReceiveStream* audio_recv_stream : audio_receive_streams_) 388 for (AudioReceiveStream* audio_recv_stream : audio_receive_streams_)
366 receiver_call_->DestroyAudioReceiveStream(audio_recv_stream); 389 receiver_call_->DestroyAudioReceiveStream(audio_recv_stream);
367 390
368 if (video_send_stream_) 391 if (video_send_stream_)
369 sender_call_->DestroyVideoSendStream(video_send_stream_); 392 sender_call_->DestroyVideoSendStream(video_send_stream_);
370 video_send_stream_ = nullptr; 393 video_send_stream_ = nullptr;
371 394
(...skipping 182 matching lines...) Expand 10 before | Expand all | Expand 10 after
554 577
555 EndToEndTest::EndToEndTest(unsigned int timeout_ms) : BaseTest(timeout_ms) { 578 EndToEndTest::EndToEndTest(unsigned int timeout_ms) : BaseTest(timeout_ms) {
556 } 579 }
557 580
558 bool EndToEndTest::ShouldCreateReceivers() const { 581 bool EndToEndTest::ShouldCreateReceivers() const {
559 return true; 582 return true;
560 } 583 }
561 584
562 } // namespace test 585 } // namespace test
563 } // namespace webrtc 586 } // namespace webrtc
OLDNEW
« no previous file with comments | « webrtc/test/call_test.h ('k') | webrtc/video/rtp_video_stream_receiver.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698