| 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 <utility> | 7 #include <utility> |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
| (...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 56 #include "third_party/WebKit/public/platform/WebMediaStream.h" | 56 #include "third_party/WebKit/public/platform/WebMediaStream.h" |
| 57 #include "third_party/WebKit/public/platform/WebMediaStreamSource.h" | 57 #include "third_party/WebKit/public/platform/WebMediaStreamSource.h" |
| 58 #include "third_party/WebKit/public/platform/WebMediaStreamTrack.h" | 58 #include "third_party/WebKit/public/platform/WebMediaStreamTrack.h" |
| 59 #include "third_party/WebKit/public/platform/WebURL.h" | 59 #include "third_party/WebKit/public/platform/WebURL.h" |
| 60 #include "third_party/WebKit/public/web/WebDocument.h" | 60 #include "third_party/WebKit/public/web/WebDocument.h" |
| 61 #include "third_party/WebKit/public/web/WebFrame.h" | 61 #include "third_party/WebKit/public/web/WebFrame.h" |
| 62 #include "third_party/libjingle/source/talk/app/webrtc/mediaconstraintsinterface
.h" | 62 #include "third_party/libjingle/source/talk/app/webrtc/mediaconstraintsinterface
.h" |
| 63 #include "third_party/webrtc/base/ssladapter.h" | 63 #include "third_party/webrtc/base/ssladapter.h" |
| 64 | 64 |
| 65 #if defined(OS_ANDROID) | 65 #if defined(OS_ANDROID) |
| 66 #include "media/base/android/media_codec_util.h" | 66 #include "media/base/android/media_codec_bridge.h" |
| 67 #endif | 67 #endif |
| 68 | 68 |
| 69 namespace content { | 69 namespace content { |
| 70 | 70 |
| 71 namespace { | 71 namespace { |
| 72 | 72 |
| 73 enum WebRTCIPHandlingPolicy { | 73 enum WebRTCIPHandlingPolicy { |
| 74 DEFAULT, | 74 DEFAULT, |
| 75 DEFAULT_PUBLIC_AND_PRIVATE_INTERFACES, | 75 DEFAULT_PUBLIC_AND_PRIVATE_INTERFACES, |
| 76 DEFAULT_PUBLIC_INTERFACE_ONLY, | 76 DEFAULT_PUBLIC_INTERFACE_ONLY, |
| (...skipping 332 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 409 const base::CommandLine* cmd_line = base::CommandLine::ForCurrentProcess(); | 409 const base::CommandLine* cmd_line = base::CommandLine::ForCurrentProcess(); |
| 410 if (gpu_factories && gpu_factories->IsGpuVideoAcceleratorEnabled()) { | 410 if (gpu_factories && gpu_factories->IsGpuVideoAcceleratorEnabled()) { |
| 411 if (!cmd_line->HasSwitch(switches::kDisableWebRtcHWDecoding)) | 411 if (!cmd_line->HasSwitch(switches::kDisableWebRtcHWDecoding)) |
| 412 decoder_factory.reset(new RTCVideoDecoderFactory(gpu_factories)); | 412 decoder_factory.reset(new RTCVideoDecoderFactory(gpu_factories)); |
| 413 | 413 |
| 414 if (!cmd_line->HasSwitch(switches::kDisableWebRtcHWEncoding)) | 414 if (!cmd_line->HasSwitch(switches::kDisableWebRtcHWEncoding)) |
| 415 encoder_factory.reset(new RTCVideoEncoderFactory(gpu_factories)); | 415 encoder_factory.reset(new RTCVideoEncoderFactory(gpu_factories)); |
| 416 } | 416 } |
| 417 | 417 |
| 418 #if defined(OS_ANDROID) | 418 #if defined(OS_ANDROID) |
| 419 if (!media::MediaCodecUtil::SupportsSetParameters()) | 419 if (!media::MediaCodecBridge::SupportsSetParameters()) |
| 420 encoder_factory.reset(); | 420 encoder_factory.reset(); |
| 421 #endif | 421 #endif |
| 422 | 422 |
| 423 pc_factory_ = webrtc::CreatePeerConnectionFactory( | 423 pc_factory_ = webrtc::CreatePeerConnectionFactory( |
| 424 worker_thread_, signaling_thread_, audio_device_.get(), | 424 worker_thread_, signaling_thread_, audio_device_.get(), |
| 425 encoder_factory.release(), decoder_factory.release()); | 425 encoder_factory.release(), decoder_factory.release()); |
| 426 CHECK(pc_factory_.get()); | 426 CHECK(pc_factory_.get()); |
| 427 | 427 |
| 428 webrtc::PeerConnectionFactoryInterface::Options factory_options; | 428 webrtc::PeerConnectionFactoryInterface::Options factory_options; |
| 429 factory_options.disable_sctp_data_channels = false; | 429 factory_options.disable_sctp_data_channels = false; |
| (...skipping 395 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 825 } | 825 } |
| 826 | 826 |
| 827 void PeerConnectionDependencyFactory::EnsureWebRtcAudioDeviceImpl() { | 827 void PeerConnectionDependencyFactory::EnsureWebRtcAudioDeviceImpl() { |
| 828 if (audio_device_.get()) | 828 if (audio_device_.get()) |
| 829 return; | 829 return; |
| 830 | 830 |
| 831 audio_device_ = new WebRtcAudioDeviceImpl(); | 831 audio_device_ = new WebRtcAudioDeviceImpl(); |
| 832 } | 832 } |
| 833 | 833 |
| 834 } // namespace content | 834 } // namespace content |
| OLD | NEW |