Skip to content

Commit

Permalink
Exclude HEVC 10bit profile on Pixel 1.
Browse files Browse the repository at this point in the history
This profile is declared as supported although it isn't.

Issue: #10345
Issue: #3537

#minor-release

PiperOrigin-RevId: 459205512
  • Loading branch information
tonihei authored and rohitjoins committed Jul 7, 2022
1 parent 84c801a commit bf88f28
Showing 1 changed file with 14 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -315,7 +315,9 @@ private boolean isCodecProfileAndLevelSupported(Format format) {
}

for (CodecProfileLevel profileLevel : profileLevels) {
if (profileLevel.profile == profile && profileLevel.level >= level) {
if (profileLevel.profile == profile
&& profileLevel.level >= level
&& !needsProfileExcludedWorkaround(mimeType, profile)) {
return true;
}
}
Expand Down Expand Up @@ -829,4 +831,15 @@ private static final boolean needsRotatedVerticalResolutionWorkaround(String nam
}
return true;
}

/**
* Whether a profile is excluded from the list of supported profiles. This may happen when a
* device declares support for a profile it doesn't actually support.
*/
private static boolean needsProfileExcludedWorkaround(String mimeType, int profile) {
// See https://github.com/google/ExoPlayer/issues/3537
return MimeTypes.VIDEO_H265.equals(mimeType)
&& CodecProfileLevel.HEVCProfileMain10 == profile
&& ("sailfish".equals(Util.DEVICE) || "marlin".equals(Util.DEVICE));
}
}

0 comments on commit bf88f28

Please sign in to comment.