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