Enable setOutputSurfaceWorkaround for dangal

Issue: #5169
PiperOrigin-RevId: 225025357
This commit is contained in:
olly 2018-12-11 18:19:07 +00:00 committed by Oliver Woodman
parent defbd04675
commit 05bfeca50b
2 changed files with 161 additions and 153 deletions

View File

@ -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 ###

View File

@ -1306,163 +1306,169 @@ 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:
// https://github.com/google/ExoPlayer/issues/3236,
// https://github.com/google/ExoPlayer/issues/3355,
// https://github.com/google/ExoPlayer/issues/3439,
// https://github.com/google/ExoPlayer/issues/3724,
// https://github.com/google/ExoPlayer/issues/3835,
// https://github.com/google/ExoPlayer/issues/4006,
// https://github.com/google/ExoPlayer/issues/4084,
// https://github.com/google/ExoPlayer/issues/4104,
// https://github.com/google/ExoPlayer/issues/4134,
// https://github.com/google/ExoPlayer/issues/4315,
// https://github.com/google/ExoPlayer/issues/4419,
// https://github.com/google/ExoPlayer/issues/4460,
// https://github.com/google/ExoPlayer/issues/4468.
synchronized (MediaCodecVideoRenderer.class) { synchronized (MediaCodecVideoRenderer.class) {
if (!evaluatedDeviceNeedsSetOutputSurfaceWorkaround) { if (!evaluatedDeviceNeedsSetOutputSurfaceWorkaround) {
switch (Util.DEVICE) { if (Util.SDK_INT <= 27 && "dangal".equals(Util.DEVICE)) {
case "1601": // Dangal is affected on API level 27: https://github.com/google/ExoPlayer/issues/5169.
case "1713": deviceNeedsSetOutputSurfaceWorkaround = true;
case "1714": } else if (Util.SDK_INT >= 27) {
case "A10-70F": // In general, devices running API level 27 or later should be unaffected. Do nothing.
case "A1601": } else {
case "A2016a40": // Enable the workaround on a per-device basis. Works around:
case "A7000-a": // https://github.com/google/ExoPlayer/issues/3236,
case "A7000plus": // https://github.com/google/ExoPlayer/issues/3355,
case "A7010a48": // https://github.com/google/ExoPlayer/issues/3439,
case "A7020a48": // https://github.com/google/ExoPlayer/issues/3724,
case "AquaPowerM": // https://github.com/google/ExoPlayer/issues/3835,
case "ASUS_X00AD_2": // https://github.com/google/ExoPlayer/issues/4006,
case "Aura_Note_2": // https://github.com/google/ExoPlayer/issues/4084,
case "BLACK-1X": // https://github.com/google/ExoPlayer/issues/4104,
case "BRAVIA_ATV2": // https://github.com/google/ExoPlayer/issues/4134,
case "C1": // https://github.com/google/ExoPlayer/issues/4315,
case "ComioS1": // https://github.com/google/ExoPlayer/issues/4419,
case "CP8676_I02": // https://github.com/google/ExoPlayer/issues/4460,
case "CPH1609": // https://github.com/google/ExoPlayer/issues/4468.
case "CPY83_I00": switch (Util.DEVICE) {
case "cv1": case "1601":
case "cv3": case "1713":
case "deb": case "1714":
case "E5643": case "A10-70F":
case "ELUGA_A3_Pro": case "A1601":
case "ELUGA_Note": case "A2016a40":
case "ELUGA_Prim": case "A7000-a":
case "ELUGA_Ray_X": case "A7000plus":
case "EverStar_S": case "A7010a48":
case "F3111": case "A7020a48":
case "F3113": case "AquaPowerM":
case "F3116": case "ASUS_X00AD_2":
case "F3211": case "Aura_Note_2":
case "F3213": case "BLACK-1X":
case "F3215": case "BRAVIA_ATV2":
case "F3311": case "C1":
case "flo": case "ComioS1":
case "GiONEE_CBL7513": case "CP8676_I02":
case "GiONEE_GBL7319": case "CPH1609":
case "GIONEE_GBL7360": case "CPY83_I00":
case "GIONEE_SWW1609": case "cv1":
case "GIONEE_SWW1627": case "cv3":
case "GIONEE_SWW1631": case "deb":
case "GIONEE_WBL5708": case "E5643":
case "GIONEE_WBL7365": case "ELUGA_A3_Pro":
case "GIONEE_WBL7519": case "ELUGA_Note":
case "griffin": case "ELUGA_Prim":
case "htc_e56ml_dtul": case "ELUGA_Ray_X":
case "hwALE-H": case "EverStar_S":
case "HWBLN-H": case "F3111":
case "HWCAM-H": case "F3113":
case "HWVNS-H": case "F3116":
case "i9031": case "F3211":
case "iball8735_9806": case "F3213":
case "Infinix-X572": case "F3215":
case "iris60": case "F3311":
case "itel_S41": case "flo":
case "j2xlteins": case "GiONEE_CBL7513":
case "JGZ": case "GiONEE_GBL7319":
case "K50a40": case "GIONEE_GBL7360":
case "kate": case "GIONEE_SWW1609":
case "le_x6": case "GIONEE_SWW1627":
case "LS-5017": case "GIONEE_SWW1631":
case "M5c": case "GIONEE_WBL5708":
case "manning": case "GIONEE_WBL7365":
case "marino_f": case "GIONEE_WBL7519":
case "MEIZU_M5": case "griffin":
case "mh": case "htc_e56ml_dtul":
case "mido": case "hwALE-H":
case "MX6": case "HWBLN-H":
case "namath": case "HWCAM-H":
case "nicklaus_f": case "HWVNS-H":
case "NX541J": case "i9031":
case "NX573J": case "iball8735_9806":
case "OnePlus5T": case "Infinix-X572":
case "p212": case "iris60":
case "P681": case "itel_S41":
case "P85": case "j2xlteins":
case "panell_d": case "JGZ":
case "panell_dl": case "K50a40":
case "panell_ds": case "kate":
case "panell_dt": case "le_x6":
case "PB2-670M": case "LS-5017":
case "PGN528": case "M5c":
case "PGN610": case "manning":
case "PGN611": case "marino_f":
case "Phantom6": case "MEIZU_M5":
case "Pixi4-7_3G": case "mh":
case "Pixi5-10_4G": case "mido":
case "PLE": case "MX6":
case "PRO7S": case "namath":
case "Q350": case "nicklaus_f":
case "Q4260": case "NX541J":
case "Q427": case "NX573J":
case "Q4310": case "OnePlus5T":
case "Q5": case "p212":
case "QM16XE_U": case "P681":
case "QX1": case "P85":
case "santoni": case "panell_d":
case "Slate_Pro": case "panell_dl":
case "SVP-DTV15": case "panell_ds":
case "s905x018": case "panell_dt":
case "taido_row": case "PB2-670M":
case "TB3-730F": case "PGN528":
case "TB3-730X": case "PGN610":
case "TB3-850F": case "PGN611":
case "TB3-850M": case "Phantom6":
case "tcl_eu": case "Pixi4-7_3G":
case "V1": case "Pixi5-10_4G":
case "V23GB": case "PLE":
case "V5": case "PRO7S":
case "vernee_M5": case "Q350":
case "watson": case "Q4260":
case "whyred": case "Q427":
case "woods_f": case "Q4310":
case "woods_fn": case "Q5":
case "X3_HK": case "QM16XE_U":
case "XE2X": case "QX1":
case "XT1663": case "santoni":
case "Z12_PRO": case "Slate_Pro":
case "Z80": case "SVP-DTV15":
deviceNeedsSetOutputSurfaceWorkaround = true; case "s905x018":
break; case "taido_row":
default: case "TB3-730F":
// Do nothing. case "TB3-730X":
break; case "TB3-850F":
} case "TB3-850M":
switch (Util.MODEL) { case "tcl_eu":
case "AFTA": case "V1":
case "AFTN": case "V23GB":
deviceNeedsSetOutputSurfaceWorkaround = true; case "V5":
break; case "vernee_M5":
default: case "watson":
// Do nothing. case "whyred":
break; case "woods_f":
case "woods_fn":
case "X3_HK":
case "XE2X":
case "XT1663":
case "Z12_PRO":
case "Z80":
deviceNeedsSetOutputSurfaceWorkaround = true;
break;
default:
// Do nothing.
break;
}
switch (Util.MODEL) {
case "AFTA":
case "AFTN":
deviceNeedsSetOutputSurfaceWorkaround = true;
break;
default:
// Do nothing.
break;
}
} }
evaluatedDeviceNeedsSetOutputSurfaceWorkaround = true; evaluatedDeviceNeedsSetOutputSurfaceWorkaround = true;
} }