diff --git a/api/current.txt b/api/current.txt index de5486907589b..da304500b36bc 100644 --- a/api/current.txt +++ b/api/current.txt @@ -22448,6 +22448,7 @@ package android.media { ctor public MediaRecorder(); method public static final int getAudioSourceMax(); method public int getMaxAmplitude() throws java.lang.IllegalStateException; + method public android.os.Bundle getMetrics(); method public android.view.Surface getSurface(); method public void pause() throws java.lang.IllegalStateException; method public void prepare() throws java.io.IOException, java.lang.IllegalStateException; diff --git a/api/system-current.txt b/api/system-current.txt index bdf06db863fc8..ec4f80bcddc86 100644 --- a/api/system-current.txt +++ b/api/system-current.txt @@ -24068,6 +24068,7 @@ package android.media { ctor public MediaRecorder(); method public static final int getAudioSourceMax(); method public int getMaxAmplitude() throws java.lang.IllegalStateException; + method public android.os.Bundle getMetrics(); method public android.view.Surface getSurface(); method public void pause() throws java.lang.IllegalStateException; method public void prepare() throws java.io.IOException, java.lang.IllegalStateException; diff --git a/api/test-current.txt b/api/test-current.txt index 0f6502b6daeda..46e0da209e2bb 100644 --- a/api/test-current.txt +++ b/api/test-current.txt @@ -22540,6 +22540,7 @@ package android.media { ctor public MediaRecorder(); method public static final int getAudioSourceMax(); method public int getMaxAmplitude() throws java.lang.IllegalStateException; + method public android.os.Bundle getMetrics(); method public android.view.Surface getSurface(); method public void pause() throws java.lang.IllegalStateException; method public void prepare() throws java.io.IOException, java.lang.IllegalStateException; diff --git a/media/java/android/media/MediaRecorder.java b/media/java/android/media/MediaRecorder.java index 3e884509833b6..bb6fd6f6382f7 100644 --- a/media/java/android/media/MediaRecorder.java +++ b/media/java/android/media/MediaRecorder.java @@ -20,6 +20,7 @@ import android.annotation.NonNull; import android.annotation.SystemApi; import android.app.ActivityThread; import android.hardware.Camera; +import android.os.Bundle; import android.os.Handler; import android.os.Looper; import android.os.Message; @@ -1257,6 +1258,93 @@ public class MediaRecorder private native void setParameter(String nameValuePair); + /** + * Returns Metrics data about the current media container. + * + * @return the set of keys and values available for the media being + * handled by this instance of MediaExtractor. The keys, data types, + * and meaning are described in the following table. + * + *
| Key | + *Type | + *Description | + *
|---|---|---|
| {@code "ht"} | + *Integer | + *Height of the recorded video (pixels) | + *
| {@code "wid"} | + *Integer | + *Width of the recorded video (pixels) | + *
| {@code "frame-rate"} | + *Integer | + *Framerate of captured Video (frames per second) | + *
| {@code "video-bitrate"} | + *Integer | + *Bit rate of encoded video (bits per second) | + *
| {@code "video-iframe-interval"} | + *Integer | + *Interval between encoded IFrames (seconds) | + *
| {@code "video-timescale"} | + *Integer | + *+ * |
| {@code "video-encoder-profile"} | + *Integer | + *Video Encoder Profile, as defined in OpenMAX IL | + *
| {@code "video-encoder-level"} | + *Integer | + *Video Encoder Level, as defined in OpenMAX IL | + *
| {@code "audio-bitrate"} | + *Integer | + *Bitrate of encoded audio (bits per second) | + *
| {@code "audio-samplerate"} | + *Integer | + *+ * |
| {@code "audio-channels"} | + *Integer | + *Number of Audio Channels Captured | + *
| {@code "audio-timescale"} | + *Integer | + *+ * |
| {@code "movie-timescale"} | + *Integer | + *+ * |
| {@code "movie-timescale"} | + *Integer | + *+ * |
| {@code "capture-fps"} | + *Integer | + *+ * |
| {@code "rotation"} | + *Integer | + *Orientation of the Video (degrees) | + *