| 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 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 53 #include "third_party/WebKit/public/platform/WebMediaStream.h" | 53 #include "third_party/WebKit/public/platform/WebMediaStream.h" |
| 54 #include "third_party/WebKit/public/platform/WebMediaStreamSource.h" | 54 #include "third_party/WebKit/public/platform/WebMediaStreamSource.h" |
| 55 #include "third_party/WebKit/public/platform/WebMediaStreamTrack.h" | 55 #include "third_party/WebKit/public/platform/WebMediaStreamTrack.h" |
| 56 #include "third_party/WebKit/public/platform/WebURL.h" | 56 #include "third_party/WebKit/public/platform/WebURL.h" |
| 57 #include "third_party/WebKit/public/web/WebDocument.h" | 57 #include "third_party/WebKit/public/web/WebDocument.h" |
| 58 #include "third_party/WebKit/public/web/WebFrame.h" | 58 #include "third_party/WebKit/public/web/WebFrame.h" |
| 59 #include "third_party/libjingle/source/talk/app/webrtc/mediaconstraintsinterface
.h" | 59 #include "third_party/libjingle/source/talk/app/webrtc/mediaconstraintsinterface
.h" |
| 60 #include "third_party/webrtc/base/ssladapter.h" | 60 #include "third_party/webrtc/base/ssladapter.h" |
| 61 | 61 |
| 62 #if defined(OS_ANDROID) | 62 #if defined(OS_ANDROID) |
| 63 #include "media/base/android/media_codec_bridge.h" | 63 #include "media/base/android/media_codec_util.h" |
| 64 #endif | 64 #endif |
| 65 | 65 |
| 66 namespace content { | 66 namespace content { |
| 67 | 67 |
| 68 namespace { | 68 namespace { |
| 69 | 69 |
| 70 enum WebRTCIPHandlingPolicy { | 70 enum WebRTCIPHandlingPolicy { |
| 71 DEFAULT, | 71 DEFAULT, |
| 72 DEFAULT_PUBLIC_AND_PRIVATE_INTERFACES, | 72 DEFAULT_PUBLIC_AND_PRIVATE_INTERFACES, |
| 73 DEFAULT_PUBLIC_INTERFACE_ONLY, | 73 DEFAULT_PUBLIC_INTERFACE_ONLY, |
| (...skipping 326 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 400 const base::CommandLine* cmd_line = base::CommandLine::ForCurrentProcess(); | 400 const base::CommandLine* cmd_line = base::CommandLine::ForCurrentProcess(); |
| 401 if (gpu_factories && gpu_factories->IsGpuVideoAcceleratorEnabled()) { | 401 if (gpu_factories && gpu_factories->IsGpuVideoAcceleratorEnabled()) { |
| 402 if (!cmd_line->HasSwitch(switches::kDisableWebRtcHWDecoding)) | 402 if (!cmd_line->HasSwitch(switches::kDisableWebRtcHWDecoding)) |
| 403 decoder_factory.reset(new RTCVideoDecoderFactory(gpu_factories)); | 403 decoder_factory.reset(new RTCVideoDecoderFactory(gpu_factories)); |
| 404 | 404 |
| 405 if (!cmd_line->HasSwitch(switches::kDisableWebRtcHWEncoding)) | 405 if (!cmd_line->HasSwitch(switches::kDisableWebRtcHWEncoding)) |
| 406 encoder_factory.reset(new RTCVideoEncoderFactory(gpu_factories)); | 406 encoder_factory.reset(new RTCVideoEncoderFactory(gpu_factories)); |
| 407 } | 407 } |
| 408 | 408 |
| 409 #if defined(OS_ANDROID) | 409 #if defined(OS_ANDROID) |
| 410 if (!media::MediaCodecBridge::SupportsSetParameters()) | 410 if (!media::SupportsSetParameters()) |
| 411 encoder_factory.reset(); | 411 encoder_factory.reset(); |
| 412 #endif | 412 #endif |
| 413 | 413 |
| 414 pc_factory_ = webrtc::CreatePeerConnectionFactory( | 414 pc_factory_ = webrtc::CreatePeerConnectionFactory( |
| 415 worker_thread_, signaling_thread_, audio_device_.get(), | 415 worker_thread_, signaling_thread_, audio_device_.get(), |
| 416 encoder_factory.release(), decoder_factory.release()); | 416 encoder_factory.release(), decoder_factory.release()); |
| 417 CHECK(pc_factory_.get()); | 417 CHECK(pc_factory_.get()); |
| 418 | 418 |
| 419 webrtc::PeerConnectionFactoryInterface::Options factory_options; | 419 webrtc::PeerConnectionFactoryInterface::Options factory_options; |
| 420 factory_options.disable_sctp_data_channels = false; | 420 factory_options.disable_sctp_data_channels = false; |
| (...skipping 385 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 806 } | 806 } |
| 807 | 807 |
| 808 void PeerConnectionDependencyFactory::EnsureWebRtcAudioDeviceImpl() { | 808 void PeerConnectionDependencyFactory::EnsureWebRtcAudioDeviceImpl() { |
| 809 if (audio_device_.get()) | 809 if (audio_device_.get()) |
| 810 return; | 810 return; |
| 811 | 811 |
| 812 audio_device_ = new WebRtcAudioDeviceImpl(); | 812 audio_device_ = new WebRtcAudioDeviceImpl(); |
| 813 } | 813 } |
| 814 | 814 |
| 815 } // namespace content | 815 } // namespace content |
| OLD | NEW |