summaryrefslogtreecommitdiffstats
path: root/ppapi
diff options
context:
space:
mode:
authorananta@chromium.org <ananta@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-03-07 00:18:33 +0000
committerananta@chromium.org <ananta@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-03-07 00:18:33 +0000
commit6013c798adabecc868d3e42da8404652507ad694 (patch)
treea758958c5383eb59071cb4de67891ded55ebbb95 /ppapi
parent49f6cce89c8780a68acca444fd7cd19d411410cf (diff)
downloadchromium_src-6013c798adabecc868d3e42da8404652507ad694.zip
chromium_src-6013c798adabecc868d3e42da8404652507ad694.tar.gz
chromium_src-6013c798adabecc868d3e42da8404652507ad694.tar.bz2
Ensure that pepper plugins honor the GPU H/W video decode blacklist and the disable-accelerated-video-decode switch
Pepper plugins like Flash should honor the GPU blacklist. Not doing that causes them to try and use buggy video drivers for video decoding which does not end well. This is done by adding a flag in the accelerated_video_decode_enabled in the WebPreferences structure This is initialized along with the other preferences in the GpuDataManagerImplPrivate::UpdateRendererWebPrefs function. This is also passed to PPAPI plugins via the ppapi::Preferences structure. The flag defaults to false. The plugin process checks this flag and if it is false does not attempt to create the video decoder. BUG=348154 R=bbudge@chromium.org, cpu@chromium.org, jam@chromium.org, jamesr@chromium.org, jbauman@chromium.org, palmer@chromium.org, bbudge, cpu, jbauman Review URL: https://codereview.chromium.org/188143003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@255473 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ppapi')
-rw-r--r--ppapi/proxy/ppapi_messages.h1
-rw-r--r--ppapi/proxy/ppb_video_decoder_proxy.cc3
-rw-r--r--ppapi/shared_impl/ppapi_preferences.cc7
-rw-r--r--ppapi/shared_impl/ppapi_preferences.h1
4 files changed, 10 insertions, 2 deletions
diff --git a/ppapi/proxy/ppapi_messages.h b/ppapi/proxy/ppapi_messages.h
index fb677cf..71f791e 100644
--- a/ppapi/proxy/ppapi_messages.h
+++ b/ppapi/proxy/ppapi_messages.h
@@ -278,6 +278,7 @@ IPC_STRUCT_TRAITS_BEGIN(ppapi::Preferences)
IPC_STRUCT_TRAITS_MEMBER(is_3d_supported)
IPC_STRUCT_TRAITS_MEMBER(is_stage3d_supported)
IPC_STRUCT_TRAITS_MEMBER(is_stage3d_baseline_supported)
+ IPC_STRUCT_TRAITS_MEMBER(is_accelerated_video_decode_enabled)
IPC_STRUCT_TRAITS_END()
IPC_STRUCT_TRAITS_BEGIN(ppapi::InputEventData)
diff --git a/ppapi/proxy/ppb_video_decoder_proxy.cc b/ppapi/proxy/ppb_video_decoder_proxy.cc
index 2a00674..dd42050 100644
--- a/ppapi/proxy/ppb_video_decoder_proxy.cc
+++ b/ppapi/proxy/ppb_video_decoder_proxy.cc
@@ -192,6 +192,9 @@ PP_Resource PPB_VideoDecoder_Proxy::CreateProxyResource(
if (!dispatcher)
return 0;
+ if (!dispatcher->preferences().is_accelerated_video_decode_enabled)
+ return 0;
+
EnterResourceNoLock<PPB_Graphics3D_API> enter_context(graphics_context,
true);
if (enter_context.failed())
diff --git a/ppapi/shared_impl/ppapi_preferences.cc b/ppapi/shared_impl/ppapi_preferences.cc
index ec11a2f..79d8d27 100644
--- a/ppapi/shared_impl/ppapi_preferences.cc
+++ b/ppapi/shared_impl/ppapi_preferences.cc
@@ -12,7 +12,8 @@ Preferences::Preferences()
number_of_cpu_cores(0),
is_3d_supported(true),
is_stage3d_supported(false),
- is_stage3d_baseline_supported(false) {}
+ is_stage3d_baseline_supported(false),
+ is_accelerated_video_decode_enabled(false) {}
Preferences::Preferences(const WebPreferences& prefs)
: standard_font_family_map(prefs.standard_font_family_map),
@@ -29,7 +30,9 @@ Preferences::Preferences(const WebPreferences& prefs)
// and if it runs in hardware
// (accelerated_compositing_for_plugins_enabled)
is_webgl_supported(prefs.experimental_webgl_enabled &&
- prefs.accelerated_compositing_for_plugins_enabled) {}
+ prefs.accelerated_compositing_for_plugins_enabled),
+ is_accelerated_video_decode_enabled(
+ prefs.pepper_accelerated_video_decode_enabled) {}
Preferences::~Preferences() {}
diff --git a/ppapi/shared_impl/ppapi_preferences.h b/ppapi/shared_impl/ppapi_preferences.h
index d3fad965..0ef9136 100644
--- a/ppapi/shared_impl/ppapi_preferences.h
+++ b/ppapi/shared_impl/ppapi_preferences.h
@@ -29,6 +29,7 @@ struct PPAPI_SHARED_EXPORT Preferences {
bool is_stage3d_supported;
bool is_stage3d_baseline_supported;
bool is_webgl_supported;
+ bool is_accelerated_video_decode_enabled;
};
} // namespace ppapi