mirror of
https://github.com/androidx/media.git
synced 2025-05-08 16:10:38 +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) {
|
synchronized (MediaCodecVideoRenderer.class) {
|
||||||
if (!evaluatedDeviceNeedsSetOutputSurfaceWorkaround) {
|
if (!evaluatedDeviceNeedsSetOutputSurfaceWorkaround) {
|
||||||
if ("dangal".equals(Util.DEVICE)) {
|
deviceNeedsSetOutputSurfaceWorkaround = evaluateDeviceNeedsSetOutputSurfaceWorkaround();
|
||||||
// Workaround for MiTV devices:
|
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/5169,
|
||||||
// https://github.com/google/ExoPlayer/issues/6899.
|
// https://github.com/google/ExoPlayer/issues/6899.
|
||||||
deviceNeedsSetOutputSurfaceWorkaround = true;
|
// https://github.com/google/ExoPlayer/issues/8014.
|
||||||
} else if (Util.SDK_INT <= 27 && "HWEML".equals(Util.DEVICE)) {
|
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:
|
// Workaround for Huawei P20:
|
||||||
// https://github.com/google/ExoPlayer/issues/4468#issuecomment-459291645.
|
// https://github.com/google/ExoPlayer/issues/4468#issuecomment-459291645.
|
||||||
deviceNeedsSetOutputSurfaceWorkaround = true;
|
return true;
|
||||||
} else if (Util.SDK_INT >= 27) {
|
}
|
||||||
// In general, devices running API level 27 or later should be unaffected. Do nothing.
|
if (Util.SDK_INT <= 26) {
|
||||||
} else {
|
// In general, devices running API level 27 or later should be unaffected unless observed
|
||||||
// Enable the workaround on a per-device basis. Works around:
|
// otherwise. 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,
|
||||||
@ -1579,6 +1615,7 @@ public class MediaCodecVideoRenderer extends MediaCodecRenderer {
|
|||||||
// https://github.com/google/ExoPlayer/issues/4468,
|
// https://github.com/google/ExoPlayer/issues/4468,
|
||||||
// https://github.com/google/ExoPlayer/issues/5312,
|
// https://github.com/google/ExoPlayer/issues/5312,
|
||||||
// https://github.com/google/ExoPlayer/issues/6503.
|
// https://github.com/google/ExoPlayer/issues/6503.
|
||||||
|
// https://github.com/google/ExoPlayer/issues/8014.
|
||||||
switch (Util.DEVICE) {
|
switch (Util.DEVICE) {
|
||||||
case "1601":
|
case "1601":
|
||||||
case "1713":
|
case "1713":
|
||||||
@ -1665,6 +1702,7 @@ public class MediaCodecVideoRenderer extends MediaCodecRenderer {
|
|||||||
case "p212":
|
case "p212":
|
||||||
case "P681":
|
case "P681":
|
||||||
case "P85":
|
case "P85":
|
||||||
|
case "pacificrim":
|
||||||
case "panell_d":
|
case "panell_d":
|
||||||
case "panell_dl":
|
case "panell_dl":
|
||||||
case "panell_ds":
|
case "panell_ds":
|
||||||
@ -1708,45 +1746,20 @@ public class MediaCodecVideoRenderer extends MediaCodecRenderer {
|
|||||||
case "XT1663":
|
case "XT1663":
|
||||||
case "Z12_PRO":
|
case "Z12_PRO":
|
||||||
case "Z80":
|
case "Z80":
|
||||||
deviceNeedsSetOutputSurfaceWorkaround = true;
|
return true;
|
||||||
break;
|
|
||||||
default:
|
default:
|
||||||
// Do nothing.
|
break; // Do nothing.
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
switch (Util.MODEL) {
|
switch (Util.MODEL) {
|
||||||
case "AFTA":
|
case "AFTA":
|
||||||
case "AFTN":
|
case "AFTN":
|
||||||
case "JSN-L21":
|
case "JSN-L21":
|
||||||
deviceNeedsSetOutputSurfaceWorkaround = true;
|
return true;
|
||||||
break;
|
|
||||||
default:
|
default:
|
||||||
// Do nothing.
|
break; // Do nothing.
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
evaluatedDeviceNeedsSetOutputSurfaceWorkaround = true;
|
return false;
|
||||||
}
|
|
||||||
}
|
|
||||||
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;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@RequiresApi(23)
|
@RequiresApi(23)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user