From 9a5a383d9e65b9e4e26ba943fcbcad2f2e4405ba Mon Sep 17 00:00:00 2001 From: Lajos Molnar Date: Wed, 19 Jun 2019 15:10:09 -0700 Subject: media: clarify frame dropping behavior for decoder output Bug: 135390389 Change-Id: Ie1b83e2db85703ea6fb03483b0ce08924de93e4f --- media/java/android/media/MediaCodec.java | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/media/java/android/media/MediaCodec.java b/media/java/android/media/MediaCodec.java index 56e8e8579ec4..510ee442f852 100644 --- a/media/java/android/media/MediaCodec.java +++ b/media/java/android/media/MediaCodec.java @@ -644,6 +644,16 @@ import java.util.concurrent.locks.ReentrantLock;

Also since {@link android.os.Build.VERSION_CODES#M}, you can change the output Surface dynamically using {@link #setOutputSurface setOutputSurface}. +

+ When rendering output to a Surface, the Surface may be configured to drop excessive frames (that + are not consumed by the Surface in a timely manner). Or it may be configured to not drop excessive + frames. In the latter mode if the Surface is not consuming output frames fast enough, it will + eventually block the decoder. Prior to {@link android.os.Build.VERSION_CODES#Q} the exact behavior + was undefined, with the exception that View surfaces (SuerfaceView or TextureView) always dropped + excessive frames. Since {@link android.os.Build.VERSION_CODES#Q} the default behavior is to drop + excessive frames. Applications can opt out of this behavior for non-View surfaces (such as + ImageReader or SurfaceTexture) by targeting SDK {@link android.os.Build.VERSION_CODES#Q} and + setting the key {@code "allow-frame-drop"} to {@code 0} in their configure format.

Transformations When Rendering onto Surface

-- cgit v1.2.3-59-g8ed1b