VideoCapabilities: account for block size for getAchievableRates

Bug: 25597057
Change-Id: I1a01e4b466e2b70cebf55179c83806fe269a31ee
This commit is contained in:
Lajos Molnar
2016-04-26 11:32:41 -07:00
parent 987609f5a7
commit 7a2ab16b65

View File

@@ -1247,7 +1247,8 @@ public final class MediaCodecInfo {
private Range<Double> estimateFrameRatesFor(int width, int height) {
Size size = findClosestSize(width, height);
Range<Long> range = mMeasuredFrameRates.get(size);
Double ratio = (double)(size.getWidth() * size.getHeight()) / (width * height);
Double ratio = getBlockCount(size.getWidth(), size.getHeight())
/ (double)Math.max(getBlockCount(width, height), 1);
return Range.create(range.getLower() * ratio, range.getUpper() * ratio);
}