mirror of
https://github.com/samsonjs/media.git
synced 2026-03-28 09:55:48 +00:00
Don't check rotated resolution for HEVC on LG Q7
Issue: #6612 PiperOrigin-RevId: 281048324
This commit is contained in:
parent
8c848a2a53
commit
09df3a013c
1 changed files with 18 additions and 3 deletions
|
|
@ -405,10 +405,8 @@ public final class MediaCodecInfo {
|
|||
return false;
|
||||
}
|
||||
if (!areSizeAndRateSupportedV21(videoCapabilities, width, height, frameRate)) {
|
||||
// Capabilities are known to be inaccurately reported for vertical resolutions on some devices
|
||||
// (b/31387661). If the video is vertical and the capabilities indicate support if the width
|
||||
// and height are swapped, we assume that the vertical resolution is also supported.
|
||||
if (width >= height
|
||||
|| !enableRotatedVerticalResolutionWorkaround(name)
|
||||
|| !areSizeAndRateSupportedV21(videoCapabilities, height, width, frameRate)) {
|
||||
logNoSupport("sizeAndRate.support, " + width + "x" + height + "x" + frameRate);
|
||||
return false;
|
||||
|
|
@ -599,4 +597,21 @@ public final class MediaCodecInfo {
|
|||
private static int getMaxSupportedInstancesV23(CodecCapabilities capabilities) {
|
||||
return capabilities.getMaxSupportedInstances();
|
||||
}
|
||||
|
||||
/**
|
||||
* Capabilities are known to be inaccurately reported for vertical resolutions on some devices.
|
||||
* [Internal ref: b/31387661]. When this workaround is enabled, we also check whether the
|
||||
* capabilities indicate support if the width and height are swapped. If they do, we assume that
|
||||
* the vertical resolution is also supported.
|
||||
*
|
||||
* @param name The name of the codec.
|
||||
* @return Whether to enable the workaround.
|
||||
*/
|
||||
private static final boolean enableRotatedVerticalResolutionWorkaround(String name) {
|
||||
if ("OMX.MTK.VIDEO.DECODER.HEVC".equals(name) && "mcv5a".equals(Util.DEVICE)) {
|
||||
// See https://github.com/google/ExoPlayer/issues/6612.
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue