Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(68)

Side by Side Diff: content/renderer/media/media_stream_dependency_factory.cc

Issue 19534002: Make RendererGpuVideoDecoderFactories live on arbitrary threads. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 7 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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<media::GpuVideoDecoder::Factories> gpu_factories = 500 scoped_ptr<base::Thread> vda_thread(new base::Thread("vda_thread"));
scherkus (not reviewing) 2013/07/18 00:54:43 OOC what warrants using a separate thread? Is it y
wuchengli 2013/07/18 09:42:00 libjingle worker thread being pegged only means I
501 RenderThreadImpl::current()->GetGpuFactories(); 501 bool started = vda_thread->Start();
502 if (gpu_factories.get() != NULL) 502 scoped_refptr<content::RendererGpuVideoDecoderFactories> gpu_factories;
503 decoder_factory.reset(new RTCVideoDecoderFactory(gpu_factories)); 503 if (started) {
504 gpu_factories = RenderThreadImpl::current()->GetGpuFactories(
505 vda_thread->message_loop_proxy());
506 }
507 if (gpu_factories.get() != NULL) {
508 decoder_factory.reset(
509 new RTCVideoDecoderFactory(vda_thread.Pass(), gpu_factories));
510 }
504 } 511 }
505 #if defined(GOOGLE_TV) 512 #if defined(GOOGLE_TV)
506 // PeerConnectionFactory will hold the ownership of this 513 // PeerConnectionFactory will hold the ownership of this
507 // VideoDecoderFactory. 514 // VideoDecoderFactory.
508 decoder_factory.reset(decoder_factory_tv_ = new RTCVideoDecoderFactoryTv); 515 decoder_factory.reset(decoder_factory_tv_ = new RTCVideoDecoderFactoryTv);
509 #endif 516 #endif
510 517
511 #if defined(ENABLE_WEBRTC) && defined(OS_CHROMEOS) 518 #if defined(ENABLE_WEBRTC) && defined(OS_CHROMEOS)
512 const CommandLine& command_line = *CommandLine::ForCurrentProcess(); 519 const CommandLine& command_line = *CommandLine::ForCurrentProcess();
513 if (command_line.HasSwitch(switches::kEnableEncodedScreenCapture)) { 520 if (command_line.HasSwitch(switches::kEnableEncodedScreenCapture)) {
(...skipping 311 matching lines...) Expand 10 before | Expand all | Expand 10 after
825 // processed before returning. We wait for the above task to finish before 832 // processed before returning. We wait for the above task to finish before
826 // letting the the function continue to avoid any potential race issues. 833 // letting the the function continue to avoid any potential race issues.
827 chrome_worker_thread_.Stop(); 834 chrome_worker_thread_.Stop();
828 } else { 835 } else {
829 NOTREACHED() << "Worker thread not running."; 836 NOTREACHED() << "Worker thread not running.";
830 } 837 }
831 } 838 }
832 } 839 }
833 840
834 } // namespace content 841 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698