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

Side by Side Diff: media/gpu/android_video_decode_accelerator.cc

Issue 2029053003: Fix AW tests for Spitzer (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Set COPY_REQUIRED flag for WevView video frame and enabled deferred strategy for WebView Created 4 years, 6 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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 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 "media/gpu/android_video_decode_accelerator.h" 5 #include "media/gpu/android_video_decode_accelerator.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include <memory> 9 #include <memory>
10 10
(...skipping 461 matching lines...) Expand 10 before | Expand all | Expand 10 after
472 LOG(ERROR) << "Failed to get gles2 decoder instance."; 472 LOG(ERROR) << "Failed to get gles2 decoder instance.";
473 return false; 473 return false;
474 } 474 }
475 475
476 const gpu::GpuPreferences& gpu_preferences = 476 const gpu::GpuPreferences& gpu_preferences =
477 gles_decoder->GetContextGroup()->gpu_preferences(); 477 gles_decoder->GetContextGroup()->gpu_preferences();
478 478
479 if (UseDeferredRenderingStrategy(gpu_preferences)) { 479 if (UseDeferredRenderingStrategy(gpu_preferences)) {
480 // TODO(liberato, watk): Figure out what we want to do about zero copy for 480 // TODO(liberato, watk): Figure out what we want to do about zero copy for
481 // fullscreen external SurfaceView in WebView. http://crbug.com/582170. 481 // fullscreen external SurfaceView in WebView. http://crbug.com/582170.
482 DCHECK(!gles_decoder->GetContextGroup()->mailbox_manager()->UsesSync()); 482 // DCHECK(!gles_decoder->GetContextGroup()->mailbox_manager()->UsesSync());
boliu 2016/06/09 15:37:15 remove it
483 DVLOG(1) << __FUNCTION__ << ", using deferred rendering strategy."; 483 DVLOG(1) << __FUNCTION__ << ", using deferred rendering strategy.";
484 strategy_.reset(new AndroidDeferredRenderingBackingStrategy(this)); 484 strategy_.reset(new AndroidDeferredRenderingBackingStrategy(this));
485 } else { 485 } else {
486 DVLOG(1) << __FUNCTION__ << ", using copy back strategy."; 486 DVLOG(1) << __FUNCTION__ << ", using copy back strategy.";
487 strategy_.reset(new AndroidCopyingBackingStrategy(this)); 487 strategy_.reset(new AndroidCopyingBackingStrategy(this));
488 } 488 }
489 489
490 if (!make_context_current_cb_.Run()) { 490 if (!make_context_current_cb_.Run()) {
491 LOG(ERROR) << "Failed to make this decoder's GL context current."; 491 LOG(ERROR) << "Failed to make this decoder's GL context current.";
492 return false; 492 return false;
(...skipping 1080 matching lines...) Expand 10 before | Expand all | Expand 10 after
1573 g_avda_timer.Pointer()->StartTimer(this); 1573 g_avda_timer.Pointer()->StartTimer(this);
1574 else 1574 else
1575 g_avda_timer.Pointer()->StopTimer(this); 1575 g_avda_timer.Pointer()->StopTimer(this);
1576 } 1576 }
1577 1577
1578 // static 1578 // static
1579 bool AndroidVideoDecodeAccelerator::UseDeferredRenderingStrategy( 1579 bool AndroidVideoDecodeAccelerator::UseDeferredRenderingStrategy(
1580 const gpu::GpuPreferences& gpu_preferences) { 1580 const gpu::GpuPreferences& gpu_preferences) {
1581 // TODO(liberato, watk): Figure out what we want to do about zero copy for 1581 // TODO(liberato, watk): Figure out what we want to do about zero copy for
1582 // fullscreen external SurfaceView in WebView. http://crbug.com/582170. 1582 // fullscreen external SurfaceView in WebView. http://crbug.com/582170.
1583 return !gpu_preferences.enable_threaded_texture_mailboxes; 1583 // return !gpu_preferences.enable_threaded_texture_mailboxes;
1584 return true;
1584 } 1585 }
1585 1586
1586 // static 1587 // static
1587 media::VideoDecodeAccelerator::Capabilities 1588 media::VideoDecodeAccelerator::Capabilities
1588 AndroidVideoDecodeAccelerator::GetCapabilities( 1589 AndroidVideoDecodeAccelerator::GetCapabilities(
1589 const gpu::GpuPreferences& gpu_preferences) { 1590 const gpu::GpuPreferences& gpu_preferences) {
1590 Capabilities capabilities; 1591 Capabilities capabilities;
1591 SupportedProfiles& profiles = capabilities.supported_profiles; 1592 SupportedProfiles& profiles = capabilities.supported_profiles;
1592 1593
1593 // Only support VP8 on Android versions where we don't have to synchronously 1594 // Only support VP8 on Android versions where we don't have to synchronously
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after
1650 if (media::MediaCodecUtil::IsSurfaceViewOutputSupported()) { 1651 if (media::MediaCodecUtil::IsSurfaceViewOutputSupported()) {
1651 capabilities.flags |= media::VideoDecodeAccelerator::Capabilities:: 1652 capabilities.flags |= media::VideoDecodeAccelerator::Capabilities::
1652 SUPPORTS_EXTERNAL_OUTPUT_SURFACE; 1653 SUPPORTS_EXTERNAL_OUTPUT_SURFACE;
1653 } 1654 }
1654 } 1655 }
1655 1656
1656 return capabilities; 1657 return capabilities;
1657 } 1658 }
1658 1659
1659 } // namespace media 1660 } // namespace media
OLDNEW
« media/filters/gpu_video_decoder.cc ('K') | « media/filters/gpu_video_decoder.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698