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

Commit 38a296a6 authored by Lajos Molnar's avatar Lajos Molnar
Browse files

media: VideoCapabilities: publish codec performance data

Bug: 20507129
Change-Id: I0508bdc9aec8eeeb3ebe16ef21f58d5c0d75af4b
parent aba29b77
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -15570,6 +15570,7 @@ package android.media {
  public static final class MediaCodecInfo.VideoCapabilities {
    method public boolean areSizeAndRateSupported(int, int, double);
    method public android.util.Range<java.lang.Double> getAchievableFrameRatesFor(int, int);
    method public android.util.Range<java.lang.Integer> getBitrateRange();
    method public int getHeightAlignment();
    method public android.util.Range<java.lang.Integer> getSupportedFrameRates();
+1 −0
Original line number Diff line number Diff line
@@ -16782,6 +16782,7 @@ package android.media {
  public static final class MediaCodecInfo.VideoCapabilities {
    method public boolean areSizeAndRateSupported(int, int, double);
    method public android.util.Range<java.lang.Double> getAchievableFrameRatesFor(int, int);
    method public android.util.Range<java.lang.Integer> getBitrateRange();
    method public int getHeightAlignment();
    method public android.util.Range<java.lang.Integer> getSupportedFrameRates();
+21 −0
Original line number Diff line number Diff line
@@ -1135,6 +1135,27 @@ public final class MediaCodecInfo {
                            (double) mFrameRateRange.getUpper()));
        }

        /**
         * Returns the range of achievable video frame rates for a video size.
         * May return {@code null}, if the codec did not publish any measurement
         * data.
         * <p>
         * This is a performance estimate, based on full-speed decoding
         * and encoding measurements of common video sizes supported by the codec.
         *
         * @param width the width of the video
         * @param height the height of the video
         *
         * @throws IllegalArgumentException if the video size is not supported.
         */
        public Range<Double> getAchievableFrameRatesFor(int width, int height) {
            if (!supports(width, height, null)) {
                throw new IllegalArgumentException("unsupported size");
            }
            // TODO: get this data from the codec
            return null;
        }

        /**
         * Returns whether a given video size ({@code width} and
         * {@code height}) and {@code frameRate} combination is supported.