mirror of
https://github.com/samsonjs/media.git
synced 2026-04-09 11:55:46 +00:00
Exclude HEVC 10bit profile on Pixel 1.
This profile is declared as supported although it isn't.
Issue: google/ExoPlayer#10345
Issue: google/ExoPlayer#3537
#minor-release
PiperOrigin-RevId: 459205512
(cherry picked from commit bf88f28539)
This commit is contained in:
parent
c2ddf27715
commit
036a48dcf9
1 changed files with 14 additions and 1 deletions
|
|
@ -315,7 +315,9 @@ public final class MediaCodecInfo {
|
|||
}
|
||||
|
||||
for (CodecProfileLevel profileLevel : profileLevels) {
|
||||
if (profileLevel.profile == profile && profileLevel.level >= level) {
|
||||
if (profileLevel.profile == profile
|
||||
&& profileLevel.level >= level
|
||||
&& !needsProfileExcludedWorkaround(mimeType, profile)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
|
@ -829,4 +831,15 @@ public final class MediaCodecInfo {
|
|||
}
|
||||
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));
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue