mirror of
https://github.com/samsonjs/media.git
synced 2026-04-27 15:07:40 +00:00
Rename SingleTrackMetadataOutput ahead of real metadata support
Issue #2176 ------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=144969838
This commit is contained in:
parent
ae01c1a6fd
commit
430d8e8a7a
3 changed files with 17 additions and 17 deletions
|
|
@ -30,15 +30,15 @@ import java.io.IOException;
|
||||||
/**
|
/**
|
||||||
* An {@link Extractor} wrapper for loading chunks containing a single track.
|
* An {@link Extractor} wrapper for loading chunks containing a single track.
|
||||||
* <p>
|
* <p>
|
||||||
* The wrapper allows switching of the {@link SingleTrackMetadataOutput} and {@link TrackOutput}
|
* The wrapper allows switching of the {@link SeekMapOutput} and {@link TrackOutput} that receive
|
||||||
* which receive parsed data.
|
* parsed data.
|
||||||
*/
|
*/
|
||||||
public final class ChunkExtractorWrapper implements ExtractorOutput, TrackOutput {
|
public final class ChunkExtractorWrapper implements ExtractorOutput, TrackOutput {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Receives metadata associated with the track as extracted by the wrapped {@link Extractor}.
|
* Receives {@link SeekMap}s extracted by the wrapped {@link Extractor}.
|
||||||
*/
|
*/
|
||||||
public interface SingleTrackMetadataOutput {
|
public interface SeekMapOutput {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @see ExtractorOutput#seekMap(SeekMap)
|
* @see ExtractorOutput#seekMap(SeekMap)
|
||||||
|
|
@ -53,7 +53,7 @@ public final class ChunkExtractorWrapper implements ExtractorOutput, TrackOutput
|
||||||
private final boolean resendFormatOnInit;
|
private final boolean resendFormatOnInit;
|
||||||
|
|
||||||
private boolean extractorInitialized;
|
private boolean extractorInitialized;
|
||||||
private SingleTrackMetadataOutput metadataOutput;
|
private SeekMapOutput seekMapOutput;
|
||||||
private TrackOutput trackOutput;
|
private TrackOutput trackOutput;
|
||||||
private Format sentFormat;
|
private Format sentFormat;
|
||||||
|
|
||||||
|
|
@ -68,7 +68,7 @@ public final class ChunkExtractorWrapper implements ExtractorOutput, TrackOutput
|
||||||
* @param preferManifestDrmInitData Whether {@link DrmInitData} defined in {@code manifestFormat}
|
* @param preferManifestDrmInitData Whether {@link DrmInitData} defined in {@code manifestFormat}
|
||||||
* should be preferred when the sample and manifest {@link Format}s are merged.
|
* should be preferred when the sample and manifest {@link Format}s are merged.
|
||||||
* @param resendFormatOnInit Whether the extractor should resend the previous {@link Format} when
|
* @param resendFormatOnInit Whether the extractor should resend the previous {@link Format} when
|
||||||
* it is initialized via {@link #init(SingleTrackMetadataOutput, TrackOutput)}.
|
* it is initialized via {@link #init(SeekMapOutput, TrackOutput)}.
|
||||||
*/
|
*/
|
||||||
public ChunkExtractorWrapper(Extractor extractor, Format manifestFormat,
|
public ChunkExtractorWrapper(Extractor extractor, Format manifestFormat,
|
||||||
boolean preferManifestDrmInitData, boolean resendFormatOnInit) {
|
boolean preferManifestDrmInitData, boolean resendFormatOnInit) {
|
||||||
|
|
@ -79,14 +79,14 @@ public final class ChunkExtractorWrapper implements ExtractorOutput, TrackOutput
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Initializes the extractor to output to the provided {@link SingleTrackMetadataOutput} and
|
* Initializes the extractor to output to the provided {@link SeekMapOutput} and
|
||||||
* {@link TrackOutput} instances, and configures it to receive data from a new chunk.
|
* {@link TrackOutput} instances, and configures it to receive data from a new chunk.
|
||||||
*
|
*
|
||||||
* @param metadataOutput The {@link SingleTrackMetadataOutput} that will receive metadata.
|
* @param seekMapOutput The {@link SeekMapOutput} that will receive extracted {@link SeekMap}s.
|
||||||
* @param trackOutput The {@link TrackOutput} that will receive sample data.
|
* @param trackOutput The {@link TrackOutput} that will receive sample data.
|
||||||
*/
|
*/
|
||||||
public void init(SingleTrackMetadataOutput metadataOutput, TrackOutput trackOutput) {
|
public void init(SeekMapOutput seekMapOutput, TrackOutput trackOutput) {
|
||||||
this.metadataOutput = metadataOutput;
|
this.seekMapOutput = seekMapOutput;
|
||||||
this.trackOutput = trackOutput;
|
this.trackOutput = trackOutput;
|
||||||
if (!extractorInitialized) {
|
if (!extractorInitialized) {
|
||||||
extractor.init(this);
|
extractor.init(this);
|
||||||
|
|
@ -130,7 +130,7 @@ public final class ChunkExtractorWrapper implements ExtractorOutput, TrackOutput
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void seekMap(SeekMap seekMap) {
|
public void seekMap(SeekMap seekMap) {
|
||||||
metadataOutput.seekMap(seekMap);
|
seekMapOutput.seekMap(seekMap);
|
||||||
}
|
}
|
||||||
|
|
||||||
// TrackOutput implementation.
|
// TrackOutput implementation.
|
||||||
|
|
|
||||||
|
|
@ -21,7 +21,7 @@ import com.google.android.exoplayer2.extractor.DefaultTrackOutput;
|
||||||
import com.google.android.exoplayer2.extractor.Extractor;
|
import com.google.android.exoplayer2.extractor.Extractor;
|
||||||
import com.google.android.exoplayer2.extractor.ExtractorInput;
|
import com.google.android.exoplayer2.extractor.ExtractorInput;
|
||||||
import com.google.android.exoplayer2.extractor.SeekMap;
|
import com.google.android.exoplayer2.extractor.SeekMap;
|
||||||
import com.google.android.exoplayer2.source.chunk.ChunkExtractorWrapper.SingleTrackMetadataOutput;
|
import com.google.android.exoplayer2.source.chunk.ChunkExtractorWrapper.SeekMapOutput;
|
||||||
import com.google.android.exoplayer2.upstream.DataSource;
|
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.util.Util;
|
import com.google.android.exoplayer2.util.Util;
|
||||||
|
|
@ -30,7 +30,7 @@ import java.io.IOException;
|
||||||
/**
|
/**
|
||||||
* A {@link BaseMediaChunk} that uses an {@link Extractor} to decode sample data.
|
* A {@link BaseMediaChunk} that uses an {@link Extractor} to decode sample data.
|
||||||
*/
|
*/
|
||||||
public class ContainerMediaChunk extends BaseMediaChunk implements SingleTrackMetadataOutput {
|
public class ContainerMediaChunk extends BaseMediaChunk implements SeekMapOutput {
|
||||||
|
|
||||||
private final int chunkCount;
|
private final int chunkCount;
|
||||||
private final long sampleOffsetUs;
|
private final long sampleOffsetUs;
|
||||||
|
|
@ -85,7 +85,7 @@ public class ContainerMediaChunk extends BaseMediaChunk implements SingleTrackMe
|
||||||
return bytesLoaded;
|
return bytesLoaded;
|
||||||
}
|
}
|
||||||
|
|
||||||
// SingleTrackMetadataOutput implementation.
|
// SeekMapOutput implementation.
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public final void seekMap(SeekMap seekMap) {
|
public final void seekMap(SeekMap seekMap) {
|
||||||
|
|
|
||||||
|
|
@ -22,7 +22,7 @@ import com.google.android.exoplayer2.extractor.Extractor;
|
||||||
import com.google.android.exoplayer2.extractor.ExtractorInput;
|
import com.google.android.exoplayer2.extractor.ExtractorInput;
|
||||||
import com.google.android.exoplayer2.extractor.SeekMap;
|
import com.google.android.exoplayer2.extractor.SeekMap;
|
||||||
import com.google.android.exoplayer2.extractor.TrackOutput;
|
import com.google.android.exoplayer2.extractor.TrackOutput;
|
||||||
import com.google.android.exoplayer2.source.chunk.ChunkExtractorWrapper.SingleTrackMetadataOutput;
|
import com.google.android.exoplayer2.source.chunk.ChunkExtractorWrapper.SeekMapOutput;
|
||||||
import com.google.android.exoplayer2.upstream.DataSource;
|
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.util.ParsableByteArray;
|
import com.google.android.exoplayer2.util.ParsableByteArray;
|
||||||
|
|
@ -32,7 +32,7 @@ import java.io.IOException;
|
||||||
/**
|
/**
|
||||||
* A {@link Chunk} that uses an {@link Extractor} to decode initialization data for single track.
|
* A {@link Chunk} that uses an {@link Extractor} to decode initialization data for single track.
|
||||||
*/
|
*/
|
||||||
public final class InitializationChunk extends Chunk implements SingleTrackMetadataOutput,
|
public final class InitializationChunk extends Chunk implements SeekMapOutput,
|
||||||
TrackOutput {
|
TrackOutput {
|
||||||
|
|
||||||
private final ChunkExtractorWrapper extractorWrapper;
|
private final ChunkExtractorWrapper extractorWrapper;
|
||||||
|
|
@ -85,7 +85,7 @@ public final class InitializationChunk extends Chunk implements SingleTrackMetad
|
||||||
return seekMap;
|
return seekMap;
|
||||||
}
|
}
|
||||||
|
|
||||||
// SingleTrackMetadataOutput implementation.
|
// SeekMapOutput implementation.
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void seekMap(SeekMap seekMap) {
|
public void seekMap(SeekMap seekMap) {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue