mirror of
https://github.com/androidx/media.git
synced 2025-04-30 06:46:50 +08:00
Rollback of db8356a17c
*** Original commit *** Suppress warnings in preparation for Checker Framework 3.7.1 upgrade. LSC: go/checker-lsc Tested: tap_presubmit: http://test/OCL:342788975:BASE:342885903:1605667635149:7731b723 Some tests failed; test failures are believed to be unrelated to this CL *** PiperOrigin-RevId: 343251530
This commit is contained in:
parent
0191febbe6
commit
e5fd2eb088
@ -39,11 +39,7 @@ public final class ClippingMediaPeriod implements MediaPeriod, MediaPeriod.Callb
|
||||
*/
|
||||
public final MediaPeriod mediaPeriod;
|
||||
|
||||
// nullness annotations are not applicable to outer types
|
||||
@SuppressWarnings("nullness:nullness.on.outer")
|
||||
@Nullable
|
||||
private MediaPeriod.Callback callback;
|
||||
|
||||
@Nullable private MediaPeriod.Callback callback;
|
||||
private @NullableType ClippingSampleStream[] sampleStreams;
|
||||
private long pendingInitialDiscontinuityPositionUs;
|
||||
/* package */ long startUs;
|
||||
|
@ -253,8 +253,6 @@ public final class DefaultMediaSourceFactory implements MediaSourceFactory {
|
||||
return this;
|
||||
}
|
||||
|
||||
// nullness annotations are not applicable to outer types
|
||||
@SuppressWarnings("nullness:nullness.on.outer")
|
||||
@Override
|
||||
public DefaultMediaSourceFactory setDrmHttpDataSourceFactory(
|
||||
@Nullable HttpDataSource.Factory drmHttpDataSourceFactory) {
|
||||
@ -391,8 +389,6 @@ public final class DefaultMediaSourceFactory implements MediaSourceFactory {
|
||||
|
||||
private MediaSource maybeWrapWithAdsMediaSource(MediaItem mediaItem, MediaSource mediaSource) {
|
||||
Assertions.checkNotNull(mediaItem.playbackProperties);
|
||||
// nullness annotations are not applicable to outer types
|
||||
@SuppressWarnings("nullness:nullness.on.outer")
|
||||
@Nullable
|
||||
MediaItem.AdsConfiguration adsConfiguration = mediaItem.playbackProperties.adsConfiguration;
|
||||
if (adsConfiguration == null) {
|
||||
|
@ -172,8 +172,6 @@ public final class ExtractorMediaSource extends CompositeMediaSource<Void> {
|
||||
/**
|
||||
* @deprecated Use {@link ProgressiveMediaSource.Factory#setDrmHttpDataSourceFactory} instead.
|
||||
*/
|
||||
// nullness annotations are not applicable to outer types
|
||||
@SuppressWarnings("nullness:nullness.on.outer")
|
||||
@Deprecated
|
||||
@Override
|
||||
public MediaSourceFactory setDrmHttpDataSourceFactory(
|
||||
|
@ -34,11 +34,7 @@ import java.util.Map;
|
||||
/** A helper to create a {@link DrmSessionManager} from a {@link MediaItem}. */
|
||||
public final class MediaSourceDrmHelper {
|
||||
|
||||
// nullness annotations are not applicable to outer types
|
||||
@SuppressWarnings("nullness:nullness.on.outer")
|
||||
@Nullable
|
||||
private HttpDataSource.Factory drmHttpDataSourceFactory;
|
||||
|
||||
@Nullable private HttpDataSource.Factory drmHttpDataSourceFactory;
|
||||
@Nullable private String userAgent;
|
||||
|
||||
/**
|
||||
@ -49,8 +45,6 @@ public final class MediaSourceDrmHelper {
|
||||
* @param drmHttpDataSourceFactory The HTTP data source factory or {@code null} to use {@link
|
||||
* DefaultHttpDataSourceFactory}.
|
||||
*/
|
||||
// nullness annotations are not applicable to outer types
|
||||
@SuppressWarnings("nullness:nullness.on.outer")
|
||||
public void setDrmHttpDataSourceFactory(
|
||||
@Nullable HttpDataSource.Factory drmHttpDataSourceFactory) {
|
||||
this.drmHttpDataSourceFactory = drmHttpDataSourceFactory;
|
||||
@ -71,8 +65,6 @@ public final class MediaSourceDrmHelper {
|
||||
/** Creates a {@link DrmSessionManager} for the given media item. */
|
||||
public DrmSessionManager create(MediaItem mediaItem) {
|
||||
Assertions.checkNotNull(mediaItem.playbackProperties);
|
||||
// nullness annotations are not applicable to outer types
|
||||
@SuppressWarnings("nullness:nullness.on.outer")
|
||||
@Nullable
|
||||
MediaItem.DrmConfiguration drmConfiguration = mediaItem.playbackProperties.drmConfiguration;
|
||||
if (drmConfiguration == null || Util.SDK_INT < 18) {
|
||||
|
@ -77,8 +77,6 @@ public interface MediaSourceFactory {
|
||||
* DefaultHttpDataSourceFactory}.
|
||||
* @return This factory, for convenience.
|
||||
*/
|
||||
// nullness annotations are not applicable to outer types
|
||||
@SuppressWarnings("nullness:nullness.on.outer")
|
||||
MediaSourceFactory setDrmHttpDataSourceFactory(
|
||||
@Nullable HttpDataSource.Factory drmHttpDataSourceFactory);
|
||||
|
||||
|
@ -153,8 +153,6 @@ public final class ProgressiveMediaSource extends BaseMediaSource
|
||||
return this;
|
||||
}
|
||||
|
||||
// nullness annotations are not applicable to outer types
|
||||
@SuppressWarnings("nullness:nullness.on.outer")
|
||||
@Override
|
||||
public Factory setDrmHttpDataSourceFactory(
|
||||
@Nullable HttpDataSource.Factory drmHttpDataSourceFactory) {
|
||||
|
@ -406,10 +406,7 @@ import org.checkerframework.checker.nullness.qual.MonotonicNonNull;
|
||||
|
||||
private final StatsDataSource dataSource;
|
||||
|
||||
// nullness annotations are not applicable to primitive types
|
||||
@SuppressWarnings("nullness:nullness.on.primitive")
|
||||
@Nullable
|
||||
private byte[] sampleData;
|
||||
@Nullable private byte[] sampleData;
|
||||
|
||||
public SourceLoadable(DataSpec dataSpec, DataSource dataSource) {
|
||||
this.loadTaskId = LoadEventInfo.getNewId();
|
||||
|
@ -57,25 +57,14 @@ public final class CacheDataSource implements DataSource {
|
||||
|
||||
private @MonotonicNonNull Cache cache;
|
||||
private DataSource.Factory cacheReadDataSourceFactory;
|
||||
// nullness annotations are not applicable to outer types
|
||||
@SuppressWarnings("nullness:nullness.on.outer")
|
||||
@Nullable
|
||||
private DataSink.Factory cacheWriteDataSinkFactory;
|
||||
|
||||
@Nullable private DataSink.Factory cacheWriteDataSinkFactory;
|
||||
private CacheKeyFactory cacheKeyFactory;
|
||||
private boolean cacheIsReadOnly;
|
||||
// nullness annotations are not applicable to outer types
|
||||
@SuppressWarnings("nullness:nullness.on.outer")
|
||||
@Nullable
|
||||
private DataSource.Factory upstreamDataSourceFactory;
|
||||
|
||||
@Nullable private DataSource.Factory upstreamDataSourceFactory;
|
||||
@Nullable private PriorityTaskManager upstreamPriorityTaskManager;
|
||||
private int upstreamPriority;
|
||||
@CacheDataSource.Flags private int flags;
|
||||
// nullness annotations are not applicable to outer types
|
||||
@SuppressWarnings("nullness:nullness.on.outer")
|
||||
@Nullable
|
||||
private CacheDataSource.EventListener eventListener;
|
||||
@Nullable private CacheDataSource.EventListener eventListener;
|
||||
|
||||
public Factory() {
|
||||
cacheReadDataSourceFactory = new FileDataSource.Factory();
|
||||
@ -128,8 +117,6 @@ public final class CacheDataSource implements DataSource {
|
||||
* DataSinks} for writing data to the cache, or {@code null} to disable writing.
|
||||
* @return This factory.
|
||||
*/
|
||||
// nullness annotations are not applicable to outer types
|
||||
@SuppressWarnings("nullness:nullness.on.outer")
|
||||
public Factory setCacheWriteDataSinkFactory(
|
||||
@Nullable DataSink.Factory cacheWriteDataSinkFactory) {
|
||||
this.cacheWriteDataSinkFactory = cacheWriteDataSinkFactory;
|
||||
@ -166,8 +153,6 @@ public final class CacheDataSource implements DataSource {
|
||||
* cache, or {@code null} to cause failure in the case of a cache miss.
|
||||
* @return This factory.
|
||||
*/
|
||||
// nullness annotations are not applicable to outer types
|
||||
@SuppressWarnings("nullness:nullness.on.outer")
|
||||
public Factory setUpstreamDataSourceFactory(
|
||||
@Nullable DataSource.Factory upstreamDataSourceFactory) {
|
||||
this.upstreamDataSourceFactory = upstreamDataSourceFactory;
|
||||
|
@ -28,15 +28,8 @@ public final class CacheDataSourceFactory implements DataSource.Factory {
|
||||
private final DataSource.Factory upstreamFactory;
|
||||
private final DataSource.Factory cacheReadDataSourceFactory;
|
||||
@CacheDataSource.Flags private final int flags;
|
||||
// nullness annotations are not applicable to outer types
|
||||
@SuppressWarnings("nullness:nullness.on.outer")
|
||||
@Nullable
|
||||
private final DataSink.Factory cacheWriteDataSinkFactory;
|
||||
// nullness annotations are not applicable to outer types
|
||||
@SuppressWarnings("nullness:nullness.on.outer")
|
||||
@Nullable
|
||||
private final CacheDataSource.EventListener eventListener;
|
||||
|
||||
@Nullable private final DataSink.Factory cacheWriteDataSinkFactory;
|
||||
@Nullable private final CacheDataSource.EventListener eventListener;
|
||||
@Nullable private final CacheKeyFactory cacheKeyFactory;
|
||||
|
||||
/**
|
||||
@ -67,8 +60,6 @@ public final class CacheDataSourceFactory implements DataSource.Factory {
|
||||
* @see CacheDataSource#CacheDataSource(Cache, DataSource, DataSource, DataSink, int,
|
||||
* CacheDataSource.EventListener)
|
||||
*/
|
||||
// nullness annotations are not applicable to outer types
|
||||
@SuppressWarnings("nullness:nullness.on.outer")
|
||||
public CacheDataSourceFactory(
|
||||
Cache cache,
|
||||
DataSource.Factory upstreamFactory,
|
||||
@ -90,8 +81,6 @@ public final class CacheDataSourceFactory implements DataSource.Factory {
|
||||
* @see CacheDataSource#CacheDataSource(Cache, DataSource, DataSource, DataSink, int,
|
||||
* CacheDataSource.EventListener, CacheKeyFactory)
|
||||
*/
|
||||
// nullness annotations are not applicable to outer types
|
||||
@SuppressWarnings("nullness:nullness.on.outer")
|
||||
public CacheDataSourceFactory(
|
||||
Cache cache,
|
||||
DataSource.Factory upstreamFactory,
|
||||
|
@ -73,8 +73,6 @@ public final class CacheWriter {
|
||||
* writer should instantiate its own internal temporary buffer.
|
||||
* @param progressListener An optional progress listener.
|
||||
*/
|
||||
// nullness annotations are not applicable to primitive types
|
||||
@SuppressWarnings("nullness:nullness.on.primitive")
|
||||
public CacheWriter(
|
||||
CacheDataSource dataSource,
|
||||
DataSpec dataSpec,
|
||||
|
@ -153,8 +153,6 @@ import org.checkerframework.checker.nullness.qual.MonotonicNonNull;
|
||||
* enabled. This option is only useful for downgrading from database storage back to legacy
|
||||
* storage.
|
||||
*/
|
||||
// nullness annotations are not applicable to primitive types
|
||||
@SuppressWarnings("nullness:nullness.on.primitive")
|
||||
public CachedContentIndex(
|
||||
@Nullable DatabaseProvider databaseProvider,
|
||||
@Nullable File legacyStorageDir,
|
||||
@ -519,8 +517,6 @@ import org.checkerframework.checker.nullness.qual.MonotonicNonNull;
|
||||
private boolean changed;
|
||||
@Nullable private ReusableBufferedOutputStream bufferedOutputStream;
|
||||
|
||||
// nullness annotations are not applicable to primitive types
|
||||
@SuppressWarnings("nullness:nullness.on.primitive")
|
||||
public LegacyStorage(File file, @Nullable byte[] secretKey, boolean encrypt) {
|
||||
checkState(secretKey != null || !encrypt);
|
||||
@Nullable Cipher cipher = null;
|
||||
|
@ -42,8 +42,6 @@ public interface ContentMetadata {
|
||||
* @param defaultValue Value to return if the metadata doesn't exist.
|
||||
* @return The metadata value.
|
||||
*/
|
||||
// nullness annotations are not applicable to primitive types
|
||||
@SuppressWarnings("nullness:nullness.on.primitive")
|
||||
@Nullable
|
||||
byte[] get(String key, @Nullable byte[] defaultValue);
|
||||
|
||||
|
@ -63,15 +63,10 @@ public final class DefaultContentMetadata implements ContentMetadata {
|
||||
return metadata.entrySet();
|
||||
}
|
||||
|
||||
// nullness annotations are not applicable to primitive types
|
||||
@SuppressWarnings("nullness:nullness.on.primitive")
|
||||
@Override
|
||||
@Nullable
|
||||
public final byte[] get(String name, @Nullable byte[] defaultValue) {
|
||||
// nullness annotations are not applicable to primitive types
|
||||
@SuppressWarnings("nullness:nullness.on.primitive")
|
||||
@Nullable
|
||||
byte[] bytes = metadata.get(name);
|
||||
@Nullable byte[] bytes = metadata.get(name);
|
||||
if (bytes != null) {
|
||||
return Arrays.copyOf(bytes, bytes.length);
|
||||
} else {
|
||||
@ -82,10 +77,7 @@ public final class DefaultContentMetadata implements ContentMetadata {
|
||||
@Override
|
||||
@Nullable
|
||||
public final String get(String name, @Nullable String defaultValue) {
|
||||
// nullness annotations are not applicable to primitive types
|
||||
@SuppressWarnings("nullness:nullness.on.primitive")
|
||||
@Nullable
|
||||
byte[] bytes = metadata.get(name);
|
||||
@Nullable byte[] bytes = metadata.get(name);
|
||||
if (bytes != null) {
|
||||
return new String(bytes, Charsets.UTF_8);
|
||||
} else {
|
||||
@ -95,10 +87,7 @@ public final class DefaultContentMetadata implements ContentMetadata {
|
||||
|
||||
@Override
|
||||
public final long get(String name, long defaultValue) {
|
||||
// nullness annotations are not applicable to primitive types
|
||||
@SuppressWarnings("nullness:nullness.on.primitive")
|
||||
@Nullable
|
||||
byte[] bytes = metadata.get(name);
|
||||
@Nullable byte[] bytes = metadata.get(name);
|
||||
if (bytes != null) {
|
||||
return ByteBuffer.wrap(bytes).getLong();
|
||||
} else {
|
||||
@ -140,10 +129,7 @@ public final class DefaultContentMetadata implements ContentMetadata {
|
||||
}
|
||||
for (Entry<String, byte[]> entry : first.entrySet()) {
|
||||
byte[] value = entry.getValue();
|
||||
// nullness annotations are not applicable to primitive types
|
||||
@SuppressWarnings("nullness:nullness.on.primitive")
|
||||
@Nullable
|
||||
byte[] otherValue = second.get(entry.getKey());
|
||||
@Nullable byte[] otherValue = second.get(entry.getKey());
|
||||
if (!Arrays.equals(value, otherValue)) {
|
||||
return false;
|
||||
}
|
||||
|
@ -177,18 +177,9 @@ import org.checkerframework.checker.nullness.compatqual.NullableType;
|
||||
*/
|
||||
@Nullable
|
||||
public static Metadata parseMdtaFromMeta(Atom.ContainerAtom meta) {
|
||||
// nullness annotations are not applicable to outer types
|
||||
@SuppressWarnings("nullness:nullness.on.outer")
|
||||
@Nullable
|
||||
Atom.LeafAtom hdlrAtom = meta.getLeafAtomOfType(Atom.TYPE_hdlr);
|
||||
// nullness annotations are not applicable to outer types
|
||||
@SuppressWarnings("nullness:nullness.on.outer")
|
||||
@Nullable
|
||||
Atom.LeafAtom keysAtom = meta.getLeafAtomOfType(Atom.TYPE_keys);
|
||||
// nullness annotations are not applicable to outer types
|
||||
@SuppressWarnings("nullness:nullness.on.outer")
|
||||
@Nullable
|
||||
Atom.LeafAtom ilstAtom = meta.getLeafAtomOfType(Atom.TYPE_ilst);
|
||||
@Nullable Atom.LeafAtom hdlrAtom = meta.getLeafAtomOfType(Atom.TYPE_hdlr);
|
||||
@Nullable Atom.LeafAtom keysAtom = meta.getLeafAtomOfType(Atom.TYPE_keys);
|
||||
@Nullable Atom.LeafAtom ilstAtom = meta.getLeafAtomOfType(Atom.TYPE_ilst);
|
||||
if (hdlrAtom == null
|
||||
|| keysAtom == null
|
||||
|| ilstAtom == null
|
||||
@ -219,8 +210,6 @@ import org.checkerframework.checker.nullness.compatqual.NullableType;
|
||||
int keyIndex = ilst.readInt() - 1;
|
||||
if (keyIndex >= 0 && keyIndex < keyNames.length) {
|
||||
String key = keyNames[keyIndex];
|
||||
// nullness annotations are not applicable to outer types
|
||||
@SuppressWarnings("nullness:nullness.on.outer")
|
||||
@Nullable
|
||||
Metadata.Entry entry =
|
||||
MetadataUtil.parseMdtaMetadataEntryFromIlst(ilst, atomPosition + atomSize, key);
|
||||
@ -290,19 +279,10 @@ import org.checkerframework.checker.nullness.compatqual.NullableType;
|
||||
mdhdData.second,
|
||||
drmInitData,
|
||||
isQuickTime);
|
||||
// nullness annotations are not applicable to primitive types
|
||||
@SuppressWarnings("nullness:nullness.on.primitive")
|
||||
@Nullable
|
||||
long[] editListDurations = null;
|
||||
// nullness annotations are not applicable to primitive types
|
||||
@SuppressWarnings("nullness:nullness.on.primitive")
|
||||
@Nullable
|
||||
long[] editListMediaTimes = null;
|
||||
@Nullable long[] editListDurations = null;
|
||||
@Nullable long[] editListMediaTimes = null;
|
||||
if (!ignoreEditLists) {
|
||||
// nullness annotations are not applicable to outer types
|
||||
@SuppressWarnings("nullness:nullness.on.outer")
|
||||
@Nullable
|
||||
Atom.ContainerAtom edtsAtom = trak.getContainerAtomOfType(Atom.TYPE_edts);
|
||||
@Nullable Atom.ContainerAtom edtsAtom = trak.getContainerAtomOfType(Atom.TYPE_edts);
|
||||
if (edtsAtom != null) {
|
||||
@Nullable Pair<long[], long[]> edtsData = parseEdts(edtsAtom);
|
||||
if (edtsData != null) {
|
||||
@ -330,17 +310,11 @@ import org.checkerframework.checker.nullness.compatqual.NullableType;
|
||||
Track track, Atom.ContainerAtom stblAtom, GaplessInfoHolder gaplessInfoHolder)
|
||||
throws ParserException {
|
||||
SampleSizeBox sampleSizeBox;
|
||||
// nullness annotations are not applicable to outer types
|
||||
@SuppressWarnings("nullness:nullness.on.outer")
|
||||
@Nullable
|
||||
Atom.LeafAtom stszAtom = stblAtom.getLeafAtomOfType(Atom.TYPE_stsz);
|
||||
@Nullable Atom.LeafAtom stszAtom = stblAtom.getLeafAtomOfType(Atom.TYPE_stsz);
|
||||
if (stszAtom != null) {
|
||||
sampleSizeBox = new StszSampleSizeBox(stszAtom);
|
||||
} else {
|
||||
// nullness annotations are not applicable to outer types
|
||||
@SuppressWarnings("nullness:nullness.on.outer")
|
||||
@Nullable
|
||||
Atom.LeafAtom stz2Atom = stblAtom.getLeafAtomOfType(Atom.TYPE_stz2);
|
||||
@Nullable Atom.LeafAtom stz2Atom = stblAtom.getLeafAtomOfType(Atom.TYPE_stz2);
|
||||
if (stz2Atom == null) {
|
||||
throw new ParserException("Track has no sample table size information");
|
||||
}
|
||||
@ -361,10 +335,7 @@ import org.checkerframework.checker.nullness.compatqual.NullableType;
|
||||
|
||||
// Entries are byte offsets of chunks.
|
||||
boolean chunkOffsetsAreLongs = false;
|
||||
// nullness annotations are not applicable to outer types
|
||||
@SuppressWarnings("nullness:nullness.on.outer")
|
||||
@Nullable
|
||||
Atom.LeafAtom chunkOffsetsAtom = stblAtom.getLeafAtomOfType(Atom.TYPE_stco);
|
||||
@Nullable Atom.LeafAtom chunkOffsetsAtom = stblAtom.getLeafAtomOfType(Atom.TYPE_stco);
|
||||
if (chunkOffsetsAtom == null) {
|
||||
chunkOffsetsAreLongs = true;
|
||||
chunkOffsetsAtom = checkNotNull(stblAtom.getLeafAtomOfType(Atom.TYPE_co64));
|
||||
@ -375,16 +346,10 @@ import org.checkerframework.checker.nullness.compatqual.NullableType;
|
||||
// Entries are (number of samples, timestamp delta between those samples).
|
||||
ParsableByteArray stts = checkNotNull(stblAtom.getLeafAtomOfType(Atom.TYPE_stts)).data;
|
||||
// Entries are the indices of samples that are synchronization samples.
|
||||
// nullness annotations are not applicable to outer types
|
||||
@SuppressWarnings("nullness:nullness.on.outer")
|
||||
@Nullable
|
||||
Atom.LeafAtom stssAtom = stblAtom.getLeafAtomOfType(Atom.TYPE_stss);
|
||||
@Nullable Atom.LeafAtom stssAtom = stblAtom.getLeafAtomOfType(Atom.TYPE_stss);
|
||||
@Nullable ParsableByteArray stss = stssAtom != null ? stssAtom.data : null;
|
||||
// Entries are (number of samples, timestamp offset).
|
||||
// nullness annotations are not applicable to outer types
|
||||
@SuppressWarnings("nullness:nullness.on.outer")
|
||||
@Nullable
|
||||
Atom.LeafAtom cttsAtom = stblAtom.getLeafAtomOfType(Atom.TYPE_ctts);
|
||||
@Nullable Atom.LeafAtom cttsAtom = stblAtom.getLeafAtomOfType(Atom.TYPE_ctts);
|
||||
@Nullable ParsableByteArray ctts = cttsAtom != null ? cttsAtom.data : null;
|
||||
|
||||
// Prepare to read chunk information.
|
||||
@ -728,10 +693,7 @@ import org.checkerframework.checker.nullness.compatqual.NullableType;
|
||||
ilst.skipBytes(Atom.HEADER_SIZE);
|
||||
ArrayList<Metadata.Entry> entries = new ArrayList<>();
|
||||
while (ilst.getPosition() < limit) {
|
||||
// nullness annotations are not applicable to outer types
|
||||
@SuppressWarnings("nullness:nullness.on.outer")
|
||||
@Nullable
|
||||
Metadata.Entry entry = MetadataUtil.parseIlstElement(ilst);
|
||||
@Nullable Metadata.Entry entry = MetadataUtil.parseIlstElement(ilst);
|
||||
if (entry != null) {
|
||||
entries.add(entry);
|
||||
}
|
||||
@ -1034,10 +996,7 @@ import org.checkerframework.checker.nullness.compatqual.NullableType;
|
||||
@Nullable List<byte[]> initializationData = null;
|
||||
@Nullable String mimeType = null;
|
||||
@Nullable String codecs = null;
|
||||
// nullness annotations are not applicable to primitive types
|
||||
@SuppressWarnings("nullness:nullness.on.primitive")
|
||||
@Nullable
|
||||
byte[] projectionData = null;
|
||||
@Nullable byte[] projectionData = null;
|
||||
@C.StereoMode
|
||||
int stereoMode = Format.NO_VALUE;
|
||||
while (childPosition - position < size) {
|
||||
@ -1087,10 +1046,7 @@ import org.checkerframework.checker.nullness.compatqual.NullableType;
|
||||
Pair<@NullableType String, byte @NullableType []> mimeTypeAndInitializationDataBytes =
|
||||
parseEsdsFromParent(parent, childStartPosition);
|
||||
mimeType = mimeTypeAndInitializationDataBytes.first;
|
||||
// nullness annotations are not applicable to primitive types
|
||||
@SuppressWarnings("nullness:nullness.on.primitive")
|
||||
@Nullable
|
||||
byte[] initializationDataBytes = mimeTypeAndInitializationDataBytes.second;
|
||||
@Nullable byte[] initializationDataBytes = mimeTypeAndInitializationDataBytes.second;
|
||||
if (initializationDataBytes != null) {
|
||||
initializationData = ImmutableList.of(initializationDataBytes);
|
||||
}
|
||||
@ -1167,10 +1123,7 @@ import org.checkerframework.checker.nullness.compatqual.NullableType;
|
||||
*/
|
||||
@Nullable
|
||||
private static Pair<long[], long[]> parseEdts(Atom.ContainerAtom edtsAtom) {
|
||||
// nullness annotations are not applicable to outer types
|
||||
@SuppressWarnings("nullness:nullness.on.outer")
|
||||
@Nullable
|
||||
Atom.LeafAtom elstAtom = edtsAtom.getLeafAtomOfType(Atom.TYPE_elst);
|
||||
@Nullable Atom.LeafAtom elstAtom = edtsAtom.getLeafAtomOfType(Atom.TYPE_elst);
|
||||
if (elstAtom == null) {
|
||||
return null;
|
||||
}
|
||||
@ -1320,10 +1273,7 @@ import org.checkerframework.checker.nullness.compatqual.NullableType;
|
||||
Pair<@NullableType String, byte @NullableType []> mimeTypeAndInitializationData =
|
||||
parseEsdsFromParent(parent, esdsAtomPosition);
|
||||
mimeType = mimeTypeAndInitializationData.first;
|
||||
// nullness annotations are not applicable to primitive types
|
||||
@SuppressWarnings("nullness:nullness.on.primitive")
|
||||
@Nullable
|
||||
byte[] initializationDataBytes = mimeTypeAndInitializationData.second;
|
||||
@Nullable byte[] initializationDataBytes = mimeTypeAndInitializationData.second;
|
||||
if (initializationDataBytes != null) {
|
||||
if (MimeTypes.AUDIO_AAC.equals(mimeType)) {
|
||||
// Update sampleRate and channelCount from the AudioSpecificConfig initialization
|
||||
@ -1578,8 +1528,6 @@ import org.checkerframework.checker.nullness.compatqual.NullableType;
|
||||
}
|
||||
|
||||
/** Parses the proj box from sv3d box, as specified by https://github.com/google/spatial-media. */
|
||||
// nullness annotations are not applicable to primitive types
|
||||
@SuppressWarnings("nullness:nullness.on.primitive")
|
||||
@Nullable
|
||||
private static byte[] parseProjFromParent(ParsableByteArray parent, int position, int size) {
|
||||
int childPosition = position + Atom.HEADER_SIZE;
|
||||
|
@ -1166,10 +1166,7 @@ public class FragmentedMp4Extractor implements Extractor {
|
||||
int perSampleIvSize = sgpd.readUnsignedByte();
|
||||
byte[] keyId = new byte[16];
|
||||
sgpd.readBytes(keyId, 0, keyId.length);
|
||||
// nullness annotations are not applicable to primitive types
|
||||
@SuppressWarnings("nullness:nullness.on.primitive")
|
||||
@Nullable
|
||||
byte[] constantIv = null;
|
||||
@Nullable byte[] constantIv = null;
|
||||
if (perSampleIvSize == 0) {
|
||||
int constantIvSize = sgpd.readUnsignedByte();
|
||||
constantIv = new byte[constantIvSize];
|
||||
@ -1417,10 +1414,7 @@ public class FragmentedMp4Extractor implements Extractor {
|
||||
@C.BufferFlags int sampleFlags = trackBundle.getCurrentSampleFlags();
|
||||
|
||||
// Encryption data.
|
||||
// nullness annotations are not applicable to outer types
|
||||
@SuppressWarnings("nullness:nullness.on.outer")
|
||||
@Nullable
|
||||
TrackOutput.CryptoData cryptoData = null;
|
||||
@Nullable TrackOutput.CryptoData cryptoData = null;
|
||||
@Nullable TrackEncryptionBox encryptionBox = trackBundle.getEncryptionBoxIfEncrypted();
|
||||
if (encryptionBox != null) {
|
||||
cryptoData = encryptionBox.cryptoData;
|
||||
|
@ -341,8 +341,6 @@ import java.util.List;
|
||||
* @param ilst Holds the data to be parsed.
|
||||
* @return The parsed element, or null if the element's type was not recognized.
|
||||
*/
|
||||
// nullness annotations are not applicable to outer types
|
||||
@SuppressWarnings("nullness:nullness.on.outer")
|
||||
@Nullable
|
||||
public static Metadata.Entry parseIlstElement(ParsableByteArray ilst) {
|
||||
int position = ilst.getPosition();
|
||||
|
@ -464,10 +464,7 @@ public final class Mp4Extractor implements Extractor, SeekMap {
|
||||
@Nullable Metadata udtaMetadata = null;
|
||||
boolean isQuickTime = fileType == FILE_TYPE_QUICKTIME;
|
||||
GaplessInfoHolder gaplessInfoHolder = new GaplessInfoHolder();
|
||||
// nullness annotations are not applicable to outer types
|
||||
@SuppressWarnings("nullness:nullness.on.outer")
|
||||
@Nullable
|
||||
Atom.LeafAtom udta = moov.getLeafAtomOfType(Atom.TYPE_udta);
|
||||
@Nullable Atom.LeafAtom udta = moov.getLeafAtomOfType(Atom.TYPE_udta);
|
||||
if (udta != null) {
|
||||
udtaMetadata = AtomParsers.parseUdta(udta, isQuickTime);
|
||||
if (udtaMetadata != null) {
|
||||
@ -475,10 +472,7 @@ public final class Mp4Extractor implements Extractor, SeekMap {
|
||||
}
|
||||
}
|
||||
@Nullable Metadata mdtaMetadata = null;
|
||||
// nullness annotations are not applicable to outer types
|
||||
@SuppressWarnings("nullness:nullness.on.outer")
|
||||
@Nullable
|
||||
Atom.ContainerAtom meta = moov.getContainerAtomOfType(Atom.TYPE_meta);
|
||||
@Nullable Atom.ContainerAtom meta = moov.getContainerAtomOfType(Atom.TYPE_meta);
|
||||
if (meta != null) {
|
||||
mdtaMetadata = AtomParsers.parseMdtaFromMeta(meta);
|
||||
}
|
||||
|
@ -37,8 +37,6 @@ public final class PsshAtomUtil {
|
||||
* @param data The scheme specific data.
|
||||
* @return The PSSH atom.
|
||||
*/
|
||||
// nullness annotations are not applicable to primitive types
|
||||
@SuppressWarnings("nullness:nullness.on.primitive")
|
||||
public static byte[] buildPsshAtom(UUID systemId, @Nullable byte[] data) {
|
||||
return buildPsshAtom(systemId, null, data);
|
||||
}
|
||||
@ -51,8 +49,6 @@ public final class PsshAtomUtil {
|
||||
* @param data The scheme specific data.
|
||||
* @return The PSSH atom.
|
||||
*/
|
||||
// nullness annotations are not applicable to primitive types
|
||||
@SuppressWarnings("nullness:nullness.on.primitive")
|
||||
public static byte[] buildPsshAtom(
|
||||
UUID systemId, @Nullable UUID[] keyIds, @Nullable byte[] data) {
|
||||
int dataLength = data != null ? data.length : 0;
|
||||
@ -136,8 +132,6 @@ public final class PsshAtomUtil {
|
||||
* @return The parsed scheme specific data. Null if the input is not a valid PSSH atom, or if the
|
||||
* PSSH atom has an unsupported version, or if the PSSH atom does not match the passed UUID.
|
||||
*/
|
||||
// nullness annotations are not applicable to primitive types
|
||||
@SuppressWarnings("nullness:nullness.on.primitive")
|
||||
@Nullable
|
||||
public static byte[] parseSchemeSpecificData(byte[] atom, UUID uuid) {
|
||||
@Nullable PsshAtom parsedAtom = parsePsshAtom(atom);
|
||||
|
@ -81,17 +81,15 @@ public final class Track {
|
||||
*/
|
||||
@Transformation public final int sampleTransformation;
|
||||
|
||||
/** Durations of edit list segments in the movie timescale. Null if there is no edit list. */
|
||||
// nullness annotations are not applicable to primitive types
|
||||
@SuppressWarnings("nullness:nullness.on.primitive")
|
||||
@Nullable
|
||||
public final long[] editListDurations;
|
||||
/**
|
||||
* Durations of edit list segments in the movie timescale. Null if there is no edit list.
|
||||
*/
|
||||
@Nullable public final long[] editListDurations;
|
||||
|
||||
/** Media times for edit list segments in the track timescale. Null if there is no edit list. */
|
||||
// nullness annotations are not applicable to primitive types
|
||||
@SuppressWarnings("nullness:nullness.on.primitive")
|
||||
@Nullable
|
||||
public final long[] editListMediaTimes;
|
||||
/**
|
||||
* Media times for edit list segments in the track timescale. Null if there is no edit list.
|
||||
*/
|
||||
@Nullable public final long[] editListMediaTimes;
|
||||
|
||||
/**
|
||||
* For H264 video tracks, the length in bytes of the NALUnitLength field in each sample. 0 for
|
||||
@ -101,20 +99,10 @@ public final class Track {
|
||||
|
||||
@Nullable private final TrackEncryptionBox[] sampleDescriptionEncryptionBoxes;
|
||||
|
||||
// nullness annotations are not applicable to primitive types
|
||||
@SuppressWarnings("nullness:nullness.on.primitive")
|
||||
public Track(
|
||||
int id,
|
||||
int type,
|
||||
long timescale,
|
||||
long movieTimescale,
|
||||
long durationUs,
|
||||
Format format,
|
||||
@Transformation int sampleTransformation,
|
||||
@Nullable TrackEncryptionBox[] sampleDescriptionEncryptionBoxes,
|
||||
int nalUnitLengthFieldLength,
|
||||
@Nullable long[] editListDurations,
|
||||
@Nullable long[] editListMediaTimes) {
|
||||
public Track(int id, int type, long timescale, long movieTimescale, long durationUs,
|
||||
Format format, @Transformation int sampleTransformation,
|
||||
@Nullable TrackEncryptionBox[] sampleDescriptionEncryptionBoxes, int nalUnitLengthFieldLength,
|
||||
@Nullable long[] editListDurations, @Nullable long[] editListMediaTimes) {
|
||||
this.id = id;
|
||||
this.type = type;
|
||||
this.timescale = timescale;
|
||||
|
@ -52,10 +52,7 @@ public final class TrackEncryptionBox {
|
||||
* If {@link #perSampleIvSize} is 0, holds the default initialization vector as defined in the
|
||||
* track encryption box or sample group description box. Null otherwise.
|
||||
*/
|
||||
// nullness annotations are not applicable to primitive types
|
||||
@SuppressWarnings("nullness:nullness.on.primitive")
|
||||
@Nullable
|
||||
public final byte[] defaultInitializationVector;
|
||||
@Nullable public final byte[] defaultInitializationVector;
|
||||
|
||||
/**
|
||||
* @param isEncrypted See {@link #isEncrypted}.
|
||||
@ -66,8 +63,6 @@ public final class TrackEncryptionBox {
|
||||
* @param defaultClearBlocks See {@link TrackOutput.CryptoData#clearBlocks}.
|
||||
* @param defaultInitializationVector See {@link #defaultInitializationVector}.
|
||||
*/
|
||||
// nullness annotations are not applicable to primitive types
|
||||
@SuppressWarnings("nullness:nullness.on.primitive")
|
||||
public TrackEncryptionBox(
|
||||
boolean isEncrypted,
|
||||
@Nullable String schemeType,
|
||||
|
Loading…
x
Reference in New Issue
Block a user