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