| 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 <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include <utility> | 9 #include <utility> |
| 10 #include <vector> | 10 #include <vector> |
| (...skipping 221 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 232 new IpcPacketSocketFactory(p2p_socket_dispatcher_.get())); | 232 new IpcPacketSocketFactory(p2p_socket_dispatcher_.get())); |
| 233 | 233 |
| 234 std::unique_ptr<cricket::WebRtcVideoDecoderFactory> decoder_factory; | 234 std::unique_ptr<cricket::WebRtcVideoDecoderFactory> decoder_factory; |
| 235 std::unique_ptr<cricket::WebRtcVideoEncoderFactory> encoder_factory; | 235 std::unique_ptr<cricket::WebRtcVideoEncoderFactory> encoder_factory; |
| 236 | 236 |
| 237 const base::CommandLine* cmd_line = base::CommandLine::ForCurrentProcess(); | 237 const base::CommandLine* cmd_line = base::CommandLine::ForCurrentProcess(); |
| 238 if (gpu_factories && gpu_factories->IsGpuVideoAcceleratorEnabled()) { | 238 if (gpu_factories && gpu_factories->IsGpuVideoAcceleratorEnabled()) { |
| 239 if (!cmd_line->HasSwitch(switches::kDisableWebRtcHWDecoding)) | 239 if (!cmd_line->HasSwitch(switches::kDisableWebRtcHWDecoding)) |
| 240 decoder_factory.reset(new RTCVideoDecoderFactory(gpu_factories)); | 240 decoder_factory.reset(new RTCVideoDecoderFactory(gpu_factories)); |
| 241 | 241 |
| 242 if (!cmd_line->HasSwitch(switches::kDisableWebRtcHWVP8Encoding) || | 242 if (!cmd_line->HasSwitch(switches::kDisableWebRtcHWEncoding) && |
| 243 base::FeatureList::IsEnabled(features::kWebRtcHWH264Encoding)) { | 243 (!cmd_line->HasSwitch(switches::kDisableWebRtcHWVP8Encoding) || |
| 244 base::FeatureList::IsEnabled(features::kWebRtcHWH264Encoding))) { |
| 244 encoder_factory.reset(new RTCVideoEncoderFactory(gpu_factories)); | 245 encoder_factory.reset(new RTCVideoEncoderFactory(gpu_factories)); |
| 245 } | 246 } |
| 246 } | 247 } |
| 247 | 248 |
| 248 #if defined(OS_ANDROID) | 249 #if defined(OS_ANDROID) |
| 249 if (!media::MediaCodecUtil::SupportsSetParameters()) | 250 if (!media::MediaCodecUtil::SupportsSetParameters()) |
| 250 encoder_factory.reset(); | 251 encoder_factory.reset(); |
| 251 #endif | 252 #endif |
| 252 | 253 |
| 253 pc_factory_ = webrtc::CreatePeerConnectionFactory( | 254 pc_factory_ = webrtc::CreatePeerConnectionFactory( |
| (...skipping 297 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 551 | 552 |
| 552 void PeerConnectionDependencyFactory::EnsureWebRtcAudioDeviceImpl() { | 553 void PeerConnectionDependencyFactory::EnsureWebRtcAudioDeviceImpl() { |
| 553 DCHECK(CalledOnValidThread()); | 554 DCHECK(CalledOnValidThread()); |
| 554 if (audio_device_.get()) | 555 if (audio_device_.get()) |
| 555 return; | 556 return; |
| 556 | 557 |
| 557 audio_device_ = new WebRtcAudioDeviceImpl(); | 558 audio_device_ = new WebRtcAudioDeviceImpl(); |
| 558 } | 559 } |
| 559 | 560 |
| 560 } // namespace content | 561 } // namespace content |
| OLD | NEW |