 Chromium Code Reviews
 Chromium Code Reviews Issue 2974453002:
  Protected streams report RTP messages directly to the FlexFec streams  (Closed)
    
  
    Issue 2974453002:
  Protected streams report RTP messages directly to the FlexFec streams  (Closed) 
  | 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 318 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 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 | 
| 343 // TODO(eladalon): This is not the order in the header; fix in separate CL. | |
| 
stefan-webrtc
2017/07/07 09:36:24
I don't think you need to add this TODO, just crea
 
eladalon
2017/07/07 14:16:24
Done.
 | |
| 341 void CallTest::SetFakeVideoCaptureRotation(VideoRotation rotation) { | 344 void CallTest::SetFakeVideoCaptureRotation(VideoRotation rotation) { | 
| 342 frame_generator_capturer_->SetFakeRotation(rotation); | 345 frame_generator_capturer_->SetFakeRotation(rotation); | 
| 343 } | 346 } | 
| 344 | 347 | 
| 345 void CallTest::CreateAudioStreams() { | 348 void CallTest::CreateAudioStreams() { | 
| 346 audio_send_stream_ = sender_call_->CreateAudioSendStream(audio_send_config_); | 349 audio_send_stream_ = sender_call_->CreateAudioSendStream(audio_send_config_); | 
| 347 for (size_t i = 0; i < audio_receive_configs_.size(); ++i) { | 350 for (size_t i = 0; i < audio_receive_configs_.size(); ++i) { | 
| 348 audio_receive_streams_.push_back( | 351 audio_receive_streams_.push_back( | 
| 349 receiver_call_->CreateAudioReceiveStream(audio_receive_configs_[i])); | 352 receiver_call_->CreateAudioReceiveStream(audio_receive_configs_[i])); | 
| 350 } | 353 } | 
| 351 } | 354 } | 
| 352 | 355 | 
| 353 void CallTest::CreateFlexfecStreams() { | 356 void CallTest::CreateFlexfecStreams() { | 
| 354 for (size_t i = 0; i < flexfec_receive_configs_.size(); ++i) { | 357 for (size_t i = 0; i < flexfec_receive_configs_.size(); ++i) { | 
| 355 flexfec_receive_streams_.push_back( | 358 flexfec_receive_streams_.push_back( | 
| 356 receiver_call_->CreateFlexfecReceiveStream( | 359 receiver_call_->CreateFlexfecReceiveStream( | 
| 357 flexfec_receive_configs_[i])); | 360 flexfec_receive_configs_[i])); | 
| 358 } | 361 } | 
| 362 | |
| 363 AssociateFlexfecStreamsWithVideoStreams(); | |
| 364 } | |
| 365 | |
| 366 void CallTest::AssociateFlexfecStreamsWithVideoStreams() { | |
| 367 // All FlexFEC streams protect all of the video streams. | |
| 368 for (auto* flexfec_receive_stream : flexfec_receive_streams_) { | |
| 369 for (auto* video_recv_stream : video_receive_streams_) { | |
| 370 video_recv_stream->AddSecondarySink(flexfec_receive_stream); | |
| 371 } | |
| 372 } | |
| 373 } | |
| 374 | |
| 375 void CallTest::DissociateFlexfecStreamsFromVideoStreams() { | |
| 376 for (VideoReceiveStream* video_recv_stream : video_receive_streams_) { | |
| 377 for (FlexfecReceiveStream* flexfec_recv_stream : flexfec_receive_streams_) { | |
| 378 video_recv_stream->RemoveSecondarySink(flexfec_recv_stream); | |
| 379 } | |
| 380 } | |
| 359 } | 381 } | 
| 360 | 382 | 
| 361 void CallTest::DestroyStreams() { | 383 void CallTest::DestroyStreams() { | 
| 384 DissociateFlexfecStreamsFromVideoStreams(); | |
| 385 | |
| 362 if (audio_send_stream_) | 386 if (audio_send_stream_) | 
| 363 sender_call_->DestroyAudioSendStream(audio_send_stream_); | 387 sender_call_->DestroyAudioSendStream(audio_send_stream_); | 
| 364 audio_send_stream_ = nullptr; | 388 audio_send_stream_ = nullptr; | 
| 365 for (AudioReceiveStream* audio_recv_stream : audio_receive_streams_) | 389 for (AudioReceiveStream* audio_recv_stream : audio_receive_streams_) | 
| 366 receiver_call_->DestroyAudioReceiveStream(audio_recv_stream); | 390 receiver_call_->DestroyAudioReceiveStream(audio_recv_stream); | 
| 367 | 391 | 
| 368 if (video_send_stream_) | 392 if (video_send_stream_) | 
| 369 sender_call_->DestroyVideoSendStream(video_send_stream_); | 393 sender_call_->DestroyVideoSendStream(video_send_stream_); | 
| 370 video_send_stream_ = nullptr; | 394 video_send_stream_ = nullptr; | 
| 371 | 395 | 
| 372 for (VideoReceiveStream* video_recv_stream : video_receive_streams_) | 396 for (VideoReceiveStream* video_recv_stream : video_receive_streams_) { | 
| 373 receiver_call_->DestroyVideoReceiveStream(video_recv_stream); | 397 receiver_call_->DestroyVideoReceiveStream(video_recv_stream); | 
| 398 } | |
| 374 | 399 | 
| 375 for (FlexfecReceiveStream* flexfec_recv_stream : flexfec_receive_streams_) | 400 for (FlexfecReceiveStream* flexfec_recv_stream : flexfec_receive_streams_) | 
| 376 receiver_call_->DestroyFlexfecReceiveStream(flexfec_recv_stream); | 401 receiver_call_->DestroyFlexfecReceiveStream(flexfec_recv_stream); | 
| 377 | 402 | 
| 378 video_receive_streams_.clear(); | 403 video_receive_streams_.clear(); | 
| 379 allocated_decoders_.clear(); | 404 allocated_decoders_.clear(); | 
| 380 } | 405 } | 
| 381 | 406 | 
| 382 void CallTest::CreateVoiceEngines() { | 407 void CallTest::CreateVoiceEngines() { | 
| 383 voe_send_.voice_engine = VoiceEngine::Create(); | 408 voe_send_.voice_engine = VoiceEngine::Create(); | 
| (...skipping 163 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 547 | 572 | 
| 548 EndToEndTest::EndToEndTest(unsigned int timeout_ms) : BaseTest(timeout_ms) { | 573 EndToEndTest::EndToEndTest(unsigned int timeout_ms) : BaseTest(timeout_ms) { | 
| 549 } | 574 } | 
| 550 | 575 | 
| 551 bool EndToEndTest::ShouldCreateReceivers() const { | 576 bool EndToEndTest::ShouldCreateReceivers() const { | 
| 552 return true; | 577 return true; | 
| 553 } | 578 } | 
| 554 | 579 | 
| 555 } // namespace test | 580 } // namespace test | 
| 556 } // namespace webrtc | 581 } // namespace webrtc | 
| OLD | NEW |