| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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_frame_impl.h" | 5 #include "content/renderer/render_frame_impl.h" |
| 6 | 6 |
| 7 #include <map> | 7 #include <map> |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/auto_reset.h" | 10 #include "base/auto_reset.h" |
| (...skipping 5214 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5225 #if defined(OS_ANDROID) | 5225 #if defined(OS_ANDROID) |
| 5226 WebMediaPlayer* RenderFrameImpl::CreateAndroidWebMediaPlayer( | 5226 WebMediaPlayer* RenderFrameImpl::CreateAndroidWebMediaPlayer( |
| 5227 WebMediaPlayerClient* client, | 5227 WebMediaPlayerClient* client, |
| 5228 WebMediaPlayerEncryptedMediaClient* encrypted_client, | 5228 WebMediaPlayerEncryptedMediaClient* encrypted_client, |
| 5229 const media::WebMediaPlayerParams& params) { | 5229 const media::WebMediaPlayerParams& params) { |
| 5230 scoped_refptr<StreamTextureFactory> stream_texture_factory; | 5230 scoped_refptr<StreamTextureFactory> stream_texture_factory; |
| 5231 if (SynchronousCompositorFactory* factory = | 5231 if (SynchronousCompositorFactory* factory = |
| 5232 SynchronousCompositorFactory::GetInstance()) { | 5232 SynchronousCompositorFactory::GetInstance()) { |
| 5233 stream_texture_factory = factory->CreateStreamTextureFactory(routing_id_); | 5233 stream_texture_factory = factory->CreateStreamTextureFactory(routing_id_); |
| 5234 } else { | 5234 } else { |
| 5235 GpuChannelHost* gpu_channel_host = | 5235 stream_texture_factory = |
| 5236 RenderThreadImpl::current()->EstablishGpuChannelSync( | 5236 RenderThreadImpl::current()->GetStreamTexureFactory(); |
| 5237 CAUSE_FOR_GPU_LAUNCH_VIDEODECODEACCELERATOR_INITIALIZE); | 5237 if (!stream_texture_factory.get()) { |
| 5238 | 5238 LOG(ERROR) << "Failed to get stream texture factory!"; |
| 5239 if (!gpu_channel_host) { | |
| 5240 LOG(ERROR) << "Failed to establish GPU channel for media player"; | |
| 5241 return NULL; | 5239 return NULL; |
| 5242 } | 5240 } |
| 5243 | |
| 5244 scoped_refptr<cc_blink::ContextProviderWebContext> context_provider = | |
| 5245 RenderThreadImpl::current()->SharedMainThreadContextProvider(); | |
| 5246 | |
| 5247 if (!context_provider.get()) { | |
| 5248 LOG(ERROR) << "Failed to get context3d for media player"; | |
| 5249 return NULL; | |
| 5250 } | |
| 5251 | |
| 5252 stream_texture_factory = StreamTextureFactoryImpl::Create( | |
| 5253 context_provider, gpu_channel_host, routing_id_); | |
| 5254 } | 5241 } |
| 5255 | 5242 |
| 5256 return new WebMediaPlayerAndroid( | 5243 return new WebMediaPlayerAndroid(frame_, client, encrypted_client, |
| 5257 frame_, client, encrypted_client, weak_factory_.GetWeakPtr(), | 5244 weak_factory_.GetWeakPtr(), |
| 5258 GetMediaPlayerManager(), GetCdmFactory(), stream_texture_factory, params); | 5245 GetMediaPlayerManager(), GetCdmFactory(), |
| 5246 stream_texture_factory, routing_id_, params); |
| 5259 } | 5247 } |
| 5260 | 5248 |
| 5261 RendererMediaPlayerManager* RenderFrameImpl::GetMediaPlayerManager() { | 5249 RendererMediaPlayerManager* RenderFrameImpl::GetMediaPlayerManager() { |
| 5262 if (!media_player_manager_) | 5250 if (!media_player_manager_) |
| 5263 media_player_manager_ = new RendererMediaPlayerManager(this); | 5251 media_player_manager_ = new RendererMediaPlayerManager(this); |
| 5264 return media_player_manager_; | 5252 return media_player_manager_; |
| 5265 } | 5253 } |
| 5266 #endif // defined(OS_ANDROID) | 5254 #endif // defined(OS_ANDROID) |
| 5267 | 5255 |
| 5268 scoped_ptr<media::MediaPermission> RenderFrameImpl::CreateMediaPermissionProxy( | 5256 scoped_ptr<media::MediaPermission> RenderFrameImpl::CreateMediaPermissionProxy( |
| (...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5352 mojo::ServiceProviderPtr service_provider; | 5340 mojo::ServiceProviderPtr service_provider; |
| 5353 mojo::URLRequestPtr request(mojo::URLRequest::New()); | 5341 mojo::URLRequestPtr request(mojo::URLRequest::New()); |
| 5354 request->url = mojo::String::From(url); | 5342 request->url = mojo::String::From(url); |
| 5355 mojo_shell_->ConnectToApplication(request.Pass(), GetProxy(&service_provider), | 5343 mojo_shell_->ConnectToApplication(request.Pass(), GetProxy(&service_provider), |
| 5356 nullptr, nullptr, | 5344 nullptr, nullptr, |
| 5357 base::Bind(&OnGotContentHandlerID)); | 5345 base::Bind(&OnGotContentHandlerID)); |
| 5358 return service_provider.Pass(); | 5346 return service_provider.Pass(); |
| 5359 } | 5347 } |
| 5360 | 5348 |
| 5361 } // namespace content | 5349 } // namespace content |
| OLD | NEW |