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 502 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
513 } | 513 } |
514 for (size_t i = 0; i < saved_candidates_.size(); ++i) { | 514 for (size_t i = 0; i < saved_candidates_.size(); ++i) { |
515 delete saved_candidates_[i]; | 515 delete saved_candidates_[i]; |
516 } | 516 } |
517 delete identity(); | 517 delete identity(); |
518 } | 518 } |
519 | 519 |
520 bool WebRtcSession::Initialize( | 520 bool WebRtcSession::Initialize( |
521 const PeerConnectionFactoryInterface::Options& options, | 521 const PeerConnectionFactoryInterface::Options& options, |
522 const MediaConstraintsInterface* constraints, | 522 const MediaConstraintsInterface* constraints, |
523 DTLSIdentityServiceInterface* dtls_identity_service, | 523 rtc::scoped_ptr<DtlsIdentityStoreInterface> dtls_identity_store, |
524 const PeerConnectionInterface::RTCConfiguration& rtc_configuration) { | 524 const PeerConnectionInterface::RTCConfiguration& rtc_configuration) { |
525 bundle_policy_ = rtc_configuration.bundle_policy; | 525 bundle_policy_ = rtc_configuration.bundle_policy; |
526 rtcp_mux_policy_ = rtc_configuration.rtcp_mux_policy; | 526 rtcp_mux_policy_ = rtc_configuration.rtcp_mux_policy; |
527 SetSslMaxProtocolVersion(options.ssl_max_version); | 527 SetSslMaxProtocolVersion(options.ssl_max_version); |
528 | 528 |
529 // TODO(perkj): Take |constraints| into consideration. Return false if not all | 529 // TODO(perkj): Take |constraints| into consideration. Return false if not all |
530 // mandatory constraints can be fulfilled. Note that |constraints| | 530 // mandatory constraints can be fulfilled. Note that |constraints| |
531 // can be null. | 531 // can be null. |
532 bool value; | 532 bool value; |
533 | 533 |
534 if (options.disable_encryption) { | 534 if (options.disable_encryption) { |
535 dtls_enabled_ = false; | 535 dtls_enabled_ = false; |
536 } else { | 536 } else { |
537 // Enable DTLS by default if |dtls_identity_service| is valid. | 537 // Enable DTLS by default if we have a |dtls_identity_store|. |
538 dtls_enabled_ = (dtls_identity_service != NULL); | 538 dtls_enabled_ = (dtls_identity_store != nullptr); |
539 // |constraints| can override the default |dtls_enabled_| value. | 539 // |constraints| can override the default |dtls_enabled_| value. |
540 if (FindConstraint( | 540 if (FindConstraint( |
541 constraints, | 541 constraints, |
542 MediaConstraintsInterface::kEnableDtlsSrtp, | 542 MediaConstraintsInterface::kEnableDtlsSrtp, |
543 &value, NULL)) { | 543 &value, NULL)) { |
544 dtls_enabled_ = value; | 544 dtls_enabled_ = value; |
545 } | 545 } |
546 } | 546 } |
547 | 547 |
548 // Enable creation of RTP data channels if the kEnableRtpDataChannels is set. | 548 // Enable creation of RTP data channels if the kEnableRtpDataChannels is set. |
(...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
654 JsepSessionDescription::kMaxVideoCodecHeight, | 654 JsepSessionDescription::kMaxVideoCodecHeight, |
655 JsepSessionDescription::kDefaultVideoCodecFramerate, | 655 JsepSessionDescription::kDefaultVideoCodecFramerate, |
656 JsepSessionDescription::kDefaultVideoCodecPreference); | 656 JsepSessionDescription::kDefaultVideoCodecPreference); |
657 channel_manager_->SetDefaultVideoEncoderConfig( | 657 channel_manager_->SetDefaultVideoEncoderConfig( |
658 cricket::VideoEncoderConfig(default_codec)); | 658 cricket::VideoEncoderConfig(default_codec)); |
659 | 659 |
660 webrtc_session_desc_factory_.reset(new WebRtcSessionDescriptionFactory( | 660 webrtc_session_desc_factory_.reset(new WebRtcSessionDescriptionFactory( |
661 signaling_thread(), | 661 signaling_thread(), |
662 channel_manager_, | 662 channel_manager_, |
663 mediastream_signaling_, | 663 mediastream_signaling_, |
664 dtls_identity_service, | 664 dtls_identity_store.Pass(), |
665 this, | 665 this, |
666 id(), | 666 id(), |
667 data_channel_type_, | 667 data_channel_type_, |
668 dtls_enabled_)); | 668 dtls_enabled_)); |
669 | 669 |
670 webrtc_session_desc_factory_->SignalIdentityReady.connect( | 670 webrtc_session_desc_factory_->SignalIdentityReady.connect( |
671 this, &WebRtcSession::OnIdentityReady); | 671 this, &WebRtcSession::OnIdentityReady); |
672 | 672 |
673 if (options.disable_encryption) { | 673 if (options.disable_encryption) { |
674 webrtc_session_desc_factory_->SetSdesPolicy(cricket::SEC_DISABLED); | 674 webrtc_session_desc_factory_->SetSdesPolicy(cricket::SEC_DISABLED); |
(...skipping 1223 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1898 metrics_observer_->IncrementCounter(kBestConnections_IPv6); | 1898 metrics_observer_->IncrementCounter(kBestConnections_IPv6); |
1899 } else { | 1899 } else { |
1900 ASSERT(false); | 1900 ASSERT(false); |
1901 } | 1901 } |
1902 return; | 1902 return; |
1903 } | 1903 } |
1904 } | 1904 } |
1905 } | 1905 } |
1906 | 1906 |
1907 } // namespace webrtc | 1907 } // namespace webrtc |
OLD | NEW |