mirror of
https://github.com/androidx/media.git
synced 2025-05-12 10:09:55 +08:00
Assume support for vertical video if rotated resolution supported
Issue: #2034 ------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=140209306
This commit is contained in:
parent
ee9b7be2fa
commit
2e3ffe1e94
@ -153,8 +153,14 @@ public final class MediaCodecInfo {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
if (!videoCapabilities.isSizeSupported(width, height)) {
|
if (!videoCapabilities.isSizeSupported(width, height)) {
|
||||||
logNoSupport("size.support, " + width + "x" + height);
|
// Capabilities are known to be inaccurately reported for vertical resolutions on some devices
|
||||||
return false;
|
// (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 || !videoCapabilities.isSizeSupported(height, width)) {
|
||||||
|
logNoSupport("size.support, " + width + "x" + height);
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
logAssumedSupport("size.rotated, " + width + "x" + height);
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@ -181,8 +187,14 @@ public final class MediaCodecInfo {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
if (!videoCapabilities.areSizeAndRateSupported(width, height, frameRate)) {
|
if (!videoCapabilities.areSizeAndRateSupported(width, height, frameRate)) {
|
||||||
logNoSupport("sizeAndRate.support, " + width + "x" + height + "x" + frameRate);
|
// Capabilities are known to be inaccurately reported for vertical resolutions on some devices
|
||||||
return false;
|
// (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 || !videoCapabilities.areSizeAndRateSupported(height, width, frameRate)) {
|
||||||
|
logNoSupport("sizeAndRate.support, " + width + "x" + height + "x" + frameRate);
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
logAssumedSupport("sizeAndRate.rotated, " + width + "x" + height + "x" + frameRate);
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@ -240,7 +252,12 @@ public final class MediaCodecInfo {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void logNoSupport(String message) {
|
private void logNoSupport(String message) {
|
||||||
Log.d(TAG, "FalseCheck [" + message + "] [" + name + ", " + mimeType + "] ["
|
Log.d(TAG, "NoSupport [" + message + "] [" + name + ", " + mimeType + "] ["
|
||||||
|
+ Util.DEVICE_DEBUG_INFO + "]");
|
||||||
|
}
|
||||||
|
|
||||||
|
private void logAssumedSupport(String message) {
|
||||||
|
Log.d(TAG, "AssumedSupport [" + message + "] [" + name + ", " + mimeType + "] ["
|
||||||
+ Util.DEVICE_DEBUG_INFO + "]");
|
+ Util.DEVICE_DEBUG_INFO + "]");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user