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

Side by Side Diff: content/renderer/render_thread_impl.cc

Issue 13890012: Integrate VDA with WebRTC. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add VDA and gpu_factories mocks. Update unittest. Created 7 years, 7 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/render_thread_impl.h" 5 #include "content/renderer/render_thread_impl.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <limits> 8 #include <limits>
9 #include <map> 9 #include <map>
10 #include <vector> 10 #include <vector>
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
55 #include "content/renderer/dom_storage/webstoragenamespace_impl.h" 55 #include "content/renderer/dom_storage/webstoragenamespace_impl.h"
56 #include "content/renderer/gpu/compositor_output_surface.h" 56 #include "content/renderer/gpu/compositor_output_surface.h"
57 #include "content/renderer/gpu/gpu_benchmarking_extension.h" 57 #include "content/renderer/gpu/gpu_benchmarking_extension.h"
58 #include "content/renderer/gpu/input_handler_manager.h" 58 #include "content/renderer/gpu/input_handler_manager.h"
59 #include "content/renderer/media/audio_input_message_filter.h" 59 #include "content/renderer/media/audio_input_message_filter.h"
60 #include "content/renderer/media/audio_message_filter.h" 60 #include "content/renderer/media/audio_message_filter.h"
61 #include "content/renderer/media/audio_renderer_mixer_manager.h" 61 #include "content/renderer/media/audio_renderer_mixer_manager.h"
62 #include "content/renderer/media/media_stream_center.h" 62 #include "content/renderer/media/media_stream_center.h"
63 #include "content/renderer/media/media_stream_dependency_factory.h" 63 #include "content/renderer/media/media_stream_dependency_factory.h"
64 #include "content/renderer/media/peer_connection_tracker.h" 64 #include "content/renderer/media/peer_connection_tracker.h"
65 #include "content/renderer/media/renderer_gpu_video_decoder_factories.h"
65 #include "content/renderer/media/video_capture_impl_manager.h" 66 #include "content/renderer/media/video_capture_impl_manager.h"
66 #include "content/renderer/media/video_capture_message_filter.h" 67 #include "content/renderer/media/video_capture_message_filter.h"
67 #include "content/renderer/memory_benchmarking_extension.h" 68 #include "content/renderer/memory_benchmarking_extension.h"
68 #include "content/renderer/p2p/socket_dispatcher.h" 69 #include "content/renderer/p2p/socket_dispatcher.h"
69 #include "content/renderer/plugin_channel_host.h" 70 #include "content/renderer/plugin_channel_host.h"
70 #include "content/renderer/render_process_impl.h" 71 #include "content/renderer/render_process_impl.h"
71 #include "content/renderer/render_view_impl.h" 72 #include "content/renderer/render_view_impl.h"
72 #include "content/renderer/renderer_webkitplatformsupport_impl.h" 73 #include "content/renderer/renderer_webkitplatformsupport_impl.h"
73 #include "grit/content_resources.h" 74 #include "grit/content_resources.h"
74 #include "ipc/ipc_channel_handle.h" 75 #include "ipc/ipc_channel_handle.h"
(...skipping 889 matching lines...) Expand 10 before | Expand all | Expand 10 after
964 bool RenderThreadImpl::ResolveProxy(const GURL& url, std::string* proxy_list) { 965 bool RenderThreadImpl::ResolveProxy(const GURL& url, std::string* proxy_list) {
965 bool result = false; 966 bool result = false;
966 Send(new ViewHostMsg_ResolveProxy(url, &result, proxy_list)); 967 Send(new ViewHostMsg_ResolveProxy(url, &result, proxy_list));
967 return result; 968 return result;
968 } 969 }
969 970
970 void RenderThreadImpl::PostponeIdleNotification() { 971 void RenderThreadImpl::PostponeIdleNotification() {
971 idle_notifications_to_skip_ = 2; 972 idle_notifications_to_skip_ = 2;
972 } 973 }
973 974
975 RendererGpuVideoDecoderFactories* RenderThreadImpl::GetGpuFactories() {
976 const CommandLine* cmd_line = CommandLine::ForCurrentProcess();
977 RendererGpuVideoDecoderFactories* gpu_factories = NULL;
978 WebGraphicsContext3DCommandBufferImpl* context3d = NULL;
979 if (!cmd_line->HasSwitch(switches::kDisableAcceleratedVideoDecode))
980 context3d = RenderThreadImpl::current()->GetGpuVDAContext3D();
981 if (context3d) {
982 scoped_refptr<base::MessageLoopProxy> factories_loop =
983 RenderThreadImpl::current()->compositor_message_loop_proxy();
984 if (!factories_loop)
985 factories_loop = base::MessageLoopProxy::current();
986 GpuChannelHost* gpu_channel_host =
987 RenderThreadImpl::current()->EstablishGpuChannelSync(
988 CAUSE_FOR_GPU_LAUNCH_VIDEODECODEACCELERATOR_INITIALIZE);
989 gpu_factories = new RendererGpuVideoDecoderFactories(
990 gpu_channel_host, factories_loop, context3d);
991 }
992 return gpu_factories;
993 }
994
974 /* static */ 995 /* static */
975 void RenderThreadImpl::OnGpuVDAContextLoss() { 996 void RenderThreadImpl::OnGpuVDAContextLoss() {
976 RenderThreadImpl* self = RenderThreadImpl::current(); 997 RenderThreadImpl* self = RenderThreadImpl::current();
977 DCHECK(self); 998 DCHECK(self);
978 if (!self->gpu_vda_context3d_) 999 if (!self->gpu_vda_context3d_)
979 return; 1000 return;
980 if (self->compositor_message_loop_proxy()) { 1001 if (self->compositor_message_loop_proxy()) {
981 self->compositor_message_loop_proxy()->DeleteSoon( 1002 self->compositor_message_loop_proxy()->DeleteSoon(
982 FROM_HERE, self->gpu_vda_context3d_.release()); 1003 FROM_HERE, self->gpu_vda_context3d_.release());
983 } else { 1004 } else {
(...skipping 293 matching lines...) Expand 10 before | Expand all | Expand 10 after
1277 client, GetMediaStreamDependencyFactory()); 1298 client, GetMediaStreamDependencyFactory());
1278 } 1299 }
1279 } 1300 }
1280 #endif 1301 #endif
1281 return media_stream_center_; 1302 return media_stream_center_;
1282 } 1303 }
1283 1304
1284 MediaStreamDependencyFactory* 1305 MediaStreamDependencyFactory*
1285 RenderThreadImpl::GetMediaStreamDependencyFactory() { 1306 RenderThreadImpl::GetMediaStreamDependencyFactory() {
1286 #if defined(ENABLE_WEBRTC) 1307 #if defined(ENABLE_WEBRTC)
1308 const CommandLine* cmd_line = CommandLine::ForCurrentProcess();
1309 scoped_refptr<media::GpuVideoDecoder::Factories> gpu_factories;
1310 if (cmd_line->HasSwitch(switches::kEnableWebRTCHWDecoding)) {
1311 gpu_factories = GetGpuFactories();
1312 }
1287 if (!media_stream_factory_) { 1313 if (!media_stream_factory_) {
1288 media_stream_factory_.reset(new MediaStreamDependencyFactory( 1314 media_stream_factory_.reset(new MediaStreamDependencyFactory(
1289 vc_manager_, p2p_socket_dispatcher_)); 1315 vc_manager_, gpu_factories, p2p_socket_dispatcher_));
1290 } 1316 }
1291 #endif 1317 #endif
1292 return media_stream_factory_.get(); 1318 return media_stream_factory_.get();
1293 } 1319 }
1294 1320
1295 GpuChannelHost* RenderThreadImpl::GetGpuChannel() { 1321 GpuChannelHost* RenderThreadImpl::GetGpuChannel() {
1296 if (!gpu_channel_) 1322 if (!gpu_channel_)
1297 return NULL; 1323 return NULL;
1298 1324
1299 if (gpu_channel_->state() != GpuChannelHost::kConnected) 1325 if (gpu_channel_->state() != GpuChannelHost::kConnected)
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
1341 1367
1342 void RenderThreadImpl::SetFlingCurveParameters( 1368 void RenderThreadImpl::SetFlingCurveParameters(
1343 const std::vector<float>& new_touchpad, 1369 const std::vector<float>& new_touchpad,
1344 const std::vector<float>& new_touchscreen) { 1370 const std::vector<float>& new_touchscreen) {
1345 webkit_platform_support_->SetFlingCurveParameters(new_touchpad, 1371 webkit_platform_support_->SetFlingCurveParameters(new_touchpad,
1346 new_touchscreen); 1372 new_touchscreen);
1347 1373
1348 } 1374 }
1349 1375
1350 } // namespace content 1376 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698