Remove DefaultSsChunkSource from nullness blacklist

Issue: #6981
PiperOrigin-RevId: 295584705
This commit is contained in:
olly 2020-02-17 15:33:32 +00:00 committed by Ian Baker
parent 3591562364
commit 1dbf2997c4
3 changed files with 12 additions and 6 deletions

View File

@ -46,12 +46,13 @@ public abstract class Chunk implements Loadable {
public final Format trackFormat; public final Format trackFormat;
/** /**
* One of the {@link C} {@code SELECTION_REASON_*} constants if the chunk belongs to a track. * One of the {@link C} {@code SELECTION_REASON_*} constants if the chunk belongs to a track.
* {@link C#SELECTION_REASON_UNKNOWN} if the chunk does not belong to a track. * {@link C#SELECTION_REASON_UNKNOWN} if the chunk does not belong to a track, or if the selection
* reason is unknown.
*/ */
public final int trackSelectionReason; public final int trackSelectionReason;
/** /**
* 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, or if there is no associated track selection data.
*/ */
@Nullable public final Object trackSelectionData; @Nullable public final Object trackSelectionData;
/** /**

View File

@ -15,6 +15,7 @@
*/ */
package com.google.android.exoplayer2.source.chunk; package com.google.android.exoplayer2.source.chunk;
import androidx.annotation.Nullable;
import com.google.android.exoplayer2.C; import com.google.android.exoplayer2.C;
import com.google.android.exoplayer2.Format; import com.google.android.exoplayer2.Format;
import com.google.android.exoplayer2.extractor.DefaultExtractorInput; import com.google.android.exoplayer2.extractor.DefaultExtractorInput;
@ -67,7 +68,7 @@ public class ContainerMediaChunk extends BaseMediaChunk {
DataSpec dataSpec, DataSpec dataSpec,
Format trackFormat, Format trackFormat,
int trackSelectionReason, int trackSelectionReason,
Object trackSelectionData, @Nullable Object trackSelectionData,
long startTimeUs, long startTimeUs,
long endTimeUs, long endTimeUs,
long clippedStartTimeUs, long clippedStartTimeUs,

View File

@ -38,6 +38,7 @@ import com.google.android.exoplayer2.upstream.DataSource;
import com.google.android.exoplayer2.upstream.DataSpec; import com.google.android.exoplayer2.upstream.DataSpec;
import com.google.android.exoplayer2.upstream.LoaderErrorThrower; import com.google.android.exoplayer2.upstream.LoaderErrorThrower;
import com.google.android.exoplayer2.upstream.TransferListener; import com.google.android.exoplayer2.upstream.TransferListener;
import com.google.android.exoplayer2.util.Assertions;
import java.io.IOException; import java.io.IOException;
import java.util.List; import java.util.List;
@ -80,7 +81,7 @@ public class DefaultSsChunkSource implements SsChunkSource {
private SsManifest manifest; private SsManifest manifest;
private int currentManifestChunkOffset; private int currentManifestChunkOffset;
private IOException fatalError; @Nullable private IOException fatalError;
/** /**
* @param manifestLoaderErrorThrower Throws errors affecting loading of manifests. * @param manifestLoaderErrorThrower Throws errors affecting loading of manifests.
@ -106,8 +107,11 @@ public class DefaultSsChunkSource implements SsChunkSource {
for (int i = 0; i < extractorWrappers.length; i++) { for (int i = 0; i < extractorWrappers.length; i++) {
int manifestTrackIndex = trackSelection.getIndexInTrackGroup(i); int manifestTrackIndex = trackSelection.getIndexInTrackGroup(i);
Format format = streamElement.formats[manifestTrackIndex]; Format format = streamElement.formats[manifestTrackIndex];
@Nullable
TrackEncryptionBox[] trackEncryptionBoxes = TrackEncryptionBox[] trackEncryptionBoxes =
format.drmInitData != null ? manifest.protectionElement.trackEncryptionBoxes : null; format.drmInitData != null
? Assertions.checkNotNull(manifest.protectionElement).trackEncryptionBoxes
: null;
int nalUnitLengthFieldLength = streamElement.type == C.TRACK_TYPE_VIDEO ? 4 : 0; int nalUnitLengthFieldLength = streamElement.type == C.TRACK_TYPE_VIDEO ? 4 : 0;
Track track = new Track(manifestTrackIndex, streamElement.type, streamElement.timescale, Track track = new Track(manifestTrackIndex, streamElement.type, streamElement.timescale,
C.TIME_UNSET, manifest.durationUs, format, Track.TRANSFORMATION_NONE, C.TIME_UNSET, manifest.durationUs, format, Track.TRANSFORMATION_NONE,
@ -277,7 +281,7 @@ public class DefaultSsChunkSource implements SsChunkSource {
long chunkEndTimeUs, long chunkEndTimeUs,
long chunkSeekTimeUs, long chunkSeekTimeUs,
int trackSelectionReason, int trackSelectionReason,
Object trackSelectionData, @Nullable Object trackSelectionData,
ChunkExtractorWrapper extractorWrapper) { ChunkExtractorWrapper extractorWrapper) {
DataSpec dataSpec = new DataSpec(uri); DataSpec dataSpec = new DataSpec(uri);
// In SmoothStreaming each chunk contains sample timestamps relative to the start of the chunk. // In SmoothStreaming each chunk contains sample timestamps relative to the start of the chunk.