summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLajos Molnar <lajos@google.com>2014-11-22 05:59:29 +0000
committerAndroid (Google) Code Review <android-gerrit@google.com>2014-11-22 05:59:31 +0000
commitc398f175cdc2ceb31bc45b6541f7cd9c3c52406a (patch)
tree93c58ff9bf3778dd8bd0f437fa04538ec90940cd
parentdfa99f63677c238453293f48b62b4fffcc101262 (diff)
parenta4fcb62a224eca99d53b1692d1cc5ae5ff2d2127 (diff)
downloadframeworks_base-c398f175cdc2ceb31bc45b6541f7cd9c3c52406a.zip
frameworks_base-c398f175cdc2ceb31bc45b6541f7cd9c3c52406a.tar.gz
frameworks_base-c398f175cdc2ceb31bc45b6541f7cd9c3c52406a.tar.bz2
Merge "media: fix isSupportedFormat for integer frame rate" into lmp-mr1-dev
-rw-r--r--media/java/android/media/MediaCodecInfo.java8
1 files changed, 4 insertions, 4 deletions
diff --git a/media/java/android/media/MediaCodecInfo.java b/media/java/android/media/MediaCodecInfo.java
index 01f8193..1029fcc 100644
--- a/media/java/android/media/MediaCodecInfo.java
+++ b/media/java/android/media/MediaCodecInfo.java
@@ -973,7 +973,7 @@ public final class MediaCodecInfo {
}
private boolean supports(
- Integer width, Integer height, Double rate) {
+ Integer width, Integer height, Number rate) {
boolean ok = true;
if (ok && width != null) {
@@ -985,7 +985,7 @@ public final class MediaCodecInfo {
&& (height % mHeightAlignment == 0);
}
if (ok && rate != null) {
- ok = mFrameRateRange.contains(Utils.intRangeFor(rate));
+ ok = mFrameRateRange.contains(Utils.intRangeFor(rate.doubleValue()));
}
if (ok && height != null && width != null) {
ok = Math.min(height, width) <= mSmallerDimensionUpperLimit;
@@ -998,7 +998,7 @@ public final class MediaCodecInfo {
new Rational(widthInBlocks, heightInBlocks))
&& mAspectRatioRange.contains(new Rational(width, height));
if (ok && rate != null) {
- double blocksPerSec = blockCount * rate;
+ double blocksPerSec = blockCount * rate.doubleValue();
ok = mBlocksPerSecondRange.contains(
Utils.longRangeFor(blocksPerSec));
}
@@ -1013,7 +1013,7 @@ public final class MediaCodecInfo {
final Map<String, Object> map = format.getMap();
Integer width = (Integer)map.get(MediaFormat.KEY_WIDTH);
Integer height = (Integer)map.get(MediaFormat.KEY_HEIGHT);
- Double rate = (Double)map.get(MediaFormat.KEY_FRAME_RATE);
+ Number rate = (Number)map.get(MediaFormat.KEY_FRAME_RATE);
// we ignore color-format for now as it is not reliably reported by codec