Chromium Code Reviews| 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 239 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 250 new IpcPacketSocketFactory(p2p_socket_dispatcher_.get())); | 250 new IpcPacketSocketFactory(p2p_socket_dispatcher_.get())); |
| 251 | 251 |
| 252 std::unique_ptr<cricket::WebRtcVideoDecoderFactory> decoder_factory; | 252 std::unique_ptr<cricket::WebRtcVideoDecoderFactory> decoder_factory; |
| 253 std::unique_ptr<cricket::WebRtcVideoEncoderFactory> encoder_factory; | 253 std::unique_ptr<cricket::WebRtcVideoEncoderFactory> encoder_factory; |
| 254 | 254 |
| 255 const base::CommandLine* cmd_line = base::CommandLine::ForCurrentProcess(); | 255 const base::CommandLine* cmd_line = base::CommandLine::ForCurrentProcess(); |
| 256 if (gpu_factories && gpu_factories->IsGpuVideoAcceleratorEnabled()) { | 256 if (gpu_factories && gpu_factories->IsGpuVideoAcceleratorEnabled()) { |
| 257 if (!cmd_line->HasSwitch(switches::kDisableWebRtcHWDecoding)) | 257 if (!cmd_line->HasSwitch(switches::kDisableWebRtcHWDecoding)) |
| 258 decoder_factory.reset(new RTCVideoDecoderFactory(gpu_factories)); | 258 decoder_factory.reset(new RTCVideoDecoderFactory(gpu_factories)); |
| 259 | 259 |
| 260 if (!cmd_line->HasSwitch(switches::kDisableWebRtcHWEncoding)) | 260 if (!cmd_line->HasSwitch(switches::kDisableWebRtcHWEncoding) || |
| 261 !cmd_line->GetSwitchValueASCII(switches::kDisableWebRtcHWEncoding) | |
|
DaleCurtis
2016/09/29 00:31:36
Multiline if needs {}
braveyao
2016/09/29 19:26:26
Done.
| |
| 262 .empty()) | |
| 261 encoder_factory.reset(new RTCVideoEncoderFactory(gpu_factories)); | 263 encoder_factory.reset(new RTCVideoEncoderFactory(gpu_factories)); |
| 262 } | 264 } |
| 263 | 265 |
| 264 #if defined(OS_ANDROID) | 266 #if defined(OS_ANDROID) |
| 265 if (!media::MediaCodecUtil::SupportsSetParameters()) | 267 if (!media::MediaCodecUtil::SupportsSetParameters()) |
| 266 encoder_factory.reset(); | 268 encoder_factory.reset(); |
| 267 #endif | 269 #endif |
| 268 | 270 |
| 269 pc_factory_ = webrtc::CreatePeerConnectionFactory( | 271 pc_factory_ = webrtc::CreatePeerConnectionFactory( |
| 270 worker_thread_, signaling_thread_, audio_device_.get(), | 272 worker_thread_, signaling_thread_, audio_device_.get(), |
| (...skipping 306 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 577 | 579 |
| 578 void PeerConnectionDependencyFactory::EnsureWebRtcAudioDeviceImpl() { | 580 void PeerConnectionDependencyFactory::EnsureWebRtcAudioDeviceImpl() { |
| 579 DCHECK(CalledOnValidThread()); | 581 DCHECK(CalledOnValidThread()); |
| 580 if (audio_device_.get()) | 582 if (audio_device_.get()) |
| 581 return; | 583 return; |
| 582 | 584 |
| 583 audio_device_ = new WebRtcAudioDeviceImpl(); | 585 audio_device_ = new WebRtcAudioDeviceImpl(); |
| 584 } | 586 } |
| 585 | 587 |
| 586 } // namespace content | 588 } // namespace content |
| OLD | NEW |