| 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 208 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 219 } | 219 } |
| 220 | 220 |
| 221 // TODO(brandtr): Update this when we support multistream protection. | 221 // TODO(brandtr): Update this when we support multistream protection. |
| 222 if (num_flexfec_streams > 0) { | 222 if (num_flexfec_streams > 0) { |
| 223 video_send_config_.rtp.flexfec.payload_type = kFlexfecPayloadType; | 223 video_send_config_.rtp.flexfec.payload_type = kFlexfecPayloadType; |
| 224 video_send_config_.rtp.flexfec.ssrc = kFlexfecSendSsrc; | 224 video_send_config_.rtp.flexfec.ssrc = kFlexfecSendSsrc; |
| 225 video_send_config_.rtp.flexfec.protected_media_ssrcs = {kVideoSendSsrcs[0]}; | 225 video_send_config_.rtp.flexfec.protected_media_ssrcs = {kVideoSendSsrcs[0]}; |
| 226 } | 226 } |
| 227 } | 227 } |
| 228 | 228 |
| 229 void CallTest::CreateMatchingVideoReceiveConfigs( |
| 230 const VideoSendStream::Config& video_send_config, |
| 231 Transport* rtcp_send_transport) { |
| 232 RTC_DCHECK(!video_send_config.rtp.ssrcs.empty()); |
| 233 VideoReceiveStream::Config video_config(rtcp_send_transport); |
| 234 video_config.rtp.remb = false; |
| 235 video_config.rtp.transport_cc = true; |
| 236 video_config.rtp.local_ssrc = kReceiverLocalVideoSsrc; |
| 237 for (const RtpExtension& extension : video_send_config.rtp.extensions) |
| 238 video_config.rtp.extensions.push_back(extension); |
| 239 video_config.renderer = &fake_renderer_; |
| 240 for (size_t i = 0; i < video_send_config.rtp.ssrcs.size(); ++i) { |
| 241 VideoReceiveStream::Decoder decoder = |
| 242 test::CreateMatchingDecoder(video_send_config.encoder_settings); |
| 243 allocated_decoders_.push_back( |
| 244 std::unique_ptr<VideoDecoder>(decoder.decoder)); |
| 245 video_config.decoders.clear(); |
| 246 video_config.decoders.push_back(decoder); |
| 247 video_config.rtp.remote_ssrc = video_send_config.rtp.ssrcs[i]; |
| 248 video_receive_configs_.push_back(video_config.Copy()); |
| 249 } |
| 250 } |
| 251 |
| 229 void CallTest::CreateMatchingReceiveConfigs(Transport* rtcp_send_transport) { | 252 void CallTest::CreateMatchingReceiveConfigs(Transport* rtcp_send_transport) { |
| 230 RTC_DCHECK(video_receive_configs_.empty()); | 253 RTC_DCHECK(video_receive_configs_.empty()); |
| 231 RTC_DCHECK(allocated_decoders_.empty()); | 254 RTC_DCHECK(allocated_decoders_.empty()); |
| 232 if (num_video_streams_ > 0) { | 255 if (num_video_streams_ > 0) { |
| 233 RTC_DCHECK(!video_send_config_.rtp.ssrcs.empty()); | 256 CreateMatchingVideoReceiveConfigs(video_send_config_, rtcp_send_transport); |
| 234 VideoReceiveStream::Config video_config(rtcp_send_transport); | |
| 235 video_config.rtp.remb = false; | |
| 236 video_config.rtp.transport_cc = true; | |
| 237 video_config.rtp.local_ssrc = kReceiverLocalVideoSsrc; | |
| 238 for (const RtpExtension& extension : video_send_config_.rtp.extensions) | |
| 239 video_config.rtp.extensions.push_back(extension); | |
| 240 video_config.renderer = &fake_renderer_; | |
| 241 for (size_t i = 0; i < video_send_config_.rtp.ssrcs.size(); ++i) { | |
| 242 VideoReceiveStream::Decoder decoder = | |
| 243 test::CreateMatchingDecoder(video_send_config_.encoder_settings); | |
| 244 allocated_decoders_.push_back( | |
| 245 std::unique_ptr<VideoDecoder>(decoder.decoder)); | |
| 246 video_config.decoders.clear(); | |
| 247 video_config.decoders.push_back(decoder); | |
| 248 video_config.rtp.remote_ssrc = video_send_config_.rtp.ssrcs[i]; | |
| 249 video_receive_configs_.push_back(video_config.Copy()); | |
| 250 } | |
| 251 } | 257 } |
| 252 | 258 |
| 253 RTC_DCHECK_GE(1, num_audio_streams_); | 259 RTC_DCHECK_GE(1, num_audio_streams_); |
| 254 if (num_audio_streams_ == 1) { | 260 if (num_audio_streams_ == 1) { |
| 255 RTC_DCHECK_LE(0, voe_send_.channel_id); | 261 RTC_DCHECK_LE(0, voe_send_.channel_id); |
| 256 AudioReceiveStream::Config audio_config; | 262 AudioReceiveStream::Config audio_config; |
| 257 audio_config.rtp.local_ssrc = kReceiverLocalAudioSsrc; | 263 audio_config.rtp.local_ssrc = kReceiverLocalAudioSsrc; |
| 258 audio_config.rtcp_send_transport = rtcp_send_transport; | 264 audio_config.rtcp_send_transport = rtcp_send_transport; |
| 259 audio_config.voe_channel_id = voe_recv_.channel_id; | 265 audio_config.voe_channel_id = voe_recv_.channel_id; |
| 260 audio_config.rtp.remote_ssrc = audio_send_config_.rtp.ssrc; | 266 audio_config.rtp.remote_ssrc = audio_send_config_.rtp.ssrc; |
| (...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 340 void CallTest::DestroyStreams() { | 346 void CallTest::DestroyStreams() { |
| 341 if (audio_send_stream_) | 347 if (audio_send_stream_) |
| 342 sender_call_->DestroyAudioSendStream(audio_send_stream_); | 348 sender_call_->DestroyAudioSendStream(audio_send_stream_); |
| 343 audio_send_stream_ = nullptr; | 349 audio_send_stream_ = nullptr; |
| 344 for (AudioReceiveStream* audio_recv_stream : audio_receive_streams_) | 350 for (AudioReceiveStream* audio_recv_stream : audio_receive_streams_) |
| 345 receiver_call_->DestroyAudioReceiveStream(audio_recv_stream); | 351 receiver_call_->DestroyAudioReceiveStream(audio_recv_stream); |
| 346 | 352 |
| 347 if (video_send_stream_) | 353 if (video_send_stream_) |
| 348 sender_call_->DestroyVideoSendStream(video_send_stream_); | 354 sender_call_->DestroyVideoSendStream(video_send_stream_); |
| 349 video_send_stream_ = nullptr; | 355 video_send_stream_ = nullptr; |
| 356 |
| 350 for (VideoReceiveStream* video_recv_stream : video_receive_streams_) | 357 for (VideoReceiveStream* video_recv_stream : video_receive_streams_) |
| 351 receiver_call_->DestroyVideoReceiveStream(video_recv_stream); | 358 receiver_call_->DestroyVideoReceiveStream(video_recv_stream); |
| 352 | 359 |
| 353 for (FlexfecReceiveStream* flexfec_recv_stream : flexfec_receive_streams_) | 360 for (FlexfecReceiveStream* flexfec_recv_stream : flexfec_receive_streams_) |
| 354 receiver_call_->DestroyFlexfecReceiveStream(flexfec_recv_stream); | 361 receiver_call_->DestroyFlexfecReceiveStream(flexfec_recv_stream); |
| 355 | 362 |
| 356 video_receive_streams_.clear(); | 363 video_receive_streams_.clear(); |
| 357 allocated_decoders_.clear(); | 364 allocated_decoders_.clear(); |
| 358 } | 365 } |
| 359 | 366 |
| (...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 495 | 502 |
| 496 EndToEndTest::EndToEndTest(unsigned int timeout_ms) : BaseTest(timeout_ms) { | 503 EndToEndTest::EndToEndTest(unsigned int timeout_ms) : BaseTest(timeout_ms) { |
| 497 } | 504 } |
| 498 | 505 |
| 499 bool EndToEndTest::ShouldCreateReceivers() const { | 506 bool EndToEndTest::ShouldCreateReceivers() const { |
| 500 return true; | 507 return true; |
| 501 } | 508 } |
| 502 | 509 |
| 503 } // namespace test | 510 } // namespace test |
| 504 } // namespace webrtc | 511 } // namespace webrtc |
| OLD | NEW |