Delete deprecated methods from MediaSourceFactory

Some have been deprecated since 2.13.0
([commit](5b9fa7d7d9)):
* `setDrmSessionManager(DrmSessionManager)`
* `setDrmHttpDataSourceFactory(HttpDataSource.Factory)`
* `setDrmUserAgent(String)`

And the rest have been deprecated since 2.12.0
([commit](d1bbd3507a)):
* `setStreamKeys(List<String>)`
* `createMediaSource(Uri)`

PiperOrigin-RevId: 417622794
This commit is contained in:
ibaker 2021-12-21 16:07:18 +00:00 committed by Ian Baker
parent bc891273b2
commit bb1357b678
12 changed files with 34 additions and 666 deletions

View file

@ -81,6 +81,15 @@
* RTSP:
* Provide a client API to override the `SocketFactory` used for any server
connection ([#9606](https://github.com/google/ExoPlayer/pull/9606)).
* Remove deprecated symbols:
* Remove `MediaSourceFactory#setDrmSessionManager`,
`MediaSourceFactory#setDrmHttpDataSourceFactory`, and
`MediaSourceFactory#setDrmUserAgent`. Use
`MediaSourceFactory#setDrmSessionManagerProvider` instead.
* Remove `MediaSourceFactory#setStreamKeys`. Use
`MediaItem.Builder#setStreamKeys` instead.
* Remove `MediaSourceFactory#createMediaSource(Uri)`. Use
`MediaSourceFactory#createMediaSource(MediaItem)` instead.
### 2.16.1 (2021-11-18)

View file

@ -24,7 +24,6 @@ import androidx.annotation.Nullable;
import com.google.android.exoplayer2.C;
import com.google.android.exoplayer2.Format;
import com.google.android.exoplayer2.MediaItem;
import com.google.android.exoplayer2.drm.DrmSessionManager;
import com.google.android.exoplayer2.drm.DrmSessionManagerProvider;
import com.google.android.exoplayer2.extractor.DefaultExtractorsFactory;
import com.google.android.exoplayer2.extractor.Extractor;
@ -34,7 +33,6 @@ import com.google.android.exoplayer2.extractor.ExtractorsFactory;
import com.google.android.exoplayer2.extractor.PositionHolder;
import com.google.android.exoplayer2.extractor.SeekMap;
import com.google.android.exoplayer2.extractor.TrackOutput;
import com.google.android.exoplayer2.offline.StreamKey;
import com.google.android.exoplayer2.source.ads.AdsLoader;
import com.google.android.exoplayer2.source.ads.AdsMediaSource;
import com.google.android.exoplayer2.text.SubtitleDecoderFactory;
@ -43,7 +41,6 @@ import com.google.android.exoplayer2.ui.AdViewProvider;
import com.google.android.exoplayer2.upstream.DataSource;
import com.google.android.exoplayer2.upstream.DataSpec;
import com.google.android.exoplayer2.upstream.DefaultDataSource;
import com.google.android.exoplayer2.upstream.HttpDataSource;
import com.google.android.exoplayer2.upstream.LoadErrorHandlingPolicy;
import com.google.android.exoplayer2.util.Assertions;
import com.google.android.exoplayer2.util.Log;
@ -280,29 +277,6 @@ public final class DefaultMediaSourceFactory implements MediaSourceFactory {
return this;
}
@Deprecated
@Override
public DefaultMediaSourceFactory setDrmHttpDataSourceFactory(
@Nullable HttpDataSource.Factory drmHttpDataSourceFactory) {
delegateFactoryLoader.setDrmHttpDataSourceFactory(drmHttpDataSourceFactory);
return this;
}
@Deprecated
@Override
public DefaultMediaSourceFactory setDrmUserAgent(@Nullable String userAgent) {
delegateFactoryLoader.setDrmUserAgent(userAgent);
return this;
}
@Deprecated
@Override
public DefaultMediaSourceFactory setDrmSessionManager(
@Nullable DrmSessionManager drmSessionManager) {
delegateFactoryLoader.setDrmSessionManager(drmSessionManager);
return this;
}
@Override
public DefaultMediaSourceFactory setDrmSessionManagerProvider(
@Nullable DrmSessionManagerProvider drmSessionManagerProvider) {
@ -318,18 +292,6 @@ public final class DefaultMediaSourceFactory implements MediaSourceFactory {
return this;
}
/**
* @deprecated Use {@link MediaItem.Builder#setStreamKeys(List)} and {@link
* #createMediaSource(MediaItem)} instead.
*/
@SuppressWarnings("deprecation") // Calling through to the same deprecated method.
@Deprecated
@Override
public DefaultMediaSourceFactory setStreamKeys(@Nullable List<StreamKey> streamKeys) {
delegateFactoryLoader.setStreamKeys(streamKeys);
return this;
}
@Override
public int[] getSupportedTypes() {
return delegateFactoryLoader.getSupportedTypes();
@ -478,12 +440,8 @@ public final class DefaultMediaSourceFactory implements MediaSourceFactory {
private final Set<Integer> supportedTypes;
private final Map<Integer, MediaSourceFactory> mediaSourceFactories;
@Nullable private HttpDataSource.Factory drmHttpDataSourceFactory;
@Nullable private String userAgent;
@Nullable private DrmSessionManager drmSessionManager;
@Nullable private DrmSessionManagerProvider drmSessionManagerProvider;
@Nullable private LoadErrorHandlingPolicy loadErrorHandlingPolicy;
@Nullable private List<StreamKey> streamKeys;
public DelegateFactoryLoader(
DataSource.Factory dataSourceFactory, ExtractorsFactory extractorsFactory) {
@ -514,53 +472,16 @@ public final class DefaultMediaSourceFactory implements MediaSourceFactory {
}
mediaSourceFactory = mediaSourceFactorySupplier.get();
if (drmHttpDataSourceFactory != null) {
mediaSourceFactory.setDrmHttpDataSourceFactory(drmHttpDataSourceFactory);
}
if (userAgent != null) {
mediaSourceFactory.setDrmUserAgent(userAgent);
}
if (drmSessionManager != null) {
mediaSourceFactory.setDrmSessionManager(drmSessionManager);
}
if (drmSessionManagerProvider != null) {
mediaSourceFactory.setDrmSessionManagerProvider(drmSessionManagerProvider);
}
if (loadErrorHandlingPolicy != null) {
mediaSourceFactory.setLoadErrorHandlingPolicy(loadErrorHandlingPolicy);
}
if (streamKeys != null) {
mediaSourceFactory.setStreamKeys(streamKeys);
}
mediaSourceFactories.put(contentType, mediaSourceFactory);
return mediaSourceFactory;
}
@SuppressWarnings("deprecation") // Forwarding to deprecated method.
public void setDrmHttpDataSourceFactory(
@Nullable HttpDataSource.Factory drmHttpDataSourceFactory) {
this.drmHttpDataSourceFactory = drmHttpDataSourceFactory;
for (MediaSourceFactory mediaSourceFactory : mediaSourceFactories.values()) {
mediaSourceFactory.setDrmHttpDataSourceFactory(drmHttpDataSourceFactory);
}
}
@SuppressWarnings("deprecation") // Forwarding to deprecated method.
public void setDrmUserAgent(@Nullable String userAgent) {
this.userAgent = userAgent;
for (MediaSourceFactory mediaSourceFactory : mediaSourceFactories.values()) {
mediaSourceFactory.setDrmUserAgent(userAgent);
}
}
@SuppressWarnings("deprecation") // Forwarding to deprecated method.
public void setDrmSessionManager(@Nullable DrmSessionManager drmSessionManager) {
this.drmSessionManager = drmSessionManager;
for (MediaSourceFactory mediaSourceFactory : mediaSourceFactories.values()) {
mediaSourceFactory.setDrmSessionManager(drmSessionManager);
}
}
public void setDrmSessionManagerProvider(
@Nullable DrmSessionManagerProvider drmSessionManagerProvider) {
this.drmSessionManagerProvider = drmSessionManagerProvider;
@ -577,14 +498,6 @@ public final class DefaultMediaSourceFactory implements MediaSourceFactory {
}
}
@SuppressWarnings("deprecation") // Forwarding to deprecated method.
public void setStreamKeys(@Nullable List<StreamKey> streamKeys) {
this.streamKeys = streamKeys;
for (MediaSourceFactory mediaSourceFactory : mediaSourceFactories.values()) {
mediaSourceFactory.setStreamKeys(streamKeys);
}
}
private void ensureAllSuppliersAreLoaded() {
maybeLoadSupplier(C.TYPE_DASH);
maybeLoadSupplier(C.TYPE_SS);

View file

@ -15,21 +15,14 @@
*/
package com.google.android.exoplayer2.source;
import android.net.Uri;
import androidx.annotation.Nullable;
import com.google.android.exoplayer2.C;
import com.google.android.exoplayer2.MediaItem;
import com.google.android.exoplayer2.drm.DefaultDrmSessionManager;
import com.google.android.exoplayer2.drm.DefaultDrmSessionManagerProvider;
import com.google.android.exoplayer2.drm.DrmSessionManager;
import com.google.android.exoplayer2.drm.DrmSessionManagerProvider;
import com.google.android.exoplayer2.drm.HttpMediaDrmCallback;
import com.google.android.exoplayer2.offline.StreamKey;
import com.google.android.exoplayer2.upstream.DefaultHttpDataSource;
import com.google.android.exoplayer2.upstream.DefaultLoadErrorHandlingPolicy;
import com.google.android.exoplayer2.upstream.HttpDataSource;
import com.google.android.exoplayer2.upstream.LoadErrorHandlingPolicy;
import java.util.List;
/** Factory for creating {@link MediaSource MediaSources} from {@link MediaItem MediaItems}. */
public interface MediaSourceFactory {
@ -46,26 +39,6 @@ public interface MediaSourceFactory {
return this;
}
@Deprecated
@Override
public MediaSourceFactory setDrmSessionManager(
@Nullable DrmSessionManager drmSessionManager) {
return this;
}
@Deprecated
@Override
public MediaSourceFactory setDrmHttpDataSourceFactory(
@Nullable HttpDataSource.Factory drmHttpDataSourceFactory) {
return this;
}
@Deprecated
@Override
public MediaSourceFactory setDrmUserAgent(@Nullable String userAgent) {
return this;
}
@Override
public MediaSourceFactory setLoadErrorHandlingPolicy(
@Nullable LoadErrorHandlingPolicy loadErrorHandlingPolicy) {
@ -84,88 +57,17 @@ public interface MediaSourceFactory {
}
};
/** @deprecated Use {@link MediaItem.LocalConfiguration#streamKeys} instead. */
@Deprecated
default MediaSourceFactory setStreamKeys(@Nullable List<StreamKey> streamKeys) {
return this;
}
/**
* Sets the {@link DrmSessionManagerProvider} used to obtain a {@link DrmSessionManager} for a
* {@link MediaItem}.
*
* <p>If not set, {@link DefaultDrmSessionManagerProvider} is used.
*
* <p>If set, calls to the following (deprecated) methods are ignored:
*
* <ul>
* <li>{@link #setDrmUserAgent(String)}
* <li>{@link #setDrmHttpDataSourceFactory(HttpDataSource.Factory)}
* </ul>
*
* @return This factory, for convenience.
*/
MediaSourceFactory setDrmSessionManagerProvider(
@Nullable DrmSessionManagerProvider drmSessionManagerProvider);
/**
* Sets the {@link DrmSessionManager} to use for all media items regardless of their {@link
* MediaItem.DrmConfiguration}.
*
* <p>Calling this with a non-null {@code drmSessionManager} is equivalent to calling {@code
* setDrmSessionManagerProvider(unusedMediaItem -> drmSessionManager)}.
*
* @param drmSessionManager The {@link DrmSessionManager}, or {@code null} to use the {@link
* DefaultDrmSessionManager}.
* @return This factory, for convenience.
* @deprecated Use {@link #setDrmSessionManagerProvider(DrmSessionManagerProvider)} and pass an
* implementation that always returns the same instance.
*/
@Deprecated
MediaSourceFactory setDrmSessionManager(@Nullable DrmSessionManager drmSessionManager);
/**
* Sets the {@link HttpDataSource.Factory} to be used for creating {@link HttpMediaDrmCallback
* HttpMediaDrmCallbacks} to execute key and provisioning requests over HTTP.
*
* <p>Calls to this method are ignored if either a {@link
* #setDrmSessionManagerProvider(DrmSessionManagerProvider) DrmSessionManager provider} or {@link
* #setDrmSessionManager(DrmSessionManager) concrete DrmSessionManager} are provided.
*
* @param drmHttpDataSourceFactory The HTTP data source factory, or {@code null} to use {@link
* DefaultHttpDataSource.Factory}.
* @return This factory, for convenience.
* @deprecated Use {@link #setDrmSessionManagerProvider(DrmSessionManagerProvider)} and pass an
* implementation that configures the returned {@link DrmSessionManager} with the desired
* {@link HttpDataSource.Factory}.
*/
@Deprecated
MediaSourceFactory setDrmHttpDataSourceFactory(
@Nullable HttpDataSource.Factory drmHttpDataSourceFactory);
/**
* Sets the optional user agent to be used for DRM requests.
*
* <p>Calls to this method are ignored if any of the following are provided:
*
* <ul>
* <li>A {@link #setDrmSessionManagerProvider(DrmSessionManagerProvider) DrmSessionManager
* provider}.
* <li>A {@link #setDrmSessionManager(DrmSessionManager) concrete DrmSessionManager}.
* <li>A {@link #setDrmHttpDataSourceFactory(HttpDataSource.Factory) DRM
* HttpDataSource.Factory}.
* </ul>
*
* @param userAgent The user agent to be used for DRM requests, or {@code null} to use the
* default.
* @return This factory, for convenience.
* @deprecated Use {@link #setDrmSessionManagerProvider(DrmSessionManagerProvider)} and pass an
* implementation that configures the returned {@link DrmSessionManager} with the desired
* {@code userAgent}.
*/
@Deprecated
MediaSourceFactory setDrmUserAgent(@Nullable String userAgent);
/**
* Sets an optional {@link LoadErrorHandlingPolicy}.
*
@ -190,10 +92,4 @@ public interface MediaSourceFactory {
* @return The new {@link MediaSource media source}.
*/
MediaSource createMediaSource(MediaItem mediaItem);
/** @deprecated Use {@link #createMediaSource(MediaItem)} instead. */
@Deprecated
default MediaSource createMediaSource(Uri uri) {
return createMediaSource(MediaItem.fromUri(uri));
}
}

View file

@ -32,7 +32,6 @@ import com.google.android.exoplayer2.extractor.ExtractorsFactory;
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.HttpDataSource;
import com.google.android.exoplayer2.upstream.LoadErrorHandlingPolicy;
import com.google.android.exoplayer2.upstream.TransferListener;
@ -56,7 +55,6 @@ public final class ProgressiveMediaSource extends BaseMediaSource
private final DataSource.Factory dataSourceFactory;
private ProgressiveMediaExtractor.Factory progressiveMediaExtractorFactory;
private boolean usingCustomDrmSessionManagerProvider;
private DrmSessionManagerProvider drmSessionManagerProvider;
private LoadErrorHandlingPolicy loadErrorHandlingPolicy;
private int continueLoadingCheckIntervalBytes;
@ -166,55 +164,13 @@ public final class ProgressiveMediaSource extends BaseMediaSource
@Override
public Factory setDrmSessionManagerProvider(
@Nullable DrmSessionManagerProvider drmSessionManagerProvider) {
if (drmSessionManagerProvider != null) {
this.drmSessionManagerProvider = drmSessionManagerProvider;
this.usingCustomDrmSessionManagerProvider = true;
} else {
this.drmSessionManagerProvider = new DefaultDrmSessionManagerProvider();
this.usingCustomDrmSessionManagerProvider = false;
}
this.drmSessionManagerProvider =
drmSessionManagerProvider != null
? drmSessionManagerProvider
: new DefaultDrmSessionManagerProvider();
return this;
}
@Deprecated
@Override
public Factory setDrmSessionManager(@Nullable DrmSessionManager drmSessionManager) {
if (drmSessionManager == null) {
setDrmSessionManagerProvider(null);
} else {
setDrmSessionManagerProvider(unusedMediaItem -> drmSessionManager);
}
return this;
}
@Deprecated
@Override
public Factory setDrmHttpDataSourceFactory(
@Nullable HttpDataSource.Factory drmHttpDataSourceFactory) {
if (!usingCustomDrmSessionManagerProvider) {
((DefaultDrmSessionManagerProvider) drmSessionManagerProvider)
.setDrmHttpDataSourceFactory(drmHttpDataSourceFactory);
}
return this;
}
@Deprecated
@Override
public Factory setDrmUserAgent(@Nullable String userAgent) {
if (!usingCustomDrmSessionManagerProvider) {
((DefaultDrmSessionManagerProvider) drmSessionManagerProvider).setDrmUserAgent(userAgent);
}
return this;
}
/** @deprecated Use {@link #createMediaSource(MediaItem)} instead. */
@SuppressWarnings("deprecation")
@Deprecated
@Override
public ProgressiveMediaSource createMediaSource(Uri uri) {
return createMediaSource(new MediaItem.Builder().setUri(uri).build());
}
/**
* Returns a new {@link ProgressiveMediaSource} using the current parameters.
*

View file

@ -62,7 +62,6 @@ import com.google.android.exoplayer2.source.dash.manifest.UtcTimingElement;
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.HttpDataSource;
import com.google.android.exoplayer2.upstream.LoadErrorHandlingPolicy;
import com.google.android.exoplayer2.upstream.LoadErrorHandlingPolicy.LoadErrorInfo;
import com.google.android.exoplayer2.upstream.Loader;
@ -84,7 +83,6 @@ import java.io.InputStreamReader;
import java.math.RoundingMode;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Collections;
import java.util.List;
import java.util.Locale;
import java.util.TimeZone;
@ -104,14 +102,12 @@ public final class DashMediaSource extends BaseMediaSource {
private final DashChunkSource.Factory chunkSourceFactory;
@Nullable private final DataSource.Factory manifestDataSourceFactory;
private boolean usingCustomDrmSessionManagerProvider;
private DrmSessionManagerProvider drmSessionManagerProvider;
private CompositeSequenceableLoaderFactory compositeSequenceableLoaderFactory;
private LoadErrorHandlingPolicy loadErrorHandlingPolicy;
private long targetLiveOffsetOverrideMs;
private long fallbackTargetLiveOffsetMs;
@Nullable private ParsingLoadable.Parser<? extends DashManifest> manifestParser;
private List<StreamKey> streamKeys;
@Nullable private Object tag;
/**
@ -143,7 +139,6 @@ public final class DashMediaSource extends BaseMediaSource {
targetLiveOffsetOverrideMs = C.TIME_UNSET;
fallbackTargetLiveOffsetMs = DEFAULT_FALLBACK_TARGET_LIVE_OFFSET_MS;
compositeSequenceableLoaderFactory = new DefaultCompositeSequenceableLoaderFactory();
streamKeys = Collections.emptyList();
}
/**
@ -156,59 +151,13 @@ public final class DashMediaSource extends BaseMediaSource {
return this;
}
/**
* @deprecated Use {@link MediaItem.Builder#setStreamKeys(List)} and {@link
* #createMediaSource(MediaItem)} instead.
*/
@SuppressWarnings("deprecation")
@Deprecated
@Override
public Factory setStreamKeys(@Nullable List<StreamKey> streamKeys) {
this.streamKeys = streamKeys != null ? streamKeys : Collections.emptyList();
return this;
}
@Override
public Factory setDrmSessionManagerProvider(
@Nullable DrmSessionManagerProvider drmSessionManagerProvider) {
if (drmSessionManagerProvider != null) {
this.drmSessionManagerProvider = drmSessionManagerProvider;
this.usingCustomDrmSessionManagerProvider = true;
} else {
this.drmSessionManagerProvider = new DefaultDrmSessionManagerProvider();
this.usingCustomDrmSessionManagerProvider = false;
}
return this;
}
@Deprecated
@Override
public Factory setDrmSessionManager(@Nullable DrmSessionManager drmSessionManager) {
if (drmSessionManager == null) {
setDrmSessionManagerProvider(null);
} else {
setDrmSessionManagerProvider(unusedMediaItem -> drmSessionManager);
}
return this;
}
@Deprecated
@Override
public Factory setDrmHttpDataSourceFactory(
@Nullable HttpDataSource.Factory drmHttpDataSourceFactory) {
if (!usingCustomDrmSessionManagerProvider) {
((DefaultDrmSessionManagerProvider) drmSessionManagerProvider)
.setDrmHttpDataSourceFactory(drmHttpDataSourceFactory);
}
return this;
}
@Deprecated
@Override
public Factory setDrmUserAgent(@Nullable String userAgent) {
if (!usingCustomDrmSessionManagerProvider) {
((DefaultDrmSessionManagerProvider) drmSessionManagerProvider).setDrmUserAgent(userAgent);
}
this.drmSessionManagerProvider =
drmSessionManagerProvider != null
? drmSessionManagerProvider
: new DefaultDrmSessionManagerProvider();
return this;
}
@ -303,7 +252,6 @@ public final class DashMediaSource extends BaseMediaSource {
.setUri(Uri.EMPTY)
.setMediaId(DEFAULT_MEDIA_ID)
.setMimeType(MimeTypes.APPLICATION_MPD)
.setStreamKeys(streamKeys)
.setTag(tag)
.build());
}
@ -335,14 +283,7 @@ public final class DashMediaSource extends BaseMediaSource {
.setTargetOffsetMs(targetLiveOffsetOverrideMs)
.build());
}
if (mediaItem.localConfiguration == null
|| mediaItem.localConfiguration.streamKeys.isEmpty()) {
mediaItemBuilder.setStreamKeys(streamKeys);
}
mediaItem = mediaItemBuilder.build();
if (!checkNotNull(mediaItem.localConfiguration).streamKeys.isEmpty()) {
manifest = manifest.copy(streamKeys);
}
return new DashMediaSource(
mediaItem,
manifest,
@ -355,19 +296,6 @@ public final class DashMediaSource extends BaseMediaSource {
fallbackTargetLiveOffsetMs);
}
/** @deprecated Use {@link #createMediaSource(MediaItem)} instead. */
@SuppressWarnings("deprecation")
@Deprecated
@Override
public DashMediaSource createMediaSource(Uri uri) {
return createMediaSource(
new MediaItem.Builder()
.setUri(uri)
.setMimeType(MimeTypes.APPLICATION_MPD)
.setTag(tag)
.build());
}
/**
* Returns a new {@link DashMediaSource} using the current parameters.
*
@ -382,28 +310,20 @@ public final class DashMediaSource extends BaseMediaSource {
if (manifestParser == null) {
manifestParser = new DashManifestParser();
}
List<StreamKey> streamKeys =
mediaItem.localConfiguration.streamKeys.isEmpty()
? this.streamKeys
: mediaItem.localConfiguration.streamKeys;
List<StreamKey> streamKeys = mediaItem.localConfiguration.streamKeys;
if (!streamKeys.isEmpty()) {
manifestParser = new FilteringManifestParser<>(manifestParser, streamKeys);
}
boolean needsTag = mediaItem.localConfiguration.tag == null && tag != null;
boolean needsStreamKeys =
mediaItem.localConfiguration.streamKeys.isEmpty() && !streamKeys.isEmpty();
boolean needsTargetLiveOffset =
mediaItem.liveConfiguration.targetOffsetMs == C.TIME_UNSET
&& targetLiveOffsetOverrideMs != C.TIME_UNSET;
if (needsTag || needsStreamKeys || needsTargetLiveOffset) {
if (needsTag || needsTargetLiveOffset) {
MediaItem.Builder builder = mediaItem.buildUpon();
if (needsTag) {
builder.setTag(tag);
}
if (needsStreamKeys) {
builder.setStreamKeys(streamKeys);
}
if (needsTargetLiveOffset) {
builder.setLiveConfiguration(
mediaItem

View file

@ -28,7 +28,6 @@ import com.google.android.exoplayer2.ParserException;
import com.google.android.exoplayer2.Timeline;
import com.google.android.exoplayer2.Timeline.Window;
import com.google.android.exoplayer2.analytics.PlayerId;
import com.google.android.exoplayer2.offline.StreamKey;
import com.google.android.exoplayer2.source.MediaSource;
import com.google.android.exoplayer2.source.MediaSource.MediaSourceCaller;
import com.google.android.exoplayer2.testutil.TestUtil;
@ -37,7 +36,6 @@ import com.google.android.exoplayer2.upstream.DataSource;
import com.google.android.exoplayer2.upstream.FileDataSource;
import com.google.android.exoplayer2.upstream.ParsingLoadable;
import com.google.android.exoplayer2.util.Util;
import com.google.common.collect.ImmutableList;
import java.io.ByteArrayInputStream;
import java.io.IOException;
import java.util.concurrent.CountDownLatch;
@ -135,45 +133,6 @@ public final class DashMediaSourceTest {
assertThat(dashMediaItem.localConfiguration.tag).isEqualTo(mediaItemTag);
}
// Tests backwards compatibility
@SuppressWarnings("deprecation")
@Test
public void factorySetStreamKeys_emptyMediaItemStreamKeys_setsMediaItemStreamKeys() {
MediaItem mediaItem = MediaItem.fromUri("http://www.google.com");
StreamKey streamKey = new StreamKey(/* groupIndex= */ 0, /* trackIndex= */ 1);
DashMediaSource.Factory factory =
new DashMediaSource.Factory(new FileDataSource.Factory())
.setStreamKeys(ImmutableList.of(streamKey));
MediaItem dashMediaItem = factory.createMediaSource(mediaItem).getMediaItem();
assertThat(dashMediaItem.localConfiguration).isNotNull();
assertThat(dashMediaItem.localConfiguration.uri).isEqualTo(mediaItem.localConfiguration.uri);
assertThat(dashMediaItem.localConfiguration.streamKeys).containsExactly(streamKey);
}
// Tests backwards compatibility
@SuppressWarnings("deprecation")
@Test
public void factorySetStreamKeys_withMediaItemStreamKeys_doesNotOverrideMediaItemStreamKeys() {
StreamKey mediaItemStreamKey = new StreamKey(/* groupIndex= */ 0, /* trackIndex= */ 1);
MediaItem mediaItem =
new MediaItem.Builder()
.setUri("http://www.google.com")
.setStreamKeys(ImmutableList.of(mediaItemStreamKey))
.build();
DashMediaSource.Factory factory =
new DashMediaSource.Factory(new FileDataSource.Factory())
.setStreamKeys(
ImmutableList.of(new StreamKey(/* groupIndex= */ 1, /* trackIndex= */ 0)));
MediaItem dashMediaItem = factory.createMediaSource(mediaItem).getMediaItem();
assertThat(dashMediaItem.localConfiguration).isNotNull();
assertThat(dashMediaItem.localConfiguration.uri).isEqualTo(mediaItem.localConfiguration.uri);
assertThat(dashMediaItem.localConfiguration.streamKeys).containsExactly(mediaItemStreamKey);
}
@Test
public void replaceManifestUri_doesNotChangeMediaItem() {
DashMediaSource.Factory factory = new DashMediaSource.Factory(new FileDataSource.Factory());

View file

@ -18,7 +18,6 @@ package com.google.android.exoplayer2.source.hls;
import static com.google.android.exoplayer2.util.Assertions.checkNotNull;
import static java.lang.annotation.RetentionPolicy.SOURCE;
import android.net.Uri;
import android.os.Looper;
import android.os.SystemClock;
import androidx.annotation.IntDef;
@ -51,17 +50,14 @@ 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.HttpDataSource;
import com.google.android.exoplayer2.upstream.LoadErrorHandlingPolicy;
import com.google.android.exoplayer2.upstream.TransferListener;
import com.google.android.exoplayer2.util.MimeTypes;
import com.google.android.exoplayer2.util.Util;
import java.io.IOException;
import java.lang.annotation.Documented;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.Target;
import java.util.Collections;
import java.util.List;
/** An HLS {@link MediaSource}. */
@ -104,13 +100,11 @@ public final class HlsMediaSource extends BaseMediaSource
private HlsPlaylistParserFactory playlistParserFactory;
private HlsPlaylistTracker.Factory playlistTrackerFactory;
private CompositeSequenceableLoaderFactory compositeSequenceableLoaderFactory;
private boolean usingCustomDrmSessionManagerProvider;
private DrmSessionManagerProvider drmSessionManagerProvider;
private LoadErrorHandlingPolicy loadErrorHandlingPolicy;
private boolean allowChunklessPreparation;
private @MetadataType int metadataType;
private boolean useSessionKeys;
private List<StreamKey> streamKeys;
@Nullable private Object tag;
private long elapsedRealTimeOffsetMs;
@ -140,7 +134,6 @@ public final class HlsMediaSource extends BaseMediaSource
loadErrorHandlingPolicy = new DefaultLoadErrorHandlingPolicy();
compositeSequenceableLoaderFactory = new DefaultCompositeSequenceableLoaderFactory();
metadataType = METADATA_TYPE_ID3;
streamKeys = Collections.emptyList();
elapsedRealTimeOffsetMs = C.TIME_UNSET;
allowChunklessPreparation = true;
}
@ -290,56 +283,10 @@ public final class HlsMediaSource extends BaseMediaSource
@Override
public Factory setDrmSessionManagerProvider(
@Nullable DrmSessionManagerProvider drmSessionManagerProvider) {
if (drmSessionManagerProvider != null) {
this.drmSessionManagerProvider = drmSessionManagerProvider;
this.usingCustomDrmSessionManagerProvider = true;
} else {
this.drmSessionManagerProvider = new DefaultDrmSessionManagerProvider();
this.usingCustomDrmSessionManagerProvider = false;
}
return this;
}
@Deprecated
@Override
public Factory setDrmSessionManager(@Nullable DrmSessionManager drmSessionManager) {
if (drmSessionManager == null) {
setDrmSessionManagerProvider(null);
} else {
setDrmSessionManagerProvider(unusedMediaItem -> drmSessionManager);
}
return this;
}
@Deprecated
@Override
public Factory setDrmHttpDataSourceFactory(
@Nullable HttpDataSource.Factory drmHttpDataSourceFactory) {
if (!usingCustomDrmSessionManagerProvider) {
((DefaultDrmSessionManagerProvider) drmSessionManagerProvider)
.setDrmHttpDataSourceFactory(drmHttpDataSourceFactory);
}
return this;
}
@Deprecated
@Override
public Factory setDrmUserAgent(@Nullable String userAgent) {
if (!usingCustomDrmSessionManagerProvider) {
((DefaultDrmSessionManagerProvider) drmSessionManagerProvider).setDrmUserAgent(userAgent);
}
return this;
}
/**
* @deprecated Use {@link MediaItem.Builder#setStreamKeys(List)} and {@link
* #createMediaSource(MediaItem)} instead.
*/
@SuppressWarnings("deprecation")
@Deprecated
@Override
public Factory setStreamKeys(@Nullable List<StreamKey> streamKeys) {
this.streamKeys = streamKeys != null ? streamKeys : Collections.emptyList();
this.drmSessionManagerProvider =
drmSessionManagerProvider != null
? drmSessionManagerProvider
: new DefaultDrmSessionManagerProvider();
return this;
}
@ -357,15 +304,6 @@ public final class HlsMediaSource extends BaseMediaSource
return this;
}
/** @deprecated Use {@link #createMediaSource(MediaItem)} instead. */
@SuppressWarnings("deprecation")
@Deprecated
@Override
public HlsMediaSource createMediaSource(Uri uri) {
return createMediaSource(
new MediaItem.Builder().setUri(uri).setMimeType(MimeTypes.APPLICATION_M3U8).build());
}
/**
* Returns a new {@link HlsMediaSource} using the current parameters.
*
@ -377,24 +315,14 @@ public final class HlsMediaSource extends BaseMediaSource
public HlsMediaSource createMediaSource(MediaItem mediaItem) {
checkNotNull(mediaItem.localConfiguration);
HlsPlaylistParserFactory playlistParserFactory = this.playlistParserFactory;
List<StreamKey> streamKeys =
mediaItem.localConfiguration.streamKeys.isEmpty()
? this.streamKeys
: mediaItem.localConfiguration.streamKeys;
List<StreamKey> streamKeys = mediaItem.localConfiguration.streamKeys;
if (!streamKeys.isEmpty()) {
playlistParserFactory =
new FilteringHlsPlaylistParserFactory(playlistParserFactory, streamKeys);
}
boolean needsTag = mediaItem.localConfiguration.tag == null && tag != null;
boolean needsStreamKeys =
mediaItem.localConfiguration.streamKeys.isEmpty() && !streamKeys.isEmpty();
if (needsTag && needsStreamKeys) {
mediaItem = mediaItem.buildUpon().setTag(tag).setStreamKeys(streamKeys).build();
} else if (needsTag) {
if (mediaItem.localConfiguration.tag == null && tag != null) {
mediaItem = mediaItem.buildUpon().setTag(tag).build();
} else if (needsStreamKeys) {
mediaItem = mediaItem.buildUpon().setStreamKeys(streamKeys).build();
}
return new HlsMediaSource(
mediaItem,

View file

@ -26,7 +26,6 @@ import com.google.android.exoplayer2.MediaItem;
import com.google.android.exoplayer2.ParserException;
import com.google.android.exoplayer2.Timeline;
import com.google.android.exoplayer2.analytics.PlayerId;
import com.google.android.exoplayer2.offline.StreamKey;
import com.google.android.exoplayer2.source.MediaSource;
import com.google.android.exoplayer2.source.hls.playlist.HlsMediaPlaylist;
import com.google.android.exoplayer2.source.hls.playlist.HlsPlaylistParser;
@ -37,7 +36,6 @@ import com.google.android.exoplayer2.util.Util;
import java.io.ByteArrayInputStream;
import java.io.IOException;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import java.util.concurrent.TimeoutException;
import java.util.concurrent.atomic.AtomicReference;
@ -82,45 +80,6 @@ public class HlsMediaSourceTest {
assertThat(hlsMediaItem.localConfiguration.tag).isEqualTo(mediaItemTag);
}
// Tests backwards compatibility
@SuppressWarnings("deprecation")
@Test
public void factorySetStreamKeys_emptyMediaItemStreamKeys_setsMediaItemStreamKeys() {
MediaItem mediaItem = MediaItem.fromUri("http://www.google.com");
StreamKey streamKey = new StreamKey(/* groupIndex= */ 0, /* trackIndex= */ 1);
HlsMediaSource.Factory factory =
new HlsMediaSource.Factory(mock(DataSource.Factory.class))
.setStreamKeys(Collections.singletonList(streamKey));
MediaItem hlsMediaItem = factory.createMediaSource(mediaItem).getMediaItem();
assertThat(hlsMediaItem.localConfiguration).isNotNull();
assertThat(hlsMediaItem.localConfiguration.uri).isEqualTo(mediaItem.localConfiguration.uri);
assertThat(hlsMediaItem.localConfiguration.streamKeys).containsExactly(streamKey);
}
// Tests backwards compatibility
@SuppressWarnings("deprecation")
@Test
public void factorySetStreamKeys_withMediaItemStreamKeys_doesNotOverrideMediaItemStreamKeys() {
StreamKey mediaItemStreamKey = new StreamKey(/* groupIndex= */ 0, /* trackIndex= */ 1);
MediaItem mediaItem =
new MediaItem.Builder()
.setUri("http://www.google.com")
.setStreamKeys(Collections.singletonList(mediaItemStreamKey))
.build();
HlsMediaSource.Factory factory =
new HlsMediaSource.Factory(mock(DataSource.Factory.class))
.setStreamKeys(
Collections.singletonList(new StreamKey(/* groupIndex= */ 1, /* trackIndex= */ 0)));
MediaItem hlsMediaItem = factory.createMediaSource(mediaItem).getMediaItem();
assertThat(hlsMediaItem.localConfiguration).isNotNull();
assertThat(hlsMediaItem.localConfiguration.uri).isEqualTo(mediaItem.localConfiguration.uri);
assertThat(hlsMediaItem.localConfiguration.streamKeys).containsExactly(mediaItemStreamKey);
}
@Test
public void loadLivePlaylist_noTargetLiveOffsetDefined_fallbackToThreeTargetDuration()
throws TimeoutException, ParserException {

View file

@ -27,7 +27,6 @@ import com.google.android.exoplayer2.C;
import com.google.android.exoplayer2.ExoPlayerLibraryInfo;
import com.google.android.exoplayer2.MediaItem;
import com.google.android.exoplayer2.Timeline;
import com.google.android.exoplayer2.drm.DrmSessionManager;
import com.google.android.exoplayer2.drm.DrmSessionManagerProvider;
import com.google.android.exoplayer2.source.BaseMediaSource;
import com.google.android.exoplayer2.source.ForwardingTimeline;
@ -36,7 +35,6 @@ import com.google.android.exoplayer2.source.MediaSource;
import com.google.android.exoplayer2.source.MediaSourceFactory;
import com.google.android.exoplayer2.source.SinglePeriodTimeline;
import com.google.android.exoplayer2.upstream.Allocator;
import com.google.android.exoplayer2.upstream.HttpDataSource;
import com.google.android.exoplayer2.upstream.LoadErrorHandlingPolicy;
import com.google.android.exoplayer2.upstream.TransferListener;
import com.google.android.exoplayer2.util.Util;
@ -60,9 +58,6 @@ public final class RtspMediaSource extends BaseMediaSource {
*
* <ul>
* <li>{@link #setDrmSessionManagerProvider(DrmSessionManagerProvider)}
* <li>{@link #setDrmSessionManager(DrmSessionManager)}
* <li>{@link #setDrmHttpDataSourceFactory(HttpDataSource.Factory)}
* <li>{@link #setDrmUserAgent(String)}
* <li>{@link #setLoadErrorHandlingPolicy(LoadErrorHandlingPolicy)}
* </ul>
*/
@ -155,40 +150,6 @@ public final class RtspMediaSource extends BaseMediaSource {
return this;
}
/**
* Does nothing. {@link RtspMediaSource} does not support DRM.
*
* @deprecated {@link RtspMediaSource} does not support DRM.
*/
@Deprecated
@Override
public Factory setDrmSessionManager(@Nullable DrmSessionManager drmSessionManager) {
return this;
}
/**
* Does nothing. {@link RtspMediaSource} does not support DRM.
*
* @deprecated {@link RtspMediaSource} does not support DRM.
*/
@Deprecated
@Override
public Factory setDrmHttpDataSourceFactory(
@Nullable HttpDataSource.Factory drmHttpDataSourceFactory) {
return this;
}
/**
* Does nothing. {@link RtspMediaSource} does not support DRM.
*
* @deprecated {@link RtspMediaSource} does not support DRM.
*/
@Deprecated
@Override
public Factory setDrmUserAgent(@Nullable String userAgent) {
return this;
}
/** Does nothing. {@link RtspMediaSource} does not support error handling policies. */
@Override
public Factory setLoadErrorHandlingPolicy(

View file

@ -52,7 +52,6 @@ import com.google.android.exoplayer2.source.smoothstreaming.manifest.SsManifestP
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.HttpDataSource;
import com.google.android.exoplayer2.upstream.LoadErrorHandlingPolicy;
import com.google.android.exoplayer2.upstream.LoadErrorHandlingPolicy.LoadErrorInfo;
import com.google.android.exoplayer2.upstream.Loader;
@ -63,9 +62,9 @@ import com.google.android.exoplayer2.upstream.TransferListener;
import com.google.android.exoplayer2.util.Assertions;
import com.google.android.exoplayer2.util.MimeTypes;
import com.google.android.exoplayer2.util.Util;
import com.google.common.collect.ImmutableList;
import java.io.IOException;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
/** A SmoothStreaming {@link MediaSource}. */
@ -83,12 +82,10 @@ public final class SsMediaSource extends BaseMediaSource
@Nullable private final DataSource.Factory manifestDataSourceFactory;
private CompositeSequenceableLoaderFactory compositeSequenceableLoaderFactory;
private boolean usingCustomDrmSessionManagerProvider;
private DrmSessionManagerProvider drmSessionManagerProvider;
private LoadErrorHandlingPolicy loadErrorHandlingPolicy;
private long livePresentationDelayMs;
@Nullable private ParsingLoadable.Parser<? extends SsManifest> manifestParser;
private List<StreamKey> streamKeys;
@Nullable private Object tag;
/**
@ -119,7 +116,6 @@ public final class SsMediaSource extends BaseMediaSource
loadErrorHandlingPolicy = new DefaultLoadErrorHandlingPolicy();
livePresentationDelayMs = DEFAULT_LIVE_PRESENTATION_DELAY_MS;
compositeSequenceableLoaderFactory = new DefaultCompositeSequenceableLoaderFactory();
streamKeys = Collections.emptyList();
}
/**
@ -196,67 +192,13 @@ public final class SsMediaSource extends BaseMediaSource
@Override
public Factory setDrmSessionManagerProvider(
@Nullable DrmSessionManagerProvider drmSessionManagerProvider) {
if (drmSessionManagerProvider != null) {
this.drmSessionManagerProvider = drmSessionManagerProvider;
this.usingCustomDrmSessionManagerProvider = true;
} else {
this.drmSessionManagerProvider = new DefaultDrmSessionManagerProvider();
this.usingCustomDrmSessionManagerProvider = false;
}
this.drmSessionManagerProvider =
drmSessionManagerProvider != null
? drmSessionManagerProvider
: new DefaultDrmSessionManagerProvider();
return this;
}
@Deprecated
@Override
public Factory setDrmSessionManager(@Nullable DrmSessionManager drmSessionManager) {
if (drmSessionManager == null) {
setDrmSessionManagerProvider(null);
} else {
setDrmSessionManagerProvider(unusedMediaItem -> drmSessionManager);
}
return this;
}
@Deprecated
@Override
public Factory setDrmHttpDataSourceFactory(
@Nullable HttpDataSource.Factory drmHttpDataSourceFactory) {
if (!usingCustomDrmSessionManagerProvider) {
((DefaultDrmSessionManagerProvider) drmSessionManagerProvider)
.setDrmHttpDataSourceFactory(drmHttpDataSourceFactory);
}
return this;
}
@Deprecated
@Override
public Factory setDrmUserAgent(@Nullable String userAgent) {
if (!usingCustomDrmSessionManagerProvider) {
((DefaultDrmSessionManagerProvider) drmSessionManagerProvider).setDrmUserAgent(userAgent);
}
return this;
}
/**
* @deprecated Use {@link MediaItem.Builder#setStreamKeys(List)} and {@link
* #createMediaSource(MediaItem)} instead.
*/
@SuppressWarnings("deprecation")
@Deprecated
@Override
public Factory setStreamKeys(@Nullable List<StreamKey> streamKeys) {
this.streamKeys = streamKeys != null ? streamKeys : Collections.emptyList();
return this;
}
/** @deprecated Use {@link #createMediaSource(MediaItem)} instead. */
@SuppressWarnings("deprecation")
@Deprecated
@Override
public SsMediaSource createMediaSource(Uri uri) {
return createMediaSource(new MediaItem.Builder().setUri(uri).build());
}
/**
* Returns a new {@link SsMediaSource} using the current parameters and the specified sideloaded
* manifest.
@ -281,9 +223,9 @@ public final class SsMediaSource extends BaseMediaSource
public SsMediaSource createMediaSource(SsManifest manifest, MediaItem mediaItem) {
Assertions.checkArgument(!manifest.isLive);
List<StreamKey> streamKeys =
mediaItem.localConfiguration != null && !mediaItem.localConfiguration.streamKeys.isEmpty()
mediaItem.localConfiguration != null
? mediaItem.localConfiguration.streamKeys
: this.streamKeys;
: ImmutableList.of();
if (!streamKeys.isEmpty()) {
manifest = manifest.copy(streamKeys);
}
@ -295,7 +237,6 @@ public final class SsMediaSource extends BaseMediaSource
.setMimeType(MimeTypes.APPLICATION_SS)
.setUri(hasUri ? mediaItem.localConfiguration.uri : Uri.EMPTY)
.setTag(hasTag ? mediaItem.localConfiguration.tag : tag)
.setStreamKeys(streamKeys)
.build();
return new SsMediaSource(
mediaItem,
@ -323,23 +264,13 @@ public final class SsMediaSource extends BaseMediaSource
if (manifestParser == null) {
manifestParser = new SsManifestParser();
}
List<StreamKey> streamKeys =
!mediaItem.localConfiguration.streamKeys.isEmpty()
? mediaItem.localConfiguration.streamKeys
: this.streamKeys;
List<StreamKey> streamKeys = mediaItem.localConfiguration.streamKeys;
if (!streamKeys.isEmpty()) {
manifestParser = new FilteringManifestParser<>(manifestParser, streamKeys);
}
boolean needsTag = mediaItem.localConfiguration.tag == null && tag != null;
boolean needsStreamKeys =
mediaItem.localConfiguration.streamKeys.isEmpty() && !streamKeys.isEmpty();
if (needsTag && needsStreamKeys) {
mediaItem = mediaItem.buildUpon().setTag(tag).setStreamKeys(streamKeys).build();
} else if (needsTag) {
if (mediaItem.localConfiguration.tag == null && tag != null) {
mediaItem = mediaItem.buildUpon().setTag(tag).build();
} else if (needsStreamKeys) {
mediaItem = mediaItem.buildUpon().setStreamKeys(streamKeys).build();
}
return new SsMediaSource(
mediaItem,

View file

@ -20,9 +20,7 @@ import static com.google.common.truth.Truth.assertThat;
import androidx.test.ext.junit.runners.AndroidJUnit4;
import com.google.android.exoplayer2.MediaItem;
import com.google.android.exoplayer2.offline.StreamKey;
import com.google.android.exoplayer2.upstream.FileDataSource;
import java.util.Collections;
import org.junit.Test;
import org.junit.runner.RunWith;
@ -65,45 +63,4 @@ public class SsMediaSourceTest {
.isEqualTo(castNonNull(mediaItem.localConfiguration).uri);
assertThat(ssMediaItem.localConfiguration.tag).isEqualTo(mediaItemTag);
}
// Tests backwards compatibility
@SuppressWarnings("deprecation")
@Test
public void factorySetStreamKeys_emptyMediaItemStreamKeys_setsMediaItemStreamKeys() {
MediaItem mediaItem = MediaItem.fromUri("http://www.google.com");
StreamKey streamKey = new StreamKey(/* groupIndex= */ 0, /* trackIndex= */ 1);
SsMediaSource.Factory factory =
new SsMediaSource.Factory(new FileDataSource.Factory())
.setStreamKeys(Collections.singletonList(streamKey));
MediaItem ssMediaItem = factory.createMediaSource(mediaItem).getMediaItem();
assertThat(ssMediaItem.localConfiguration).isNotNull();
assertThat(ssMediaItem.localConfiguration.uri)
.isEqualTo(castNonNull(mediaItem.localConfiguration).uri);
assertThat(ssMediaItem.localConfiguration.streamKeys).containsExactly(streamKey);
}
// Tests backwards compatibility
@SuppressWarnings("deprecation")
@Test
public void factorySetStreamKeys_withMediaItemStreamKeys_doesNotOverrideMediaItemStreamKeys() {
StreamKey mediaItemStreamKey = new StreamKey(/* groupIndex= */ 0, /* trackIndex= */ 1);
MediaItem mediaItem =
new MediaItem.Builder()
.setUri("http://www.google.com")
.setStreamKeys(Collections.singletonList(mediaItemStreamKey))
.build();
SsMediaSource.Factory factory =
new SsMediaSource.Factory(new FileDataSource.Factory())
.setStreamKeys(
Collections.singletonList(new StreamKey(/* groupIndex= */ 1, /* trackIndex= */ 0)));
MediaItem ssMediaItem = factory.createMediaSource(mediaItem).getMediaItem();
assertThat(ssMediaItem.localConfiguration).isNotNull();
assertThat(ssMediaItem.localConfiguration.uri)
.isEqualTo(castNonNull(mediaItem.localConfiguration).uri);
assertThat(ssMediaItem.localConfiguration.streamKeys).containsExactly(mediaItemStreamKey);
}
}

View file

@ -18,13 +18,11 @@ package com.google.android.exoplayer2.testutil;
import androidx.annotation.Nullable;
import com.google.android.exoplayer2.C;
import com.google.android.exoplayer2.MediaItem;
import com.google.android.exoplayer2.drm.DrmSessionManager;
import com.google.android.exoplayer2.drm.DrmSessionManagerProvider;
import com.google.android.exoplayer2.source.MediaSource;
import com.google.android.exoplayer2.source.MediaSourceFactory;
import com.google.android.exoplayer2.source.ads.AdPlaybackState;
import com.google.android.exoplayer2.testutil.FakeTimeline.TimelineWindowDefinition;
import com.google.android.exoplayer2.upstream.HttpDataSource;
import com.google.android.exoplayer2.upstream.LoadErrorHandlingPolicy;
import com.google.android.exoplayer2.util.Util;
@ -40,25 +38,6 @@ public class FakeMediaSourceFactory implements MediaSourceFactory {
throw new UnsupportedOperationException();
}
@Deprecated
@Override
public MediaSourceFactory setDrmSessionManager(@Nullable DrmSessionManager drmSessionManager) {
throw new UnsupportedOperationException();
}
@Deprecated
@Override
public MediaSourceFactory setDrmHttpDataSourceFactory(
@Nullable HttpDataSource.Factory drmHttpDataSourceFactory) {
throw new UnsupportedOperationException();
}
@Deprecated
@Override
public MediaSourceFactory setDrmUserAgent(@Nullable String userAgent) {
throw new UnsupportedOperationException();
}
@Override
public MediaSourceFactory setLoadErrorHandlingPolicy(
@Nullable LoadErrorHandlingPolicy loadErrorHandlingPolicy) {