mirror of
https://github.com/samsonjs/media.git
synced 2026-04-27 15:07:40 +00:00
Remove extra constructors.
This commit is contained in:
parent
35a744a5d4
commit
476cefa7cc
8 changed files with 8 additions and 33 deletions
|
|
@ -38,13 +38,6 @@ public abstract class BaseMediaChunk extends MediaChunk {
|
||||||
private DefaultTrackOutput output;
|
private DefaultTrackOutput output;
|
||||||
private int firstSampleIndex;
|
private int firstSampleIndex;
|
||||||
|
|
||||||
public BaseMediaChunk(DataSource dataSource, DataSpec dataSpec, int trigger, Format format,
|
|
||||||
long startTimeUs, long endTimeUs, int chunkIndex, boolean isLastChunk,
|
|
||||||
boolean isMediaFormatFinal) {
|
|
||||||
this(dataSource, dataSpec, trigger, format, startTimeUs, endTimeUs, chunkIndex, isLastChunk,
|
|
||||||
isMediaFormatFinal, Chunk.NO_PARENT_ID);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param dataSource A {@link DataSource} for loading the data.
|
* @param dataSource A {@link DataSource} for loading the data.
|
||||||
* @param dataSpec Defines the data to be loaded.
|
* @param dataSpec Defines the data to be loaded.
|
||||||
|
|
|
||||||
|
|
@ -104,10 +104,6 @@ public abstract class Chunk implements Loadable {
|
||||||
|
|
||||||
protected final DataSource dataSource;
|
protected final DataSource dataSource;
|
||||||
|
|
||||||
public Chunk(DataSource dataSource, DataSpec dataSpec, int type, int trigger, Format format) {
|
|
||||||
this(dataSource, dataSpec, type, trigger, format, NO_PARENT_ID);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param dataSource The source from which the data should be loaded.
|
* @param dataSource The source from which the data should be loaded.
|
||||||
* @param dataSpec Defines the data to be loaded. {@code dataSpec.length} must not exceed
|
* @param dataSpec Defines the data to be loaded. {@code dataSpec.length} must not exceed
|
||||||
|
|
|
||||||
|
|
@ -43,15 +43,6 @@ public class ContainerMediaChunk extends BaseMediaChunk implements SingleTrackOu
|
||||||
private volatile int bytesLoaded;
|
private volatile int bytesLoaded;
|
||||||
private volatile boolean loadCanceled;
|
private volatile boolean loadCanceled;
|
||||||
|
|
||||||
public ContainerMediaChunk(DataSource dataSource, DataSpec dataSpec, int trigger, Format format,
|
|
||||||
long startTimeUs, long endTimeUs, int chunkIndex, boolean isLastChunk, long sampleOffsetUs,
|
|
||||||
ChunkExtractorWrapper extractorWrapper, MediaFormat mediaFormat, DrmInitData drmInitData,
|
|
||||||
boolean isMediaFormatFinal) {
|
|
||||||
this(dataSource, dataSpec, trigger, format, startTimeUs, endTimeUs, chunkIndex, isLastChunk,
|
|
||||||
sampleOffsetUs, extractorWrapper, mediaFormat, drmInitData, isMediaFormatFinal,
|
|
||||||
Chunk.NO_PARENT_ID);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param dataSource A {@link DataSource} for loading the data.
|
* @param dataSource A {@link DataSource} for loading the data.
|
||||||
* @param dataSpec Defines the data to be loaded.
|
* @param dataSpec Defines the data to be loaded.
|
||||||
|
|
|
||||||
|
|
@ -43,11 +43,12 @@ public abstract class DataChunk extends Chunk {
|
||||||
* @param type See {@link #type}.
|
* @param type See {@link #type}.
|
||||||
* @param trigger See {@link #trigger}.
|
* @param trigger See {@link #trigger}.
|
||||||
* @param format See {@link #format}.
|
* @param format See {@link #format}.
|
||||||
|
* @param parentId Identifier for a parent from which this chunk originates.
|
||||||
* @param data An optional recycled array that can be used as a holder for the data.
|
* @param data An optional recycled array that can be used as a holder for the data.
|
||||||
*/
|
*/
|
||||||
public DataChunk(DataSource dataSource, DataSpec dataSpec, int type, int trigger, Format format,
|
public DataChunk(DataSource dataSource, DataSpec dataSpec, int type, int trigger, Format format,
|
||||||
byte[] data) {
|
int parentId, byte[] data) {
|
||||||
super(dataSource, dataSpec, type, trigger, format);
|
super(dataSource, dataSpec, type, trigger, format, parentId);
|
||||||
this.data = data;
|
this.data = data;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -116,7 +116,7 @@ public final class SingleSampleChunkSource implements ChunkSource {
|
||||||
|
|
||||||
private SingleSampleMediaChunk initChunk() {
|
private SingleSampleMediaChunk initChunk() {
|
||||||
return new SingleSampleMediaChunk(dataSource, dataSpec, Chunk.TRIGGER_UNSPECIFIED, format, 0,
|
return new SingleSampleMediaChunk(dataSource, dataSpec, Chunk.TRIGGER_UNSPECIFIED, format, 0,
|
||||||
durationUs, 0, true, mediaFormat, null);
|
durationUs, 0, true, mediaFormat, null, Chunk.NO_PARENT_ID);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -35,13 +35,6 @@ public final class SingleSampleMediaChunk extends BaseMediaChunk {
|
||||||
private volatile int bytesLoaded;
|
private volatile int bytesLoaded;
|
||||||
private volatile boolean loadCanceled;
|
private volatile boolean loadCanceled;
|
||||||
|
|
||||||
public SingleSampleMediaChunk(DataSource dataSource, DataSpec dataSpec, int trigger,
|
|
||||||
Format format, long startTimeUs, long endTimeUs, int chunkIndex, boolean isLastChunk,
|
|
||||||
MediaFormat sampleFormat, DrmInitData sampleDrmInitData) {
|
|
||||||
this(dataSource, dataSpec, trigger, format, startTimeUs, endTimeUs, chunkIndex, isLastChunk,
|
|
||||||
sampleFormat, sampleDrmInitData, Chunk.NO_PARENT_ID);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param dataSource A {@link DataSource} for loading the data.
|
* @param dataSource A {@link DataSource} for loading the data.
|
||||||
* @param dataSpec Defines the data to be loaded.
|
* @param dataSpec Defines the data to be loaded.
|
||||||
|
|
|
||||||
|
|
@ -658,7 +658,7 @@ public class HlsChunkSource {
|
||||||
public MediaPlaylistChunk(DataSource dataSource, DataSpec dataSpec, byte[] scratchSpace,
|
public MediaPlaylistChunk(DataSource dataSource, DataSpec dataSpec, byte[] scratchSpace,
|
||||||
HlsPlaylistParser playlistParser, int variantIndex, String playlistUrl) {
|
HlsPlaylistParser playlistParser, int variantIndex, String playlistUrl) {
|
||||||
super(dataSource, dataSpec, Chunk.TYPE_MANIFEST, Chunk.TRIGGER_UNSPECIFIED, null,
|
super(dataSource, dataSpec, Chunk.TYPE_MANIFEST, Chunk.TRIGGER_UNSPECIFIED, null,
|
||||||
scratchSpace);
|
Chunk.NO_PARENT_ID, scratchSpace);
|
||||||
this.variantIndex = variantIndex;
|
this.variantIndex = variantIndex;
|
||||||
this.playlistParser = playlistParser;
|
this.playlistParser = playlistParser;
|
||||||
this.playlistUrl = playlistUrl;
|
this.playlistUrl = playlistUrl;
|
||||||
|
|
@ -685,7 +685,8 @@ public class HlsChunkSource {
|
||||||
|
|
||||||
public EncryptionKeyChunk(DataSource dataSource, DataSpec dataSpec, byte[] scratchSpace,
|
public EncryptionKeyChunk(DataSource dataSource, DataSpec dataSpec, byte[] scratchSpace,
|
||||||
String iv, int variantIndex) {
|
String iv, int variantIndex) {
|
||||||
super(dataSource, dataSpec, Chunk.TYPE_DRM, Chunk.TRIGGER_UNSPECIFIED, null, scratchSpace);
|
super(dataSource, dataSpec, Chunk.TYPE_DRM, Chunk.TRIGGER_UNSPECIFIED, null,
|
||||||
|
Chunk.NO_PARENT_ID, scratchSpace);
|
||||||
this.iv = iv;
|
this.iv = iv;
|
||||||
this.variantIndex = variantIndex;
|
this.variantIndex = variantIndex;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -487,7 +487,7 @@ public class SmoothStreamingChunkSource implements ChunkSource,
|
||||||
// To convert them the absolute timestamps, we need to set sampleOffsetUs to -chunkStartTimeUs.
|
// To convert them the absolute timestamps, we need to set sampleOffsetUs to -chunkStartTimeUs.
|
||||||
return new ContainerMediaChunk(dataSource, dataSpec, trigger, formatInfo, chunkStartTimeUs,
|
return new ContainerMediaChunk(dataSource, dataSpec, trigger, formatInfo, chunkStartTimeUs,
|
||||||
chunkEndTimeUs, chunkIndex, isLast, chunkStartTimeUs, extractorWrapper, mediaFormat,
|
chunkEndTimeUs, chunkIndex, isLast, chunkStartTimeUs, extractorWrapper, mediaFormat,
|
||||||
drmInitData, true);
|
drmInitData, true, Chunk.NO_PARENT_ID);
|
||||||
}
|
}
|
||||||
|
|
||||||
private static int getManifestTrackKey(int elementIndex, int trackIndex) {
|
private static int getManifestTrackKey(int elementIndex, int trackIndex) {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue