Commit a174af0d by aquilescanta Committed by Andrew Lewis

Remove deprecated HLS-related constructors

PiperOrigin-RevId: 234586744
parent 774c01d0
......@@ -36,15 +36,12 @@ import com.google.android.exoplayer2.source.hls.playlist.DefaultHlsPlaylistParse
import com.google.android.exoplayer2.source.hls.playlist.DefaultHlsPlaylistTracker;
import com.google.android.exoplayer2.source.hls.playlist.FilteringHlsPlaylistParserFactory;
import com.google.android.exoplayer2.source.hls.playlist.HlsMediaPlaylist;
import com.google.android.exoplayer2.source.hls.playlist.HlsPlaylist;
import com.google.android.exoplayer2.source.hls.playlist.HlsPlaylistParser;
import com.google.android.exoplayer2.source.hls.playlist.HlsPlaylistParserFactory;
import com.google.android.exoplayer2.source.hls.playlist.HlsPlaylistTracker;
import com.google.android.exoplayer2.upstream.Allocator;
import com.google.android.exoplayer2.upstream.DataSource;
import com.google.android.exoplayer2.upstream.DefaultLoadErrorHandlingPolicy;
import com.google.android.exoplayer2.upstream.LoadErrorHandlingPolicy;
import com.google.android.exoplayer2.upstream.ParsingLoadable;
import com.google.android.exoplayer2.upstream.TransferListener;
import com.google.android.exoplayer2.util.Assertions;
import java.io.IOException;
......@@ -297,99 +294,6 @@ public final class HlsMediaSource extends BaseMediaSource
private @Nullable TransferListener mediaTransferListener;
/**
* @param manifestUri The {@link Uri} of the HLS manifest.
* @param dataSourceFactory An {@link HlsDataSourceFactory} for {@link DataSource}s for manifests,
* segments and keys.
* @param eventHandler A handler for events. May be null if delivery of events is not required.
* @param eventListener A {@link MediaSourceEventListener}. May be null if delivery of events is
* not required.
* @deprecated Use {@link Factory} instead.
*/
@Deprecated
@SuppressWarnings("deprecation")
public HlsMediaSource(
Uri manifestUri,
DataSource.Factory dataSourceFactory,
Handler eventHandler,
MediaSourceEventListener eventListener) {
this(
manifestUri,
dataSourceFactory,
DefaultLoadErrorHandlingPolicy.DEFAULT_MIN_LOADABLE_RETRY_COUNT,
eventHandler,
eventListener);
}
/**
* @param manifestUri The {@link Uri} of the HLS manifest.
* @param dataSourceFactory An {@link HlsDataSourceFactory} for {@link DataSource}s for manifests,
* segments and keys.
* @param minLoadableRetryCount The minimum number of times loads must be retried before errors
* are propagated.
* @param eventHandler A handler for events. May be null if delivery of events is not required.
* @param eventListener A {@link MediaSourceEventListener}. May be null if delivery of events is
* not required.
* @deprecated Use {@link Factory} instead.
*/
@Deprecated
@SuppressWarnings("deprecation")
public HlsMediaSource(
Uri manifestUri,
DataSource.Factory dataSourceFactory,
int minLoadableRetryCount,
Handler eventHandler,
MediaSourceEventListener eventListener) {
this(
manifestUri,
new DefaultHlsDataSourceFactory(dataSourceFactory),
HlsExtractorFactory.DEFAULT,
minLoadableRetryCount,
eventHandler,
eventListener,
new HlsPlaylistParser());
}
/**
* @param manifestUri The {@link Uri} of the HLS manifest.
* @param dataSourceFactory An {@link HlsDataSourceFactory} for {@link DataSource}s for manifests,
* segments and keys.
* @param extractorFactory An {@link HlsExtractorFactory} for {@link Extractor}s for the segments.
* @param minLoadableRetryCount The minimum number of times loads must be retried before errors
* are propagated.
* @param eventHandler A handler for events. May be null if delivery of events is not required.
* @param eventListener A {@link MediaSourceEventListener}. May be null if delivery of events is
* not required.
* @param playlistParser A {@link ParsingLoadable.Parser} for HLS playlists.
* @deprecated Use {@link Factory} instead.
*/
@Deprecated
@SuppressWarnings("deprecation")
public HlsMediaSource(
Uri manifestUri,
HlsDataSourceFactory dataSourceFactory,
HlsExtractorFactory extractorFactory,
int minLoadableRetryCount,
Handler eventHandler,
MediaSourceEventListener eventListener,
ParsingLoadable.Parser<HlsPlaylist> playlistParser) {
this(
manifestUri,
dataSourceFactory,
extractorFactory,
new DefaultCompositeSequenceableLoaderFactory(),
new DefaultLoadErrorHandlingPolicy(minLoadableRetryCount),
new DefaultHlsPlaylistTracker(
dataSourceFactory,
new DefaultLoadErrorHandlingPolicy(minLoadableRetryCount),
playlistParser),
/* allowChunklessPreparation= */ false,
/* tag= */ null);
if (eventHandler != null && eventListener != null) {
addEventListener(eventHandler, eventListener);
}
}
private HlsMediaSource(
Uri manifestUri,
HlsDataSourceFactory dataSourceFactory,
......
......@@ -70,23 +70,6 @@ public final class DefaultHlsPlaylistTracker
/**
* @param dataSourceFactory A factory for {@link DataSource} instances.
* @param loadErrorHandlingPolicy The {@link LoadErrorHandlingPolicy}.
* @param playlistParser A {@link ParsingLoadable.Parser} for HLS playlists.
* @deprecated Use {@link #DefaultHlsPlaylistTracker(HlsDataSourceFactory,
* LoadErrorHandlingPolicy, HlsPlaylistParserFactory)} instead. Using this constructor
* prevents support for attributes that are carried over from the master playlist to the media
* playlists.
*/
@Deprecated
public DefaultHlsPlaylistTracker(
HlsDataSourceFactory dataSourceFactory,
LoadErrorHandlingPolicy loadErrorHandlingPolicy,
ParsingLoadable.Parser<HlsPlaylist> playlistParser) {
this(dataSourceFactory, loadErrorHandlingPolicy, createFixedFactory(playlistParser));
}
/**
* @param dataSourceFactory A factory for {@link DataSource} instances.
* @param loadErrorHandlingPolicy The {@link LoadErrorHandlingPolicy}.
* @param playlistParserFactory An {@link HlsPlaylistParserFactory}.
*/
public DefaultHlsPlaylistTracker(
......@@ -654,26 +637,4 @@ public final class DefaultHlsPlaylistTracker
return primaryHlsUrl == playlistUrl && !maybeSelectNewPrimaryUrl();
}
}
/**
* Creates a factory which always returns the given playlist parser.
*
* @param playlistParser The parser to return.
* @return A factory which always returns the given playlist parser.
*/
private static HlsPlaylistParserFactory createFixedFactory(
ParsingLoadable.Parser<HlsPlaylist> playlistParser) {
return new HlsPlaylistParserFactory() {
@Override
public ParsingLoadable.Parser<HlsPlaylist> createPlaylistParser() {
return playlistParser;
}
@Override
public ParsingLoadable.Parser<HlsPlaylist> createPlaylistParser(
HlsMasterPlaylist masterPlaylist) {
return playlistParser;
}
};
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment