Commit e4b08117 by andrewlewis Committed by Oliver Woodman

Use adaptation workaround on N7v1.

Also, only enable the workaround when the resolution isn't changing but the
format is changing.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=127192637
parent de27b2e0
...@@ -693,7 +693,8 @@ public abstract class MediaCodecRenderer extends Renderer { ...@@ -693,7 +693,8 @@ public abstract class MediaCodecRenderer extends Renderer {
if (codec != null && canReconfigureCodec(codec, codecIsAdaptive, oldFormat, format)) { if (codec != null && canReconfigureCodec(codec, codecIsAdaptive, oldFormat, format)) {
codecReconfigured = true; codecReconfigured = true;
codecReconfigurationState = RECONFIGURATION_STATE_WRITE_PENDING; codecReconfigurationState = RECONFIGURATION_STATE_WRITE_PENDING;
codecNeedsAdaptationWorkaroundBuffer = codecNeedsAdaptationWorkaround; codecNeedsAdaptationWorkaroundBuffer = codecNeedsAdaptationWorkaround
&& format.width == oldFormat.width && format.height == oldFormat.height;
} else { } else {
if (codecReceivedBuffers) { if (codecReceivedBuffers) {
// Signal end of stream and wait for any final output buffers before re-initialization. // Signal end of stream and wait for any final output buffers before re-initialization.
...@@ -957,7 +958,8 @@ public abstract class MediaCodecRenderer extends Renderer { ...@@ -957,7 +958,8 @@ public abstract class MediaCodecRenderer extends Renderer {
} }
/** /**
* Returns whether the decoder is known to get stuck during some adaptations. * Returns whether the decoder is known to get stuck during some adaptations where the resolution
* does not change.
* <p> * <p>
* If true is returned, the renderer will work around the issue by queueing and discarding a blank * If true is returned, the renderer will work around the issue by queueing and discarding a blank
* frame at a different resolution, which resets the codec's internal state. * frame at a different resolution, which resets the codec's internal state.
...@@ -968,8 +970,10 @@ public abstract class MediaCodecRenderer extends Renderer { ...@@ -968,8 +970,10 @@ public abstract class MediaCodecRenderer extends Renderer {
* @return True if the decoder is known to get stuck during some adaptations. * @return True if the decoder is known to get stuck during some adaptations.
*/ */
private static boolean codecNeedsAdaptationWorkaround(String name) { private static boolean codecNeedsAdaptationWorkaround(String name) {
return Util.SDK_INT < 24 && Util.DEVICE.startsWith("flounder") return Util.SDK_INT < 24
&& ("OMX.Nvidia.h264.decode".equals(name) || "OMX.Nvidia.h264.decode.secure".equals(name)); && ("OMX.Nvidia.h264.decode".equals(name) || "OMX.Nvidia.h264.decode.secure".equals(name))
&& (Util.DEVICE.equals("flounder") || Util.DEVICE.equals("flounder_lte")
|| Util.DEVICE.equals("grouper") || Util.DEVICE.equals("tilapia"));
} }
/** /**
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment