Fall back to AVC/HEVC for Dolby Vision levels 10-13

Before, the level was set to null in this case.
MediaCodecUtil.getCodecProfileAndLevel() was therefore returning null
and the fallback to AVC/HEVC was not enabled in MediaCodecVideoRenderer.

Issue:#8530
PiperOrigin-RevId: 355574499
This commit is contained in:
kimvde 2021-02-04 09:16:43 +00:00 committed by Oliver Woodman
parent 74ade6fcda
commit 045048f6f5
2 changed files with 10 additions and 1 deletions

View File

@ -45,7 +45,7 @@ public final class DolbyVisionConfig {
} else { } else {
return null; return null;
} }
String codecs = codecsPrefix + ".0" + dvProfile + ".0" + dvLevel; String codecs = codecsPrefix + ".0" + dvProfile + (dvLevel < 10 ? ".0" : ".") + dvLevel;
return new DolbyVisionConfig(dvProfile, dvLevel, codecs); return new DolbyVisionConfig(dvProfile, dvLevel, codecs);
} }

View File

@ -1272,6 +1272,7 @@ public final class MediaCodecUtil {
if (levelString == null) { if (levelString == null) {
return null; return null;
} }
// TODO (Internal: b/179261323): use framework constants for levels 10 to 13.
switch (levelString) { switch (levelString) {
case "01": case "01":
return CodecProfileLevel.DolbyVisionLevelHd24; return CodecProfileLevel.DolbyVisionLevelHd24;
@ -1291,6 +1292,14 @@ public final class MediaCodecUtil {
return CodecProfileLevel.DolbyVisionLevelUhd48; return CodecProfileLevel.DolbyVisionLevelUhd48;
case "09": case "09":
return CodecProfileLevel.DolbyVisionLevelUhd60; return CodecProfileLevel.DolbyVisionLevelUhd60;
case "10":
return 0x200;
case "11":
return 0x400;
case "12":
return 0x800;
case "13":
return 0x1000;
default: default:
return null; return null;
} }