Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 7d612f0d authored by Lajos Molnar's avatar Lajos Molnar Committed by Android Git Automerger
Browse files

am 0b10f9c0: am 63845f1b: am c398f175: Merge "media: fix isSupportedFormat for...

am 0b10f9c0: am 63845f1b: am c398f175: Merge "media: fix isSupportedFormat for integer frame rate" into lmp-mr1-dev

* commit '0b10f9c0':
  media: fix isSupportedFormat for integer frame rate
parents a48e26bb 0b10f9c0
Loading
Loading
Loading
Loading
+4 −4
Original line number Diff line number Diff line
@@ -974,7 +974,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) {
@@ -986,7 +986,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;
@@ -999,7 +999,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));
                }
@@ -1014,7 +1014,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