diff --git a/media/java/android/media/MediaCodec.java b/media/java/android/media/MediaCodec.java index 1ca96583112e7..d26412789f39e 100644 --- a/media/java/android/media/MediaCodec.java +++ b/media/java/android/media/MediaCodec.java @@ -3188,9 +3188,55 @@ final public class MediaCodec { /** * Returns Analytics/Metrics data about the current content being * - * @return a Bundle containint the set of attributes and values available + * @return a Bundle containing the set of attributes and values available * for the media being handled by this instance of MediaCodec * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + *
KeyTypeDescription
{@code "codec"}StringIdentifies the particular codec in use
{@code "mime"}StringMime type of the media being encoded/decoded
{@code "mode"}String"Audio" or "Video"
{@code "secure"}IntegerIndicates whether the code is operating on secure content and + * may also use capabilities in android.media.MediaCrypto
{@code "height"}IntegerHeight (pixels); valid only when mode=video
{@code "width"}IntegerWidth (pixels); valid only when mode=video
{@code "rotation"}Integerrotation (degrees) to orient the video onto the target surface; + * valid only when mode=video. Note there may be additional + * rotations applied when the surface is mapped to the screen.
+ * + * Additional fields specific to individual codecs will also appear in + * the return value. */ public native Bundle getMetrics(); diff --git a/media/java/android/media/MediaExtractor.java b/media/java/android/media/MediaExtractor.java index 01ae36ffccfe0..b9e409d177485 100644 --- a/media/java/android/media/MediaExtractor.java +++ b/media/java/android/media/MediaExtractor.java @@ -656,6 +656,33 @@ final public class MediaExtractor { * @return the set of keys and values available for the media being * handled by this instance of MediaExtractor * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + *
KeyTypeDescription
{@code "fmt"}StringThe container format (which determines the handler)
{@code "mime"}StringMime type of the container.
{@code "ntrk"}IntegerNumber of tracks in the container
+ * + * Additional fields specific to individual codecs will also appear in + * the return value. */ public native Bundle getMetrics(); diff --git a/media/java/android/media/MediaPlayer.java b/media/java/android/media/MediaPlayer.java index 1ebbe855a43f0..edae9b865bcef 100644 --- a/media/java/android/media/MediaPlayer.java +++ b/media/java/android/media/MediaPlayer.java @@ -1493,6 +1493,64 @@ public class MediaPlayer extends PlayerBase * * @return the a map of attributes and values available for this video * player or null if no metrics are available. + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + *
KeyTypeDescription
{@code "video/codec"}StringIdentifies the video codec in use
{@code "video/mime"}StringMime type of the video being encoded/decoded
{@code "audio/codec"}StringIdentifies the audio codec in use
{@code "audio/mime"}StringMime type of the audio being encoded/decoded
{@code "ht"}IntegerHeight (pixels); valid only when mode=video
{@code "wid"}IntegerWidth (pixels); valid only when mode=video
{@code "frame"}IntegerNumber of decoded video frames sent to the display
{@code "dropped"}IntegerNumber of decoded video frames that were not sent to display. + * These frames were dropped by the player.
{@code "durationMs"}IntegerThe length of the media being played (in ms), e.g. "This video lasts for 30000 milliseconds".
{@code "playingMs"}IntegerThe time the media has been played (in ms). If you watch a + * 30 second twice through, this will report 60000 ms.
+ * + * Additional fields specific to individual codecs will also appear in + * the return value. */ public native Bundle getMetrics();