OLD | NEW |
---|---|
1 /* | 1 /* |
2 * Copyright 2012 The WebRTC project authors. All Rights Reserved. | 2 * Copyright 2012 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 503 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
514 return true; | 514 return true; |
515 } | 515 } |
516 } | 516 } |
517 return false; | 517 return false; |
518 } | 518 } |
519 | 519 |
520 private: | 520 private: |
521 bool ice_restart_; | 521 bool ice_restart_; |
522 }; | 522 }; |
523 | 523 |
524 WebRtcSession::WebRtcSession(webrtc::MediaControllerInterface* media_controller, | 524 WebRtcSession::WebRtcSession(rtc::Thread* signaling_thread, |
525 rtc::Thread* signaling_thread, | |
526 rtc::Thread* worker_thread, | 525 rtc::Thread* worker_thread, |
527 cricket::PortAllocator* port_allocator) | 526 cricket::PortAllocator* port_allocator) |
528 : signaling_thread_(signaling_thread), | 527 : signaling_thread_(signaling_thread), |
529 worker_thread_(worker_thread), | 528 worker_thread_(worker_thread), |
530 port_allocator_(port_allocator), | 529 port_allocator_(port_allocator), |
531 // RFC 3264: The numeric value of the session id and version in the | 530 // RFC 3264: The numeric value of the session id and version in the |
532 // o line MUST be representable with a "64 bit signed integer". | 531 // o line MUST be representable with a "64 bit signed integer". |
533 // Due to this constraint session id |sid_| is max limited to LLONG_MAX. | 532 // Due to this constraint session id |sid_| is max limited to LLONG_MAX. |
534 sid_(rtc::ToString(rtc::CreateRandomId64() & LLONG_MAX)), | 533 sid_(rtc::ToString(rtc::CreateRandomId64() & LLONG_MAX)), |
535 transport_controller_(new cricket::TransportController(signaling_thread, | 534 transport_controller_(new cricket::TransportController(signaling_thread, |
536 worker_thread, | 535 worker_thread, |
537 port_allocator)), | 536 port_allocator)), |
538 media_controller_(media_controller), | |
539 channel_manager_(media_controller_->channel_manager()), | |
540 ice_observer_(NULL), | 537 ice_observer_(NULL), |
541 ice_connection_state_(PeerConnectionInterface::kIceConnectionNew), | 538 ice_connection_state_(PeerConnectionInterface::kIceConnectionNew), |
542 ice_connection_receiving_(true), | 539 ice_connection_receiving_(true), |
543 older_version_remote_peer_(false), | |
544 dtls_enabled_(false), | |
545 data_channel_type_(cricket::DCT_NONE), | 540 data_channel_type_(cricket::DCT_NONE), |
546 ice_restart_latch_(new IceRestartAnswerLatch), | 541 ice_restart_latch_(new IceRestartAnswerLatch), |
547 metrics_observer_(NULL) { | 542 metrics_observer_(NULL) { |
548 transport_controller_->SetIceRole(cricket::ICEROLE_CONTROLLED); | 543 transport_controller_->SetIceRole(cricket::ICEROLE_CONTROLLED); |
549 transport_controller_->SignalConnectionState.connect( | 544 transport_controller_->SignalConnectionState.connect( |
550 this, &WebRtcSession::OnTransportControllerConnectionState); | 545 this, &WebRtcSession::OnTransportControllerConnectionState); |
551 transport_controller_->SignalReceiving.connect( | 546 transport_controller_->SignalReceiving.connect( |
552 this, &WebRtcSession::OnTransportControllerReceiving); | 547 this, &WebRtcSession::OnTransportControllerReceiving); |
553 transport_controller_->SignalGatheringState.connect( | 548 transport_controller_->SignalGatheringState.connect( |
554 this, &WebRtcSession::OnTransportControllerGatheringState); | 549 this, &WebRtcSession::OnTransportControllerGatheringState); |
555 transport_controller_->SignalCandidatesGathered.connect( | 550 transport_controller_->SignalCandidatesGathered.connect( |
556 this, &WebRtcSession::OnTransportControllerCandidatesGathered); | 551 this, &WebRtcSession::OnTransportControllerCandidatesGathered); |
557 } | 552 } |
558 | 553 |
559 WebRtcSession::~WebRtcSession() { | 554 WebRtcSession::~WebRtcSession() { |
560 ASSERT(signaling_thread()->IsCurrent()); | 555 ASSERT(signaling_thread()->IsCurrent()); |
561 // Destroy video_channel_ first since it may have a pointer to the | 556 // Destroy video_channel_ first since it may have a pointer to the |
562 // voice_channel_. | 557 // voice_channel_. |
563 if (video_channel_) { | 558 if (video_channel_) { |
559 RTC_DCHECK(media_controller_); | |
564 SignalVideoChannelDestroyed(); | 560 SignalVideoChannelDestroyed(); |
565 channel_manager_->DestroyVideoChannel(video_channel_.release()); | 561 media_controller_->channel_manager()->DestroyVideoChannel( |
562 video_channel_.release()); | |
566 } | 563 } |
567 if (voice_channel_) { | 564 if (voice_channel_) { |
565 RTC_DCHECK(media_controller_); | |
568 SignalVoiceChannelDestroyed(); | 566 SignalVoiceChannelDestroyed(); |
569 channel_manager_->DestroyVoiceChannel(voice_channel_.release()); | 567 media_controller_->channel_manager()->DestroyVoiceChannel( |
568 voice_channel_.release()); | |
570 } | 569 } |
571 if (data_channel_) { | 570 if (data_channel_) { |
571 RTC_DCHECK(media_controller_); | |
572 SignalDataChannelDestroyed(); | 572 SignalDataChannelDestroyed(); |
573 channel_manager_->DestroyDataChannel(data_channel_.release()); | 573 media_controller_->channel_manager()->DestroyDataChannel( |
574 data_channel_.release()); | |
574 } | 575 } |
575 SignalDestroyed(); | 576 SignalDestroyed(); |
576 | 577 |
577 LOG(LS_INFO) << "Session: " << id() << " is destroyed."; | 578 LOG(LS_INFO) << "Session: " << id() << " is destroyed."; |
578 } | 579 } |
579 | 580 |
580 bool WebRtcSession::Initialize( | 581 bool WebRtcSession::Initialize( |
581 const PeerConnectionFactoryInterface::Options& options, | 582 const PeerConnectionFactoryInterface::Options& options, |
582 const MediaConstraintsInterface* constraints, | 583 const MediaConstraintsInterface* constraints, |
583 rtc::scoped_ptr<DtlsIdentityStoreInterface> dtls_identity_store, | 584 rtc::scoped_ptr<DtlsIdentityStoreInterface> dtls_identity_store, |
584 const PeerConnectionInterface::RTCConfiguration& rtc_configuration) { | 585 const PeerConnectionInterface::RTCConfiguration& rtc_configuration) { |
585 bundle_policy_ = rtc_configuration.bundle_policy; | 586 bundle_policy_ = rtc_configuration.bundle_policy; |
586 rtcp_mux_policy_ = rtc_configuration.rtcp_mux_policy; | 587 rtcp_mux_policy_ = rtc_configuration.rtcp_mux_policy; |
587 transport_controller_->SetSslMaxProtocolVersion(options.ssl_max_version); | 588 transport_controller_->SetSslMaxProtocolVersion(options.ssl_max_version); |
589 dtls_identity_store_ = std::move(dtls_identity_store); | |
588 | 590 |
589 // Obtain a certificate from RTCConfiguration if any were provided (optional). | 591 // Obtain a certificate from RTCConfiguration if any were provided (optional). |
590 rtc::scoped_refptr<rtc::RTCCertificate> certificate; | |
591 if (!rtc_configuration.certificates.empty()) { | 592 if (!rtc_configuration.certificates.empty()) { |
592 // TODO(hbos,torbjorng): Decide on certificate-selection strategy instead of | 593 // TODO(hbos,torbjorng): Decide on certificate-selection strategy instead of |
593 // just picking the first one. The decision should be made based on the DTLS | 594 // just picking the first one. The decision should be made based on the DTLS |
594 // handshake. The DTLS negotiations need to know about all certificates. | 595 // handshake. The DTLS negotiations need to know about all certificates. |
595 certificate = rtc_configuration.certificates[0]; | 596 certificate_ = rtc_configuration.certificates[0]; |
596 } | 597 } |
597 | 598 |
598 SetIceConfig(ParseIceConfig(rtc_configuration)); | 599 SetIceConfig(ParseIceConfig(rtc_configuration)); |
599 | 600 |
600 // TODO(perkj): Take |constraints| into consideration. Return false if not all | 601 // TODO(perkj): Take |constraints| into consideration. Return false if not all |
601 // mandatory constraints can be fulfilled. Note that |constraints| | 602 // mandatory constraints can be fulfilled. Note that |constraints| |
602 // can be null. | 603 // can be null. |
603 bool value; | 604 bool value; |
604 | 605 |
605 if (options.disable_encryption) { | 606 if (options.disable_encryption) { |
606 dtls_enabled_ = false; | 607 dtls_enabled_ = false; |
608 disable_encryption_ = true; | |
607 } else { | 609 } else { |
608 // Enable DTLS by default if we have an identity store or a certificate. | 610 // Enable DTLS by default if we have an identity store or a certificate. |
609 dtls_enabled_ = (dtls_identity_store || certificate); | 611 dtls_enabled_ = (dtls_identity_store_ || certificate_); |
610 // |constraints| can override the default |dtls_enabled_| value. | 612 // |constraints| can override the default |dtls_enabled_| value. |
611 if (FindConstraint(constraints, MediaConstraintsInterface::kEnableDtlsSrtp, | 613 if (FindConstraint(constraints, MediaConstraintsInterface::kEnableDtlsSrtp, |
612 &value, nullptr)) { | 614 &value, nullptr)) { |
613 dtls_enabled_ = value; | 615 dtls_enabled_ = value; |
614 } | 616 } |
615 } | 617 } |
616 | 618 |
617 // Enable creation of RTP data channels if the kEnableRtpDataChannels is set. | 619 // Enable creation of RTP data channels if the kEnableRtpDataChannels is set. |
618 // It takes precendence over the disable_sctp_data_channels | 620 // It takes precendence over the disable_sctp_data_channels |
619 // PeerConnectionFactoryInterface::Options. | 621 // PeerConnectionFactoryInterface::Options. |
(...skipping 26 matching lines...) Expand all Loading... | |
646 SetOptionFromOptionalConstraint(constraints, | 648 SetOptionFromOptionalConstraint(constraints, |
647 MediaConstraintsInterface::kCombinedAudioVideoBwe, | 649 MediaConstraintsInterface::kCombinedAudioVideoBwe, |
648 &audio_options_.combined_audio_video_bwe); | 650 &audio_options_.combined_audio_video_bwe); |
649 | 651 |
650 audio_options_.audio_jitter_buffer_max_packets = | 652 audio_options_.audio_jitter_buffer_max_packets = |
651 rtc::Optional<int>(rtc_configuration.audio_jitter_buffer_max_packets); | 653 rtc::Optional<int>(rtc_configuration.audio_jitter_buffer_max_packets); |
652 | 654 |
653 audio_options_.audio_jitter_buffer_fast_accelerate = rtc::Optional<bool>( | 655 audio_options_.audio_jitter_buffer_fast_accelerate = rtc::Optional<bool>( |
654 rtc_configuration.audio_jitter_buffer_fast_accelerate); | 656 rtc_configuration.audio_jitter_buffer_fast_accelerate); |
655 | 657 |
658 port_allocator()->set_candidate_filter( | |
659 ConvertIceTransportTypeToCandidateFilter(rtc_configuration.type)); | |
660 | |
661 return true; | |
662 } | |
663 | |
664 void WebRtcSession::LateInitialize( | |
665 webrtc::MediaControllerInterface* media_controller) { | |
666 RTC_DCHECK(media_controller); | |
667 RTC_DCHECK(!media_controller_); | |
668 media_controller_ = media_controller; | |
669 | |
656 if (!dtls_enabled_) { | 670 if (!dtls_enabled_) { |
657 // Construct with DTLS disabled. | 671 // Construct with DTLS disabled. |
658 webrtc_session_desc_factory_.reset(new WebRtcSessionDescriptionFactory( | 672 webrtc_session_desc_factory_.reset(new WebRtcSessionDescriptionFactory( |
659 signaling_thread(), channel_manager_, this, id())); | 673 signaling_thread(), media_controller_->channel_manager(), this, id())); |
660 } else { | 674 } else { |
661 // Construct with DTLS enabled. | 675 // Construct with DTLS enabled. |
662 if (!certificate) { | 676 if (!certificate_) { |
663 // Use the |dtls_identity_store| to generate a certificate. | 677 // Use the |dtls_identity_store| to generate a certificate. |
664 RTC_DCHECK(dtls_identity_store); | 678 RTC_DCHECK(dtls_identity_store_); |
665 webrtc_session_desc_factory_.reset(new WebRtcSessionDescriptionFactory( | 679 webrtc_session_desc_factory_.reset(new WebRtcSessionDescriptionFactory( |
666 signaling_thread(), channel_manager_, std::move(dtls_identity_store), | 680 signaling_thread(), media_controller_->channel_manager(), |
667 this, id())); | 681 std::move(dtls_identity_store_), this, id())); |
668 } else { | 682 } else { |
669 // Use the already generated certificate. | 683 // Use the already generated certificate. |
670 webrtc_session_desc_factory_.reset(new WebRtcSessionDescriptionFactory( | 684 webrtc_session_desc_factory_.reset(new WebRtcSessionDescriptionFactory( |
671 signaling_thread(), channel_manager_, certificate, this, id())); | 685 signaling_thread(), media_controller_->channel_manager(), |
686 certificate_, this, id())); | |
tommi
2016/02/22 15:22:05
after LateInitialize() has executed, is there need
the sun
2016/02/23 14:14:03
I decided not to pass it as an argument as that re
| |
672 } | 687 } |
673 } | 688 } |
674 | 689 |
675 webrtc_session_desc_factory_->SignalCertificateReady.connect( | 690 webrtc_session_desc_factory_->SignalCertificateReady.connect( |
676 this, &WebRtcSession::OnCertificateReady); | 691 this, &WebRtcSession::OnCertificateReady); |
677 | 692 |
678 if (options.disable_encryption) { | 693 if (disable_encryption_) { |
679 webrtc_session_desc_factory_->SetSdesPolicy(cricket::SEC_DISABLED); | 694 webrtc_session_desc_factory_->SetSdesPolicy(cricket::SEC_DISABLED); |
680 } | 695 } |
681 port_allocator()->set_candidate_filter( | |
682 ConvertIceTransportTypeToCandidateFilter(rtc_configuration.type)); | |
683 | |
684 return true; | |
685 } | 696 } |
686 | 697 |
687 void WebRtcSession::Close() { | 698 void WebRtcSession::Close() { |
688 SetState(STATE_CLOSED); | 699 SetState(STATE_CLOSED); |
689 RemoveUnusedChannels(nullptr); | 700 RemoveUnusedChannels(nullptr); |
690 ASSERT(!voice_channel_); | 701 ASSERT(!voice_channel_); |
691 ASSERT(!video_channel_); | 702 ASSERT(!video_channel_); |
692 ASSERT(!data_channel_); | 703 ASSERT(!data_channel_); |
704 media_controller_ = nullptr; | |
693 } | 705 } |
694 | 706 |
695 void WebRtcSession::SetSdesPolicy(cricket::SecurePolicy secure_policy) { | 707 void WebRtcSession::SetSdesPolicy(cricket::SecurePolicy secure_policy) { |
696 webrtc_session_desc_factory_->SetSdesPolicy(secure_policy); | 708 webrtc_session_desc_factory_->SetSdesPolicy(secure_policy); |
697 } | 709 } |
698 | 710 |
699 cricket::SecurePolicy WebRtcSession::SdesPolicy() const { | 711 cricket::SecurePolicy WebRtcSession::SdesPolicy() const { |
700 return webrtc_session_desc_factory_->SdesPolicy(); | 712 return webrtc_session_desc_factory_->SdesPolicy(); |
701 } | 713 } |
702 | 714 |
(...skipping 986 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1689 } | 1701 } |
1690 return true; | 1702 return true; |
1691 } | 1703 } |
1692 | 1704 |
1693 void WebRtcSession::RemoveUnusedChannels(const SessionDescription* desc) { | 1705 void WebRtcSession::RemoveUnusedChannels(const SessionDescription* desc) { |
1694 // Destroy video_channel_ first since it may have a pointer to the | 1706 // Destroy video_channel_ first since it may have a pointer to the |
1695 // voice_channel_. | 1707 // voice_channel_. |
1696 const cricket::ContentInfo* video_info = | 1708 const cricket::ContentInfo* video_info = |
1697 cricket::GetFirstVideoContent(desc); | 1709 cricket::GetFirstVideoContent(desc); |
1698 if ((!video_info || video_info->rejected) && video_channel_) { | 1710 if ((!video_info || video_info->rejected) && video_channel_) { |
1711 RTC_DCHECK(media_controller_); | |
1699 SignalVideoChannelDestroyed(); | 1712 SignalVideoChannelDestroyed(); |
1700 channel_manager_->DestroyVideoChannel(video_channel_.release()); | 1713 media_controller_->channel_manager()->DestroyVideoChannel( |
1714 video_channel_.release()); | |
1701 } | 1715 } |
1702 | 1716 |
1703 const cricket::ContentInfo* voice_info = | 1717 const cricket::ContentInfo* voice_info = |
1704 cricket::GetFirstAudioContent(desc); | 1718 cricket::GetFirstAudioContent(desc); |
1705 if ((!voice_info || voice_info->rejected) && voice_channel_) { | 1719 if ((!voice_info || voice_info->rejected) && voice_channel_) { |
1720 RTC_DCHECK(media_controller_); | |
1706 SignalVoiceChannelDestroyed(); | 1721 SignalVoiceChannelDestroyed(); |
1707 channel_manager_->DestroyVoiceChannel(voice_channel_.release()); | 1722 media_controller_->channel_manager()->DestroyVoiceChannel( |
1723 voice_channel_.release()); | |
1708 } | 1724 } |
1709 | 1725 |
1710 const cricket::ContentInfo* data_info = | 1726 const cricket::ContentInfo* data_info = |
1711 cricket::GetFirstDataContent(desc); | 1727 cricket::GetFirstDataContent(desc); |
1712 if ((!data_info || data_info->rejected) && data_channel_) { | 1728 if ((!data_info || data_info->rejected) && data_channel_) { |
1729 RTC_DCHECK(media_controller_); | |
1713 SignalDataChannelDestroyed(); | 1730 SignalDataChannelDestroyed(); |
1714 channel_manager_->DestroyDataChannel(data_channel_.release()); | 1731 media_controller_->channel_manager()->DestroyDataChannel( |
1732 data_channel_.release()); | |
1715 } | 1733 } |
1716 } | 1734 } |
1717 | 1735 |
1718 // TODO(mallinath) - Add a correct error code if the channels are not created | 1736 // TODO(mallinath) - Add a correct error code if the channels are not created |
1719 // due to BUNDLE is enabled but rtcp-mux is disabled. | 1737 // due to BUNDLE is enabled but rtcp-mux is disabled. |
1720 bool WebRtcSession::CreateChannels(const SessionDescription* desc) { | 1738 bool WebRtcSession::CreateChannels(const SessionDescription* desc) { |
1721 // Creating the media channels and transport proxies. | 1739 // Creating the media channels and transport proxies. |
1722 const cricket::ContentInfo* voice = cricket::GetFirstAudioContent(desc); | 1740 const cricket::ContentInfo* voice = cricket::GetFirstAudioContent(desc); |
1723 if (voice && !voice->rejected && !voice_channel_) { | 1741 if (voice && !voice->rejected && !voice_channel_) { |
1724 if (!CreateVoiceChannel(voice)) { | 1742 if (!CreateVoiceChannel(voice)) { |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1767 if (!EnableBundle(*bundle_group)) { | 1785 if (!EnableBundle(*bundle_group)) { |
1768 LOG(LS_WARNING) << "max-bundle failed to enable bundling."; | 1786 LOG(LS_WARNING) << "max-bundle failed to enable bundling."; |
1769 return false; | 1787 return false; |
1770 } | 1788 } |
1771 } | 1789 } |
1772 | 1790 |
1773 return true; | 1791 return true; |
1774 } | 1792 } |
1775 | 1793 |
1776 bool WebRtcSession::CreateVoiceChannel(const cricket::ContentInfo* content) { | 1794 bool WebRtcSession::CreateVoiceChannel(const cricket::ContentInfo* content) { |
1777 voice_channel_.reset(channel_manager_->CreateVoiceChannel( | 1795 RTC_DCHECK(media_controller_); |
1796 voice_channel_.reset(media_controller_->channel_manager()->CreateVoiceChannel( | |
1778 media_controller_, transport_controller_.get(), content->name, true, | 1797 media_controller_, transport_controller_.get(), content->name, true, |
1779 audio_options_)); | 1798 audio_options_)); |
1780 if (!voice_channel_) { | 1799 if (!voice_channel_) { |
1781 return false; | 1800 return false; |
1782 } | 1801 } |
1783 | 1802 |
1784 voice_channel_->SignalDtlsSetupFailure.connect( | 1803 voice_channel_->SignalDtlsSetupFailure.connect( |
1785 this, &WebRtcSession::OnDtlsSetupFailure); | 1804 this, &WebRtcSession::OnDtlsSetupFailure); |
1786 | 1805 |
1787 SignalVoiceChannelCreated(); | 1806 SignalVoiceChannelCreated(); |
1788 voice_channel_->transport_channel()->SignalSentPacket.connect( | 1807 voice_channel_->transport_channel()->SignalSentPacket.connect( |
1789 this, &WebRtcSession::OnSentPacket_w); | 1808 this, &WebRtcSession::OnSentPacket_w); |
1790 return true; | 1809 return true; |
1791 } | 1810 } |
1792 | 1811 |
1793 bool WebRtcSession::CreateVideoChannel(const cricket::ContentInfo* content) { | 1812 bool WebRtcSession::CreateVideoChannel(const cricket::ContentInfo* content) { |
1794 video_channel_.reset(channel_manager_->CreateVideoChannel( | 1813 RTC_DCHECK(media_controller_); |
1814 video_channel_.reset(media_controller_->channel_manager()->CreateVideoChannel( | |
1795 media_controller_, transport_controller_.get(), content->name, true, | 1815 media_controller_, transport_controller_.get(), content->name, true, |
1796 video_options_)); | 1816 video_options_)); |
1797 if (!video_channel_) { | 1817 if (!video_channel_) { |
1798 return false; | 1818 return false; |
1799 } | 1819 } |
1800 | 1820 |
1801 video_channel_->SignalDtlsSetupFailure.connect( | 1821 video_channel_->SignalDtlsSetupFailure.connect( |
1802 this, &WebRtcSession::OnDtlsSetupFailure); | 1822 this, &WebRtcSession::OnDtlsSetupFailure); |
1803 | 1823 |
1804 SignalVideoChannelCreated(); | 1824 SignalVideoChannelCreated(); |
1805 video_channel_->transport_channel()->SignalSentPacket.connect( | 1825 video_channel_->transport_channel()->SignalSentPacket.connect( |
1806 this, &WebRtcSession::OnSentPacket_w); | 1826 this, &WebRtcSession::OnSentPacket_w); |
1807 return true; | 1827 return true; |
1808 } | 1828 } |
1809 | 1829 |
1810 bool WebRtcSession::CreateDataChannel(const cricket::ContentInfo* content) { | 1830 bool WebRtcSession::CreateDataChannel(const cricket::ContentInfo* content) { |
1831 RTC_DCHECK(media_controller_); | |
1811 bool sctp = (data_channel_type_ == cricket::DCT_SCTP); | 1832 bool sctp = (data_channel_type_ == cricket::DCT_SCTP); |
1812 data_channel_.reset(channel_manager_->CreateDataChannel( | 1833 data_channel_.reset(media_controller_->channel_manager()->CreateDataChannel( |
1813 transport_controller_.get(), content->name, !sctp, data_channel_type_)); | 1834 transport_controller_.get(), content->name, !sctp, data_channel_type_)); |
1814 if (!data_channel_) { | 1835 if (!data_channel_) { |
1815 return false; | 1836 return false; |
1816 } | 1837 } |
1817 | 1838 |
1818 if (sctp) { | 1839 if (sctp) { |
1819 data_channel_->SignalDataReceived.connect( | 1840 data_channel_->SignalDataReceived.connect( |
1820 this, &WebRtcSession::OnDataChannelMessageReceived); | 1841 this, &WebRtcSession::OnDataChannelMessageReceived); |
1821 } | 1842 } |
1822 | 1843 |
(...skipping 316 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2139 } | 2160 } |
2140 if (ssl_cipher_suite != rtc::TLS_NULL_WITH_NULL_NULL) { | 2161 if (ssl_cipher_suite != rtc::TLS_NULL_WITH_NULL_NULL) { |
2141 metrics_observer_->IncrementSparseEnumCounter(ssl_counter_type, | 2162 metrics_observer_->IncrementSparseEnumCounter(ssl_counter_type, |
2142 ssl_cipher_suite); | 2163 ssl_cipher_suite); |
2143 } | 2164 } |
2144 } | 2165 } |
2145 | 2166 |
2146 void WebRtcSession::OnSentPacket_w(cricket::TransportChannel* channel, | 2167 void WebRtcSession::OnSentPacket_w(cricket::TransportChannel* channel, |
2147 const rtc::SentPacket& sent_packet) { | 2168 const rtc::SentPacket& sent_packet) { |
2148 RTC_DCHECK(worker_thread()->IsCurrent()); | 2169 RTC_DCHECK(worker_thread()->IsCurrent()); |
2170 RTC_DCHECK(media_controller_); | |
2149 media_controller_->call_w()->OnSentPacket(sent_packet); | 2171 media_controller_->call_w()->OnSentPacket(sent_packet); |
2150 } | 2172 } |
2151 | 2173 |
2152 } // namespace webrtc | 2174 } // namespace webrtc |
OLD | NEW |