Commit 0ed8e86b by olly Committed by Oliver Woodman

Allow overriding of setOutputSurface workarounds

Since this is an ongoing problem, it's reasonable that we allow
developers to toggle these workarounds without too much hassle.

Issue: #4468

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=203364488
parent 264bed06
...@@ -1180,23 +1180,35 @@ public class MediaCodecVideoRenderer extends MediaCodecRenderer { ...@@ -1180,23 +1180,35 @@ public class MediaCodecVideoRenderer extends MediaCodecRenderer {
} }
/** /**
* Returns whether the device is known to handle {@link DummySurface} incorrectly. * Returns whether the codec is known to handle {@link DummySurface} incorrectly.
* *
* <p>If true is returned then use of {@link DummySurface} is disabled. * <p>If true is returned then use of {@link DummySurface} is disabled.
*
* @param name The name of the codec.
* @return True if the device is known to handle {@link DummySurface} incorrectly.
*/ */
private static boolean codecNeedsDummySurfaceWorkaround(String name) { protected boolean codecNeedsDummySurfaceWorkaround(String name) {
// Work around https://github.com/google/ExoPlayer/issues/4419. // Work around https://github.com/google/ExoPlayer/issues/4419.
return ("Amazon".equals(Util.MANUFACTURER) && "AFTN".equals(Util.MODEL)) // FireTV 4K return ("Amazon".equals(Util.MANUFACTURER) && "AFTN".equals(Util.MODEL)) // FireTV 4K
&& "OMX.amlogic.avc.decoder.awesome".equals(name); && "OMX.amlogic.avc.decoder.awesome".equals(name);
} }
/** /**
* Returns whether the device is known to implement {@link MediaCodec#setOutputSurface(Surface)} * Returns whether the codec is known to implement {@link MediaCodec#setOutputSurface(Surface)}
* incorrectly. * incorrectly.
* <p> *
* If true is returned then we fall back to releasing and re-instantiating the codec instead. * <p>If true is returned then we fall back to releasing and re-instantiating the codec instead.
*
* <p>Note: This workaround should only be used if {@link MediaCodec#setOutputSurface(Surface)}
* doesn't work when transitioning between two real surfaces. If an issue only occurs when
* transitioning to or from {@link DummySurface}, then {@link
* #codecNeedsDummySurfaceWorkaround(String)} should be used instead.
*
* @param name The name of the codec.
* @return True if the device is known to implement {@link MediaCodec#setOutputSurface(Surface)}
* incorrectly.
*/ */
private static boolean codecNeedsSetOutputSurfaceWorkaround(String name) { protected boolean codecNeedsSetOutputSurfaceWorkaround(String name) {
// Work around https://github.com/google/ExoPlayer/issues/3236, // Work around https://github.com/google/ExoPlayer/issues/3236,
// https://github.com/google/ExoPlayer/issues/3355, // https://github.com/google/ExoPlayer/issues/3355,
// https://github.com/google/ExoPlayer/issues/3439, // https://github.com/google/ExoPlayer/issues/3439,
......
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