OLD | NEW |
1 /* | 1 /* |
2 * libjingle | 2 * libjingle |
3 * Copyright 2012 Google Inc. | 3 * Copyright 2012 Google Inc. |
4 * | 4 * |
5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
6 * modification, are permitted provided that the following conditions are met: | 6 * modification, are permitted provided that the following conditions are met: |
7 * | 7 * |
8 * 1. Redistributions of source code must retain the above copyright notice, | 8 * 1. Redistributions of source code must retain the above copyright notice, |
9 * this list of conditions and the following disclaimer. | 9 * this list of conditions and the following disclaimer. |
10 * 2. Redistributions in binary form must reproduce the above copyright notice, | 10 * 2. Redistributions in binary form must reproduce the above copyright notice, |
(...skipping 590 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
601 | 601 |
602 // Obtain a certificate from RTCConfiguration if any were provided (optional). | 602 // Obtain a certificate from RTCConfiguration if any were provided (optional). |
603 rtc::scoped_refptr<rtc::RTCCertificate> certificate; | 603 rtc::scoped_refptr<rtc::RTCCertificate> certificate; |
604 if (!rtc_configuration.certificates.empty()) { | 604 if (!rtc_configuration.certificates.empty()) { |
605 // TODO(hbos,torbjorng): Decide on certificate-selection strategy instead of | 605 // TODO(hbos,torbjorng): Decide on certificate-selection strategy instead of |
606 // just picking the first one. The decision should be made based on the DTLS | 606 // just picking the first one. The decision should be made based on the DTLS |
607 // handshake. The DTLS negotiations need to know about all certificates. | 607 // handshake. The DTLS negotiations need to know about all certificates. |
608 certificate = rtc_configuration.certificates[0]; | 608 certificate = rtc_configuration.certificates[0]; |
609 } | 609 } |
610 | 610 |
611 SetIceConnectionReceivingTimeout( | 611 SetIceConfig(ParseIceConfig(rtc_configuration)); |
612 rtc_configuration.ice_connection_receiving_timeout); | |
613 | 612 |
614 // TODO(perkj): Take |constraints| into consideration. Return false if not all | 613 // TODO(perkj): Take |constraints| into consideration. Return false if not all |
615 // mandatory constraints can be fulfilled. Note that |constraints| | 614 // mandatory constraints can be fulfilled. Note that |constraints| |
616 // can be null. | 615 // can be null. |
617 bool value; | 616 bool value; |
618 | 617 |
619 if (options.disable_encryption) { | 618 if (options.disable_encryption) { |
620 dtls_enabled_ = false; | 619 dtls_enabled_ = false; |
621 } else { | 620 } else { |
622 // Enable DTLS by default if we have an identity store or a certificate. | 621 // Enable DTLS by default if we have an identity store or a certificate. |
(...skipping 152 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
775 port_allocator()->flags() | | 774 port_allocator()->flags() | |
776 cricket::PORTALLOCATOR_ENABLE_LOCALHOST_CANDIDATE); | 775 cricket::PORTALLOCATOR_ENABLE_LOCALHOST_CANDIDATE); |
777 } | 776 } |
778 | 777 |
779 media_controller_.reset(MediaControllerInterface::Create( | 778 media_controller_.reset(MediaControllerInterface::Create( |
780 worker_thread(), channel_manager_->media_engine()->GetVoE())); | 779 worker_thread(), channel_manager_->media_engine()->GetVoE())); |
781 | 780 |
782 return true; | 781 return true; |
783 } | 782 } |
784 | 783 |
| 784 cricket::IceConfig WebRtcSession::ParseIceConfig( |
| 785 const PeerConnectionInterface::RTCConfiguration& config) const { |
| 786 cricket::IceConfig ice_config; |
| 787 ice_config.receiving_timeout_ms = config.ice_connection_receiving_timeout; |
| 788 ice_config.gather_continually = (config.continual_gathering_policy == |
| 789 PeerConnectionInterface::GATHER_CONTINUALLY); |
| 790 return ice_config; |
| 791 } |
| 792 |
785 void WebRtcSession::Terminate() { | 793 void WebRtcSession::Terminate() { |
786 SetState(STATE_RECEIVEDTERMINATE); | 794 SetState(STATE_RECEIVEDTERMINATE); |
787 RemoveUnusedChannels(NULL); | 795 RemoveUnusedChannels(NULL); |
788 ASSERT(!voice_channel_); | 796 ASSERT(!voice_channel_); |
789 ASSERT(!video_channel_); | 797 ASSERT(!video_channel_); |
790 ASSERT(!data_channel_); | 798 ASSERT(!data_channel_); |
791 } | 799 } |
792 | 800 |
793 void WebRtcSession::SetSdesPolicy(cricket::SecurePolicy secure_policy) { | 801 void WebRtcSession::SetSdesPolicy(cricket::SecurePolicy secure_policy) { |
794 webrtc_session_desc_factory_->SetSdesPolicy(secure_policy); | 802 webrtc_session_desc_factory_->SetSdesPolicy(secure_policy); |
(...skipping 1369 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2164 | 2172 |
2165 if (!srtp_cipher.empty()) { | 2173 if (!srtp_cipher.empty()) { |
2166 metrics_observer_->AddHistogramSample(srtp_name, srtp_cipher); | 2174 metrics_observer_->AddHistogramSample(srtp_name, srtp_cipher); |
2167 } | 2175 } |
2168 if (!ssl_cipher.empty()) { | 2176 if (!ssl_cipher.empty()) { |
2169 metrics_observer_->AddHistogramSample(ssl_name, ssl_cipher); | 2177 metrics_observer_->AddHistogramSample(ssl_name, ssl_cipher); |
2170 } | 2178 } |
2171 } | 2179 } |
2172 | 2180 |
2173 } // namespace webrtc | 2181 } // namespace webrtc |
OLD | NEW |