Deprecate SingleSampleMediaChunk
This is only used as part of legacy subtitle decoding. If any apps are using it directly (rather than via `DashMediaSource` or `SsMediaSource`) they probably need to enable legacy decoding in `TextRenderer` to avoid playback failures. PiperOrigin-RevId: 663740343
This commit is contained in:
parent
91a95e23c9
commit
3600d04719
@ -22,13 +22,22 @@ import androidx.media3.common.util.UnstableApi;
|
||||
import androidx.media3.datasource.DataSource;
|
||||
import androidx.media3.datasource.DataSourceUtil;
|
||||
import androidx.media3.datasource.DataSpec;
|
||||
import androidx.media3.exoplayer.ExoPlayer;
|
||||
import androidx.media3.exoplayer.text.TextRenderer;
|
||||
import androidx.media3.extractor.DefaultExtractorInput;
|
||||
import androidx.media3.extractor.ExtractorInput;
|
||||
import androidx.media3.extractor.TrackOutput;
|
||||
import java.io.IOException;
|
||||
|
||||
/** A {@link BaseMediaChunk} for chunks consisting of a single raw sample. */
|
||||
/**
|
||||
* @deprecated The only use for this class is subtitle playback, but it is only compatible with
|
||||
* legacy subtitle decoding, which is not supported by default. Users of this class almost
|
||||
* certainly need to {@linkplain TextRenderer#experimentalSetLegacyDecodingEnabled(boolean)
|
||||
* enable legacy subtitle decoding} on their {@link ExoPlayer} instance in order to avoid
|
||||
* playback errors when trying to play subtitles.
|
||||
*/
|
||||
@UnstableApi
|
||||
@Deprecated
|
||||
public final class SingleSampleMediaChunk extends BaseMediaChunk {
|
||||
|
||||
private final @C.TrackType int trackType;
|
||||
|
@ -762,6 +762,9 @@ public class DefaultDashChunkSource implements DashChunkSource {
|
||||
representationHolder.chunkExtractor);
|
||||
}
|
||||
|
||||
// TODO: b/289983417 - Stop using deprecated SingleSampleMediaChunk when legacy subtitle decoding
|
||||
// is no longer supported.
|
||||
@SuppressWarnings("deprecation")
|
||||
protected Chunk newMediaChunk(
|
||||
RepresentationHolder representationHolder,
|
||||
DataSource dataSource,
|
||||
|
Loading…
x
Reference in New Issue
Block a user