OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "content/renderer/media/webrtc/peer_connection_dependency_factory.h" | 5 #include "content/renderer/media/webrtc/peer_connection_dependency_factory.h" |
6 | 6 |
7 #include <vector> | 7 #include <vector> |
8 | 8 |
9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
10 #include "base/location.h" | 10 #include "base/location.h" |
(...skipping 389 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
400 | 400 |
401 pc_factory_ = webrtc::CreatePeerConnectionFactory( | 401 pc_factory_ = webrtc::CreatePeerConnectionFactory( |
402 worker_thread_, signaling_thread_, audio_device_.get(), | 402 worker_thread_, signaling_thread_, audio_device_.get(), |
403 encoder_factory.release(), decoder_factory.release()); | 403 encoder_factory.release(), decoder_factory.release()); |
404 CHECK(pc_factory_.get()); | 404 CHECK(pc_factory_.get()); |
405 | 405 |
406 webrtc::PeerConnectionFactoryInterface::Options factory_options; | 406 webrtc::PeerConnectionFactoryInterface::Options factory_options; |
407 factory_options.disable_sctp_data_channels = false; | 407 factory_options.disable_sctp_data_channels = false; |
408 factory_options.disable_encryption = | 408 factory_options.disable_encryption = |
409 cmd_line->HasSwitch(switches::kDisableWebRtcEncryption); | 409 cmd_line->HasSwitch(switches::kDisableWebRtcEncryption); |
410 if (cmd_line->HasSwitch(switches::kEnableWebRtcDtls12)) | 410 |
| 411 std::string group_name = |
| 412 base::FieldTrialList::FindFullName("WebRTC-PeerConnectionDTLS1.2"); |
| 413 if (StartsWith(group_name, "Enabled", base::CompareCase::SENSITIVE) || |
| 414 cmd_line->HasSwitch(switches::kEnableWebRtcDtls12)) { |
411 factory_options.ssl_max_version = rtc::SSL_PROTOCOL_DTLS_12; | 415 factory_options.ssl_max_version = rtc::SSL_PROTOCOL_DTLS_12; |
| 416 } |
412 pc_factory_->SetOptions(factory_options); | 417 pc_factory_->SetOptions(factory_options); |
413 | 418 |
414 event->Signal(); | 419 event->Signal(); |
415 } | 420 } |
416 | 421 |
417 bool PeerConnectionDependencyFactory::PeerConnectionFactoryCreated() { | 422 bool PeerConnectionDependencyFactory::PeerConnectionFactoryCreated() { |
418 return pc_factory_.get() != NULL; | 423 return pc_factory_.get() != NULL; |
419 } | 424 } |
420 | 425 |
421 scoped_refptr<webrtc::PeerConnectionInterface> | 426 scoped_refptr<webrtc::PeerConnectionInterface> |
(...skipping 327 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
749 } | 754 } |
750 | 755 |
751 void PeerConnectionDependencyFactory::EnsureWebRtcAudioDeviceImpl() { | 756 void PeerConnectionDependencyFactory::EnsureWebRtcAudioDeviceImpl() { |
752 if (audio_device_.get()) | 757 if (audio_device_.get()) |
753 return; | 758 return; |
754 | 759 |
755 audio_device_ = new WebRtcAudioDeviceImpl(); | 760 audio_device_ = new WebRtcAudioDeviceImpl(); |
756 } | 761 } |
757 | 762 |
758 } // namespace content | 763 } // namespace content |
OLD | NEW |