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

Commit 38946757 authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Add @Nullable to MediaMetadataRetriever methods"

parents 41c5b259 3328535d
Loading
Loading
Loading
Loading
+14 −14
Original line number Diff line number Diff line
@@ -25420,22 +25420,22 @@ package android.media {
  public class MediaMetadataRetriever implements java.lang.AutoCloseable {
    ctor public MediaMetadataRetriever();
    method public void close();
    method public String extractMetadata(int);
    method public byte[] getEmbeddedPicture();
    method public android.graphics.Bitmap getFrameAtIndex(int, @NonNull android.media.MediaMetadataRetriever.BitmapParams);
    method public android.graphics.Bitmap getFrameAtIndex(int);
    method public android.graphics.Bitmap getFrameAtTime(long, int);
    method public android.graphics.Bitmap getFrameAtTime(long, int, @NonNull android.media.MediaMetadataRetriever.BitmapParams);
    method public android.graphics.Bitmap getFrameAtTime(long);
    method public android.graphics.Bitmap getFrameAtTime();
    method @Nullable public String extractMetadata(int);
    method @Nullable public byte[] getEmbeddedPicture();
    method @Nullable public android.graphics.Bitmap getFrameAtIndex(int, @NonNull android.media.MediaMetadataRetriever.BitmapParams);
    method @Nullable public android.graphics.Bitmap getFrameAtIndex(int);
    method @Nullable public android.graphics.Bitmap getFrameAtTime(long, int);
    method @Nullable public android.graphics.Bitmap getFrameAtTime(long, int, @NonNull android.media.MediaMetadataRetriever.BitmapParams);
    method @Nullable public android.graphics.Bitmap getFrameAtTime(long);
    method @Nullable public android.graphics.Bitmap getFrameAtTime();
    method @NonNull public java.util.List<android.graphics.Bitmap> getFramesAtIndex(int, int, @NonNull android.media.MediaMetadataRetriever.BitmapParams);
    method @NonNull public java.util.List<android.graphics.Bitmap> getFramesAtIndex(int, int);
    method public android.graphics.Bitmap getImageAtIndex(int, @NonNull android.media.MediaMetadataRetriever.BitmapParams);
    method public android.graphics.Bitmap getImageAtIndex(int);
    method public android.graphics.Bitmap getPrimaryImage(@NonNull android.media.MediaMetadataRetriever.BitmapParams);
    method public android.graphics.Bitmap getPrimaryImage();
    method public android.graphics.Bitmap getScaledFrameAtTime(long, int, int, int);
    method public android.graphics.Bitmap getScaledFrameAtTime(long, int, int, int, @NonNull android.media.MediaMetadataRetriever.BitmapParams);
    method @Nullable public android.graphics.Bitmap getImageAtIndex(int, @NonNull android.media.MediaMetadataRetriever.BitmapParams);
    method @Nullable public android.graphics.Bitmap getImageAtIndex(int);
    method @Nullable public android.graphics.Bitmap getPrimaryImage(@NonNull android.media.MediaMetadataRetriever.BitmapParams);
    method @Nullable public android.graphics.Bitmap getPrimaryImage();
    method @Nullable public android.graphics.Bitmap getScaledFrameAtTime(long, int, int, int);
    method @Nullable public android.graphics.Bitmap getScaledFrameAtTime(long, int, int, int, @NonNull android.media.MediaMetadataRetriever.BitmapParams);
    method public void release();
    method public void setDataSource(String) throws java.lang.IllegalArgumentException;
    method public void setDataSource(String, java.util.Map<java.lang.String,java.lang.String>) throws java.lang.IllegalArgumentException;
+14 −14
Original line number Diff line number Diff line
@@ -224,7 +224,7 @@ public class MediaMetadataRetriever implements AutoCloseable {
     * @return The meta data value associate with the given keyCode on success;
     * null on failure.
     */
    public native String extractMetadata(int keyCode);
    public native @Nullable String extractMetadata(int keyCode);

    /**
     * This method is similar to {@link #getFrameAtTime(long, int, BitmapParams)}
@@ -255,7 +255,7 @@ public class MediaMetadataRetriever implements AutoCloseable {
     *
     * @see {@link #getFrameAtTime(long, int, BitmapParams)}
     */
    public Bitmap getFrameAtTime(long timeUs, @Option int option) {
    public @Nullable Bitmap getFrameAtTime(long timeUs, @Option int option) {
        if (option < OPTION_PREVIOUS_SYNC ||
            option > OPTION_CLOSEST) {
            throw new IllegalArgumentException("Unsupported option: " + option);
@@ -301,7 +301,7 @@ public class MediaMetadataRetriever implements AutoCloseable {
     *
     * @see {@link #getFrameAtTime(long, int)}
     */
    public Bitmap getFrameAtTime(
    public @Nullable Bitmap getFrameAtTime(
            long timeUs, @Option int option, @NonNull BitmapParams params) {
        if (option < OPTION_PREVIOUS_SYNC ||
            option > OPTION_CLOSEST) {
@@ -343,7 +343,7 @@ public class MediaMetadataRetriever implements AutoCloseable {
     *         is less than or equal to 0.
     * @see {@link #getScaledFrameAtTime(long, int, int, int, BitmapParams)}
     */
    public Bitmap getScaledFrameAtTime(
    public @Nullable Bitmap getScaledFrameAtTime(
            long timeUs, @Option int option, int dstWidth, int dstHeight) {
        validate(option, dstWidth, dstHeight);
        return _getFrameAtTime(timeUs, option, dstWidth, dstHeight, null);
@@ -388,7 +388,7 @@ public class MediaMetadataRetriever implements AutoCloseable {
     *         is less than or equal to 0.
     * @see {@link #getScaledFrameAtTime(long, int, int, int)}
     */
    public Bitmap getScaledFrameAtTime(long timeUs, @Option int option,
    public @Nullable Bitmap getScaledFrameAtTime(long timeUs, @Option int option,
            int dstWidth, int dstHeight, @NonNull BitmapParams params) {
        validate(option, dstWidth, dstHeight);
        return _getFrameAtTime(timeUs, option, dstWidth, dstHeight, params);
@@ -430,7 +430,7 @@ public class MediaMetadataRetriever implements AutoCloseable {
     *
     * @see #getFrameAtTime(long, int)
     */
    public Bitmap getFrameAtTime(long timeUs) {
    public @Nullable Bitmap getFrameAtTime(long timeUs) {
        return getFrameAtTime(timeUs, OPTION_CLOSEST_SYNC);
    }

@@ -452,7 +452,7 @@ public class MediaMetadataRetriever implements AutoCloseable {
     * @see #getFrameAtTime(long)
     * @see #getFrameAtTime(long, int)
     */
    public Bitmap getFrameAtTime() {
    public @Nullable Bitmap getFrameAtTime() {
        return _getFrameAtTime(
                -1, OPTION_CLOSEST_SYNC, -1 /*dst_width*/, -1 /*dst_height*/, null);
    }
@@ -528,7 +528,7 @@ public class MediaMetadataRetriever implements AutoCloseable {
     * @see #getFramesAtIndex(int, int, BitmapParams)
     * @see #getFramesAtIndex(int, int)
     */
    public Bitmap getFrameAtIndex(int frameIndex, @NonNull BitmapParams params) {
    public @Nullable Bitmap getFrameAtIndex(int frameIndex, @NonNull BitmapParams params) {
        List<Bitmap> bitmaps = getFramesAtIndex(frameIndex, 1, params);
        return bitmaps.get(0);
    }
@@ -550,7 +550,7 @@ public class MediaMetadataRetriever implements AutoCloseable {
     * @see #getFramesAtIndex(int, int, BitmapParams)
     * @see #getFramesAtIndex(int, int)
     */
    public Bitmap getFrameAtIndex(int frameIndex) {
    public @Nullable Bitmap getFrameAtIndex(int frameIndex) {
        List<Bitmap> bitmaps = getFramesAtIndex(frameIndex, 1);
        return bitmaps.get(0);
    }
@@ -653,7 +653,7 @@ public class MediaMetadataRetriever implements AutoCloseable {
     * @see #getPrimaryImage(BitmapParams)
     * @see #getPrimaryImage()
     */
    public Bitmap getImageAtIndex(int imageIndex, @NonNull BitmapParams params) {
    public @Nullable Bitmap getImageAtIndex(int imageIndex, @NonNull BitmapParams params) {
        return getImageAtIndexInternal(imageIndex, params);
    }

@@ -691,7 +691,7 @@ public class MediaMetadataRetriever implements AutoCloseable {
     * @see #getPrimaryImage(BitmapParams)
     * @see #getPrimaryImage()
     */
    public Bitmap getImageAtIndex(int imageIndex) {
    public @Nullable Bitmap getImageAtIndex(int imageIndex) {
        return getImageAtIndexInternal(imageIndex, null);
    }

@@ -713,7 +713,7 @@ public class MediaMetadataRetriever implements AutoCloseable {
     * @see #getImageAtIndex(int)
     * @see #getPrimaryImage()
     */
    public Bitmap getPrimaryImage(@NonNull BitmapParams params) {
    public @Nullable Bitmap getPrimaryImage(@NonNull BitmapParams params) {
        return getImageAtIndexInternal(-1, params);
    }

@@ -729,7 +729,7 @@ public class MediaMetadataRetriever implements AutoCloseable {
     * @see #getImageAtIndex(int)
     * @see #getPrimaryImage(BitmapParams)
     */
    public Bitmap getPrimaryImage() {
    public @Nullable Bitmap getPrimaryImage() {
        return getImageAtIndexInternal(-1, null);
    }

@@ -755,7 +755,7 @@ public class MediaMetadataRetriever implements AutoCloseable {
     *
     * @return null if no such graphic is found.
     */
    public byte[] getEmbeddedPicture() {
    public @Nullable byte[] getEmbeddedPicture() {
        return getEmbeddedPicture(EMBEDDED_PICTURE_TYPE_ANY);
    }