mirror of
https://github.com/samsonjs/media.git
synced 2026-04-04 11:05:47 +00:00
Some renaming to make format use slightly clearer.
This commit is contained in:
parent
fae6c65367
commit
4b2991267e
3 changed files with 13 additions and 13 deletions
|
|
@ -108,7 +108,7 @@ public class DashChunkSource implements ChunkSource {
|
|||
private final Handler eventHandler;
|
||||
private final EventListener eventListener;
|
||||
|
||||
private final MediaFormat mediaFormat;
|
||||
private final MediaFormat trackFormat;
|
||||
private final DataSource dataSource;
|
||||
private final FormatEvaluator formatEvaluator;
|
||||
private final Evaluation evaluation;
|
||||
|
|
@ -294,7 +294,7 @@ public class DashChunkSource implements ChunkSource {
|
|||
this.maxWidth = maxWidth == 0 ? MediaFormat.NO_VALUE : maxWidth;
|
||||
this.maxHeight = maxHeight == 0 ? MediaFormat.NO_VALUE : maxHeight;
|
||||
// TODO: Remove this and pass proper formats instead (b/22996976).
|
||||
this.mediaFormat = MediaFormat.createFormatForMimeType(mimeType, MediaFormat.NO_VALUE,
|
||||
this.trackFormat = MediaFormat.createFormatForMimeType(mimeType, MediaFormat.NO_VALUE,
|
||||
totalDurationUs);
|
||||
}
|
||||
|
||||
|
|
@ -310,7 +310,7 @@ public class DashChunkSource implements ChunkSource {
|
|||
|
||||
@Override
|
||||
public final MediaFormat getFormat(int track) {
|
||||
return mediaFormat;
|
||||
return trackFormat;
|
||||
}
|
||||
|
||||
// VisibleForTesting
|
||||
|
|
|
|||
|
|
@ -71,7 +71,7 @@ public final class HlsSampleSource implements SampleSource, SampleSourceReader,
|
|||
private int enabledTrackCount;
|
||||
private boolean[] trackEnabledStates;
|
||||
private boolean[] pendingDiscontinuities;
|
||||
private MediaFormat[] mediaFormats;
|
||||
private MediaFormat[] trackFormat;
|
||||
private MediaFormat[] downstreamMediaFormats;
|
||||
private Format downstreamFormat;
|
||||
|
||||
|
|
@ -135,14 +135,14 @@ public final class HlsSampleSource implements SampleSource, SampleSourceReader,
|
|||
trackEnabledStates = new boolean[trackCount];
|
||||
pendingDiscontinuities = new boolean[trackCount];
|
||||
downstreamMediaFormats = new MediaFormat[trackCount];
|
||||
mediaFormats = new MediaFormat[trackCount];
|
||||
trackFormat = new MediaFormat[trackCount];
|
||||
long durationUs = chunkSource.getDurationUs();
|
||||
for (int i = 0; i < trackCount; i++) {
|
||||
MediaFormat format = extractor.getMediaFormat(i).copyWithDurationUs(durationUs);
|
||||
if (MimeTypes.isVideo(format.mimeType)) {
|
||||
format = format.copyAsAdaptive();
|
||||
}
|
||||
mediaFormats[i] = format;
|
||||
trackFormat[i] = format;
|
||||
}
|
||||
prepared = true;
|
||||
return true;
|
||||
|
|
@ -176,7 +176,7 @@ public final class HlsSampleSource implements SampleSource, SampleSourceReader,
|
|||
@Override
|
||||
public MediaFormat getFormat(int track) {
|
||||
Assertions.checkState(prepared);
|
||||
return mediaFormats[track];
|
||||
return trackFormat[track];
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
|||
|
|
@ -180,7 +180,7 @@ public class SmoothStreamingChunkSource implements ChunkSource,
|
|||
|
||||
@Override
|
||||
public final MediaFormat getFormat(int track) {
|
||||
return tracks.get(track).format;
|
||||
return tracks.get(track).trackFormat;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
@ -512,7 +512,7 @@ public class SmoothStreamingChunkSource implements ChunkSource,
|
|||
|
||||
private static final class ExposedTrack {
|
||||
|
||||
public final MediaFormat format;
|
||||
public final MediaFormat trackFormat;
|
||||
|
||||
private final int elementIndex;
|
||||
|
||||
|
|
@ -524,8 +524,8 @@ public class SmoothStreamingChunkSource implements ChunkSource,
|
|||
private final int adaptiveMaxWidth;
|
||||
private final int adaptiveMaxHeight;
|
||||
|
||||
public ExposedTrack(MediaFormat format, int elementIndex, Format fixedFormat) {
|
||||
this.format = format;
|
||||
public ExposedTrack(MediaFormat trackFormat, int elementIndex, Format fixedFormat) {
|
||||
this.trackFormat = trackFormat;
|
||||
this.elementIndex = elementIndex;
|
||||
this.fixedFormat = fixedFormat;
|
||||
this.adaptiveFormats = null;
|
||||
|
|
@ -533,9 +533,9 @@ public class SmoothStreamingChunkSource implements ChunkSource,
|
|||
this.adaptiveMaxHeight = MediaFormat.NO_VALUE;
|
||||
}
|
||||
|
||||
public ExposedTrack(MediaFormat format, int elementIndex, Format[] adaptiveFormats,
|
||||
public ExposedTrack(MediaFormat trackFormat, int elementIndex, Format[] adaptiveFormats,
|
||||
int adaptiveMaxWidth, int adaptiveMaxHeight) {
|
||||
this.format = format;
|
||||
this.trackFormat = trackFormat;
|
||||
this.elementIndex = elementIndex;
|
||||
this.adaptiveFormats = adaptiveFormats;
|
||||
this.adaptiveMaxWidth = adaptiveMaxWidth;
|
||||
|
|
|
|||
Loading…
Reference in a new issue