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

Unified Diff: content/common/gpu/media/android_video_decode_accelerator.cc

Issue 1809943002: Select BackingStrategy based on GpuPreferences (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 9 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 side-by-side diff with in-line comments
Download patch
Index: content/common/gpu/media/android_video_decode_accelerator.cc
diff --git a/content/common/gpu/media/android_video_decode_accelerator.cc b/content/common/gpu/media/android_video_decode_accelerator.cc
index 9eccdc65e0440ab49d2bdcb479e2e670382960ea..a8fca8d6291e44f67b39fa0981f18a94b71ae2af 100644
--- a/content/common/gpu/media/android_video_decode_accelerator.cc
+++ b/content/common/gpu/media/android_video_decode_accelerator.cc
@@ -254,6 +254,7 @@ static base::LazyInstance<AVDATimerManager>::Leaky g_avda_timer =
AndroidVideoDecodeAccelerator::AndroidVideoDecodeAccelerator(
const base::WeakPtr<gpu::gles2::GLES2Decoder> decoder,
+ const gpu::GpuPreferences& gpu_preferences,
const base::Callback<bool(void)>& make_context_current)
: client_(NULL),
make_context_current_(make_context_current),
@@ -268,7 +269,7 @@ AndroidVideoDecodeAccelerator::AndroidVideoDecodeAccelerator(
error_sequence_token_(0),
defer_errors_(false),
weak_this_factory_(this) {
- if (UseDeferredRenderingStrategy()) {
+ if (!gpu_preferences.enable_threaded_texture_mailboxes) {
// TODO(liberato, watk): Figure out what we want to do about zero copy for
// fullscreen external SurfaceView in WebView. http://crbug.com/582170.
DCHECK(!gl_decoder_->GetContextGroup()->mailbox_manager()->UsesSync());
@@ -1156,16 +1157,9 @@ void AndroidVideoDecodeAccelerator::ManageTimer(bool did_work) {
}
// static
-bool AndroidVideoDecodeAccelerator::UseDeferredRenderingStrategy() {
- const base::CommandLine* cmd_line = base::CommandLine::ForCurrentProcess();
- // TODO(liberato, watk): Figure out what we want to do about zero copy for
- // fullscreen external SurfaceView in WebView. http://crbug.com/582170.
- return !cmd_line->HasSwitch(switches::kEnableThreadedTextureMailboxes);
-}
-
-// static
media::VideoDecodeAccelerator::Capabilities
-AndroidVideoDecodeAccelerator::GetCapabilities() {
+AndroidVideoDecodeAccelerator::GetCapabilities(
+ const gpu::GpuPreferences& gpu_preferences) {
Capabilities capabilities;
SupportedProfiles& profiles = capabilities.supported_profiles;
@@ -1196,7 +1190,7 @@ AndroidVideoDecodeAccelerator::GetCapabilities() {
profiles.push_back(profile);
}
- if (UseDeferredRenderingStrategy()) {
+ if (!gpu_preferences.enable_threaded_texture_mailboxes) {
liberato (no reviews please) 2016/03/21 16:39:52 rather than have two copies of this check which mu
william.xie 2016/03/22 01:09:24 Done.
capabilities.flags = media::VideoDecodeAccelerator::Capabilities::
NEEDS_ALL_PICTURE_BUFFERS_TO_DECODE |
media::VideoDecodeAccelerator::Capabilities::

Powered by Google App Engine
This is Rietveld 408576698