Mark outgoing pictures as "allow_overlay" all the time, but also mark them as backed by surface texture if needed. this will prevent overlay, but allow us to receive a hint.
also, request the hint by marking them as "wants_promotion_hint".
pretty much, do this:
diff --git a/media/gpu/android_video_decode_accelerator.cc b/media/gpu/android_video_decode_accelerator.cc
index 1fe3474..e34b7d2 100644
--- a/media/gpu/android_video_decode_accelerator.cc
+++ b/media/gpu/android_video_decode_accelerator.cc
@@ -741,12 +741,15 @@ void AndroidVideoDecodeAccelerator::SendDecodedFrameToClient(
if (size_changed)
picture_buffer.set_size(size_);
- const bool allow_overlay = picture_buffer_manager_.ArePicturesOverlayable();
- UMA_HISTOGRAM_BOOLEAN("Media.AVDA.FrameSentAsOverlay", allow_overlay);
+ const bool surface_view = picture_buffer_manager_.ArePicturesOverlayable();
+ UMA_HISTOGRAM_BOOLEAN("Media.AVDA.FrameSentAsOverlay", surface_view);
// TODO(hubbe): Insert the correct color space. http://crbug.com/647725
Picture picture(picture_buffer_id, bitstream_id, gfx::Rect(size_),
- gfx::ColorSpace(), allow_overlay);
+ gfx::ColorSpace(), true /* allow_overlay */);
picture.set_size_changed(size_changed);
+ picture.set_surface_texture(!surface_view);
+ picture.set_wants_promotion_hint(true);
// Notify picture ready before calling UseCodecBufferForPictureBuffer() since
// that process may be slow and shouldn't delay delivery of the frame to the
Comment 1 by bugdroid1@chromium.org
, Jun 28 2017