OLD | NEW |
---|---|
1 /* | 1 /* |
2 * Copyright 2017 The WebRTC project authors. All Rights Reserved. | 2 * Copyright 2017 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 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
122 DestroyVideoChannel(); | 122 DestroyVideoChannel(); |
123 } | 123 } |
124 // Call must be destroyed on the worker thread. | 124 // Call must be destroyed on the worker thread. |
125 worker_thread_->Invoke<void>( | 125 worker_thread_->Invoke<void>( |
126 RTC_FROM_HERE, | 126 RTC_FROM_HERE, |
127 rtc::Bind(&RtpTransportControllerAdapter::Close_w, this)); | 127 rtc::Bind(&RtpTransportControllerAdapter::Close_w, this)); |
128 } | 128 } |
129 | 129 |
130 RTCErrorOr<std::unique_ptr<RtpTransportInterface>> | 130 RTCErrorOr<std::unique_ptr<RtpTransportInterface>> |
131 RtpTransportControllerAdapter::CreateProxiedRtpTransport( | 131 RtpTransportControllerAdapter::CreateProxiedRtpTransport( |
132 const RtcpParameters& rtcp_parameters, | 132 const RtpTransportParameters& parameters, |
133 PacketTransportInterface* rtp, | 133 PacketTransportInterface* rtp, |
134 PacketTransportInterface* rtcp) { | 134 PacketTransportInterface* rtcp) { |
135 auto result = | 135 if (!transport_proxies_.empty() && (parameters.keepalive != keepalive_)) { |
136 RtpTransportAdapter::CreateProxied(rtcp_parameters, rtp, rtcp, this); | 136 LOG_AND_RETURN_ERROR(RTCErrorType::INVALID_MODIFICATION, |
137 "Cannot create RtpTransport with different keep-alive " | |
138 "from the RtpTransports already associated with this " | |
139 "transport controller."); | |
140 } | |
141 auto result = RtpTransportAdapter::CreateProxied(parameters, rtp, rtcp, this); | |
137 if (result.ok()) { | 142 if (result.ok()) { |
138 transport_proxies_.push_back(result.value().get()); | 143 transport_proxies_.push_back(result.value().get()); |
139 transport_proxies_.back()->GetInternal()->SignalDestroyed.connect( | 144 transport_proxies_.back()->GetInternal()->SignalDestroyed.connect( |
140 this, &RtpTransportControllerAdapter::OnRtpTransportDestroyed); | 145 this, &RtpTransportControllerAdapter::OnRtpTransportDestroyed); |
141 } | 146 } |
142 return result; | 147 return result; |
143 } | 148 } |
144 | 149 |
145 RTCErrorOr<std::unique_ptr<SrtpTransportInterface>> | 150 RTCErrorOr<std::unique_ptr<SrtpTransportInterface>> |
146 RtpTransportControllerAdapter::CreateProxiedSrtpTransport( | 151 RtpTransportControllerAdapter::CreateProxiedSrtpTransport( |
147 const RtcpParameters& rtcp_parameters, | 152 const RtpTransportParameters& parameters, |
148 PacketTransportInterface* rtp, | 153 PacketTransportInterface* rtp, |
149 PacketTransportInterface* rtcp) { | 154 PacketTransportInterface* rtcp) { |
150 auto result = | 155 auto result = |
151 RtpTransportAdapter::CreateSrtpProxied(rtcp_parameters, rtp, rtcp, this); | 156 RtpTransportAdapter::CreateSrtpProxied(parameters, rtp, rtcp, this); |
152 if (result.ok()) { | 157 if (result.ok()) { |
153 transport_proxies_.push_back(result.value().get()); | 158 transport_proxies_.push_back(result.value().get()); |
154 transport_proxies_.back()->GetInternal()->SignalDestroyed.connect( | 159 transport_proxies_.back()->GetInternal()->SignalDestroyed.connect( |
155 this, &RtpTransportControllerAdapter::OnRtpTransportDestroyed); | 160 this, &RtpTransportControllerAdapter::OnRtpTransportDestroyed); |
156 } | 161 } |
157 return result; | 162 return result; |
158 } | 163 } |
159 | 164 |
160 RTCErrorOr<std::unique_ptr<OrtcRtpSenderInterface>> | 165 RTCErrorOr<std::unique_ptr<OrtcRtpSenderInterface>> |
161 RtpTransportControllerAdapter::CreateProxiedRtpSender( | 166 RtpTransportControllerAdapter::CreateProxiedRtpSender( |
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
212 | 217 |
213 return OrtcRtpReceiverAdapter::CreateProxy(std::move(new_receiver)); | 218 return OrtcRtpReceiverAdapter::CreateProxy(std::move(new_receiver)); |
214 } | 219 } |
215 | 220 |
216 std::vector<RtpTransportInterface*> | 221 std::vector<RtpTransportInterface*> |
217 RtpTransportControllerAdapter::GetTransports() const { | 222 RtpTransportControllerAdapter::GetTransports() const { |
218 RTC_DCHECK_RUN_ON(signaling_thread_); | 223 RTC_DCHECK_RUN_ON(signaling_thread_); |
219 return transport_proxies_; | 224 return transport_proxies_; |
220 } | 225 } |
221 | 226 |
222 RTCError RtpTransportControllerAdapter::SetRtcpParameters( | 227 RTCError RtpTransportControllerAdapter::SetRtpTransportParameters( |
223 const RtcpParameters& parameters, | 228 const RtpTransportParameters& parameters, |
224 RtpTransportInterface* inner_transport) { | 229 RtpTransportInterface* inner_transport) { |
230 if ((video_channel_ != nullptr || voice_channel_ != nullptr) && | |
231 (parameters.keepalive != keepalive_)) { | |
232 LOG_AND_RETURN_ERROR(RTCErrorType::INVALID_MODIFICATION, | |
233 "Cannot change keep-alive settings after creating " | |
234 "media streams or additional transports for the same " | |
235 "transport controller."); | |
stefan-webrtc
2017/08/09 07:23:10
Just a thought; if it's not possible to set after
sprang_webrtc
2017/08/09 07:59:24
Agree the would be nice (at least from the Call pe
| |
236 } | |
237 // Call must be configured on the worker thread. | |
238 worker_thread_->Invoke<void>( | |
239 RTC_FROM_HERE, | |
240 rtc::Bind(&RtpTransportControllerAdapter::SetRtpTransportParameters_w, | |
241 this, parameters)); | |
242 | |
225 do { | 243 do { |
226 if (inner_transport == inner_audio_transport_) { | 244 if (inner_transport == inner_audio_transport_) { |
227 CopyRtcpParametersToDescriptions(parameters, &local_audio_description_, | 245 CopyRtcpParametersToDescriptions(parameters.rtcp, |
246 &local_audio_description_, | |
228 &remote_audio_description_); | 247 &remote_audio_description_); |
229 if (!voice_channel_->SetLocalContent(&local_audio_description_, | 248 if (!voice_channel_->SetLocalContent(&local_audio_description_, |
230 cricket::CA_OFFER, nullptr)) { | 249 cricket::CA_OFFER, nullptr)) { |
231 break; | 250 break; |
232 } | 251 } |
233 if (!voice_channel_->SetRemoteContent(&remote_audio_description_, | 252 if (!voice_channel_->SetRemoteContent(&remote_audio_description_, |
234 cricket::CA_ANSWER, nullptr)) { | 253 cricket::CA_ANSWER, nullptr)) { |
235 break; | 254 break; |
236 } | 255 } |
237 } else if (inner_transport == inner_video_transport_) { | 256 } else if (inner_transport == inner_video_transport_) { |
238 CopyRtcpParametersToDescriptions(parameters, &local_video_description_, | 257 CopyRtcpParametersToDescriptions(parameters.rtcp, |
258 &local_video_description_, | |
239 &remote_video_description_); | 259 &remote_video_description_); |
240 if (!video_channel_->SetLocalContent(&local_video_description_, | 260 if (!video_channel_->SetLocalContent(&local_video_description_, |
241 cricket::CA_OFFER, nullptr)) { | 261 cricket::CA_OFFER, nullptr)) { |
242 break; | 262 break; |
243 } | 263 } |
244 if (!video_channel_->SetRemoteContent(&remote_video_description_, | 264 if (!video_channel_->SetRemoteContent(&remote_video_description_, |
245 cricket::CA_ANSWER, nullptr)) { | 265 cricket::CA_ANSWER, nullptr)) { |
246 break; | 266 break; |
247 } | 267 } |
248 } | 268 } |
249 return RTCError::OK(); | 269 return RTCError::OK(); |
250 } while (false); | 270 } while (false); |
251 LOG_AND_RETURN_ERROR(RTCErrorType::INTERNAL_ERROR, | 271 LOG_AND_RETURN_ERROR(RTCErrorType::INTERNAL_ERROR, |
252 "Failed to apply new RTCP parameters."); | 272 "Failed to apply new RTCP parameters."); |
253 } | 273 } |
254 | 274 |
275 void RtpTransportControllerAdapter::SetRtpTransportParameters_w( | |
276 const RtpTransportParameters& parameters) { | |
277 call_send_rtp_transport_controller_->SetKeepAliveConfig(parameters.keepalive); | |
278 } | |
279 | |
255 RTCError RtpTransportControllerAdapter::ValidateAndApplyAudioSenderParameters( | 280 RTCError RtpTransportControllerAdapter::ValidateAndApplyAudioSenderParameters( |
256 const RtpParameters& parameters, | 281 const RtpParameters& parameters, |
257 uint32_t* primary_ssrc) { | 282 uint32_t* primary_ssrc) { |
258 RTC_DCHECK(voice_channel_); | 283 RTC_DCHECK(voice_channel_); |
259 RTC_DCHECK(have_audio_sender_); | 284 RTC_DCHECK(have_audio_sender_); |
260 | 285 |
261 auto codecs_result = ToCricketCodecs<cricket::AudioCodec>(parameters.codecs); | 286 auto codecs_result = ToCricketCodecs<cricket::AudioCodec>(parameters.codecs); |
262 if (!codecs_result.ok()) { | 287 if (!codecs_result.ok()) { |
263 return codecs_result.MoveError(); | 288 return codecs_result.MoveError(); |
264 } | 289 } |
265 | 290 |
266 auto extensions_result = | 291 auto extensions_result = |
267 ToCricketRtpHeaderExtensions(parameters.header_extensions); | 292 ToCricketRtpHeaderExtensions(parameters.header_extensions); |
268 if (!extensions_result.ok()) { | 293 if (!extensions_result.ok()) { |
269 return extensions_result.MoveError(); | 294 return extensions_result.MoveError(); |
270 } | 295 } |
271 | 296 |
272 auto stream_params_result = MakeSendStreamParamsVec( | 297 auto stream_params_result = MakeSendStreamParamsVec( |
273 parameters.encodings, inner_audio_transport_->GetRtcpParameters().cname, | 298 parameters.encodings, inner_audio_transport_->GetParameters().rtcp.cname, |
274 local_audio_description_); | 299 local_audio_description_); |
275 if (!stream_params_result.ok()) { | 300 if (!stream_params_result.ok()) { |
276 return stream_params_result.MoveError(); | 301 return stream_params_result.MoveError(); |
277 } | 302 } |
278 | 303 |
279 // Check that audio/video sender aren't using the same IDs to refer to | 304 // Check that audio/video sender aren't using the same IDs to refer to |
280 // different things, if they share the same transport. | 305 // different things, if they share the same transport. |
281 if (inner_audio_transport_ == inner_video_transport_) { | 306 if (inner_audio_transport_ == inner_video_transport_) { |
282 RTCError err = CheckForIdConflicts( | 307 RTCError err = CheckForIdConflicts( |
283 codecs_result.value(), extensions_result.value(), | 308 codecs_result.value(), extensions_result.value(), |
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
352 return codecs_result.MoveError(); | 377 return codecs_result.MoveError(); |
353 } | 378 } |
354 | 379 |
355 auto extensions_result = | 380 auto extensions_result = |
356 ToCricketRtpHeaderExtensions(parameters.header_extensions); | 381 ToCricketRtpHeaderExtensions(parameters.header_extensions); |
357 if (!extensions_result.ok()) { | 382 if (!extensions_result.ok()) { |
358 return extensions_result.MoveError(); | 383 return extensions_result.MoveError(); |
359 } | 384 } |
360 | 385 |
361 auto stream_params_result = MakeSendStreamParamsVec( | 386 auto stream_params_result = MakeSendStreamParamsVec( |
362 parameters.encodings, inner_video_transport_->GetRtcpParameters().cname, | 387 parameters.encodings, inner_video_transport_->GetParameters().rtcp.cname, |
363 local_video_description_); | 388 local_video_description_); |
364 if (!stream_params_result.ok()) { | 389 if (!stream_params_result.ok()) { |
365 return stream_params_result.MoveError(); | 390 return stream_params_result.MoveError(); |
366 } | 391 } |
367 | 392 |
368 // Check that audio/video sender aren't using the same IDs to refer to | 393 // Check that audio/video sender aren't using the same IDs to refer to |
369 // different things, if they share the same transport. | 394 // different things, if they share the same transport. |
370 if (inner_audio_transport_ == inner_video_transport_) { | 395 if (inner_audio_transport_ == inner_video_transport_) { |
371 RTCError err = CheckForIdConflicts( | 396 RTCError err = CheckForIdConflicts( |
372 codecs_result.value(), extensions_result.value(), | 397 codecs_result.value(), extensions_result.value(), |
(...skipping 210 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
583 RtpTransportControllerAdapter::RtpTransportControllerAdapter( | 608 RtpTransportControllerAdapter::RtpTransportControllerAdapter( |
584 const cricket::MediaConfig& config, | 609 const cricket::MediaConfig& config, |
585 cricket::ChannelManager* channel_manager, | 610 cricket::ChannelManager* channel_manager, |
586 webrtc::RtcEventLog* event_log, | 611 webrtc::RtcEventLog* event_log, |
587 rtc::Thread* signaling_thread, | 612 rtc::Thread* signaling_thread, |
588 rtc::Thread* worker_thread) | 613 rtc::Thread* worker_thread) |
589 : signaling_thread_(signaling_thread), | 614 : signaling_thread_(signaling_thread), |
590 worker_thread_(worker_thread), | 615 worker_thread_(worker_thread), |
591 media_config_(config), | 616 media_config_(config), |
592 channel_manager_(channel_manager), | 617 channel_manager_(channel_manager), |
593 event_log_(event_log) { | 618 event_log_(event_log), |
619 call_send_rtp_transport_controller_(nullptr) { | |
594 RTC_DCHECK_RUN_ON(signaling_thread_); | 620 RTC_DCHECK_RUN_ON(signaling_thread_); |
595 RTC_DCHECK(channel_manager_); | 621 RTC_DCHECK(channel_manager_); |
596 // Add "dummy" codecs to the descriptions, because the media engines | 622 // Add "dummy" codecs to the descriptions, because the media engines |
597 // currently reject empty lists of codecs. Note that these codecs will never | 623 // currently reject empty lists of codecs. Note that these codecs will never |
598 // actually be used, because when parameters are set, the dummy codecs will | 624 // actually be used, because when parameters are set, the dummy codecs will |
599 // be replaced by actual codecs before any send/receive streams are created. | 625 // be replaced by actual codecs before any send/receive streams are created. |
600 static const cricket::AudioCodec dummy_audio(0, cricket::kPcmuCodecName, 8000, | 626 static const cricket::AudioCodec dummy_audio(0, cricket::kPcmuCodecName, 8000, |
601 0, 1); | 627 0, 1); |
602 static const cricket::VideoCodec dummy_video(96, cricket::kVp8CodecName); | 628 static const cricket::VideoCodec dummy_video(96, cricket::kVp8CodecName); |
603 local_audio_description_.AddCodec(dummy_audio); | 629 local_audio_description_.AddCodec(dummy_audio); |
(...skipping 15 matching lines...) Expand all Loading... | |
619 const int kMinBandwidthBps = 30000; | 645 const int kMinBandwidthBps = 30000; |
620 const int kStartBandwidthBps = 300000; | 646 const int kStartBandwidthBps = 300000; |
621 const int kMaxBandwidthBps = 2000000; | 647 const int kMaxBandwidthBps = 2000000; |
622 | 648 |
623 webrtc::Call::Config call_config(event_log_); | 649 webrtc::Call::Config call_config(event_log_); |
624 call_config.audio_state = channel_manager_->media_engine()->GetAudioState(); | 650 call_config.audio_state = channel_manager_->media_engine()->GetAudioState(); |
625 call_config.bitrate_config.min_bitrate_bps = kMinBandwidthBps; | 651 call_config.bitrate_config.min_bitrate_bps = kMinBandwidthBps; |
626 call_config.bitrate_config.start_bitrate_bps = kStartBandwidthBps; | 652 call_config.bitrate_config.start_bitrate_bps = kStartBandwidthBps; |
627 call_config.bitrate_config.max_bitrate_bps = kMaxBandwidthBps; | 653 call_config.bitrate_config.max_bitrate_bps = kMaxBandwidthBps; |
628 | 654 |
629 call_.reset(webrtc::Call::Create(call_config)); | 655 call_send_rtp_transport_controller_ = |
656 new RtpTransportControllerSend(Clock::GetRealTimeClock(), event_log_); | |
657 call_.reset(webrtc::Call::Create( | |
658 call_config, std::unique_ptr<RtpTransportControllerSendInterface>( | |
659 call_send_rtp_transport_controller_))); | |
630 } | 660 } |
631 | 661 |
632 void RtpTransportControllerAdapter::Close_w() { | 662 void RtpTransportControllerAdapter::Close_w() { |
633 call_.reset(); | 663 call_.reset(); |
664 call_send_rtp_transport_controller_ = nullptr; | |
634 } | 665 } |
635 | 666 |
636 RTCError RtpTransportControllerAdapter::AttachAudioSender( | 667 RTCError RtpTransportControllerAdapter::AttachAudioSender( |
637 OrtcRtpSenderAdapter* sender, | 668 OrtcRtpSenderAdapter* sender, |
638 RtpTransportInterface* inner_transport) { | 669 RtpTransportInterface* inner_transport) { |
639 if (have_audio_sender_) { | 670 if (have_audio_sender_) { |
640 LOG_AND_RETURN_ERROR(RTCErrorType::UNSUPPORTED_OPERATION, | 671 LOG_AND_RETURN_ERROR(RTCErrorType::UNSUPPORTED_OPERATION, |
641 "Using two audio RtpSenders with the same " | 672 "Using two audio RtpSenders with the same " |
642 "RtpTransportControllerAdapter is not currently " | 673 "RtpTransportControllerAdapter is not currently " |
643 "supported."); | 674 "supported."); |
644 } | 675 } |
645 if (inner_audio_transport_ && inner_audio_transport_ != inner_transport) { | 676 if (inner_audio_transport_ && inner_audio_transport_ != inner_transport) { |
646 LOG_AND_RETURN_ERROR(RTCErrorType::UNSUPPORTED_OPERATION, | 677 LOG_AND_RETURN_ERROR(RTCErrorType::UNSUPPORTED_OPERATION, |
647 "Using different transports for the audio " | 678 "Using different transports for the audio " |
648 "RtpSender and RtpReceiver is not currently " | 679 "RtpSender and RtpReceiver is not currently " |
649 "supported."); | 680 "supported."); |
650 } | 681 } |
651 RTCError err = MaybeSetCryptos(inner_transport, &local_audio_description_, | 682 RTCError err = MaybeSetCryptos(inner_transport, &local_audio_description_, |
652 &remote_audio_description_); | 683 &remote_audio_description_); |
653 if (!err.ok()) { | 684 if (!err.ok()) { |
654 return err; | 685 return err; |
655 } | 686 } |
656 // If setting new transport, extract its RTCP parameters and create voice | 687 // If setting new transport, extract its RTCP parameters and create voice |
657 // channel. | 688 // channel. |
658 if (!inner_audio_transport_) { | 689 if (!inner_audio_transport_) { |
659 CopyRtcpParametersToDescriptions(inner_transport->GetRtcpParameters(), | 690 CopyRtcpParametersToDescriptions(inner_transport->GetParameters().rtcp, |
660 &local_audio_description_, | 691 &local_audio_description_, |
661 &remote_audio_description_); | 692 &remote_audio_description_); |
662 inner_audio_transport_ = inner_transport; | 693 inner_audio_transport_ = inner_transport; |
663 CreateVoiceChannel(); | 694 CreateVoiceChannel(); |
664 } | 695 } |
665 have_audio_sender_ = true; | 696 have_audio_sender_ = true; |
666 sender->SignalDestroyed.connect( | 697 sender->SignalDestroyed.connect( |
667 this, &RtpTransportControllerAdapter::OnAudioSenderDestroyed); | 698 this, &RtpTransportControllerAdapter::OnAudioSenderDestroyed); |
668 return RTCError::OK(); | 699 return RTCError::OK(); |
669 } | 700 } |
(...skipping 14 matching lines...) Expand all Loading... | |
684 "supported."); | 715 "supported."); |
685 } | 716 } |
686 RTCError err = MaybeSetCryptos(inner_transport, &local_video_description_, | 717 RTCError err = MaybeSetCryptos(inner_transport, &local_video_description_, |
687 &remote_video_description_); | 718 &remote_video_description_); |
688 if (!err.ok()) { | 719 if (!err.ok()) { |
689 return err; | 720 return err; |
690 } | 721 } |
691 // If setting new transport, extract its RTCP parameters and create video | 722 // If setting new transport, extract its RTCP parameters and create video |
692 // channel. | 723 // channel. |
693 if (!inner_video_transport_) { | 724 if (!inner_video_transport_) { |
694 CopyRtcpParametersToDescriptions(inner_transport->GetRtcpParameters(), | 725 CopyRtcpParametersToDescriptions(inner_transport->GetParameters().rtcp, |
695 &local_video_description_, | 726 &local_video_description_, |
696 &remote_video_description_); | 727 &remote_video_description_); |
697 inner_video_transport_ = inner_transport; | 728 inner_video_transport_ = inner_transport; |
698 CreateVideoChannel(); | 729 CreateVideoChannel(); |
699 } | 730 } |
700 have_video_sender_ = true; | 731 have_video_sender_ = true; |
701 sender->SignalDestroyed.connect( | 732 sender->SignalDestroyed.connect( |
702 this, &RtpTransportControllerAdapter::OnVideoSenderDestroyed); | 733 this, &RtpTransportControllerAdapter::OnVideoSenderDestroyed); |
703 return RTCError::OK(); | 734 return RTCError::OK(); |
704 } | 735 } |
(...skipping 14 matching lines...) Expand all Loading... | |
719 "supported."); | 750 "supported."); |
720 } | 751 } |
721 RTCError err = MaybeSetCryptos(inner_transport, &local_audio_description_, | 752 RTCError err = MaybeSetCryptos(inner_transport, &local_audio_description_, |
722 &remote_audio_description_); | 753 &remote_audio_description_); |
723 if (!err.ok()) { | 754 if (!err.ok()) { |
724 return err; | 755 return err; |
725 } | 756 } |
726 // If setting new transport, extract its RTCP parameters and create voice | 757 // If setting new transport, extract its RTCP parameters and create voice |
727 // channel. | 758 // channel. |
728 if (!inner_audio_transport_) { | 759 if (!inner_audio_transport_) { |
729 CopyRtcpParametersToDescriptions(inner_transport->GetRtcpParameters(), | 760 CopyRtcpParametersToDescriptions(inner_transport->GetParameters().rtcp, |
730 &local_audio_description_, | 761 &local_audio_description_, |
731 &remote_audio_description_); | 762 &remote_audio_description_); |
732 inner_audio_transport_ = inner_transport; | 763 inner_audio_transport_ = inner_transport; |
733 CreateVoiceChannel(); | 764 CreateVoiceChannel(); |
734 } | 765 } |
735 have_audio_receiver_ = true; | 766 have_audio_receiver_ = true; |
736 receiver->SignalDestroyed.connect( | 767 receiver->SignalDestroyed.connect( |
737 this, &RtpTransportControllerAdapter::OnAudioReceiverDestroyed); | 768 this, &RtpTransportControllerAdapter::OnAudioReceiverDestroyed); |
738 return RTCError::OK(); | 769 return RTCError::OK(); |
739 } | 770 } |
(...skipping 14 matching lines...) Expand all Loading... | |
754 "supported."); | 785 "supported."); |
755 } | 786 } |
756 RTCError err = MaybeSetCryptos(inner_transport, &local_video_description_, | 787 RTCError err = MaybeSetCryptos(inner_transport, &local_video_description_, |
757 &remote_video_description_); | 788 &remote_video_description_); |
758 if (!err.ok()) { | 789 if (!err.ok()) { |
759 return err; | 790 return err; |
760 } | 791 } |
761 // If setting new transport, extract its RTCP parameters and create video | 792 // If setting new transport, extract its RTCP parameters and create video |
762 // channel. | 793 // channel. |
763 if (!inner_video_transport_) { | 794 if (!inner_video_transport_) { |
764 CopyRtcpParametersToDescriptions(inner_transport->GetRtcpParameters(), | 795 CopyRtcpParametersToDescriptions(inner_transport->GetParameters().rtcp, |
765 &local_video_description_, | 796 &local_video_description_, |
766 &remote_video_description_); | 797 &remote_video_description_); |
767 inner_video_transport_ = inner_transport; | 798 inner_video_transport_ = inner_transport; |
768 CreateVideoChannel(); | 799 CreateVideoChannel(); |
769 } | 800 } |
770 have_video_receiver_ = true; | 801 have_video_receiver_ = true; |
771 receiver->SignalDestroyed.connect( | 802 receiver->SignalDestroyed.connect( |
772 this, &RtpTransportControllerAdapter::OnVideoReceiverDestroyed); | 803 this, &RtpTransportControllerAdapter::OnVideoReceiverDestroyed); |
773 return RTCError::OK(); | 804 return RTCError::OK(); |
774 } | 805 } |
(...skipping 199 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
974 local_description->set_cryptos(cryptos); | 1005 local_description->set_cryptos(cryptos); |
975 | 1006 |
976 cryptos.clear(); | 1007 cryptos.clear(); |
977 cryptos.push_back(*(rtp_transport->GetInternal()->send_key())); | 1008 cryptos.push_back(*(rtp_transport->GetInternal()->send_key())); |
978 remote_description->set_cryptos(cryptos); | 1009 remote_description->set_cryptos(cryptos); |
979 } | 1010 } |
980 return RTCError::OK(); | 1011 return RTCError::OK(); |
981 } | 1012 } |
982 | 1013 |
983 } // namespace webrtc | 1014 } // namespace webrtc |
OLD | NEW |