| 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" |
| 11 #include "base/metrics/field_trial.h" |
| 11 #include "base/strings/utf_string_conversions.h" | 12 #include "base/strings/utf_string_conversions.h" |
| 12 #include "base/synchronization/waitable_event.h" | 13 #include "base/synchronization/waitable_event.h" |
| 13 #include "content/common/media/media_stream_messages.h" | 14 #include "content/common/media/media_stream_messages.h" |
| 14 #include "content/public/common/content_switches.h" | 15 #include "content/public/common/content_switches.h" |
| 15 #include "content/public/common/renderer_preferences.h" | 16 #include "content/public/common/renderer_preferences.h" |
| 16 #include "content/renderer/media/media_stream.h" | 17 #include "content/renderer/media/media_stream.h" |
| 17 #include "content/renderer/media/media_stream_audio_processor.h" | 18 #include "content/renderer/media/media_stream_audio_processor.h" |
| 18 #include "content/renderer/media/media_stream_audio_processor_options.h" | 19 #include "content/renderer/media/media_stream_audio_processor_options.h" |
| 19 #include "content/renderer/media/media_stream_audio_source.h" | 20 #include "content/renderer/media/media_stream_audio_source.h" |
| 20 #include "content/renderer/media/media_stream_video_source.h" | 21 #include "content/renderer/media/media_stream_video_source.h" |
| (...skipping 347 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 368 | 369 |
| 369 pc_factory_ = webrtc::CreatePeerConnectionFactory( | 370 pc_factory_ = webrtc::CreatePeerConnectionFactory( |
| 370 worker_thread_, signaling_thread_, audio_device_.get(), | 371 worker_thread_, signaling_thread_, audio_device_.get(), |
| 371 encoder_factory.release(), decoder_factory.release()); | 372 encoder_factory.release(), decoder_factory.release()); |
| 372 CHECK(pc_factory_.get()); | 373 CHECK(pc_factory_.get()); |
| 373 | 374 |
| 374 webrtc::PeerConnectionFactoryInterface::Options factory_options; | 375 webrtc::PeerConnectionFactoryInterface::Options factory_options; |
| 375 factory_options.disable_sctp_data_channels = false; | 376 factory_options.disable_sctp_data_channels = false; |
| 376 factory_options.disable_encryption = | 377 factory_options.disable_encryption = |
| 377 cmd_line->HasSwitch(switches::kDisableWebRtcEncryption); | 378 cmd_line->HasSwitch(switches::kDisableWebRtcEncryption); |
| 378 if (cmd_line->HasSwitch(switches::kEnableWebRtcDtls12)) | 379 if (cmd_line->HasSwitch(switches::kEnableWebRtcDtls12) || |
| 380 base::FieldTrialList::FindFullName("WebRTC-PeerConnectionDTLS1.2") == |
| 381 "Enabled") { |
| 379 factory_options.ssl_max_version = rtc::SSL_PROTOCOL_DTLS_12; | 382 factory_options.ssl_max_version = rtc::SSL_PROTOCOL_DTLS_12; |
| 383 } |
| 380 pc_factory_->SetOptions(factory_options); | 384 pc_factory_->SetOptions(factory_options); |
| 381 | 385 |
| 382 event->Signal(); | 386 event->Signal(); |
| 383 } | 387 } |
| 384 | 388 |
| 385 bool PeerConnectionDependencyFactory::PeerConnectionFactoryCreated() { | 389 bool PeerConnectionDependencyFactory::PeerConnectionFactoryCreated() { |
| 386 return pc_factory_.get() != NULL; | 390 return pc_factory_.get() != NULL; |
| 387 } | 391 } |
| 388 | 392 |
| 389 scoped_refptr<webrtc::PeerConnectionInterface> | 393 scoped_refptr<webrtc::PeerConnectionInterface> |
| (...skipping 291 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 681 } | 685 } |
| 682 | 686 |
| 683 void PeerConnectionDependencyFactory::EnsureWebRtcAudioDeviceImpl() { | 687 void PeerConnectionDependencyFactory::EnsureWebRtcAudioDeviceImpl() { |
| 684 if (audio_device_.get()) | 688 if (audio_device_.get()) |
| 685 return; | 689 return; |
| 686 | 690 |
| 687 audio_device_ = new WebRtcAudioDeviceImpl(); | 691 audio_device_ = new WebRtcAudioDeviceImpl(); |
| 688 } | 692 } |
| 689 | 693 |
| 690 } // namespace content | 694 } // namespace content |
| OLD | NEW |