mirror of
https://github.com/androidx/media.git
synced 2025-05-08 08:00:49 +08:00
Add MiTV devices requiring the output surface workaround
Issue: #8014 PiperOrigin-RevId: 337142176
This commit is contained in:
parent
2b6a9a346a
commit
ec96e0c495
@ -1551,19 +1551,55 @@ public class MediaCodecVideoRenderer extends MediaCodecRenderer {
|
||||
}
|
||||
synchronized (MediaCodecVideoRenderer.class) {
|
||||
if (!evaluatedDeviceNeedsSetOutputSurfaceWorkaround) {
|
||||
if ("dangal".equals(Util.DEVICE)) {
|
||||
// Workaround for MiTV devices:
|
||||
deviceNeedsSetOutputSurfaceWorkaround = evaluateDeviceNeedsSetOutputSurfaceWorkaround();
|
||||
evaluatedDeviceNeedsSetOutputSurfaceWorkaround = true;
|
||||
}
|
||||
}
|
||||
return deviceNeedsSetOutputSurfaceWorkaround;
|
||||
}
|
||||
|
||||
protected Surface getSurface() {
|
||||
return surface;
|
||||
}
|
||||
|
||||
protected static final class CodecMaxValues {
|
||||
|
||||
public final int width;
|
||||
public final int height;
|
||||
public final int inputSize;
|
||||
|
||||
public CodecMaxValues(int width, int height, int inputSize) {
|
||||
this.width = width;
|
||||
this.height = height;
|
||||
this.inputSize = inputSize;
|
||||
}
|
||||
}
|
||||
|
||||
private static boolean evaluateDeviceNeedsSetOutputSurfaceWorkaround() {
|
||||
if (Util.SDK_INT <= 28) {
|
||||
// Workaround for MiTV devices which have been observed broken up to API 28.
|
||||
// https://github.com/google/ExoPlayer/issues/5169,
|
||||
// https://github.com/google/ExoPlayer/issues/6899.
|
||||
deviceNeedsSetOutputSurfaceWorkaround = true;
|
||||
} else if (Util.SDK_INT <= 27 && "HWEML".equals(Util.DEVICE)) {
|
||||
// https://github.com/google/ExoPlayer/issues/8014.
|
||||
switch (Util.DEVICE) {
|
||||
case "dangal":
|
||||
case "dangalUHD":
|
||||
case "dangalFHD":
|
||||
case "magnolia":
|
||||
case "machuca":
|
||||
return true;
|
||||
default:
|
||||
break; // Do nothing.
|
||||
}
|
||||
}
|
||||
if (Util.SDK_INT <= 27 && "HWEML".equals(Util.DEVICE)) {
|
||||
// Workaround for Huawei P20:
|
||||
// https://github.com/google/ExoPlayer/issues/4468#issuecomment-459291645.
|
||||
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:
|
||||
return true;
|
||||
}
|
||||
if (Util.SDK_INT <= 26) {
|
||||
// In general, devices running API level 27 or later should be unaffected unless observed
|
||||
// otherwise. Enable the workaround on a per-device basis. Works around:
|
||||
// https://github.com/google/ExoPlayer/issues/3236,
|
||||
// https://github.com/google/ExoPlayer/issues/3355,
|
||||
// https://github.com/google/ExoPlayer/issues/3439,
|
||||
@ -1579,6 +1615,7 @@ public class MediaCodecVideoRenderer extends MediaCodecRenderer {
|
||||
// https://github.com/google/ExoPlayer/issues/4468,
|
||||
// https://github.com/google/ExoPlayer/issues/5312,
|
||||
// https://github.com/google/ExoPlayer/issues/6503.
|
||||
// https://github.com/google/ExoPlayer/issues/8014.
|
||||
switch (Util.DEVICE) {
|
||||
case "1601":
|
||||
case "1713":
|
||||
@ -1665,6 +1702,7 @@ public class MediaCodecVideoRenderer extends MediaCodecRenderer {
|
||||
case "p212":
|
||||
case "P681":
|
||||
case "P85":
|
||||
case "pacificrim":
|
||||
case "panell_d":
|
||||
case "panell_dl":
|
||||
case "panell_ds":
|
||||
@ -1708,45 +1746,20 @@ public class MediaCodecVideoRenderer extends MediaCodecRenderer {
|
||||
case "XT1663":
|
||||
case "Z12_PRO":
|
||||
case "Z80":
|
||||
deviceNeedsSetOutputSurfaceWorkaround = true;
|
||||
break;
|
||||
return true;
|
||||
default:
|
||||
// Do nothing.
|
||||
break;
|
||||
break; // Do nothing.
|
||||
}
|
||||
switch (Util.MODEL) {
|
||||
case "AFTA":
|
||||
case "AFTN":
|
||||
case "JSN-L21":
|
||||
deviceNeedsSetOutputSurfaceWorkaround = true;
|
||||
break;
|
||||
return true;
|
||||
default:
|
||||
// Do nothing.
|
||||
break;
|
||||
break; // Do nothing.
|
||||
}
|
||||
}
|
||||
evaluatedDeviceNeedsSetOutputSurfaceWorkaround = true;
|
||||
}
|
||||
}
|
||||
return deviceNeedsSetOutputSurfaceWorkaround;
|
||||
}
|
||||
|
||||
protected Surface getSurface() {
|
||||
return surface;
|
||||
}
|
||||
|
||||
protected static final class CodecMaxValues {
|
||||
|
||||
public final int width;
|
||||
public final int height;
|
||||
public final int inputSize;
|
||||
|
||||
public CodecMaxValues(int width, int height, int inputSize) {
|
||||
this.width = width;
|
||||
this.height = height;
|
||||
this.inputSize = inputSize;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
@RequiresApi(23)
|
||||
|
Loading…
x
Reference in New Issue
Block a user