| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/media_stream_dependency_factory.h" | 5 #include "content/renderer/media/media_stream_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/strings/utf_string_conversions.h" | 10 #include "base/strings/utf_string_conversions.h" |
| (...skipping 479 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 490 DVLOG(1) << "MediaStreamDependencyFactory::CreatePeerConnectionFactory()"; | 490 DVLOG(1) << "MediaStreamDependencyFactory::CreatePeerConnectionFactory()"; |
| 491 if (!pc_factory_.get()) { | 491 if (!pc_factory_.get()) { |
| 492 DCHECK(!audio_device_.get()); | 492 DCHECK(!audio_device_.get()); |
| 493 audio_device_ = new WebRtcAudioDeviceImpl(); | 493 audio_device_ = new WebRtcAudioDeviceImpl(); |
| 494 | 494 |
| 495 scoped_ptr<cricket::WebRtcVideoDecoderFactory> decoder_factory; | 495 scoped_ptr<cricket::WebRtcVideoDecoderFactory> decoder_factory; |
| 496 scoped_ptr<cricket::WebRtcVideoEncoderFactory> encoder_factory; | 496 scoped_ptr<cricket::WebRtcVideoEncoderFactory> encoder_factory; |
| 497 | 497 |
| 498 const CommandLine* cmd_line = CommandLine::ForCurrentProcess(); | 498 const CommandLine* cmd_line = CommandLine::ForCurrentProcess(); |
| 499 if (cmd_line->HasSwitch(switches::kEnableWebRtcHWDecoding)) { | 499 if (cmd_line->HasSwitch(switches::kEnableWebRtcHWDecoding)) { |
| 500 scoped_refptr<base::MessageLoopProxy> media_loop_proxy = |
| 501 RenderThreadImpl::current()->GetMediaThreadMessageLoopProxy(); |
| 500 scoped_refptr<media::GpuVideoDecoder::Factories> gpu_factories = | 502 scoped_refptr<media::GpuVideoDecoder::Factories> gpu_factories = |
| 501 RenderThreadImpl::current()->GetGpuFactories(); | 503 RenderThreadImpl::current()->GetGpuFactories(media_loop_proxy); |
| 502 if (gpu_factories.get() != NULL) | 504 if (gpu_factories.get() != NULL) { |
| 503 decoder_factory.reset(new RTCVideoDecoderFactory(gpu_factories)); | 505 decoder_factory.reset( |
| 506 new RTCVideoDecoderFactory(media_loop_proxy, gpu_factories)); |
| 507 } |
| 504 } | 508 } |
| 505 #if defined(GOOGLE_TV) | 509 #if defined(GOOGLE_TV) |
| 506 // PeerConnectionFactory will hold the ownership of this | 510 // PeerConnectionFactory will hold the ownership of this |
| 507 // VideoDecoderFactory. | 511 // VideoDecoderFactory. |
| 508 decoder_factory.reset(decoder_factory_tv_ = new RTCVideoDecoderFactoryTv); | 512 decoder_factory.reset(decoder_factory_tv_ = new RTCVideoDecoderFactoryTv); |
| 509 #endif | 513 #endif |
| 510 | 514 |
| 511 #if defined(ENABLE_WEBRTC) && defined(OS_CHROMEOS) | 515 #if defined(ENABLE_WEBRTC) && defined(OS_CHROMEOS) |
| 512 const CommandLine& command_line = *CommandLine::ForCurrentProcess(); | 516 const CommandLine& command_line = *CommandLine::ForCurrentProcess(); |
| 513 if (command_line.HasSwitch(switches::kEnableEncodedScreenCapture)) { | 517 if (command_line.HasSwitch(switches::kEnableEncodedScreenCapture)) { |
| (...skipping 311 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 825 // processed before returning. We wait for the above task to finish before | 829 // processed before returning. We wait for the above task to finish before |
| 826 // letting the the function continue to avoid any potential race issues. | 830 // letting the the function continue to avoid any potential race issues. |
| 827 chrome_worker_thread_.Stop(); | 831 chrome_worker_thread_.Stop(); |
| 828 } else { | 832 } else { |
| 829 NOTREACHED() << "Worker thread not running."; | 833 NOTREACHED() << "Worker thread not running."; |
| 830 } | 834 } |
| 831 } | 835 } |
| 832 } | 836 } |
| 833 | 837 |
| 834 } // namespace content | 838 } // namespace content |
| OLD | NEW |