Commit 05bfeca5 by olly Committed by Oliver Woodman

Enable setOutputSurfaceWorkaround for dangal

Issue: #5169
PiperOrigin-RevId: 225025357
parent defbd046
...@@ -23,6 +23,8 @@ ...@@ -23,6 +23,8 @@
(`DataSpec.FLAG_DONT_CACHE_IF_LENGTH_UNKNOWN`). (`DataSpec.FLAG_DONT_CACHE_IF_LENGTH_UNKNOWN`).
* Disable post processing on Nvidia devices, as it breaks decode-only frame * Disable post processing on Nvidia devices, as it breaks decode-only frame
skippping. skippping.
* Workaround for MiTV (dangal) issue when swapping output surface
([#5169](https://github.com/google/ExoPlayer/issues/5169)).
### 2.9.2 ### ### 2.9.2 ###
......
...@@ -1306,12 +1306,19 @@ public class MediaCodecVideoRenderer extends MediaCodecRenderer { ...@@ -1306,12 +1306,19 @@ public class MediaCodecVideoRenderer extends MediaCodecRenderer {
* incorrectly. * incorrectly.
*/ */
protected boolean codecNeedsSetOutputSurfaceWorkaround(String name) { protected boolean codecNeedsSetOutputSurfaceWorkaround(String name) {
if (Util.SDK_INT >= 27 || name.startsWith("OMX.google")) { if (name.startsWith("OMX.google")) {
// Devices running API level 27 or later should also be unaffected. Google OMX decoders are // Google OMX decoders are not known to have this issue on any API level.
// not known to have this issue on any API level.
return false; return false;
} }
// Work around: synchronized (MediaCodecVideoRenderer.class) {
if (!evaluatedDeviceNeedsSetOutputSurfaceWorkaround) {
if (Util.SDK_INT <= 27 && "dangal".equals(Util.DEVICE)) {
// Dangal is affected on API level 27: https://github.com/google/ExoPlayer/issues/5169.
deviceNeedsSetOutputSurfaceWorkaround = true;
} else if (Util.SDK_INT >= 27) {
// In general, devices running API level 27 or later should be unaffected. Do nothing.
} else {
// Enable the workaround on a per-device basis. Works around:
// https://github.com/google/ExoPlayer/issues/3236, // 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,
...@@ -1325,8 +1332,6 @@ public class MediaCodecVideoRenderer extends MediaCodecRenderer { ...@@ -1325,8 +1332,6 @@ public class MediaCodecVideoRenderer extends MediaCodecRenderer {
// https://github.com/google/ExoPlayer/issues/4419, // https://github.com/google/ExoPlayer/issues/4419,
// https://github.com/google/ExoPlayer/issues/4460, // https://github.com/google/ExoPlayer/issues/4460,
// https://github.com/google/ExoPlayer/issues/4468. // https://github.com/google/ExoPlayer/issues/4468.
synchronized (MediaCodecVideoRenderer.class) {
if (!evaluatedDeviceNeedsSetOutputSurfaceWorkaround) {
switch (Util.DEVICE) { switch (Util.DEVICE) {
case "1601": case "1601":
case "1713": case "1713":
...@@ -1464,6 +1469,7 @@ public class MediaCodecVideoRenderer extends MediaCodecRenderer { ...@@ -1464,6 +1469,7 @@ public class MediaCodecVideoRenderer extends MediaCodecRenderer {
// Do nothing. // Do nothing.
break; break;
} }
}
evaluatedDeviceNeedsSetOutputSurfaceWorkaround = true; evaluatedDeviceNeedsSetOutputSurfaceWorkaround = true;
} }
} }
......
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