mirror of
https://github.com/androidx/media.git
synced 2025-04-30 06:46:50 +08:00
Clean up nullness annotation
PiperOrigin-RevId: 627114088
This commit is contained in:
parent
430fafded6
commit
7aed9d40a0
@ -239,15 +239,15 @@ public final class VideoFrameProcessorTestRunner {
|
|||||||
public static final int VIDEO_FRAME_PROCESSING_WAIT_MS = 5_000;
|
public static final int VIDEO_FRAME_PROCESSING_WAIT_MS = 5_000;
|
||||||
|
|
||||||
private final String testId;
|
private final String testId;
|
||||||
private final @MonotonicNonNull String videoAssetPath;
|
@Nullable private final String videoAssetPath;
|
||||||
private final String outputFileLabel;
|
private final String outputFileLabel;
|
||||||
private final float pixelWidthHeightRatio;
|
private final float pixelWidthHeightRatio;
|
||||||
private final ConditionVariable videoFrameProcessorReadyCondition;
|
private final ConditionVariable videoFrameProcessorReadyCondition;
|
||||||
private final @MonotonicNonNull CountDownLatch videoFrameProcessingEndedLatch;
|
@Nullable private final CountDownLatch videoFrameProcessingEndedLatch;
|
||||||
private final AtomicReference<VideoFrameProcessingException> videoFrameProcessingException;
|
private final AtomicReference<VideoFrameProcessingException> videoFrameProcessingException;
|
||||||
private final VideoFrameProcessor videoFrameProcessor;
|
private final VideoFrameProcessor videoFrameProcessor;
|
||||||
private final ImmutableList<Effect> effects;
|
private final ImmutableList<Effect> effects;
|
||||||
private final @MonotonicNonNull BitmapReader bitmapReader;
|
@Nullable private final BitmapReader bitmapReader;
|
||||||
|
|
||||||
private VideoFrameProcessorTestRunner(
|
private VideoFrameProcessorTestRunner(
|
||||||
String testId,
|
String testId,
|
||||||
|
@ -48,7 +48,7 @@ public final class DefaultAssetLoaderFactory implements AssetLoader.Factory {
|
|||||||
private final Context context;
|
private final Context context;
|
||||||
private final Codec.DecoderFactory decoderFactory;
|
private final Codec.DecoderFactory decoderFactory;
|
||||||
private final Clock clock;
|
private final Clock clock;
|
||||||
private final MediaSource.@MonotonicNonNull Factory mediaSourceFactory;
|
@Nullable private final MediaSource.Factory mediaSourceFactory;
|
||||||
private final BitmapLoader bitmapLoader;
|
private final BitmapLoader bitmapLoader;
|
||||||
|
|
||||||
private AssetLoader.@MonotonicNonNull Factory imageAssetLoaderFactory;
|
private AssetLoader.@MonotonicNonNull Factory imageAssetLoaderFactory;
|
||||||
|
@ -33,7 +33,6 @@ import java.lang.annotation.RetentionPolicy;
|
|||||||
import java.lang.annotation.Target;
|
import java.lang.annotation.Target;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Objects;
|
import java.util.Objects;
|
||||||
import org.checkerframework.checker.nullness.qual.MonotonicNonNull;
|
|
||||||
|
|
||||||
/** Information about the result of an export. */
|
/** Information about the result of an export. */
|
||||||
@UnstableApi
|
@UnstableApi
|
||||||
@ -289,13 +288,13 @@ public final class ExportResult {
|
|||||||
* The name of the audio decoder used to process {@code mediaItem}. This field is {@code null}
|
* The name of the audio decoder used to process {@code mediaItem}. This field is {@code null}
|
||||||
* if no audio decoder was used.
|
* if no audio decoder was used.
|
||||||
*/
|
*/
|
||||||
public final @MonotonicNonNull String audioDecoderName;
|
@Nullable public final String audioDecoderName;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The name of the video decoder used to process {@code mediaItem}. This field is {@code null}
|
* The name of the video decoder used to process {@code mediaItem}. This field is {@code null}
|
||||||
* if no video decoder was used.
|
* if no video decoder was used.
|
||||||
*/
|
*/
|
||||||
public final @MonotonicNonNull String videoDecoderName;
|
@Nullable public final String videoDecoderName;
|
||||||
|
|
||||||
/** Creates an instance. */
|
/** Creates an instance. */
|
||||||
public ProcessedInput(
|
public ProcessedInput(
|
||||||
|
@ -146,7 +146,7 @@ import org.checkerframework.checker.nullness.qual.MonotonicNonNull;
|
|||||||
private final boolean dropSamplesBeforeFirstVideoSample;
|
private final boolean dropSamplesBeforeFirstVideoSample;
|
||||||
private final SparseArray<TrackInfo> trackTypeToInfo;
|
private final SparseArray<TrackInfo> trackTypeToInfo;
|
||||||
private final ScheduledExecutorService abortScheduledExecutorService;
|
private final ScheduledExecutorService abortScheduledExecutorService;
|
||||||
private final @MonotonicNonNull Format appendVideoFormat;
|
@Nullable private final Format appendVideoFormat;
|
||||||
private final long maxDelayBetweenSamplesMs;
|
private final long maxDelayBetweenSamplesMs;
|
||||||
private final BufferInfo bufferInfo;
|
private final BufferInfo bufferInfo;
|
||||||
|
|
||||||
@ -354,7 +354,8 @@ import org.checkerframework.checker.nullness.qual.MonotonicNonNull;
|
|||||||
* and all the formats must be added before any samples can be {@linkplain #writeSample(int,
|
* and all the formats must be added before any samples can be {@linkplain #writeSample(int,
|
||||||
* ByteBuffer, boolean, long) written}.
|
* ByteBuffer, boolean, long) written}.
|
||||||
*
|
*
|
||||||
* <p>{@link Muxer#addMetadata(Metadata)} is called if the {@link Format#metadata} is present.
|
* <p>{@link Muxer#addMetadataEntry(Metadata.Entry)} is called if the {@link Format#metadata} is
|
||||||
|
* present.
|
||||||
*
|
*
|
||||||
* @param format The {@link Format} to be added. In {@link #MUXER_MODE_APPEND} mode, the added
|
* @param format The {@link Format} to be added. In {@link #MUXER_MODE_APPEND} mode, the added
|
||||||
* {@link Format} must match the existing {@link Format} set when the muxer was in {@link
|
* {@link Format} must match the existing {@link Format} set when the muxer was in {@link
|
||||||
|
@ -57,9 +57,9 @@ import org.checkerframework.checker.nullness.qual.MonotonicNonNull;
|
|||||||
public final class RawAssetLoader implements AssetLoader {
|
public final class RawAssetLoader implements AssetLoader {
|
||||||
private final EditedMediaItem editedMediaItem;
|
private final EditedMediaItem editedMediaItem;
|
||||||
private final Listener assetLoaderListener;
|
private final Listener assetLoaderListener;
|
||||||
private final @MonotonicNonNull Format audioFormat;
|
@Nullable private final Format audioFormat;
|
||||||
private final @MonotonicNonNull Format videoFormat;
|
@Nullable private final Format videoFormat;
|
||||||
private final @MonotonicNonNull OnInputFrameProcessedListener frameProcessedListener;
|
@Nullable private final OnInputFrameProcessedListener frameProcessedListener;
|
||||||
|
|
||||||
private @MonotonicNonNull SampleConsumer audioSampleConsumer;
|
private @MonotonicNonNull SampleConsumer audioSampleConsumer;
|
||||||
private @MonotonicNonNull SampleConsumer videoSampleConsumer;
|
private @MonotonicNonNull SampleConsumer videoSampleConsumer;
|
||||||
@ -121,6 +121,7 @@ public final class RawAssetLoader implements AssetLoader {
|
|||||||
public void start() {
|
public void start() {
|
||||||
progressState = PROGRESS_STATE_AVAILABLE;
|
progressState = PROGRESS_STATE_AVAILABLE;
|
||||||
assetLoaderListener.onDurationUs(editedMediaItem.durationUs);
|
assetLoaderListener.onDurationUs(editedMediaItem.durationUs);
|
||||||
|
// The constructor guarantees at least one track is present.
|
||||||
int trackCount = 1;
|
int trackCount = 1;
|
||||||
if (audioFormat != null && videoFormat != null) {
|
if (audioFormat != null && videoFormat != null) {
|
||||||
trackCount = 2;
|
trackCount = 2;
|
||||||
@ -174,13 +175,14 @@ public final class RawAssetLoader implements AssetLoader {
|
|||||||
}
|
}
|
||||||
if (videoSampleConsumer == null) {
|
if (videoSampleConsumer == null) {
|
||||||
@Nullable
|
@Nullable
|
||||||
SampleConsumer sampleConsumer =
|
SampleConsumer videoSampleConsumer =
|
||||||
assetLoaderListener.onOutputFormat(checkNotNull(videoFormat));
|
assetLoaderListener.onOutputFormat(checkNotNull(videoFormat));
|
||||||
if (sampleConsumer == null) {
|
if (videoSampleConsumer == null) {
|
||||||
return false;
|
return false;
|
||||||
} else {
|
} else {
|
||||||
videoSampleConsumer = sampleConsumer;
|
this.videoSampleConsumer = videoSampleConsumer;
|
||||||
sampleConsumer.setOnInputFrameProcessedListener(checkNotNull(frameProcessedListener));
|
videoSampleConsumer.setOnInputFrameProcessedListener(
|
||||||
|
checkNotNull(frameProcessedListener));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@SampleConsumer.InputResult
|
@SampleConsumer.InputResult
|
||||||
@ -239,12 +241,12 @@ public final class RawAssetLoader implements AssetLoader {
|
|||||||
}
|
}
|
||||||
if (audioSampleConsumer == null) {
|
if (audioSampleConsumer == null) {
|
||||||
@Nullable
|
@Nullable
|
||||||
SampleConsumer sampleConsumer =
|
SampleConsumer audioSampleConsumer =
|
||||||
assetLoaderListener.onOutputFormat(checkNotNull(audioFormat));
|
assetLoaderListener.onOutputFormat(checkNotNull(audioFormat));
|
||||||
if (sampleConsumer == null) {
|
if (audioSampleConsumer == null) {
|
||||||
return false;
|
return false;
|
||||||
} else {
|
} else {
|
||||||
audioSampleConsumer = sampleConsumer;
|
this.audioSampleConsumer = audioSampleConsumer;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
DecoderInputBuffer decoderInputBuffer = audioSampleConsumer.getInputBuffer();
|
DecoderInputBuffer decoderInputBuffer = audioSampleConsumer.getInputBuffer();
|
||||||
|
@ -25,7 +25,6 @@ import androidx.media3.common.util.UnstableApi;
|
|||||||
import com.google.common.collect.ImmutableList;
|
import com.google.common.collect.ImmutableList;
|
||||||
import com.google.errorprone.annotations.CanIgnoreReturnValue;
|
import com.google.errorprone.annotations.CanIgnoreReturnValue;
|
||||||
import java.util.Objects;
|
import java.util.Objects;
|
||||||
import org.checkerframework.checker.nullness.qual.MonotonicNonNull;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @deprecated Use {@link ExportResult} instead.
|
* @deprecated Use {@link ExportResult} instead.
|
||||||
@ -272,13 +271,13 @@ public final class TransformationResult {
|
|||||||
* The name of the audio decoder used to process {@code mediaItem}. This field is {@code null}
|
* The name of the audio decoder used to process {@code mediaItem}. This field is {@code null}
|
||||||
* if no audio decoder was used.
|
* if no audio decoder was used.
|
||||||
*/
|
*/
|
||||||
public final @MonotonicNonNull String audioDecoderName;
|
@Nullable public final String audioDecoderName;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The name of the video decoder used to process {@code mediaItem}. This field is {@code null}
|
* The name of the video decoder used to process {@code mediaItem}. This field is {@code null}
|
||||||
* if no video decoder was used.
|
* if no video decoder was used.
|
||||||
*/
|
*/
|
||||||
public final @MonotonicNonNull String videoDecoderName;
|
@Nullable public final String videoDecoderName;
|
||||||
|
|
||||||
/** Creates an instance. */
|
/** Creates an instance. */
|
||||||
public ProcessedInput(
|
public ProcessedInput(
|
||||||
|
Loading…
x
Reference in New Issue
Block a user