diff --git a/libraries/effect/src/main/java/androidx/media3/effect/BitmapOverlay.java b/libraries/effect/src/main/java/androidx/media3/effect/BitmapOverlay.java index 6afcb9b97bb..eef72501150 100644 --- a/libraries/effect/src/main/java/androidx/media3/effect/BitmapOverlay.java +++ b/libraries/effect/src/main/java/androidx/media3/effect/BitmapOverlay.java @@ -21,6 +21,7 @@ import android.graphics.Bitmap; import android.net.Uri; import android.opengl.Matrix; +import androidx.annotation.Nullable; import androidx.media3.common.C; import androidx.media3.common.VideoFrameProcessingException; import androidx.media3.common.util.BitmapLoader; @@ -31,7 +32,6 @@ import com.google.common.util.concurrent.ListenableFuture; import java.util.concurrent.ExecutionException; import org.checkerframework.checker.nullness.qual.MonotonicNonNull; -import org.checkerframework.checker.nullness.qual.Nullable; /** * Creates {@link TextureOverlay}s from {@link Bitmap}s. @@ -45,7 +45,7 @@ public abstract class BitmapOverlay extends TextureOverlay { private int lastTextureId; private int lastBitmapGenerationId; - private @Nullable Bitmap lastBitmap; + @Nullable private Bitmap lastBitmap; public BitmapOverlay() { float[] temp = GlUtil.create4x4IdentityMatrix(); diff --git a/libraries/effect/src/main/java/androidx/media3/effect/BitmapTextureManager.java b/libraries/effect/src/main/java/androidx/media3/effect/BitmapTextureManager.java index 699de5d5651..5ca81958bc9 100644 --- a/libraries/effect/src/main/java/androidx/media3/effect/BitmapTextureManager.java +++ b/libraries/effect/src/main/java/androidx/media3/effect/BitmapTextureManager.java @@ -24,6 +24,7 @@ import static androidx.media3.effect.DebugTraceUtil.EVENT_SIGNAL_EOS; import android.graphics.Bitmap; +import androidx.annotation.Nullable; import androidx.media3.common.C; import androidx.media3.common.FrameInfo; import androidx.media3.common.GlObjectsProvider; @@ -35,7 +36,6 @@ import java.util.Queue; import java.util.concurrent.LinkedBlockingQueue; import org.checkerframework.checker.nullness.qual.MonotonicNonNull; -import org.checkerframework.checker.nullness.qual.Nullable; /** * Forwards a video frame produced from a {@link Bitmap} to a {@link GlShaderProgram} for diff --git a/libraries/effect/src/main/java/androidx/media3/effect/InputSwitcher.java b/libraries/effect/src/main/java/androidx/media3/effect/InputSwitcher.java index 6b74d9381f2..82dd41ebac0 100644 --- a/libraries/effect/src/main/java/androidx/media3/effect/InputSwitcher.java +++ b/libraries/effect/src/main/java/androidx/media3/effect/InputSwitcher.java @@ -29,6 +29,7 @@ import android.content.Context; import android.util.SparseArray; import android.view.Surface; +import androidx.annotation.Nullable; import androidx.media3.common.ColorInfo; import androidx.media3.common.FrameInfo; import androidx.media3.common.GlObjectsProvider; @@ -39,7 +40,6 @@ import androidx.media3.effect.DefaultVideoFrameProcessor.WorkingColorSpace; import java.util.concurrent.Executor; import org.checkerframework.checker.nullness.qual.MonotonicNonNull; -import org.checkerframework.checker.nullness.qual.Nullable; /** * A switcher to switch between {@linkplain TextureManager texture managers} of different @@ -269,11 +269,13 @@ public void setChainingListener(GatedChainingListenerWrapper gatedChainingListen checkNotNull(samplingGlShaderProgram).setOutputListener(gatedChainingListenerWrapper); } - public @Nullable ExternalShaderProgram getSamplingGlShaderProgram() { + @Nullable + public ExternalShaderProgram getSamplingGlShaderProgram() { return samplingGlShaderProgram; } - public @Nullable ColorInfo getInputColorInfo() { + @Nullable + public ColorInfo getInputColorInfo() { return inputColorInfo; } diff --git a/libraries/exoplayer/src/main/java/androidx/media3/exoplayer/image/ImageRenderer.java b/libraries/exoplayer/src/main/java/androidx/media3/exoplayer/image/ImageRenderer.java index afe6a1acda2..3aff8bd753d 100644 --- a/libraries/exoplayer/src/main/java/androidx/media3/exoplayer/image/ImageRenderer.java +++ b/libraries/exoplayer/src/main/java/androidx/media3/exoplayer/image/ImageRenderer.java @@ -28,6 +28,7 @@ import android.graphics.Bitmap; import android.os.SystemClock; import androidx.annotation.IntDef; +import androidx.annotation.Nullable; import androidx.media3.common.C; import androidx.media3.common.Format; import androidx.media3.common.PlaybackException; @@ -48,7 +49,6 @@ import java.util.ArrayDeque; import org.checkerframework.checker.nullness.qual.EnsuresNonNull; import org.checkerframework.checker.nullness.qual.MonotonicNonNull; -import org.checkerframework.checker.nullness.qual.Nullable; import org.checkerframework.checker.nullness.qual.RequiresNonNull; /** A {@link Renderer} implementation for images. */ @@ -108,14 +108,14 @@ public class ImageRenderer extends BaseRenderer { private long largestQueuedPresentationTimeUs; private @ReinitializationState int decoderReinitializationState; private @C.FirstFrameState int firstFrameState; - private @Nullable Format inputFormat; - private @Nullable ImageDecoder decoder; - private @Nullable DecoderInputBuffer inputBuffer; + @Nullable private Format inputFormat; + @Nullable private ImageDecoder decoder; + @Nullable private DecoderInputBuffer inputBuffer; private ImageOutput imageOutput; - private @Nullable Bitmap outputBitmap; + @Nullable private Bitmap outputBitmap; private boolean readyToOutputTiles; - private @Nullable TileInfo tileInfo; - private @Nullable TileInfo nextTileInfo; + @Nullable private TileInfo tileInfo; + @Nullable private TileInfo nextTileInfo; private int currentTileIndex; /** @@ -274,8 +274,8 @@ public void handleMessage(@MessageType int messageType, @Nullable Object message throws ExoPlaybackException { switch (messageType) { case MSG_SET_IMAGE_OUTPUT: - @Nullable ImageOutput imageOutput = - message instanceof ImageOutput ? (ImageOutput) message : null; + @Nullable + ImageOutput imageOutput = message instanceof ImageOutput ? (ImageOutput) message : null; setImageOutput(imageOutput); break; default: diff --git a/libraries/exoplayer_rtsp/src/main/java/androidx/media3/exoplayer/rtsp/reader/RtpPayloadReader.java b/libraries/exoplayer_rtsp/src/main/java/androidx/media3/exoplayer/rtsp/reader/RtpPayloadReader.java index 12787b997c5..ca314fafccc 100644 --- a/libraries/exoplayer_rtsp/src/main/java/androidx/media3/exoplayer/rtsp/reader/RtpPayloadReader.java +++ b/libraries/exoplayer_rtsp/src/main/java/androidx/media3/exoplayer/rtsp/reader/RtpPayloadReader.java @@ -16,12 +16,12 @@ package androidx.media3.exoplayer.rtsp.reader; +import androidx.annotation.Nullable; import androidx.media3.common.ParserException; import androidx.media3.common.util.ParsableByteArray; import androidx.media3.common.util.UnstableApi; import androidx.media3.exoplayer.rtsp.RtpPayloadFormat; import androidx.media3.extractor.ExtractorOutput; -import org.checkerframework.checker.nullness.qual.Nullable; /** Extracts media samples from the payload of received RTP packets. */ @UnstableApi @@ -37,7 +37,8 @@ interface Factory { * @return A {@link RtpPayloadReader} for the packet stream, or {@code null} if the stream * format is not supported. */ - @Nullable RtpPayloadReader createPayloadReader(RtpPayloadFormat payloadFormat); + @Nullable + RtpPayloadReader createPayloadReader(RtpPayloadFormat payloadFormat); } /** diff --git a/libraries/transformer/src/androidTest/java/androidx/media3/transformer/DefaultVideoCompositorPixelTest.java b/libraries/transformer/src/androidTest/java/androidx/media3/transformer/DefaultVideoCompositorPixelTest.java index 76094d0144d..f0cf1f1dcfd 100644 --- a/libraries/transformer/src/androidTest/java/androidx/media3/transformer/DefaultVideoCompositorPixelTest.java +++ b/libraries/transformer/src/androidTest/java/androidx/media3/transformer/DefaultVideoCompositorPixelTest.java @@ -40,6 +40,7 @@ import android.text.style.StyleSpan; import android.text.style.TypefaceSpan; import android.util.Pair; +import androidx.annotation.Nullable; import androidx.media3.common.C; import androidx.media3.common.ColorInfo; import androidx.media3.common.Effect; @@ -74,7 +75,6 @@ import java.util.concurrent.ExecutorService; import java.util.concurrent.atomic.AtomicReference; import org.checkerframework.checker.nullness.qual.MonotonicNonNull; -import org.checkerframework.checker.nullness.qual.Nullable; import org.junit.After; import org.junit.Before; import org.junit.Rule; @@ -645,7 +645,7 @@ private static final class VideoCompositorTestRunner { private final LinkedHashMap outputTimestampsToBitmaps; private final List inputVideoFrameProcessorTestRunners; private final VideoCompositor videoCompositor; - private final @Nullable ExecutorService sharedExecutorService; + @Nullable private final ExecutorService sharedExecutorService; private final AtomicReference compositionException; private final CountDownLatch compositorEnded; private final String testId; diff --git a/libraries/transformer/src/androidTest/java/androidx/media3/transformer/mh/HdrEditingTest.java b/libraries/transformer/src/androidTest/java/androidx/media3/transformer/mh/HdrEditingTest.java index c435aedad60..abbb62838a7 100644 --- a/libraries/transformer/src/androidTest/java/androidx/media3/transformer/mh/HdrEditingTest.java +++ b/libraries/transformer/src/androidTest/java/androidx/media3/transformer/mh/HdrEditingTest.java @@ -33,6 +33,7 @@ import android.content.Context; import android.net.Uri; +import androidx.annotation.Nullable; import androidx.media3.common.C; import androidx.media3.common.Format; import androidx.media3.common.MediaItem; @@ -51,7 +52,6 @@ import androidx.test.ext.junit.runners.AndroidJUnit4; import java.util.Objects; import java.util.concurrent.atomic.AtomicBoolean; -import org.checkerframework.checker.nullness.qual.Nullable; import org.junit.AssumptionViolatedException; import org.junit.Before; import org.junit.Rule; diff --git a/libraries/transformer/src/main/java/androidx/media3/transformer/InAppMuxer.java b/libraries/transformer/src/main/java/androidx/media3/transformer/InAppMuxer.java index a59c8bf0f19..ce40aa13cad 100644 --- a/libraries/transformer/src/main/java/androidx/media3/transformer/InAppMuxer.java +++ b/libraries/transformer/src/main/java/androidx/media3/transformer/InAppMuxer.java @@ -16,6 +16,7 @@ package androidx.media3.transformer; import android.media.MediaCodec.BufferInfo; +import androidx.annotation.Nullable; import androidx.media3.common.C; import androidx.media3.common.Format; import androidx.media3.common.Metadata; @@ -33,7 +34,6 @@ import java.nio.ByteBuffer; import java.util.LinkedHashSet; import java.util.Set; -import org.checkerframework.checker.nullness.qual.Nullable; /** {@link Muxer} implementation that uses an {@link Mp4Muxer} or {@link FragmentedMp4Muxer}. */ @UnstableApi @@ -59,7 +59,7 @@ public static final class Factory implements Muxer.Factory { /** A builder for {@link Factory} instances. */ public static final class Builder { - private @Nullable MetadataProvider metadataProvider; + @Nullable private MetadataProvider metadataProvider; private boolean outputFragmentedMp4; private long fragmentDurationMs; @@ -123,7 +123,7 @@ public Factory build() { MimeTypes.AUDIO_OPUS, MimeTypes.AUDIO_VORBIS); - private final @Nullable MetadataProvider metadataProvider; + @Nullable private final MetadataProvider metadataProvider; private final boolean outputFragmentedMp4; private final long fragmentDurationMs; @@ -168,7 +168,7 @@ public ImmutableList getSupportedSampleMimeTypes(@C.TrackType int trackT } private final androidx.media3.muxer.Muxer muxer; - private final @Nullable MetadataProvider metadataProvider; + @Nullable private final MetadataProvider metadataProvider; private final Set metadataEntries; private InAppMuxer( diff --git a/libraries/transformer/src/main/java/androidx/media3/transformer/Mp4Info.java b/libraries/transformer/src/main/java/androidx/media3/transformer/Mp4Info.java index e027abede1e..aa2f8462f5c 100644 --- a/libraries/transformer/src/main/java/androidx/media3/transformer/Mp4Info.java +++ b/libraries/transformer/src/main/java/androidx/media3/transformer/Mp4Info.java @@ -20,6 +20,7 @@ import static java.lang.Math.min; import android.content.Context; +import androidx.annotation.Nullable; import androidx.media3.common.C; import androidx.media3.common.DataReader; import androidx.media3.common.Format; @@ -40,7 +41,6 @@ import java.util.HashMap; import java.util.Map; import org.checkerframework.checker.nullness.qual.MonotonicNonNull; -import org.checkerframework.checker.nullness.qual.Nullable; /** * Provides some specific MP4 metadata about an mp4 file such as the duration, last sync sample @@ -70,10 +70,10 @@ public final boolean isFirstVideoSampleAfterTimeUsSyncSample; /** The video {@link Format} or {@code null} if there is no video track. */ - public final @Nullable Format videoFormat; + @Nullable public final Format videoFormat; /** The audio {@link Format} or {@code null} if there is no audio track. */ - public final @Nullable Format audioFormat; + @Nullable public final Format audioFormat; private Mp4Info( long durationUs,