Index: content/renderer/render_view_impl.cc |
diff --git a/content/renderer/render_view_impl.cc b/content/renderer/render_view_impl.cc |
index 44e58f5487dd9b546ecff4591258efe5789be19f..54647af3f07c2226ca018ef4f84b858fc56350ef 100644 |
--- a/content/renderer/render_view_impl.cc |
+++ b/content/renderer/render_view_impl.cc |
@@ -216,6 +216,7 @@ |
#if defined(OS_ANDROID) |
#include "content/common/android/device_telephony_info.h" |
+#include "content/common/gpu/client/context_provider_command_buffer.h" |
#include "content/renderer/android/address_detector.h" |
#include "content/renderer/android/content_detector.h" |
#include "content/renderer/android/email_detector.h" |
@@ -2721,9 +2722,6 @@ WebMediaPlayer* RenderViewImpl::createMediaPlayer( |
#endif |
#if defined(OS_ANDROID) |
- WebGraphicsContext3D* resource_context = |
- GetWebView()->sharedGraphicsContext3D(); |
- |
GpuChannelHost* gpu_channel_host = |
RenderThreadImpl::current()->EstablishGpuChannelSync( |
CAUSE_FOR_GPU_LAUNCH_VIDEODECODEACCELERATOR_INITIALIZE); |
@@ -2732,6 +2730,14 @@ WebMediaPlayer* RenderViewImpl::createMediaPlayer( |
return NULL; |
} |
+ scoped_refptr<cc::ContextProvider> context_provider = |
+ RenderThreadImpl::current()->OffscreenContextProviderForMainThread(); |
+ if (!context_provider->InitializeOnMainThread() || |
+ !context_provider->BindToCurrentThread()) { |
+ LOG(ERROR) << "Failed to get context3d for media player"; |
+ return NULL; |
+ } |
+ |
if (cmd_line->HasSwitch(switches::kInProcessWebGL)) { |
if (!media_bridge_manager_.get()) { |
media_bridge_manager_.reset( |
@@ -2744,7 +2750,7 @@ WebMediaPlayer* RenderViewImpl::createMediaPlayer( |
media_player_manager_.get(), |
media_bridge_manager_.get(), |
new StreamTextureFactoryImpl( |
- resource_context, gpu_channel_host, routing_id_), |
+ context_provider->Context3d(), gpu_channel_host, routing_id_), |
cmd_line->HasSwitch(switches::kDisableMediaHistoryLogging)); |
} |
if (!media_player_proxy_) { |
@@ -2757,7 +2763,7 @@ WebMediaPlayer* RenderViewImpl::createMediaPlayer( |
media_player_manager_.get(), |
media_player_proxy_, |
new StreamTextureFactoryImpl( |
- resource_context, gpu_channel_host, routing_id_)); |
+ context_provider->Context3d(), gpu_channel_host, routing_id_)); |
#endif |
scoped_refptr<media::AudioRendererSink> sink; |