Fix generics warning in FakeAdaptiveMediaPeriod.
Remove all generic arrays from this class. FakeAdaptiveMediaPeriod.java:171: warning: [rawtypes] found raw type: ChunkSampleStream return new ChunkSampleStream[length]; ^ missing type arguments for generic class ChunkSampleStream<T> where T is a type-variable: T extends ChunkSource declared in class ChunkSampleStream PiperOrigin-RevId: 284761750
This commit is contained in:
parent
03b02f98df
commit
6ebc9f96c8
@ -45,7 +45,7 @@ public class FakeAdaptiveMediaPeriod extends FakeMediaPeriod
|
|||||||
private final long durationUs;
|
private final long durationUs;
|
||||||
|
|
||||||
private Callback callback;
|
private Callback callback;
|
||||||
private ChunkSampleStream<FakeChunkSource>[] sampleStreams;
|
private List<ChunkSampleStream<FakeChunkSource>> sampleStreams;
|
||||||
private SequenceableLoader sequenceableLoader;
|
private SequenceableLoader sequenceableLoader;
|
||||||
|
|
||||||
public FakeAdaptiveMediaPeriod(
|
public FakeAdaptiveMediaPeriod(
|
||||||
@ -60,7 +60,7 @@ public class FakeAdaptiveMediaPeriod extends FakeMediaPeriod
|
|||||||
this.chunkSourceFactory = chunkSourceFactory;
|
this.chunkSourceFactory = chunkSourceFactory;
|
||||||
this.transferListener = transferListener;
|
this.transferListener = transferListener;
|
||||||
this.durationUs = durationUs;
|
this.durationUs = durationUs;
|
||||||
this.sampleStreams = newSampleStreamArray(0);
|
this.sampleStreams = new ArrayList<>();
|
||||||
this.sequenceableLoader = new CompositeSequenceableLoader(new SequenceableLoader[0]);
|
this.sequenceableLoader = new CompositeSequenceableLoader(new SequenceableLoader[0]);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -94,8 +94,9 @@ public class FakeAdaptiveMediaPeriod extends FakeMediaPeriod
|
|||||||
validStreams.add((ChunkSampleStream<FakeChunkSource>) stream);
|
validStreams.add((ChunkSampleStream<FakeChunkSource>) stream);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
this.sampleStreams = validStreams.toArray(newSampleStreamArray(validStreams.size()));
|
this.sampleStreams = validStreams;
|
||||||
this.sequenceableLoader = new CompositeSequenceableLoader(sampleStreams);
|
this.sequenceableLoader =
|
||||||
|
new CompositeSequenceableLoader(sampleStreams.toArray(new SequenceableLoader[0]));
|
||||||
return returnPositionUs;
|
return returnPositionUs;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -165,9 +166,4 @@ public class FakeAdaptiveMediaPeriod extends FakeMediaPeriod
|
|||||||
public void onContinueLoadingRequested(ChunkSampleStream<FakeChunkSource> source) {
|
public void onContinueLoadingRequested(ChunkSampleStream<FakeChunkSource> source) {
|
||||||
callback.onContinueLoadingRequested(this);
|
callback.onContinueLoadingRequested(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
@SuppressWarnings("unchecked")
|
|
||||||
private static ChunkSampleStream<FakeChunkSource>[] newSampleStreamArray(int length) {
|
|
||||||
return new ChunkSampleStream[length];
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user