Skip to content

Commit

Permalink
Fall back to AVC/HEVC for Dolby Vision levels 10-13
Browse files Browse the repository at this point in the history
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
#minor-release
PiperOrigin-RevId: 355574499
  • Loading branch information
kim-vde committed Feb 4, 2021
1 parent e345e0a commit 35d34af
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 1 deletion.
3 changes: 3 additions & 0 deletions RELEASENOTES.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@
* Core library:
* Log a warning when `SingleSampleMediaPeriod` transforms a load error
into end-of-stream.
* Fall back to AVC/HEVC decoders for Dolby Vision streams with level 10
to 13
([#8530](https://github.com/google/ExoPlayer/issues/8530)).
* UI:
* Add builder for `PlayerNotificationManager`.
* Extractors:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ public static DolbyVisionConfig parse(ParsableByteArray data) {
} else {
return null;
}
String codecs = codecsPrefix + ".0" + dvProfile + ".0" + dvLevel;
String codecs = codecsPrefix + ".0" + dvProfile + (dvLevel < 10 ? ".0" : ".") + dvLevel;
return new DolbyVisionConfig(dvProfile, dvLevel, codecs);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1272,6 +1272,7 @@ private static Integer dolbyVisionStringToLevel(@Nullable String levelString) {
if (levelString == null) {
return null;
}
// TODO (Internal: b/179261323): use framework constants for levels 10 to 13.
switch (levelString) {
case "01":
return CodecProfileLevel.DolbyVisionLevelHd24;
Expand All @@ -1291,6 +1292,14 @@ private static Integer dolbyVisionStringToLevel(@Nullable String levelString) {
return CodecProfileLevel.DolbyVisionLevelUhd48;
case "09":
return CodecProfileLevel.DolbyVisionLevelUhd60;
case "10":
return 0x200;
case "11":
return 0x400;
case "12":
return 0x800;
case "13":
return 0x1000;
default:
return null;
}
Expand Down

0 comments on commit 35d34af

Please sign in to comment.