Commit 3afdd7ac by olly Committed by Toni

Put @Nullable annotation in the right place

PiperOrigin-RevId: 249828748
parent 11c0c6d2
Showing with 242 additions and 201 deletions
...@@ -555,7 +555,8 @@ public class PlayerActivity extends AppCompatActivity ...@@ -555,7 +555,8 @@ public class PlayerActivity extends AppCompatActivity
} }
/** Returns an ads media source, reusing the ads loader if one exists. */ /** Returns an ads media source, reusing the ads loader if one exists. */
private @Nullable MediaSource createAdsMediaSource(MediaSource mediaSource, Uri adTagUri) { @Nullable
private MediaSource createAdsMediaSource(MediaSource mediaSource, Uri adTagUri) {
// Load the extension source using reflection so the demo app doesn't have to depend on it. // Load the extension source using reflection so the demo app doesn't have to depend on it.
// The ads loader is reused for multiple playbacks, so that ad playback can resume. // The ads loader is reused for multiple playbacks, so that ad playback can resume.
try { try {
......
...@@ -42,7 +42,7 @@ import java.util.List; ...@@ -42,7 +42,7 @@ import java.util.List;
private static final int DECODER_ERROR_OTHER = -2; private static final int DECODER_ERROR_OTHER = -2;
private final String codecName; private final String codecName;
private final @Nullable byte[] extraData; @Nullable private final byte[] extraData;
private final @C.Encoding int encoding; private final @C.Encoding int encoding;
private final int outputBufferSize; private final int outputBufferSize;
......
...@@ -228,7 +228,8 @@ public final class FlacExtractorSeekTest { ...@@ -228,7 +228,8 @@ public final class FlacExtractorSeekTest {
} }
} }
private @Nullable SeekMap extractSeekMap(FlacExtractor extractor, FakeExtractorOutput output) @Nullable
private SeekMap extractSeekMap(FlacExtractor extractor, FakeExtractorOutput output)
throws IOException, InterruptedException { throws IOException, InterruptedException {
try { try {
ExtractorInput input = getExtractorInputFromPosition(0); ExtractorInput input = getExtractorInputFromPosition(0);
......
...@@ -88,7 +88,7 @@ public final class FlacExtractor implements Extractor { ...@@ -88,7 +88,7 @@ public final class FlacExtractor implements Extractor {
private FlacStreamInfo streamInfo; private FlacStreamInfo streamInfo;
private Metadata id3Metadata; private Metadata id3Metadata;
private @Nullable FlacBinarySearchSeeker flacBinarySearchSeeker; @Nullable private FlacBinarySearchSeeker flacBinarySearchSeeker;
private boolean readPastStreamInfo; private boolean readPastStreamInfo;
......
...@@ -313,14 +313,14 @@ public final class ImaAdsLoader ...@@ -313,14 +313,14 @@ public final class ImaAdsLoader
*/ */
private static final int IMA_AD_STATE_PAUSED = 2; private static final int IMA_AD_STATE_PAUSED = 2;
private final @Nullable Uri adTagUri; @Nullable private final Uri adTagUri;
private final @Nullable String adsResponse; @Nullable private final String adsResponse;
private final int vastLoadTimeoutMs; private final int vastLoadTimeoutMs;
private final int mediaLoadTimeoutMs; private final int mediaLoadTimeoutMs;
private final boolean focusSkipButtonWhenAvailable; private final boolean focusSkipButtonWhenAvailable;
private final int mediaBitrate; private final int mediaBitrate;
private final @Nullable Set<UiElement> adUiElements; @Nullable private final Set<UiElement> adUiElements;
private final @Nullable AdEventListener adEventListener; @Nullable private final AdEventListener adEventListener;
private final ImaFactory imaFactory; private final ImaFactory imaFactory;
private final Timeline.Period period; private final Timeline.Period period;
private final List<VideoAdPlayerCallback> adCallbacks; private final List<VideoAdPlayerCallback> adCallbacks;
......
...@@ -252,7 +252,8 @@ public class ImaAdsLoaderTest { ...@@ -252,7 +252,8 @@ public class ImaAdsLoaderTest {
} }
@Override @Override
public @Nullable Ad getAd() { @Nullable
public Ad getAd() {
return ad; return ad;
} }
......
...@@ -51,10 +51,10 @@ public final class LeanbackPlayerAdapter extends PlayerAdapter implements Runnab ...@@ -51,10 +51,10 @@ public final class LeanbackPlayerAdapter extends PlayerAdapter implements Runnab
private final ComponentListener componentListener; private final ComponentListener componentListener;
private final int updatePeriodMs; private final int updatePeriodMs;
private @Nullable PlaybackPreparer playbackPreparer; @Nullable private PlaybackPreparer playbackPreparer;
private ControlDispatcher controlDispatcher; private ControlDispatcher controlDispatcher;
private @Nullable ErrorMessageProvider<? super ExoPlaybackException> errorMessageProvider; @Nullable private ErrorMessageProvider<? super ExoPlaybackException> errorMessageProvider;
private @Nullable SurfaceHolderGlueHost surfaceHolderGlueHost; @Nullable private SurfaceHolderGlueHost surfaceHolderGlueHost;
private boolean hasSurface; private boolean hasSurface;
private boolean lastNotifiedPreparedState; private boolean lastNotifiedPreparedState;
......
...@@ -167,7 +167,8 @@ public class OkHttpDataSource extends BaseDataSource implements HttpDataSource { ...@@ -167,7 +167,8 @@ public class OkHttpDataSource extends BaseDataSource implements HttpDataSource {
} }
@Override @Override
public @Nullable Uri getUri() { @Nullable
public Uri getUri() {
return response == null ? null : Uri.parse(response.request().url().toString()); return response == null ? null : Uri.parse(response.request().url().toString());
} }
......
...@@ -29,9 +29,9 @@ import okhttp3.Call; ...@@ -29,9 +29,9 @@ import okhttp3.Call;
public final class OkHttpDataSourceFactory extends BaseFactory { public final class OkHttpDataSourceFactory extends BaseFactory {
private final Call.Factory callFactory; private final Call.Factory callFactory;
private final @Nullable String userAgent; @Nullable private final String userAgent;
private final @Nullable TransferListener listener; @Nullable private final TransferListener listener;
private final @Nullable CacheControl cacheControl; @Nullable private final CacheControl cacheControl;
/** /**
* @param callFactory A {@link Call.Factory} (typically an {@link okhttp3.OkHttpClient}) for use * @param callFactory A {@link Call.Factory} (typically an {@link okhttp3.OkHttpClient}) for use
......
...@@ -25,7 +25,7 @@ import com.google.android.exoplayer2.upstream.TransferListener; ...@@ -25,7 +25,7 @@ import com.google.android.exoplayer2.upstream.TransferListener;
*/ */
public final class RtmpDataSourceFactory implements DataSource.Factory { public final class RtmpDataSourceFactory implements DataSource.Factory {
private final @Nullable TransferListener listener; @Nullable private final TransferListener listener;
public RtmpDataSourceFactory() { public RtmpDataSourceFactory() {
this(null); this(null);
......
...@@ -43,8 +43,8 @@ import com.google.android.exoplayer2.util.StandaloneMediaClock; ...@@ -43,8 +43,8 @@ import com.google.android.exoplayer2.util.StandaloneMediaClock;
private final StandaloneMediaClock standaloneMediaClock; private final StandaloneMediaClock standaloneMediaClock;
private final PlaybackParameterListener listener; private final PlaybackParameterListener listener;
private @Nullable Renderer rendererClockSource; @Nullable private Renderer rendererClockSource;
private @Nullable MediaClock rendererClock; @Nullable private MediaClock rendererClock;
/** /**
* Creates a new instance with listener for playback parameter changes and a {@link Clock} to use * Creates a new instance with listener for playback parameter changes and a {@link Clock} to use
......
...@@ -73,7 +73,7 @@ import java.util.concurrent.CopyOnWriteArrayList; ...@@ -73,7 +73,7 @@ import java.util.concurrent.CopyOnWriteArrayList;
private boolean foregroundMode; private boolean foregroundMode;
private PlaybackParameters playbackParameters; private PlaybackParameters playbackParameters;
private SeekParameters seekParameters; private SeekParameters seekParameters;
private @Nullable ExoPlaybackException playbackError; @Nullable private ExoPlaybackException playbackError;
// Playback information when there is no pending seek/set source operation. // Playback information when there is no pending seek/set source operation.
private PlaybackInfo playbackInfo; private PlaybackInfo playbackInfo;
...@@ -199,7 +199,8 @@ import java.util.concurrent.CopyOnWriteArrayList; ...@@ -199,7 +199,8 @@ import java.util.concurrent.CopyOnWriteArrayList;
} }
@Override @Override
public @Nullable ExoPlaybackException getPlaybackError() { @Nullable
public ExoPlaybackException getPlaybackError() {
return playbackError; return playbackError;
} }
......
...@@ -1836,7 +1836,7 @@ import java.util.concurrent.atomic.AtomicBoolean; ...@@ -1836,7 +1836,7 @@ import java.util.concurrent.atomic.AtomicBoolean;
public int resolvedPeriodIndex; public int resolvedPeriodIndex;
public long resolvedPeriodTimeUs; public long resolvedPeriodTimeUs;
public @Nullable Object resolvedPeriodUid; @Nullable public Object resolvedPeriodUid;
public PendingMessageInfo(PlayerMessage message) { public PendingMessageInfo(PlayerMessage message) {
this.message = message; this.message = message;
......
...@@ -45,9 +45,9 @@ public final class Format implements Parcelable { ...@@ -45,9 +45,9 @@ public final class Format implements Parcelable {
public static final long OFFSET_SAMPLE_RELATIVE = Long.MAX_VALUE; public static final long OFFSET_SAMPLE_RELATIVE = Long.MAX_VALUE;
/** An identifier for the format, or null if unknown or not applicable. */ /** An identifier for the format, or null if unknown or not applicable. */
public final @Nullable String id; @Nullable public final String id;
/** The human readable label, or null if unknown or not applicable. */ /** The human readable label, or null if unknown or not applicable. */
public final @Nullable String label; @Nullable public final String label;
/** Track selection flags. */ /** Track selection flags. */
@C.SelectionFlags public final int selectionFlags; @C.SelectionFlags public final int selectionFlags;
/** Track role flags. */ /** Track role flags. */
...@@ -57,14 +57,14 @@ public final class Format implements Parcelable { ...@@ -57,14 +57,14 @@ public final class Format implements Parcelable {
*/ */
public final int bitrate; public final int bitrate;
/** Codecs of the format as described in RFC 6381, or null if unknown or not applicable. */ /** Codecs of the format as described in RFC 6381, or null if unknown or not applicable. */
public final @Nullable String codecs; @Nullable public final String codecs;
/** Metadata, or null if unknown or not applicable. */ /** Metadata, or null if unknown or not applicable. */
public final @Nullable Metadata metadata; @Nullable public final Metadata metadata;
// Container specific. // Container specific.
/** The mime type of the container, or null if unknown or not applicable. */ /** The mime type of the container, or null if unknown or not applicable. */
public final @Nullable String containerMimeType; @Nullable public final String containerMimeType;
// Elementary stream specific. // Elementary stream specific.
...@@ -72,7 +72,7 @@ public final class Format implements Parcelable { ...@@ -72,7 +72,7 @@ public final class Format implements Parcelable {
* The mime type of the elementary stream (i.e. the individual samples), or null if unknown or not * The mime type of the elementary stream (i.e. the individual samples), or null if unknown or not
* applicable. * applicable.
*/ */
public final @Nullable String sampleMimeType; @Nullable public final String sampleMimeType;
/** /**
* The maximum size of a buffer of data (typically one sample), or {@link #NO_VALUE} if unknown or * The maximum size of a buffer of data (typically one sample), or {@link #NO_VALUE} if unknown or
* not applicable. * not applicable.
...@@ -84,7 +84,7 @@ public final class Format implements Parcelable { ...@@ -84,7 +84,7 @@ public final class Format implements Parcelable {
*/ */
public final List<byte[]> initializationData; public final List<byte[]> initializationData;
/** DRM initialization data if the stream is protected, or null otherwise. */ /** DRM initialization data if the stream is protected, or null otherwise. */
public final @Nullable DrmInitData drmInitData; @Nullable public final DrmInitData drmInitData;
/** /**
* For samples that contain subsamples, this is an offset that should be added to subsample * For samples that contain subsamples, this is an offset that should be added to subsample
...@@ -122,9 +122,9 @@ public final class Format implements Parcelable { ...@@ -122,9 +122,9 @@ public final class Format implements Parcelable {
@C.StereoMode @C.StereoMode
public final int stereoMode; public final int stereoMode;
/** The projection data for 360/VR video, or null if not applicable. */ /** The projection data for 360/VR video, or null if not applicable. */
public final @Nullable byte[] projectionData; @Nullable public final byte[] projectionData;
/** The color metadata associated with the video, helps with accurate color reproduction. */ /** The color metadata associated with the video, helps with accurate color reproduction. */
public final @Nullable ColorInfo colorInfo; @Nullable public final ColorInfo colorInfo;
// Audio specific. // Audio specific.
...@@ -157,7 +157,7 @@ public final class Format implements Parcelable { ...@@ -157,7 +157,7 @@ public final class Format implements Parcelable {
// Audio and text specific. // Audio and text specific.
/** The language as an IETF BCP 47 conformant tag, or null if unknown or not applicable. */ /** The language as an IETF BCP 47 conformant tag, or null if unknown or not applicable. */
public final @Nullable String language; @Nullable public final String language;
/** /**
* The Accessibility channel, or {@link #NO_VALUE} if not known or applicable. * The Accessibility channel, or {@link #NO_VALUE} if not known or applicable.
*/ */
......
...@@ -46,11 +46,11 @@ import com.google.android.exoplayer2.util.Assertions; ...@@ -46,11 +46,11 @@ import com.google.android.exoplayer2.util.Assertions;
private Timeline timeline; private Timeline timeline;
private @RepeatMode int repeatMode; private @RepeatMode int repeatMode;
private boolean shuffleModeEnabled; private boolean shuffleModeEnabled;
private @Nullable MediaPeriodHolder playing; @Nullable private MediaPeriodHolder playing;
private @Nullable MediaPeriodHolder reading; @Nullable private MediaPeriodHolder reading;
private @Nullable MediaPeriodHolder loading; @Nullable private MediaPeriodHolder loading;
private int length; private int length;
private @Nullable Object oldFrontPeriodUid; @Nullable private Object oldFrontPeriodUid;
private long oldFrontPeriodWindowSequenceNumber; private long oldFrontPeriodWindowSequenceNumber;
/** Creates a new media period queue. */ /** Creates a new media period queue. */
......
...@@ -36,7 +36,7 @@ import com.google.android.exoplayer2.trackselection.TrackSelectorResult; ...@@ -36,7 +36,7 @@ import com.google.android.exoplayer2.trackselection.TrackSelectorResult;
/** The current {@link Timeline}. */ /** The current {@link Timeline}. */
public final Timeline timeline; public final Timeline timeline;
/** The current manifest. */ /** The current manifest. */
public final @Nullable Object manifest; @Nullable public final Object manifest;
/** The {@link MediaPeriodId} of the currently playing media period in the {@link #timeline}. */ /** The {@link MediaPeriodId} of the currently playing media period in the {@link #timeline}. */
public final MediaPeriodId periodId; public final MediaPeriodId periodId;
/** /**
......
...@@ -55,7 +55,7 @@ public final class PlayerMessage { ...@@ -55,7 +55,7 @@ public final class PlayerMessage {
private final Timeline timeline; private final Timeline timeline;
private int type; private int type;
private @Nullable Object payload; @Nullable private Object payload;
private Handler handler; private Handler handler;
private int windowIndex; private int windowIndex;
private long positionMs; private long positionMs;
...@@ -134,7 +134,8 @@ public final class PlayerMessage { ...@@ -134,7 +134,8 @@ public final class PlayerMessage {
} }
/** Returns the message payload forwarded to {@link Target#handleMessage(int, Object)}. */ /** Returns the message payload forwarded to {@link Target#handleMessage(int, Object)}. */
public @Nullable Object getPayload() { @Nullable
public Object getPayload() {
return payload; return payload;
} }
......
...@@ -880,7 +880,8 @@ public class SimpleExoPlayer extends BasePlayer ...@@ -880,7 +880,8 @@ public class SimpleExoPlayer extends BasePlayer
} }
@Override @Override
public @Nullable ExoPlaybackException getPlaybackError() { @Nullable
public ExoPlaybackException getPlaybackError() {
verifyApplicationThread(); verifyApplicationThread();
return player.getPlaybackError(); return player.getPlaybackError();
} }
......
...@@ -687,8 +687,8 @@ public class AnalyticsCollector ...@@ -687,8 +687,8 @@ public class AnalyticsCollector
private final HashMap<MediaPeriodId, MediaPeriodInfo> mediaPeriodIdToInfo; private final HashMap<MediaPeriodId, MediaPeriodInfo> mediaPeriodIdToInfo;
private final Period period; private final Period period;
private @Nullable MediaPeriodInfo lastReportedPlayingMediaPeriod; @Nullable private MediaPeriodInfo lastReportedPlayingMediaPeriod;
private @Nullable MediaPeriodInfo readingMediaPeriod; @Nullable private MediaPeriodInfo readingMediaPeriod;
private Timeline timeline; private Timeline timeline;
private boolean isSeeking; private boolean isSeeking;
...@@ -706,7 +706,8 @@ public class AnalyticsCollector ...@@ -706,7 +706,8 @@ public class AnalyticsCollector
* always return null to reflect the uncertainty about the current playing period. May also be * always return null to reflect the uncertainty about the current playing period. May also be
* null, if the timeline is empty or no media period is active yet. * null, if the timeline is empty or no media period is active yet.
*/ */
public @Nullable MediaPeriodInfo getPlayingMediaPeriod() { @Nullable
public MediaPeriodInfo getPlayingMediaPeriod() {
return mediaPeriodInfoQueue.isEmpty() || timeline.isEmpty() || isSeeking return mediaPeriodInfoQueue.isEmpty() || timeline.isEmpty() || isSeeking
? null ? null
: mediaPeriodInfoQueue.get(0); : mediaPeriodInfoQueue.get(0);
...@@ -719,7 +720,8 @@ public class AnalyticsCollector ...@@ -719,7 +720,8 @@ public class AnalyticsCollector
* reported until the seek or preparation is processed. May be null, if no media period is * reported until the seek or preparation is processed. May be null, if no media period is
* active yet. * active yet.
*/ */
public @Nullable MediaPeriodInfo getLastReportedPlayingMediaPeriod() { @Nullable
public MediaPeriodInfo getLastReportedPlayingMediaPeriod() {
return lastReportedPlayingMediaPeriod; return lastReportedPlayingMediaPeriod;
} }
...@@ -727,7 +729,8 @@ public class AnalyticsCollector ...@@ -727,7 +729,8 @@ public class AnalyticsCollector
* Returns the {@link MediaPeriodInfo} of the media period currently being read by the player. * Returns the {@link MediaPeriodInfo} of the media period currently being read by the player.
* May be null, if the player is not reading a media period. * May be null, if the player is not reading a media period.
*/ */
public @Nullable MediaPeriodInfo getReadingMediaPeriod() { @Nullable
public MediaPeriodInfo getReadingMediaPeriod() {
return readingMediaPeriod; return readingMediaPeriod;
} }
...@@ -736,14 +739,16 @@ public class AnalyticsCollector ...@@ -736,14 +739,16 @@ public class AnalyticsCollector
* currently loading or will be the next one loading. May be null, if no media period is active * currently loading or will be the next one loading. May be null, if no media period is active
* yet. * yet.
*/ */
public @Nullable MediaPeriodInfo getLoadingMediaPeriod() { @Nullable
public MediaPeriodInfo getLoadingMediaPeriod() {
return mediaPeriodInfoQueue.isEmpty() return mediaPeriodInfoQueue.isEmpty()
? null ? null
: mediaPeriodInfoQueue.get(mediaPeriodInfoQueue.size() - 1); : mediaPeriodInfoQueue.get(mediaPeriodInfoQueue.size() - 1);
} }
/** Returns the {@link MediaPeriodInfo} for the given {@link MediaPeriodId}. */ /** Returns the {@link MediaPeriodInfo} for the given {@link MediaPeriodId}. */
public @Nullable MediaPeriodInfo getMediaPeriodInfo(MediaPeriodId mediaPeriodId) { @Nullable
public MediaPeriodInfo getMediaPeriodInfo(MediaPeriodId mediaPeriodId) {
return mediaPeriodIdToInfo.get(mediaPeriodId); return mediaPeriodIdToInfo.get(mediaPeriodId);
} }
...@@ -756,7 +761,8 @@ public class AnalyticsCollector ...@@ -756,7 +761,8 @@ public class AnalyticsCollector
* Tries to find an existing media period info from the specified window index. Only returns a * Tries to find an existing media period info from the specified window index. Only returns a
* non-null media period info if there is a unique, unambiguous match. * non-null media period info if there is a unique, unambiguous match.
*/ */
public @Nullable MediaPeriodInfo tryResolveWindowIndex(int windowIndex) { @Nullable
public MediaPeriodInfo tryResolveWindowIndex(int windowIndex) {
MediaPeriodInfo match = null; MediaPeriodInfo match = null;
for (int i = 0; i < mediaPeriodInfoQueue.size(); i++) { for (int i = 0; i < mediaPeriodInfoQueue.size(); i++) {
MediaPeriodInfo info = mediaPeriodInfoQueue.get(i); MediaPeriodInfo info = mediaPeriodInfoQueue.get(i);
......
...@@ -68,7 +68,7 @@ public interface AnalyticsListener { ...@@ -68,7 +68,7 @@ public interface AnalyticsListener {
* Media period identifier for the media period this event belongs to, or {@code null} if the * Media period identifier for the media period this event belongs to, or {@code null} if the
* event is not associated with a specific media period. * event is not associated with a specific media period.
*/ */
public final @Nullable MediaPeriodId mediaPeriodId; @Nullable public final MediaPeriodId mediaPeriodId;
/** /**
* Position in the window or ad this event belongs to at the time of the event, in milliseconds. * Position in the window or ad this event belongs to at the time of the event, in milliseconds.
......
...@@ -103,7 +103,7 @@ public final class AudioFocusManager { ...@@ -103,7 +103,7 @@ public final class AudioFocusManager {
private final AudioManager audioManager; private final AudioManager audioManager;
private final AudioFocusListener focusListener; private final AudioFocusListener focusListener;
private final PlayerControl playerControl; private final PlayerControl playerControl;
private @Nullable AudioAttributes audioAttributes; @Nullable private AudioAttributes audioAttributes;
private @AudioFocusState int audioFocusState; private @AudioFocusState int audioFocusState;
private int focusGain; private int focusGain;
......
...@@ -82,7 +82,7 @@ import java.lang.annotation.RetentionPolicy; ...@@ -82,7 +82,7 @@ import java.lang.annotation.RetentionPolicy;
*/ */
private static final int INITIALIZING_DURATION_US = 500_000; private static final int INITIALIZING_DURATION_US = 500_000;
private final @Nullable AudioTimestampV19 audioTimestamp; @Nullable private final AudioTimestampV19 audioTimestamp;
private @State int state; private @State int state;
private long initializeSystemTimeUs; private long initializeSystemTimeUs;
......
...@@ -133,10 +133,10 @@ import java.lang.reflect.Method; ...@@ -133,10 +133,10 @@ import java.lang.reflect.Method;
private final Listener listener; private final Listener listener;
private final long[] playheadOffsets; private final long[] playheadOffsets;
private @Nullable AudioTrack audioTrack; @Nullable private AudioTrack audioTrack;
private int outputPcmFrameSize; private int outputPcmFrameSize;
private int bufferSize; private int bufferSize;
private @Nullable AudioTimestampPoller audioTimestampPoller; @Nullable private AudioTimestampPoller audioTimestampPoller;
private int outputSampleRate; private int outputSampleRate;
private boolean needsPassthroughWorkarounds; private boolean needsPassthroughWorkarounds;
private long bufferSizeUs; private long bufferSizeUs;
...@@ -144,7 +144,7 @@ import java.lang.reflect.Method; ...@@ -144,7 +144,7 @@ import java.lang.reflect.Method;
private long smoothedPlayheadOffsetUs; private long smoothedPlayheadOffsetUs;
private long lastPlayheadSampleTimeUs; private long lastPlayheadSampleTimeUs;
private @Nullable Method getLatencyMethod; @Nullable private Method getLatencyMethod;
private long latencyUs; private long latencyUs;
private boolean hasData; private boolean hasData;
......
...@@ -88,13 +88,13 @@ import org.checkerframework.checker.nullness.qual.RequiresNonNull; ...@@ -88,13 +88,13 @@ import org.checkerframework.checker.nullness.qual.RequiresNonNull;
private static final int MAX_LICENSE_DURATION_TO_RENEW_SECONDS = 60; private static final int MAX_LICENSE_DURATION_TO_RENEW_SECONDS = 60;
/** The DRM scheme datas, or null if this session uses offline keys. */ /** The DRM scheme datas, or null if this session uses offline keys. */
public final @Nullable List<SchemeData> schemeDatas; @Nullable public final List<SchemeData> schemeDatas;
private final ExoMediaDrm<T> mediaDrm; private final ExoMediaDrm<T> mediaDrm;
private final ProvisioningManager<T> provisioningManager; private final ProvisioningManager<T> provisioningManager;
private final ReleaseCallback<T> releaseCallback; private final ReleaseCallback<T> releaseCallback;
private final @DefaultDrmSessionManager.Mode int mode; private final @DefaultDrmSessionManager.Mode int mode;
private final @Nullable HashMap<String, String> optionalKeyRequestParameters; @Nullable private final HashMap<String, String> optionalKeyRequestParameters;
private final EventDispatcher<DefaultDrmSessionEventListener> eventDispatcher; private final EventDispatcher<DefaultDrmSessionEventListener> eventDispatcher;
private final int initialDrmRequestRetryCount; private final int initialDrmRequestRetryCount;
...@@ -111,8 +111,8 @@ import org.checkerframework.checker.nullness.qual.RequiresNonNull; ...@@ -111,8 +111,8 @@ import org.checkerframework.checker.nullness.qual.RequiresNonNull;
private byte @MonotonicNonNull [] sessionId; private byte @MonotonicNonNull [] sessionId;
private byte @MonotonicNonNull [] offlineLicenseKeySetId; private byte @MonotonicNonNull [] offlineLicenseKeySetId;
private @Nullable KeyRequest currentKeyRequest; @Nullable private KeyRequest currentKeyRequest;
private @Nullable ProvisionRequest currentProvisionRequest; @Nullable private ProvisionRequest currentProvisionRequest;
/** /**
* Instantiates a new DRM session. * Instantiates a new DRM session.
...@@ -259,12 +259,14 @@ import org.checkerframework.checker.nullness.qual.RequiresNonNull; ...@@ -259,12 +259,14 @@ import org.checkerframework.checker.nullness.qual.RequiresNonNull;
} }
@Override @Override
public @Nullable Map<String, String> queryKeyStatus() { @Nullable
public Map<String, String> queryKeyStatus() {
return sessionId == null ? null : mediaDrm.queryKeyStatus(sessionId); return sessionId == null ? null : mediaDrm.queryKeyStatus(sessionId);
} }
@Override @Override
public @Nullable byte[] getOfflineLicenseKeySetId() { @Nullable
public byte[] getOfflineLicenseKeySetId() {
return offlineLicenseKeySetId; return offlineLicenseKeySetId;
} }
......
...@@ -88,7 +88,7 @@ public class DefaultDrmSessionManager<T extends ExoMediaCrypto> ...@@ -88,7 +88,7 @@ public class DefaultDrmSessionManager<T extends ExoMediaCrypto>
private final UUID uuid; private final UUID uuid;
private final ExoMediaDrm<T> mediaDrm; private final ExoMediaDrm<T> mediaDrm;
private final MediaDrmCallback callback; private final MediaDrmCallback callback;
private final @Nullable HashMap<String, String> optionalKeyRequestParameters; @Nullable private final HashMap<String, String> optionalKeyRequestParameters;
private final EventDispatcher<DefaultDrmSessionEventListener> eventDispatcher; private final EventDispatcher<DefaultDrmSessionEventListener> eventDispatcher;
private final boolean multiSession; private final boolean multiSession;
private final int initialDrmRequestRetryCount; private final int initialDrmRequestRetryCount;
...@@ -96,9 +96,9 @@ public class DefaultDrmSessionManager<T extends ExoMediaCrypto> ...@@ -96,9 +96,9 @@ public class DefaultDrmSessionManager<T extends ExoMediaCrypto>
private final List<DefaultDrmSession<T>> sessions; private final List<DefaultDrmSession<T>> sessions;
private final List<DefaultDrmSession<T>> provisioningSessions; private final List<DefaultDrmSession<T>> provisioningSessions;
private @Nullable Looper playbackLooper; @Nullable private Looper playbackLooper;
private int mode; private int mode;
private @Nullable byte[] offlineLicenseKeySetId; @Nullable private byte[] offlineLicenseKeySetId;
/* package */ volatile @Nullable MediaDrmHandler mediaDrmHandler; /* package */ volatile @Nullable MediaDrmHandler mediaDrmHandler;
......
...@@ -87,7 +87,7 @@ public final class DrmInitData implements Comparator<SchemeData>, Parcelable { ...@@ -87,7 +87,7 @@ public final class DrmInitData implements Comparator<SchemeData>, Parcelable {
private int hashCode; private int hashCode;
/** The protection scheme type, or null if not applicable or unknown. */ /** The protection scheme type, or null if not applicable or unknown. */
public final @Nullable String schemeType; @Nullable public final String schemeType;
/** /**
* Number of {@link SchemeData}s. * Number of {@link SchemeData}s.
...@@ -152,7 +152,8 @@ public final class DrmInitData implements Comparator<SchemeData>, Parcelable { ...@@ -152,7 +152,8 @@ public final class DrmInitData implements Comparator<SchemeData>, Parcelable {
* @return The initialization data for the scheme, or null if the scheme is not supported. * @return The initialization data for the scheme, or null if the scheme is not supported.
*/ */
@Deprecated @Deprecated
public @Nullable SchemeData get(UUID uuid) { @Nullable
public SchemeData get(UUID uuid) {
for (SchemeData schemeData : schemeDatas) { for (SchemeData schemeData : schemeDatas) {
if (schemeData.matches(uuid)) { if (schemeData.matches(uuid)) {
return schemeData; return schemeData;
...@@ -286,11 +287,11 @@ public final class DrmInitData implements Comparator<SchemeData>, Parcelable { ...@@ -286,11 +287,11 @@ public final class DrmInitData implements Comparator<SchemeData>, Parcelable {
*/ */
private final UUID uuid; private final UUID uuid;
/** The URL of the server to which license requests should be made. May be null if unknown. */ /** The URL of the server to which license requests should be made. May be null if unknown. */
public final @Nullable String licenseServerUrl; @Nullable public final String licenseServerUrl;
/** The mimeType of {@link #data}. */ /** The mimeType of {@link #data}. */
public final String mimeType; public final String mimeType;
/** The initialization data. May be null for scheme support checks only. */ /** The initialization data. May be null for scheme support checks only. */
public final @Nullable byte[] data; @Nullable public final byte[] data;
/** /**
* @param uuid The {@link UUID} of the DRM scheme, or {@link C#UUID_NIL} if the data is * @param uuid The {@link UUID} of the DRM scheme, or {@link C#UUID_NIL} if the data is
......
...@@ -34,22 +34,26 @@ public final class ErrorStateDrmSession<T extends ExoMediaCrypto> implements Drm ...@@ -34,22 +34,26 @@ public final class ErrorStateDrmSession<T extends ExoMediaCrypto> implements Drm
} }
@Override @Override
public @Nullable DrmSessionException getError() { @Nullable
public DrmSessionException getError() {
return error; return error;
} }
@Override @Override
public @Nullable T getMediaCrypto() { @Nullable
public T getMediaCrypto() {
return null; return null;
} }
@Override @Override
public @Nullable Map<String, String> queryKeyStatus() { @Nullable
public Map<String, String> queryKeyStatus() {
return null; return null;
} }
@Override @Override
public @Nullable byte[] getOfflineLicenseKeySetId() { @Nullable
public byte[] getOfflineLicenseKeySetId() {
return null; return null;
} }
......
...@@ -140,7 +140,7 @@ public final class AmrExtractor implements Extractor { ...@@ -140,7 +140,7 @@ public final class AmrExtractor implements Extractor {
private ExtractorOutput extractorOutput; private ExtractorOutput extractorOutput;
private TrackOutput trackOutput; private TrackOutput trackOutput;
private @Nullable SeekMap seekMap; @Nullable private SeekMap seekMap;
private boolean hasOutputFormat; private boolean hasOutputFormat;
public AmrExtractor() { public AmrExtractor() {
......
...@@ -90,7 +90,7 @@ import com.google.android.exoplayer2.util.Util; ...@@ -90,7 +90,7 @@ import com.google.android.exoplayer2.util.Util;
* Entries are in the range [0, 255], but are stored as long integers for convenience. Null if the * Entries are in the range [0, 255], but are stored as long integers for convenience. Null if the
* table of contents was missing from the header, in which case seeking is not be supported. * table of contents was missing from the header, in which case seeking is not be supported.
*/ */
private final @Nullable long[] tableOfContents; @Nullable private final long[] tableOfContents;
private XingSeeker(long dataStartPosition, int xingFrameSize, long durationUs) { private XingSeeker(long dataStartPosition, int xingFrameSize, long durationUs) {
this( this(
......
...@@ -458,7 +458,8 @@ import java.util.List; ...@@ -458,7 +458,8 @@ import java.util.List;
* @param type The leaf type. * @param type The leaf type.
* @return The child leaf of the given type, or null if no such child exists. * @return The child leaf of the given type, or null if no such child exists.
*/ */
public @Nullable LeafAtom getLeafAtomOfType(int type) { @Nullable
public LeafAtom getLeafAtomOfType(int type) {
int childrenSize = leafChildren.size(); int childrenSize = leafChildren.size();
for (int i = 0; i < childrenSize; i++) { for (int i = 0; i < childrenSize; i++) {
LeafAtom atom = leafChildren.get(i); LeafAtom atom = leafChildren.get(i);
...@@ -478,7 +479,8 @@ import java.util.List; ...@@ -478,7 +479,8 @@ import java.util.List;
* @param type The container type. * @param type The container type.
* @return The child container of the given type, or null if no such child exists. * @return The child container of the given type, or null if no such child exists.
*/ */
public @Nullable ContainerAtom getContainerAtomOfType(int type) { @Nullable
public ContainerAtom getContainerAtomOfType(int type) {
int childrenSize = containerChildren.size(); int childrenSize = containerChildren.size();
for (int i = 0; i < childrenSize; i++) { for (int i = 0; i < childrenSize; i++) {
ContainerAtom atom = containerChildren.get(i); ContainerAtom atom = containerChildren.get(i);
......
...@@ -122,11 +122,11 @@ public class FragmentedMp4Extractor implements Extractor { ...@@ -122,11 +122,11 @@ public class FragmentedMp4Extractor implements Extractor {
// Workarounds. // Workarounds.
@Flags private final int flags; @Flags private final int flags;
private final @Nullable Track sideloadedTrack; @Nullable private final Track sideloadedTrack;
// Sideloaded data. // Sideloaded data.
private final List<Format> closedCaptionFormats; private final List<Format> closedCaptionFormats;
private final @Nullable DrmInitData sideloadedDrmInitData; @Nullable private final DrmInitData sideloadedDrmInitData;
// Track-linked data bundle, accessible as a whole through trackID. // Track-linked data bundle, accessible as a whole through trackID.
private final SparseArray<TrackBundle> trackBundles; private final SparseArray<TrackBundle> trackBundles;
...@@ -139,13 +139,13 @@ public class FragmentedMp4Extractor implements Extractor { ...@@ -139,13 +139,13 @@ public class FragmentedMp4Extractor implements Extractor {
private final ParsableByteArray scratch; private final ParsableByteArray scratch;
// Adjusts sample timestamps. // Adjusts sample timestamps.
private final @Nullable TimestampAdjuster timestampAdjuster; @Nullable private final TimestampAdjuster timestampAdjuster;
// Parser state. // Parser state.
private final ParsableByteArray atomHeader; private final ParsableByteArray atomHeader;
private final ArrayDeque<ContainerAtom> containerAtoms; private final ArrayDeque<ContainerAtom> containerAtoms;
private final ArrayDeque<MetadataSampleInfo> pendingMetadataSampleInfos; private final ArrayDeque<MetadataSampleInfo> pendingMetadataSampleInfos;
private final @Nullable TrackOutput additionalEmsgTrackOutput; @Nullable private final TrackOutput additionalEmsgTrackOutput;
private int parserState; private int parserState;
private int atomType; private int atomType;
......
...@@ -85,7 +85,7 @@ public final class AdtsExtractor implements Extractor { ...@@ -85,7 +85,7 @@ public final class AdtsExtractor implements Extractor {
private final ParsableBitArray scratchBits; private final ParsableBitArray scratchBits;
private final long firstStreamSampleTimestampUs; private final long firstStreamSampleTimestampUs;
private @Nullable ExtractorOutput extractorOutput; @Nullable private ExtractorOutput extractorOutput;
private long firstSampleTimestampUs; private long firstSampleTimestampUs;
private long firstFramePosition; private long firstFramePosition;
......
...@@ -94,7 +94,7 @@ public abstract class MediaCodecRenderer extends BaseRenderer { ...@@ -94,7 +94,7 @@ public abstract class MediaCodecRenderer extends BaseRenderer {
* to initialize, the {@link DecoderInitializationException} for the fallback decoder. Null if * to initialize, the {@link DecoderInitializationException} for the fallback decoder. Null if
* there was no fallback decoder or no suitable decoders were found. * there was no fallback decoder or no suitable decoders were found.
*/ */
public final @Nullable DecoderInitializationException fallbackDecoderInitializationException; @Nullable public final DecoderInitializationException fallbackDecoderInitializationException;
public DecoderInitializationException(Format format, Throwable cause, public DecoderInitializationException(Format format, Throwable cause,
boolean secureDecoderRequired, int errorCode) { boolean secureDecoderRequired, int errorCode) {
......
...@@ -40,7 +40,8 @@ public interface MediaCodecSelector { ...@@ -40,7 +40,8 @@ public interface MediaCodecSelector {
} }
@Override @Override
public @Nullable MediaCodecInfo getPassthroughDecoderInfo() throws DecoderQueryException { @Nullable
public MediaCodecInfo getPassthroughDecoderInfo() throws DecoderQueryException {
return MediaCodecUtil.getPassthroughDecoderInfo(); return MediaCodecUtil.getPassthroughDecoderInfo();
} }
}; };
......
...@@ -48,7 +48,7 @@ public final class MetadataRenderer extends BaseRenderer implements Callback { ...@@ -48,7 +48,7 @@ public final class MetadataRenderer extends BaseRenderer implements Callback {
private final MetadataDecoderFactory decoderFactory; private final MetadataDecoderFactory decoderFactory;
private final MetadataOutput output; private final MetadataOutput output;
private final @Nullable Handler outputHandler; @Nullable private final Handler outputHandler;
private final FormatHolder formatHolder; private final FormatHolder formatHolder;
private final MetadataInputBuffer buffer; private final MetadataInputBuffer buffer;
private final Metadata[] pendingMetadata; private final Metadata[] pendingMetadata;
......
...@@ -31,7 +31,7 @@ public final class ApicFrame extends Id3Frame { ...@@ -31,7 +31,7 @@ public final class ApicFrame extends Id3Frame {
public static final String ID = "APIC"; public static final String ID = "APIC";
public final String mimeType; public final String mimeType;
public final @Nullable String description; @Nullable public final String description;
public final int pictureType; public final int pictureType;
public final byte[] pictureData; public final byte[] pictureData;
......
...@@ -82,7 +82,7 @@ public final class Id3Decoder implements MetadataDecoder { ...@@ -82,7 +82,7 @@ public final class Id3Decoder implements MetadataDecoder {
private static final int ID3_TEXT_ENCODING_UTF_16BE = 2; private static final int ID3_TEXT_ENCODING_UTF_16BE = 2;
private static final int ID3_TEXT_ENCODING_UTF_8 = 3; private static final int ID3_TEXT_ENCODING_UTF_8 = 3;
private final @Nullable FramePredicate framePredicate; @Nullable private final FramePredicate framePredicate;
public Id3Decoder() { public Id3Decoder() {
this(null); this(null);
...@@ -97,7 +97,8 @@ public final class Id3Decoder implements MetadataDecoder { ...@@ -97,7 +97,8 @@ public final class Id3Decoder implements MetadataDecoder {
@SuppressWarnings("ByteBufferBackingArray") @SuppressWarnings("ByteBufferBackingArray")
@Override @Override
public @Nullable Metadata decode(MetadataInputBuffer inputBuffer) { @Nullable
public Metadata decode(MetadataInputBuffer inputBuffer) {
ByteBuffer buffer = inputBuffer.data; ByteBuffer buffer = inputBuffer.data;
return decode(buffer.array(), buffer.limit()); return decode(buffer.array(), buffer.limit());
} }
...@@ -110,7 +111,8 @@ public final class Id3Decoder implements MetadataDecoder { ...@@ -110,7 +111,8 @@ public final class Id3Decoder implements MetadataDecoder {
* @return A {@link Metadata} object containing the decoded ID3 tags, or null if the data could * @return A {@link Metadata} object containing the decoded ID3 tags, or null if the data could
* not be decoded. * not be decoded.
*/ */
public @Nullable Metadata decode(byte[] data, int size) { @Nullable
public Metadata decode(byte[] data, int size) {
List<Id3Frame> id3Frames = new ArrayList<>(); List<Id3Frame> id3Frames = new ArrayList<>();
ParsableByteArray id3Data = new ParsableByteArray(data, size); ParsableByteArray id3Data = new ParsableByteArray(data, size);
......
...@@ -27,7 +27,7 @@ import com.google.android.exoplayer2.util.Util; ...@@ -27,7 +27,7 @@ import com.google.android.exoplayer2.util.Util;
*/ */
public final class TextInformationFrame extends Id3Frame { public final class TextInformationFrame extends Id3Frame {
public final @Nullable String description; @Nullable public final String description;
public final String value; public final String value;
public TextInformationFrame(String id, @Nullable String description, String value) { public TextInformationFrame(String id, @Nullable String description, String value) {
......
...@@ -27,7 +27,7 @@ import com.google.android.exoplayer2.util.Util; ...@@ -27,7 +27,7 @@ import com.google.android.exoplayer2.util.Util;
*/ */
public final class UrlLinkFrame extends Id3Frame { public final class UrlLinkFrame extends Id3Frame {
public final @Nullable String description; @Nullable public final String description;
public final String url; public final String url;
public UrlLinkFrame(String id, @Nullable String description, String url) { public UrlLinkFrame(String id, @Nullable String description, String url) {
......
...@@ -34,8 +34,8 @@ public abstract class CompositeMediaSource<T> extends BaseMediaSource { ...@@ -34,8 +34,8 @@ public abstract class CompositeMediaSource<T> extends BaseMediaSource {
private final HashMap<T, MediaSourceAndListener> childSources; private final HashMap<T, MediaSourceAndListener> childSources;
private @Nullable Handler eventHandler; @Nullable private Handler eventHandler;
private @Nullable TransferListener mediaTransferListener; @Nullable private TransferListener mediaTransferListener;
/** Create composite media source without child sources. */ /** Create composite media source without child sources. */
protected CompositeMediaSource() { protected CompositeMediaSource() {
......
...@@ -64,9 +64,9 @@ public final class ExtractorMediaSource extends BaseMediaSource ...@@ -64,9 +64,9 @@ public final class ExtractorMediaSource extends BaseMediaSource
private final DataSource.Factory dataSourceFactory; private final DataSource.Factory dataSourceFactory;
private @Nullable ExtractorsFactory extractorsFactory; @Nullable private ExtractorsFactory extractorsFactory;
private @Nullable String customCacheKey; @Nullable private String customCacheKey;
private @Nullable Object tag; @Nullable private Object tag;
private LoadErrorHandlingPolicy loadErrorHandlingPolicy; private LoadErrorHandlingPolicy loadErrorHandlingPolicy;
private int continueLoadingCheckIntervalBytes; private int continueLoadingCheckIntervalBytes;
private boolean isCreateCalled; private boolean isCreateCalled;
......
...@@ -101,7 +101,7 @@ public interface MediaSourceEventListener { ...@@ -101,7 +101,7 @@ public interface MediaSourceEventListener {
* The format of the track to which the data belongs. Null if the data does not belong to a * The format of the track to which the data belongs. Null if the data does not belong to a
* specific track. * specific track.
*/ */
public final @Nullable Format trackFormat; @Nullable public final Format trackFormat;
/** /**
* One of the {@link C} {@code SELECTION_REASON_*} constants if the data belongs to a track. * One of the {@link C} {@code SELECTION_REASON_*} constants if the data belongs to a track.
* {@link C#SELECTION_REASON_UNKNOWN} otherwise. * {@link C#SELECTION_REASON_UNKNOWN} otherwise.
...@@ -111,7 +111,7 @@ public interface MediaSourceEventListener { ...@@ -111,7 +111,7 @@ public interface MediaSourceEventListener {
* Optional data associated with the selection of the track to which the data belongs. Null if * Optional data associated with the selection of the track to which the data belongs. Null if
* the data does not belong to a track. * the data does not belong to a track.
*/ */
public final @Nullable Object trackSelectionData; @Nullable public final Object trackSelectionData;
/** /**
* The start time of the media, or {@link C#TIME_UNSET} if the data does not belong to a * The start time of the media, or {@link C#TIME_UNSET} if the data does not belong to a
* specific media period. * specific media period.
...@@ -296,7 +296,7 @@ public interface MediaSourceEventListener { ...@@ -296,7 +296,7 @@ public interface MediaSourceEventListener {
/** The timeline window index reported with the events. */ /** The timeline window index reported with the events. */
public final int windowIndex; public final int windowIndex;
/** The {@link MediaPeriodId} reported with the events. */ /** The {@link MediaPeriodId} reported with the events. */
public final @Nullable MediaPeriodId mediaPeriodId; @Nullable public final MediaPeriodId mediaPeriodId;
private final CopyOnWriteArrayList<ListenerAndHandler> listenerAndHandlers; private final CopyOnWriteArrayList<ListenerAndHandler> listenerAndHandlers;
private final long mediaTimeOffsetMs; private final long mediaTimeOffsetMs;
......
...@@ -1013,7 +1013,7 @@ import org.checkerframework.checker.nullness.compatqual.NullableType; ...@@ -1013,7 +1013,7 @@ import org.checkerframework.checker.nullness.compatqual.NullableType;
private final Extractor[] extractors; private final Extractor[] extractors;
private @Nullable Extractor extractor; @Nullable private Extractor extractor;
/** /**
* Creates a holder that will select an extractor and initialize it using the specified output. * Creates a holder that will select an extractor and initialize it using the specified output.
......
...@@ -35,7 +35,7 @@ public final class SinglePeriodTimeline extends Timeline { ...@@ -35,7 +35,7 @@ public final class SinglePeriodTimeline extends Timeline {
private final long windowDefaultStartPositionUs; private final long windowDefaultStartPositionUs;
private final boolean isSeekable; private final boolean isSeekable;
private final boolean isDynamic; private final boolean isDynamic;
private final @Nullable Object tag; @Nullable private final Object tag;
/** /**
* Creates a timeline containing a single period and a window that spans it. * Creates a timeline containing a single period and a window that spans it.
......
...@@ -53,7 +53,7 @@ import org.checkerframework.checker.nullness.qual.MonotonicNonNull; ...@@ -53,7 +53,7 @@ import org.checkerframework.checker.nullness.qual.MonotonicNonNull;
private final DataSpec dataSpec; private final DataSpec dataSpec;
private final DataSource.Factory dataSourceFactory; private final DataSource.Factory dataSourceFactory;
private final @Nullable TransferListener transferListener; @Nullable private final TransferListener transferListener;
private final LoadErrorHandlingPolicy loadErrorHandlingPolicy; private final LoadErrorHandlingPolicy loadErrorHandlingPolicy;
private final EventDispatcher eventDispatcher; private final EventDispatcher eventDispatcher;
private final TrackGroupArray tracks; private final TrackGroupArray tracks;
......
...@@ -60,7 +60,7 @@ public final class SingleSampleMediaSource extends BaseMediaSource { ...@@ -60,7 +60,7 @@ public final class SingleSampleMediaSource extends BaseMediaSource {
private LoadErrorHandlingPolicy loadErrorHandlingPolicy; private LoadErrorHandlingPolicy loadErrorHandlingPolicy;
private boolean treatLoadErrorsAsEndOfStream; private boolean treatLoadErrorsAsEndOfStream;
private boolean isCreateCalled; private boolean isCreateCalled;
private @Nullable Object tag; @Nullable private Object tag;
/** /**
* Creates a factory for {@link SingleSampleMediaSource}s. * Creates a factory for {@link SingleSampleMediaSource}s.
...@@ -186,7 +186,7 @@ public final class SingleSampleMediaSource extends BaseMediaSource { ...@@ -186,7 +186,7 @@ public final class SingleSampleMediaSource extends BaseMediaSource {
private final Timeline timeline; private final Timeline timeline;
@Nullable private final Object tag; @Nullable private final Object tag;
private @Nullable TransferListener transferListener; @Nullable private TransferListener transferListener;
/** /**
* @param uri The {@link Uri} of the media stream. * @param uri The {@link Uri} of the media stream.
......
...@@ -56,7 +56,7 @@ public abstract class Chunk implements Loadable { ...@@ -56,7 +56,7 @@ public abstract class Chunk implements Loadable {
* Optional data associated with the selection of the track to which this chunk belongs. Null if * Optional data associated with the selection of the track to which this chunk belongs. Null if
* the chunk does not belong to a track. * the chunk does not belong to a track.
*/ */
public final @Nullable Object trackSelectionData; @Nullable public final Object trackSelectionData;
/** /**
* The start time of the media contained by the chunk, or {@link C#TIME_UNSET} if the data * The start time of the media contained by the chunk, or {@link C#TIME_UNSET} if the data
* being loaded does not contain media samples. * being loaded does not contain media samples.
......
...@@ -76,7 +76,7 @@ public class ChunkSampleStream<T extends ChunkSource> implements SampleStream, S ...@@ -76,7 +76,7 @@ public class ChunkSampleStream<T extends ChunkSource> implements SampleStream, S
private final BaseMediaChunkOutput mediaChunkOutput; private final BaseMediaChunkOutput mediaChunkOutput;
private Format primaryDownstreamTrackFormat; private Format primaryDownstreamTrackFormat;
private @Nullable ReleaseCallback<T> releaseCallback; @Nullable private ReleaseCallback<T> releaseCallback;
private long pendingResetPositionUs; private long pendingResetPositionUs;
private long lastSeekPositionUs; private long lastSeekPositionUs;
private int nextNotifyPrimaryFormatMediaChunkIndex; private int nextNotifyPrimaryFormatMediaChunkIndex;
......
...@@ -77,7 +77,7 @@ public final class TextRenderer extends BaseRenderer implements Callback { ...@@ -77,7 +77,7 @@ public final class TextRenderer extends BaseRenderer implements Callback {
private static final int MSG_UPDATE_OUTPUT = 0; private static final int MSG_UPDATE_OUTPUT = 0;
private final @Nullable Handler outputHandler; @Nullable private final Handler outputHandler;
private final TextOutput output; private final TextOutput output;
private final SubtitleDecoderFactory decoderFactory; private final SubtitleDecoderFactory decoderFactory;
private final FormatHolder formatHolder; private final FormatHolder formatHolder;
......
...@@ -39,7 +39,7 @@ public class AdaptiveTrackSelection extends BaseTrackSelection { ...@@ -39,7 +39,7 @@ public class AdaptiveTrackSelection extends BaseTrackSelection {
/** Factory for {@link AdaptiveTrackSelection} instances. */ /** Factory for {@link AdaptiveTrackSelection} instances. */
public static class Factory implements TrackSelection.Factory { public static class Factory implements TrackSelection.Factory {
private final @Nullable BandwidthMeter bandwidthMeter; @Nullable private final BandwidthMeter bandwidthMeter;
private final int minDurationForQualityIncreaseMs; private final int minDurationForQualityIncreaseMs;
private final int maxDurationForQualityDecreaseMs; private final int maxDurationForQualityDecreaseMs;
private final int minDurationToRetainAfterDiscardMs; private final int minDurationToRetainAfterDiscardMs;
...@@ -537,7 +537,8 @@ public class AdaptiveTrackSelection extends BaseTrackSelection { ...@@ -537,7 +537,8 @@ public class AdaptiveTrackSelection extends BaseTrackSelection {
} }
@Override @Override
public @Nullable Object getSelectionData() { @Nullable
public Object getSelectionData() {
return null; return null;
} }
......
...@@ -39,7 +39,7 @@ public final class FixedTrackSelection extends BaseTrackSelection { ...@@ -39,7 +39,7 @@ public final class FixedTrackSelection extends BaseTrackSelection {
public static final class Factory implements TrackSelection.Factory { public static final class Factory implements TrackSelection.Factory {
private final int reason; private final int reason;
private final @Nullable Object data; @Nullable private final Object data;
public Factory() { public Factory() {
this.reason = C.SELECTION_REASON_UNKNOWN; this.reason = C.SELECTION_REASON_UNKNOWN;
...@@ -66,7 +66,7 @@ public final class FixedTrackSelection extends BaseTrackSelection { ...@@ -66,7 +66,7 @@ public final class FixedTrackSelection extends BaseTrackSelection {
} }
private final int reason; private final int reason;
private final @Nullable Object data; @Nullable private final Object data;
/** /**
* @param group The {@link TrackGroup}. Must not be null. * @param group The {@link TrackGroup}. Must not be null.
...@@ -109,7 +109,8 @@ public final class FixedTrackSelection extends BaseTrackSelection { ...@@ -109,7 +109,8 @@ public final class FixedTrackSelection extends BaseTrackSelection {
} }
@Override @Override
public @Nullable Object getSelectionData() { @Nullable
public Object getSelectionData() {
return data; return data;
} }
......
...@@ -312,7 +312,7 @@ public abstract class MappingTrackSelector extends TrackSelector { ...@@ -312,7 +312,7 @@ public abstract class MappingTrackSelector extends TrackSelector {
} }
private @Nullable MappedTrackInfo currentMappedTrackInfo; @Nullable private MappedTrackInfo currentMappedTrackInfo;
/** /**
* Returns the mapping information for the currently active track selection, or null if no * Returns the mapping information for the currently active track selection, or null if no
......
...@@ -135,7 +135,8 @@ public final class RandomTrackSelection extends BaseTrackSelection { ...@@ -135,7 +135,8 @@ public final class RandomTrackSelection extends BaseTrackSelection {
} }
@Override @Override
public @Nullable Object getSelectionData() { @Nullable
public Object getSelectionData() {
return null; return null;
} }
......
...@@ -42,7 +42,8 @@ public final class TrackSelectionArray { ...@@ -42,7 +42,8 @@ public final class TrackSelectionArray {
* @param index The index of the selection. * @param index The index of the selection.
* @return The selection. * @return The selection.
*/ */
public @Nullable TrackSelection get(int index) { @Nullable
public TrackSelection get(int index) {
return trackSelections[index]; return trackSelections[index];
} }
......
...@@ -98,8 +98,8 @@ public abstract class TrackSelector { ...@@ -98,8 +98,8 @@ public abstract class TrackSelector {
} }
private @Nullable InvalidationListener listener; @Nullable private InvalidationListener listener;
private @Nullable BandwidthMeter bandwidthMeter; @Nullable private BandwidthMeter bandwidthMeter;
/** /**
* Called by the player to initialize the selector. * Called by the player to initialize the selector.
......
...@@ -33,7 +33,7 @@ public abstract class BaseDataSource implements DataSource { ...@@ -33,7 +33,7 @@ public abstract class BaseDataSource implements DataSource {
private final ArrayList<TransferListener> listeners; private final ArrayList<TransferListener> listeners;
private int listenerCount; private int listenerCount;
private @Nullable DataSpec dataSpec; @Nullable private DataSpec dataSpec;
/** /**
* Creates base data source. * Creates base data source.
......
...@@ -97,10 +97,10 @@ public final class DataSpec { ...@@ -97,10 +97,10 @@ public final class DataSpec {
/** /**
* The HTTP body, null otherwise. If the body is non-null, then httpBody.length will be non-zero. * The HTTP body, null otherwise. If the body is non-null, then httpBody.length will be non-zero.
*/ */
public final @Nullable byte[] httpBody; @Nullable public final byte[] httpBody;
/** @deprecated Use {@link #httpBody} instead. */ /** @deprecated Use {@link #httpBody} instead. */
@Deprecated public final @Nullable byte[] postBody; @Deprecated @Nullable public final byte[] postBody;
/** /**
* The absolute position of the data in the full stream. * The absolute position of the data in the full stream.
...@@ -121,7 +121,7 @@ public final class DataSpec { ...@@ -121,7 +121,7 @@ public final class DataSpec {
* A key that uniquely identifies the original stream. Used for cache indexing. May be null if the * A key that uniquely identifies the original stream. Used for cache indexing. May be null if the
* data spec is not intended to be used in conjunction with a cache. * data spec is not intended to be used in conjunction with a cache.
*/ */
public final @Nullable String key; @Nullable public final String key;
/** Request {@link Flags flags}. */ /** Request {@link Flags flags}. */
public final @Flags int flags; public final @Flags int flags;
......
...@@ -62,14 +62,14 @@ public final class DefaultDataSource implements DataSource { ...@@ -62,14 +62,14 @@ public final class DefaultDataSource implements DataSource {
private final DataSource baseDataSource; private final DataSource baseDataSource;
// Lazily initialized. // Lazily initialized.
private @Nullable DataSource fileDataSource; @Nullable private DataSource fileDataSource;
private @Nullable DataSource assetDataSource; @Nullable private DataSource assetDataSource;
private @Nullable DataSource contentDataSource; @Nullable private DataSource contentDataSource;
private @Nullable DataSource rtmpDataSource; @Nullable private DataSource rtmpDataSource;
private @Nullable DataSource dataSchemeDataSource; @Nullable private DataSource dataSchemeDataSource;
private @Nullable DataSource rawResourceDataSource; @Nullable private DataSource rawResourceDataSource;
private @Nullable DataSource dataSource; @Nullable private DataSource dataSource;
/** /**
* Constructs a new instance, optionally configured to follow cross-protocol redirects. * Constructs a new instance, optionally configured to follow cross-protocol redirects.
...@@ -178,7 +178,8 @@ public final class DefaultDataSource implements DataSource { ...@@ -178,7 +178,8 @@ public final class DefaultDataSource implements DataSource {
} }
@Override @Override
public @Nullable Uri getUri() { @Nullable
public Uri getUri() {
return dataSource == null ? null : dataSource.getUri(); return dataSource == null ? null : dataSource.getUri();
} }
......
...@@ -26,7 +26,7 @@ import com.google.android.exoplayer2.upstream.DataSource.Factory; ...@@ -26,7 +26,7 @@ import com.google.android.exoplayer2.upstream.DataSource.Factory;
public final class DefaultDataSourceFactory implements Factory { public final class DefaultDataSourceFactory implements Factory {
private final Context context; private final Context context;
private final @Nullable TransferListener listener; @Nullable private final TransferListener listener;
private final DataSource.Factory baseDataSourceFactory; private final DataSource.Factory baseDataSourceFactory;
/** /**
......
...@@ -228,7 +228,8 @@ public class DefaultHttpDataSource extends BaseDataSource implements HttpDataSou ...@@ -228,7 +228,8 @@ public class DefaultHttpDataSource extends BaseDataSource implements HttpDataSou
} }
@Override @Override
public @Nullable Uri getUri() { @Nullable
public Uri getUri() {
return connection == null ? null : Uri.parse(connection.getURL().toString()); return connection == null ? null : Uri.parse(connection.getURL().toString());
} }
......
...@@ -24,7 +24,7 @@ import com.google.android.exoplayer2.util.Assertions; ...@@ -24,7 +24,7 @@ import com.google.android.exoplayer2.util.Assertions;
public final class DefaultHttpDataSourceFactory extends BaseFactory { public final class DefaultHttpDataSourceFactory extends BaseFactory {
private final String userAgent; private final String userAgent;
private final @Nullable TransferListener listener; @Nullable private final TransferListener listener;
private final int connectTimeoutMillis; private final int connectTimeoutMillis;
private final int readTimeoutMillis; private final int readTimeoutMillis;
private final boolean allowCrossProtocolRedirects; private final boolean allowCrossProtocolRedirects;
......
...@@ -22,7 +22,7 @@ import androidx.annotation.Nullable; ...@@ -22,7 +22,7 @@ import androidx.annotation.Nullable;
*/ */
public final class FileDataSourceFactory implements DataSource.Factory { public final class FileDataSourceFactory implements DataSource.Factory {
private final @Nullable TransferListener listener; @Nullable private final TransferListener listener;
public FileDataSourceFactory() { public FileDataSourceFactory() {
this(null); this(null);
......
...@@ -311,7 +311,7 @@ public final class Loader implements LoaderErrorThrower { ...@@ -311,7 +311,7 @@ public final class Loader implements LoaderErrorThrower {
private final T loadable; private final T loadable;
private final long startTimeMs; private final long startTimeMs;
private @Nullable Loader.Callback<T> callback; @Nullable private Loader.Callback<T> callback;
private IOException currentError; private IOException currentError;
private int errorCount; private int errorCount;
......
...@@ -71,7 +71,8 @@ public final class PriorityDataSource implements DataSource { ...@@ -71,7 +71,8 @@ public final class PriorityDataSource implements DataSource {
} }
@Override @Override
public @Nullable Uri getUri() { @Nullable
public Uri getUri() {
return upstream.getUri(); return upstream.getUri();
} }
......
...@@ -96,7 +96,8 @@ public final class StatsDataSource implements DataSource { ...@@ -96,7 +96,8 @@ public final class StatsDataSource implements DataSource {
} }
@Override @Override
public @Nullable Uri getUri() { @Nullable
public Uri getUri() {
return dataSource.getUri(); return dataSource.getUri();
} }
......
...@@ -80,7 +80,8 @@ public final class TeeDataSource implements DataSource { ...@@ -80,7 +80,8 @@ public final class TeeDataSource implements DataSource {
} }
@Override @Override
public @Nullable Uri getUri() { @Nullable
public Uri getUri() {
return upstream.getUri(); return upstream.getUri();
} }
......
...@@ -123,7 +123,7 @@ public final class CacheDataSource implements DataSource { ...@@ -123,7 +123,7 @@ public final class CacheDataSource implements DataSource {
private final Cache cache; private final Cache cache;
private final DataSource cacheReadDataSource; private final DataSource cacheReadDataSource;
private final @Nullable DataSource cacheWriteDataSource; @Nullable private final DataSource cacheWriteDataSource;
private final DataSource upstreamDataSource; private final DataSource upstreamDataSource;
private final CacheKeyFactory cacheKeyFactory; private final CacheKeyFactory cacheKeyFactory;
@Nullable private final EventListener eventListener; @Nullable private final EventListener eventListener;
...@@ -132,16 +132,16 @@ public final class CacheDataSource implements DataSource { ...@@ -132,16 +132,16 @@ public final class CacheDataSource implements DataSource {
private final boolean ignoreCacheOnError; private final boolean ignoreCacheOnError;
private final boolean ignoreCacheForUnsetLengthRequests; private final boolean ignoreCacheForUnsetLengthRequests;
private @Nullable DataSource currentDataSource; @Nullable private DataSource currentDataSource;
private boolean currentDataSpecLengthUnset; private boolean currentDataSpecLengthUnset;
private @Nullable Uri uri; @Nullable private Uri uri;
private @Nullable Uri actualUri; @Nullable private Uri actualUri;
private @HttpMethod int httpMethod; private @HttpMethod int httpMethod;
private int flags; private int flags;
private @Nullable String key; @Nullable private String key;
private long readPosition; private long readPosition;
private long bytesRemaining; private long bytesRemaining;
private @Nullable CacheSpan currentHoleSpan; @Nullable private CacheSpan currentHoleSpan;
private boolean seenCacheError; private boolean seenCacheError;
private boolean currentRequestIgnoresCache; private boolean currentRequestIgnoresCache;
private long totalCachedBytesRead; private long totalCachedBytesRead;
...@@ -329,7 +329,8 @@ public final class CacheDataSource implements DataSource { ...@@ -329,7 +329,8 @@ public final class CacheDataSource implements DataSource {
} }
@Override @Override
public @Nullable Uri getUri() { @Nullable
public Uri getUri() {
return actualUri; return actualUri;
} }
......
...@@ -41,10 +41,8 @@ public class CacheSpan implements Comparable<CacheSpan> { ...@@ -41,10 +41,8 @@ public class CacheSpan implements Comparable<CacheSpan> {
* Whether the {@link CacheSpan} is cached. * Whether the {@link CacheSpan} is cached.
*/ */
public final boolean isCached; public final boolean isCached;
/** /** The file corresponding to this {@link CacheSpan}, or null if {@link #isCached} is false. */
* The file corresponding to this {@link CacheSpan}, or null if {@link #isCached} is false. @Nullable public final File file;
*/
public final @Nullable File file;
/** The last touch timestamp, or {@link C#TIME_UNSET} if {@link #isCached} is false. */ /** The last touch timestamp, or {@link C#TIME_UNSET} if {@link #isCached} is false. */
public final long lastTouchTimestamp; public final long lastTouchTimestamp;
......
...@@ -71,7 +71,8 @@ public final class AesCipherDataSource implements DataSource { ...@@ -71,7 +71,8 @@ public final class AesCipherDataSource implements DataSource {
} }
@Override @Override
public @Nullable Uri getUri() { @Nullable
public Uri getUri() {
return upstream.getUri(); return upstream.getUri();
} }
......
...@@ -83,12 +83,12 @@ public final class EGLSurfaceTexture implements SurfaceTexture.OnFrameAvailableL ...@@ -83,12 +83,12 @@ public final class EGLSurfaceTexture implements SurfaceTexture.OnFrameAvailableL
private final Handler handler; private final Handler handler;
private final int[] textureIdHolder; private final int[] textureIdHolder;
private final @Nullable TextureImageListener callback; @Nullable private final TextureImageListener callback;
private @Nullable EGLDisplay display; @Nullable private EGLDisplay display;
private @Nullable EGLContext context; @Nullable private EGLContext context;
private @Nullable EGLSurface surface; @Nullable private EGLSurface surface;
private @Nullable SurfaceTexture texture; @Nullable private SurfaceTexture texture;
/** /**
* @param handler The {@link Handler} that will be used to call {@link * @param handler The {@link Handler} that will be used to call {@link
......
...@@ -54,7 +54,7 @@ public class EventLogger implements AnalyticsListener { ...@@ -54,7 +54,7 @@ public class EventLogger implements AnalyticsListener {
TIME_FORMAT.setGroupingUsed(false); TIME_FORMAT.setGroupingUsed(false);
} }
private final @Nullable MappingTrackSelector trackSelector; @Nullable private final MappingTrackSelector trackSelector;
private final String tag; private final String tag;
private final Timeline.Window window; private final Timeline.Window window;
private final Timeline.Period period; private final Timeline.Period period;
......
...@@ -490,7 +490,8 @@ public final class ParsableByteArray { ...@@ -490,7 +490,8 @@ public final class ParsableByteArray {
* @return The string not including any terminating NUL byte, or null if the end of the data has * @return The string not including any terminating NUL byte, or null if the end of the data has
* already been reached. * already been reached.
*/ */
public @Nullable String readNullTerminatedString() { @Nullable
public String readNullTerminatedString() {
if (bytesLeft() == 0) { if (bytesLeft() == 0) {
return null; return null;
} }
...@@ -516,7 +517,8 @@ public final class ParsableByteArray { ...@@ -516,7 +517,8 @@ public final class ParsableByteArray {
* @return The line not including any line-termination characters, or null if the end of the data * @return The line not including any line-termination characters, or null if the end of the data
* has already been reached. * has already been reached.
*/ */
public @Nullable String readLine() { @Nullable
public String readLine() {
if (bytesLeft() == 0) { if (bytesLeft() == 0) {
return null; return null;
} }
......
...@@ -97,7 +97,8 @@ public final class TimedValueQueue<V> { ...@@ -97,7 +97,8 @@ public final class TimedValueQueue<V> {
* @return The value with the closest timestamp or null if the buffer is empty or there is no * @return The value with the closest timestamp or null if the buffer is empty or there is no
* older value and {@code onlyOlder} is true. * older value and {@code onlyOlder} is true.
*/ */
private @Nullable V poll(long timestamp, boolean onlyOlder) { @Nullable
private V poll(long timestamp, boolean onlyOlder) {
V value = null; V value = null;
long previousTimeDiff = Long.MAX_VALUE; long previousTimeDiff = Long.MAX_VALUE;
while (size > 0) { while (size > 0) {
......
...@@ -51,7 +51,7 @@ public final class ColorInfo implements Parcelable { ...@@ -51,7 +51,7 @@ public final class ColorInfo implements Parcelable {
public final int colorTransfer; public final int colorTransfer;
/** HdrStaticInfo as defined in CTA-861.3, or null if none specified. */ /** HdrStaticInfo as defined in CTA-861.3, or null if none specified. */
public final @Nullable byte[] hdrStaticInfo; @Nullable public final byte[] hdrStaticInfo;
// Lazily initialized hashcode. // Lazily initialized hashcode.
private int hashCode; private int hashCode;
......
...@@ -158,9 +158,9 @@ public final class DummySurface extends Surface { ...@@ -158,9 +158,9 @@ public final class DummySurface extends Surface {
private @MonotonicNonNull EGLSurfaceTexture eglSurfaceTexture; private @MonotonicNonNull EGLSurfaceTexture eglSurfaceTexture;
private @MonotonicNonNull Handler handler; private @MonotonicNonNull Handler handler;
private @Nullable Error initError; @Nullable private Error initError;
private @Nullable RuntimeException initException; @Nullable private RuntimeException initException;
private @Nullable DummySurface surface; @Nullable private DummySurface surface;
public DummySurfaceThread() { public DummySurfaceThread() {
super("dummySurface"); super("dummySurface");
......
...@@ -27,7 +27,7 @@ import java.util.List; ...@@ -27,7 +27,7 @@ import java.util.List;
*/ */
public final class HevcConfig { public final class HevcConfig {
public final @Nullable List<byte[]> initializationData; @Nullable public final List<byte[]> initializationData;
public final int nalUnitLengthFieldLength; public final int nalUnitLengthFieldLength;
/** /**
......
...@@ -138,7 +138,7 @@ public class MediaCodecVideoRenderer extends MediaCodecRenderer { ...@@ -138,7 +138,7 @@ public class MediaCodecVideoRenderer extends MediaCodecRenderer {
private long lastInputTimeUs; private long lastInputTimeUs;
private long outputStreamOffsetUs; private long outputStreamOffsetUs;
private int pendingOutputStreamOffsetCount; private int pendingOutputStreamOffsetCount;
private @Nullable VideoFrameMetadataListener frameMetadataListener; @Nullable private VideoFrameMetadataListener frameMetadataListener;
/** /**
* @param context A context. * @param context A context.
......
...@@ -39,7 +39,7 @@ public class CameraMotionRenderer extends BaseRenderer { ...@@ -39,7 +39,7 @@ public class CameraMotionRenderer extends BaseRenderer {
private final ParsableByteArray scratch; private final ParsableByteArray scratch;
private long offsetUs; private long offsetUs;
private @Nullable CameraMotionListener listener; @Nullable private CameraMotionListener listener;
private long lastTimestampUs; private long lastTimestampUs;
public CameraMotionRenderer() { public CameraMotionRenderer() {
......
...@@ -847,7 +847,7 @@ public final class AnalyticsCollectorTest { ...@@ -847,7 +847,7 @@ public final class AnalyticsCollectorTest {
private static final class EventWindowAndPeriodId { private static final class EventWindowAndPeriodId {
private final int windowIndex; private final int windowIndex;
private final @Nullable MediaPeriodId mediaPeriodId; @Nullable private final MediaPeriodId mediaPeriodId;
public EventWindowAndPeriodId(int windowIndex, @Nullable MediaPeriodId mediaPeriodId) { public EventWindowAndPeriodId(int windowIndex, @Nullable MediaPeriodId mediaPeriodId) {
this.windowIndex = windowIndex; this.windowIndex = windowIndex;
......
...@@ -107,7 +107,8 @@ public class BaseDataSourceTest { ...@@ -107,7 +107,8 @@ public class BaseDataSourceTest {
} }
@Override @Override
public @Nullable Uri getUri() { @Nullable
public Uri getUri() {
throw new UnsupportedOperationException(); throw new UnsupportedOperationException();
} }
......
...@@ -69,7 +69,7 @@ import java.util.regex.Pattern; ...@@ -69,7 +69,7 @@ import java.util.regex.Pattern;
/* package */ final int id; /* package */ final int id;
private final DashChunkSource.Factory chunkSourceFactory; private final DashChunkSource.Factory chunkSourceFactory;
private final @Nullable TransferListener transferListener; @Nullable private final TransferListener transferListener;
private final LoadErrorHandlingPolicy loadErrorHandlingPolicy; private final LoadErrorHandlingPolicy loadErrorHandlingPolicy;
private final long elapsedRealtimeOffsetMs; private final long elapsedRealtimeOffsetMs;
private final LoaderErrorThrower manifestLoaderErrorThrower; private final LoaderErrorThrower manifestLoaderErrorThrower;
...@@ -82,7 +82,7 @@ import java.util.regex.Pattern; ...@@ -82,7 +82,7 @@ import java.util.regex.Pattern;
trackEmsgHandlerBySampleStream; trackEmsgHandlerBySampleStream;
private final EventDispatcher eventDispatcher; private final EventDispatcher eventDispatcher;
private @Nullable Callback callback; @Nullable private Callback callback;
private ChunkSampleStream<DashChunkSource>[] sampleStreams; private ChunkSampleStream<DashChunkSource>[] sampleStreams;
private EventSampleStream[] eventSampleStreams; private EventSampleStream[] eventSampleStreams;
private SequenceableLoader compositeSequenceableLoader; private SequenceableLoader compositeSequenceableLoader;
......
...@@ -373,11 +373,11 @@ public final class DashMediaSource extends BaseMediaSource { ...@@ -373,11 +373,11 @@ public final class DashMediaSource extends BaseMediaSource {
private final Runnable simulateManifestRefreshRunnable; private final Runnable simulateManifestRefreshRunnable;
private final PlayerEmsgCallback playerEmsgCallback; private final PlayerEmsgCallback playerEmsgCallback;
private final LoaderErrorThrower manifestLoadErrorThrower; private final LoaderErrorThrower manifestLoadErrorThrower;
private final @Nullable Object tag; @Nullable private final Object tag;
private DataSource dataSource; private DataSource dataSource;
private Loader loader; private Loader loader;
private @Nullable TransferListener mediaTransferListener; @Nullable private TransferListener mediaTransferListener;
private IOException manifestFatalError; private IOException manifestFatalError;
private Handler handler; private Handler handler;
...@@ -1139,7 +1139,7 @@ public final class DashMediaSource extends BaseMediaSource { ...@@ -1139,7 +1139,7 @@ public final class DashMediaSource extends BaseMediaSource {
private final long windowDurationUs; private final long windowDurationUs;
private final long windowDefaultStartPositionUs; private final long windowDefaultStartPositionUs;
private final DashManifest manifest; private final DashManifest manifest;
private final @Nullable Object windowTag; @Nullable private final Object windowTag;
public DashTimeline( public DashTimeline(
long presentationStartTimeMs, long presentationStartTimeMs,
......
...@@ -617,7 +617,7 @@ public class DefaultDashChunkSource implements DashChunkSource { ...@@ -617,7 +617,7 @@ public class DefaultDashChunkSource implements DashChunkSource {
/* package */ final @Nullable ChunkExtractorWrapper extractorWrapper; /* package */ final @Nullable ChunkExtractorWrapper extractorWrapper;
public final Representation representation; public final Representation representation;
public final @Nullable DashSegmentIndex segmentIndex; @Nullable public final DashSegmentIndex segmentIndex;
private final long periodDurationUs; private final long periodDurationUs;
private final long segmentNumShift; private final long segmentNumShift;
......
...@@ -86,7 +86,8 @@ public final class RangedUri { ...@@ -86,7 +86,8 @@ public final class RangedUri {
* @param baseUri The optional base Uri. * @param baseUri The optional base Uri.
* @return The merged {@link RangedUri} if the merge was successful. Null otherwise. * @return The merged {@link RangedUri} if the merge was successful. Null otherwise.
*/ */
public @Nullable RangedUri attemptMerge(@Nullable RangedUri other, String baseUri) { @Nullable
public RangedUri attemptMerge(@Nullable RangedUri other, String baseUri) {
final String resolvedUri = resolveUriString(baseUri); final String resolvedUri = resolveUriString(baseUri);
if (other == null || !resolvedUri.equals(other.resolveUriString(baseUri))) { if (other == null || !resolvedUri.equals(other.resolveUriString(baseUri))) {
return null; return null;
......
...@@ -51,7 +51,7 @@ import javax.crypto.spec.SecretKeySpec; ...@@ -51,7 +51,7 @@ import javax.crypto.spec.SecretKeySpec;
private final byte[] encryptionKey; private final byte[] encryptionKey;
private final byte[] encryptionIv; private final byte[] encryptionIv;
private @Nullable CipherInputStream cipherInputStream; @Nullable private CipherInputStream cipherInputStream;
/** /**
* @param upstream The upstream {@link DataSource}. * @param upstream The upstream {@link DataSource}.
......
...@@ -62,7 +62,7 @@ public final class HlsMediaPeriod implements MediaPeriod, HlsSampleStreamWrapper ...@@ -62,7 +62,7 @@ public final class HlsMediaPeriod implements MediaPeriod, HlsSampleStreamWrapper
private final HlsExtractorFactory extractorFactory; private final HlsExtractorFactory extractorFactory;
private final HlsPlaylistTracker playlistTracker; private final HlsPlaylistTracker playlistTracker;
private final HlsDataSourceFactory dataSourceFactory; private final HlsDataSourceFactory dataSourceFactory;
private final @Nullable TransferListener mediaTransferListener; @Nullable private final TransferListener mediaTransferListener;
private final LoadErrorHandlingPolicy loadErrorHandlingPolicy; private final LoadErrorHandlingPolicy loadErrorHandlingPolicy;
private final EventDispatcher eventDispatcher; private final EventDispatcher eventDispatcher;
private final Allocator allocator; private final Allocator allocator;
...@@ -72,7 +72,7 @@ public final class HlsMediaPeriod implements MediaPeriod, HlsSampleStreamWrapper ...@@ -72,7 +72,7 @@ public final class HlsMediaPeriod implements MediaPeriod, HlsSampleStreamWrapper
private final boolean allowChunklessPreparation; private final boolean allowChunklessPreparation;
private final boolean useSessionKeys; private final boolean useSessionKeys;
private @Nullable Callback callback; @Nullable private Callback callback;
private int pendingPrepareCount; private int pendingPrepareCount;
private TrackGroupArray trackGroups; private TrackGroupArray trackGroups;
private HlsSampleStreamWrapper[] sampleStreamWrappers; private HlsSampleStreamWrapper[] sampleStreamWrappers;
......
...@@ -301,9 +301,9 @@ public final class HlsMediaSource extends BaseMediaSource ...@@ -301,9 +301,9 @@ public final class HlsMediaSource extends BaseMediaSource
private final boolean allowChunklessPreparation; private final boolean allowChunklessPreparation;
private final boolean useSessionKeys; private final boolean useSessionKeys;
private final HlsPlaylistTracker playlistTracker; private final HlsPlaylistTracker playlistTracker;
private final @Nullable Object tag; @Nullable private final Object tag;
private @Nullable TransferListener mediaTransferListener; @Nullable private TransferListener mediaTransferListener;
private HlsMediaSource( private HlsMediaSource(
Uri manifestUri, Uri manifestUri,
......
...@@ -166,7 +166,8 @@ public final class DefaultHlsPlaylistTracker ...@@ -166,7 +166,8 @@ public final class DefaultHlsPlaylistTracker
} }
@Override @Override
public @Nullable HlsMasterPlaylist getMasterPlaylist() { @Nullable
public HlsMasterPlaylist getMasterPlaylist() {
return masterPlaylist; return masterPlaylist;
} }
......
...@@ -42,7 +42,7 @@ import java.util.List; ...@@ -42,7 +42,7 @@ import java.util.List;
implements MediaPeriod, SequenceableLoader.Callback<ChunkSampleStream<SsChunkSource>> { implements MediaPeriod, SequenceableLoader.Callback<ChunkSampleStream<SsChunkSource>> {
private final SsChunkSource.Factory chunkSourceFactory; private final SsChunkSource.Factory chunkSourceFactory;
private final @Nullable TransferListener transferListener; @Nullable private final TransferListener transferListener;
private final LoaderErrorThrower manifestLoaderErrorThrower; private final LoaderErrorThrower manifestLoaderErrorThrower;
private final LoadErrorHandlingPolicy loadErrorHandlingPolicy; private final LoadErrorHandlingPolicy loadErrorHandlingPolicy;
private final EventDispatcher eventDispatcher; private final EventDispatcher eventDispatcher;
...@@ -50,7 +50,7 @@ import java.util.List; ...@@ -50,7 +50,7 @@ import java.util.List;
private final TrackGroupArray trackGroups; private final TrackGroupArray trackGroups;
private final CompositeSequenceableLoaderFactory compositeSequenceableLoaderFactory; private final CompositeSequenceableLoaderFactory compositeSequenceableLoaderFactory;
private @Nullable Callback callback; @Nullable private Callback callback;
private SsManifest manifest; private SsManifest manifest;
private ChunkSampleStream<SsChunkSource>[] sampleStreams; private ChunkSampleStream<SsChunkSource>[] sampleStreams;
private SequenceableLoader compositeSequenceableLoader; private SequenceableLoader compositeSequenceableLoader;
......
...@@ -323,12 +323,12 @@ public final class SsMediaSource extends BaseMediaSource ...@@ -323,12 +323,12 @@ public final class SsMediaSource extends BaseMediaSource
private final EventDispatcher manifestEventDispatcher; private final EventDispatcher manifestEventDispatcher;
private final ParsingLoadable.Parser<? extends SsManifest> manifestParser; private final ParsingLoadable.Parser<? extends SsManifest> manifestParser;
private final ArrayList<SsMediaPeriod> mediaPeriods; private final ArrayList<SsMediaPeriod> mediaPeriods;
private final @Nullable Object tag; @Nullable private final Object tag;
private DataSource manifestDataSource; private DataSource manifestDataSource;
private Loader manifestLoader; private Loader manifestLoader;
private LoaderErrorThrower manifestLoaderErrorThrower; private LoaderErrorThrower manifestLoaderErrorThrower;
private @Nullable TransferListener mediaTransferListener; @Nullable private TransferListener mediaTransferListener;
private long manifestLoadStartTimestamp; private long manifestLoadStartTimestamp;
private SsManifest manifest; private SsManifest manifest;
......
...@@ -190,7 +190,7 @@ public class DefaultTimeBar extends View implements TimeBar { ...@@ -190,7 +190,7 @@ public class DefaultTimeBar extends View implements TimeBar {
private final Paint adMarkerPaint; private final Paint adMarkerPaint;
private final Paint playedAdMarkerPaint; private final Paint playedAdMarkerPaint;
private final Paint scrubberPaint; private final Paint scrubberPaint;
private final @Nullable Drawable scrubberDrawable; @Nullable private final Drawable scrubberDrawable;
private final int barHeight; private final int barHeight;
private final int touchTargetHeight; private final int touchTargetHeight;
private final int adMarkerWidth; private final int adMarkerWidth;
...@@ -217,8 +217,8 @@ public class DefaultTimeBar extends View implements TimeBar { ...@@ -217,8 +217,8 @@ public class DefaultTimeBar extends View implements TimeBar {
private long position; private long position;
private long bufferedPosition; private long bufferedPosition;
private int adGroupCount; private int adGroupCount;
private @Nullable long[] adGroupTimesMs; @Nullable private long[] adGroupTimesMs;
private @Nullable boolean[] playedAdGroups; @Nullable private boolean[] playedAdGroups;
public DefaultTimeBar(Context context) { public DefaultTimeBar(Context context) {
this(context, null); this(context, null);
......
...@@ -621,7 +621,8 @@ public class PlayerView extends FrameLayout implements AdsLoader.AdViewProvider ...@@ -621,7 +621,8 @@ public class PlayerView extends FrameLayout implements AdsLoader.AdViewProvider
} }
/** Returns the default artwork to display. */ /** Returns the default artwork to display. */
public @Nullable Drawable getDefaultArtwork() { @Nullable
public Drawable getDefaultArtwork() {
return defaultArtwork; return defaultArtwork;
} }
......
...@@ -91,8 +91,8 @@ import org.checkerframework.checker.nullness.qual.Nullable; ...@@ -91,8 +91,8 @@ import org.checkerframework.checker.nullness.qual.Nullable;
}; };
private int stereoMode; private int stereoMode;
private @Nullable MeshData leftMeshData; @Nullable private MeshData leftMeshData;
private @Nullable MeshData rightMeshData; @Nullable private MeshData rightMeshData;
// Program related GL items. These are only valid if program != 0. // Program related GL items. These are only valid if program != 0.
private int program; private int program;
......
...@@ -54,7 +54,7 @@ public final class SceneRenderer implements VideoFrameMetadataListener, CameraMo ...@@ -54,7 +54,7 @@ public final class SceneRenderer implements VideoFrameMetadataListener, CameraMo
// Used by other threads only // Used by other threads only
private volatile @C.StreamType int defaultStereoMode; private volatile @C.StreamType int defaultStereoMode;
private @C.StreamType int lastStereoMode; private @C.StreamType int lastStereoMode;
private @Nullable byte[] lastProjectionData; @Nullable private byte[] lastProjectionData;
// Methods called on any thread. // Methods called on any thread.
......
...@@ -64,14 +64,14 @@ public final class SphericalSurfaceView extends GLSurfaceView { ...@@ -64,14 +64,14 @@ public final class SphericalSurfaceView extends GLSurfaceView {
/* package */ static final float UPRIGHT_ROLL = (float) Math.PI; /* package */ static final float UPRIGHT_ROLL = (float) Math.PI;
private final SensorManager sensorManager; private final SensorManager sensorManager;
private final @Nullable Sensor orientationSensor; @Nullable private final Sensor orientationSensor;
private final OrientationListener orientationListener; private final OrientationListener orientationListener;
private final Handler mainHandler; private final Handler mainHandler;
private final TouchTracker touchTracker; private final TouchTracker touchTracker;
private final SceneRenderer scene; private final SceneRenderer scene;
private @Nullable SurfaceTexture surfaceTexture; @Nullable private SurfaceTexture surfaceTexture;
private @Nullable Surface surface; @Nullable private Surface surface;
private @Nullable Player.VideoComponent videoComponent; @Nullable private Player.VideoComponent videoComponent;
public SphericalSurfaceView(Context context) { public SphericalSurfaceView(Context context) {
this(context, null); this(context, null);
......
...@@ -65,7 +65,7 @@ import android.view.View; ...@@ -65,7 +65,7 @@ import android.view.View;
// The conversion from touch to yaw & pitch requires compensating for device roll. This is set // The conversion from touch to yaw & pitch requires compensating for device roll. This is set
// on the sensor thread and read on the UI thread. // on the sensor thread and read on the UI thread.
private volatile float roll; private volatile float roll;
private @Nullable SingleTapListener singleTapListener; @Nullable private SingleTapListener singleTapListener;
@SuppressWarnings({ @SuppressWarnings({
"nullness:assignment.type.incompatible", "nullness:assignment.type.incompatible",
......
...@@ -43,7 +43,7 @@ import com.google.android.exoplayer2.util.Log; ...@@ -43,7 +43,7 @@ import com.google.android.exoplayer2.util.Log;
public abstract class Action { public abstract class Action {
private final String tag; private final String tag;
private final @Nullable String description; @Nullable private final String description;
/** /**
* @param tag A tag to use for logging. * @param tag A tag to use for logging.
...@@ -547,7 +547,7 @@ public abstract class Action { ...@@ -547,7 +547,7 @@ public abstract class Action {
*/ */
public static final class WaitForTimelineChanged extends Action { public static final class WaitForTimelineChanged extends Action {
private final @Nullable Timeline expectedTimeline; @Nullable private final Timeline expectedTimeline;
/** /**
* Creates action waiting for a timeline change. * Creates action waiting for a timeline change.
......
...@@ -613,7 +613,7 @@ public final class ActionSchedule { ...@@ -613,7 +613,7 @@ public final class ActionSchedule {
*/ */
private static final class CallbackAction extends Action { private static final class CallbackAction extends Action {
private @Nullable Callback callback; @Nullable private Callback callback;
public CallbackAction(String tag) { public CallbackAction(String tag) {
super(tag, "FinishedCallback"); super(tag, "FinishedCallback");
......
...@@ -338,9 +338,9 @@ public final class ExoPlayerTestRunner implements Player.EventListener, ActionSc ...@@ -338,9 +338,9 @@ public final class ExoPlayerTestRunner implements Player.EventListener, ActionSc
private final DefaultTrackSelector trackSelector; private final DefaultTrackSelector trackSelector;
private final LoadControl loadControl; private final LoadControl loadControl;
private final BandwidthMeter bandwidthMeter; private final BandwidthMeter bandwidthMeter;
private final @Nullable ActionSchedule actionSchedule; @Nullable private final ActionSchedule actionSchedule;
private final @Nullable Player.EventListener eventListener; @Nullable private final Player.EventListener eventListener;
private final @Nullable AnalyticsListener analyticsListener; @Nullable private final AnalyticsListener analyticsListener;
private final HandlerThread playerThread; private final HandlerThread playerThread;
private final HandlerWrapper handler; private final HandlerWrapper handler;
......
...@@ -40,7 +40,7 @@ public class FakeAdaptiveMediaPeriod extends FakeMediaPeriod ...@@ -40,7 +40,7 @@ public class FakeAdaptiveMediaPeriod extends FakeMediaPeriod
private final Allocator allocator; private final Allocator allocator;
private final FakeChunkSource.Factory chunkSourceFactory; private final FakeChunkSource.Factory chunkSourceFactory;
private final @Nullable TransferListener transferListener; @Nullable private final TransferListener transferListener;
private final long durationUs; private final long durationUs;
private Callback callback; private Callback callback;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment