summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Lajos Molnar <lajos@google.com> 2015-04-23 00:57:36 -0700
committer Lajos Molnar <lajos@google.com> 2015-04-23 01:02:39 -0700
commit38a296a65f89b0b16a717fe29f583db21e5c46df (patch)
treec0426cff5341618618cd4697f5b3fd7aca835ed8
parentaba29b77a5742fc920ec62dbc9ddb6f025759d65 (diff)
media: VideoCapabilities: publish codec performance data
Bug: 20507129 Change-Id: I0508bdc9aec8eeeb3ebe16ef21f58d5c0d75af4b
-rw-r--r--api/current.txt1
-rw-r--r--api/system-current.txt1
-rw-r--r--media/java/android/media/MediaCodecInfo.java21
3 files changed, 23 insertions, 0 deletions
diff --git a/api/current.txt b/api/current.txt
index 09ef131e04ff..dee68744ed95 100644
--- a/api/current.txt
+++ b/api/current.txt
@@ -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();
diff --git a/api/system-current.txt b/api/system-current.txt
index 26a06c352ef9..e38d91bdad93 100644
--- a/api/system-current.txt
+++ b/api/system-current.txt
@@ -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();
diff --git a/media/java/android/media/MediaCodecInfo.java b/media/java/android/media/MediaCodecInfo.java
index b497001b6d3d..ff1b57d54aaf 100644
--- a/media/java/android/media/MediaCodecInfo.java
+++ b/media/java/android/media/MediaCodecInfo.java
@@ -1136,6 +1136,27 @@ public final class MediaCodecInfo {
}
/**
+ * 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.
*/