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/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 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
109 #endif | 109 #endif |
110 | 110 |
111 #if defined(OS_POSIX) | 111 #if defined(OS_POSIX) |
112 #include "ipc/ipc_channel_posix.h" | 112 #include "ipc/ipc_channel_posix.h" |
113 #endif | 113 #endif |
114 | 114 |
115 #if defined(ENABLE_WEBRTC) | 115 #if defined(ENABLE_WEBRTC) |
116 #include "third_party/webrtc/system_wrappers/interface/event_tracer.h" | 116 #include "third_party/webrtc/system_wrappers/interface/event_tracer.h" |
117 #endif | 117 #endif |
118 | 118 |
119 #include "content/renderer/media/renderer_gpu_video_decoder_factories.h" | |
Pawel Osciak
2013/04/26 07:08:01
This seems out of place
wuchengli
2013/04/26 11:49:14
Done.
| |
120 | |
119 using WebKit::WebDocument; | 121 using WebKit::WebDocument; |
120 using WebKit::WebFrame; | 122 using WebKit::WebFrame; |
121 using WebKit::WebNetworkStateNotifier; | 123 using WebKit::WebNetworkStateNotifier; |
122 using WebKit::WebRuntimeFeatures; | 124 using WebKit::WebRuntimeFeatures; |
123 using WebKit::WebScriptController; | 125 using WebKit::WebScriptController; |
124 using WebKit::WebSecurityPolicy; | 126 using WebKit::WebSecurityPolicy; |
125 using WebKit::WebString; | 127 using WebKit::WebString; |
126 using WebKit::WebView; | 128 using WebKit::WebView; |
127 | 129 |
128 namespace content { | 130 namespace content { |
(...skipping 1096 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1225 client, GetMediaStreamDependencyFactory()); | 1227 client, GetMediaStreamDependencyFactory()); |
1226 } | 1228 } |
1227 } | 1229 } |
1228 #endif | 1230 #endif |
1229 return media_stream_center_; | 1231 return media_stream_center_; |
1230 } | 1232 } |
1231 | 1233 |
1232 MediaStreamDependencyFactory* | 1234 MediaStreamDependencyFactory* |
1233 RenderThreadImpl::GetMediaStreamDependencyFactory() { | 1235 RenderThreadImpl::GetMediaStreamDependencyFactory() { |
1234 #if defined(ENABLE_WEBRTC) | 1236 #if defined(ENABLE_WEBRTC) |
1237 const CommandLine* cmd_line = CommandLine::ForCurrentProcess(); | |
1238 scoped_refptr<media::GpuVideoDecoder::Factories> gpu_factories; | |
1239 WebGraphicsContext3DCommandBufferImpl* context3d = NULL; | |
1240 if (!cmd_line->HasSwitch(switches::kDisableAcceleratedVideoDecode)) | |
Ami GONE FROM CHROMIUM
2013/04/26 00:42:05
IWBN to avoid the code duplication between here an
wuchengli
2013/04/26 11:49:14
I added a line here. Also, I could not find a good
wuchengli
2013/05/08 15:58:56
GetMediaStreamDependencyFactory is also called by
| |
1241 context3d = RenderThreadImpl::current()->GetGpuVDAContext3D(); | |
1242 if (context3d) { | |
1243 scoped_refptr<base::MessageLoopProxy> factories_loop = | |
1244 RenderThreadImpl::current()->compositor_message_loop_proxy(); | |
1245 if (!factories_loop) | |
1246 factories_loop = base::MessageLoopProxy::current(); | |
1247 GpuChannelHost* gpu_channel_host = | |
1248 RenderThreadImpl::current()->EstablishGpuChannelSync( | |
1249 CAUSE_FOR_GPU_LAUNCH_VIDEODECODEACCELERATOR_INITIALIZE); | |
1250 gpu_factories = new RendererGpuVideoDecoderFactories( | |
1251 gpu_channel_host, factories_loop, context3d); | |
1252 } | |
1235 if (!media_stream_factory_.get()) { | 1253 if (!media_stream_factory_.get()) { |
1236 media_stream_factory_.reset(new MediaStreamDependencyFactory( | 1254 media_stream_factory_.reset(new MediaStreamDependencyFactory( |
1237 vc_manager_, p2p_socket_dispatcher_)); | 1255 vc_manager_, gpu_factories, p2p_socket_dispatcher_)); |
1238 } | 1256 } |
1239 #endif | 1257 #endif |
1240 return media_stream_factory_.get(); | 1258 return media_stream_factory_.get(); |
1241 } | 1259 } |
1242 | 1260 |
1243 GpuChannelHost* RenderThreadImpl::GetGpuChannel() { | 1261 GpuChannelHost* RenderThreadImpl::GetGpuChannel() { |
1244 if (!gpu_channel_.get()) | 1262 if (!gpu_channel_.get()) |
1245 return NULL; | 1263 return NULL; |
1246 | 1264 |
1247 if (gpu_channel_->state() != GpuChannelHost::kConnected) | 1265 if (gpu_channel_->state() != GpuChannelHost::kConnected) |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1289 | 1307 |
1290 void RenderThreadImpl::SetFlingCurveParameters( | 1308 void RenderThreadImpl::SetFlingCurveParameters( |
1291 const std::vector<float>& new_touchpad, | 1309 const std::vector<float>& new_touchpad, |
1292 const std::vector<float>& new_touchscreen) { | 1310 const std::vector<float>& new_touchscreen) { |
1293 webkit_platform_support_->SetFlingCurveParameters(new_touchpad, | 1311 webkit_platform_support_->SetFlingCurveParameters(new_touchpad, |
1294 new_touchscreen); | 1312 new_touchscreen); |
1295 | 1313 |
1296 } | 1314 } |
1297 | 1315 |
1298 } // namespace content | 1316 } // namespace content |
OLD | NEW |