Commit eb71d730 by christosts Committed by Ian Baker

Remove SingleSampleMediaSource.EventListener and constructors

They have been deprecated since r2.7.0

PiperOrigin-RevId: 351777769
parent 4c3f580b
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
### dev-v2 (not yet released) ### dev-v2 (not yet released)
* Core library: * Core library:
* Remove long deprecated methods: * Remove long deprecated symbols:
* `DefaultEventListener.onTimelineChanged(Timeline, Object)`. Use * `DefaultEventListener.onTimelineChanged(Timeline, Object)`. Use
`Player.EventListener.onTimelineChanged(Timeline, int)` instead. `Player.EventListener.onTimelineChanged(Timeline, int)` instead.
* `DefaultLoadControl` constructors. Use `DefaultLoadControl.Builder` * `DefaultLoadControl` constructors. Use `DefaultLoadControl.Builder`
...@@ -55,8 +55,11 @@ ...@@ -55,8 +55,11 @@
application is calling `SimpleExoPlayer.setVideoListener(null)`, application is calling `SimpleExoPlayer.setVideoListener(null)`,
make sure to replace this call with make sure to replace this call with
`SimpleExoPlayer.removeVideoListener(VideoListener)`. `SimpleExoPlayer.removeVideoListener(VideoListener)`.
* Remove deprecated interface `AdaptiveMediaSourceEventListener`. Use * `SingleSampleMediaSource.EventListener` and constructors. Use
`MediaSourceEventListener` instead. `MediaSourceEventListener` and `SingleSampleMediaSource.Factory`
instead.
* Remove deprecated interface `AdaptiveMediaSourceEventListener`. Use
`MediaSourceEventListener` instead.
* Add a `LivePlaybackSpeedControl` component to control the playback speed * Add a `LivePlaybackSpeedControl` component to control the playback speed
during live playbacks. This allows the player to stay close to the during live playbacks. This allows the player to stay close to the
configured live offset. A configurable default implementation configured live offset. A configurable default implementation
...@@ -97,8 +100,8 @@ ...@@ -97,8 +100,8 @@
`MediaItem.playbackProperties.subtitles` `MediaItem.playbackProperties.subtitles`
([#8430](https://github.com/google/ExoPlayer/issues/8430)). ([#8430](https://github.com/google/ExoPlayer/issues/8430)).
* Remove `ExoPlaybackException.OutOfMemoryError`. * Remove `ExoPlaybackException.OutOfMemoryError`.
* Remove `setVideoDecoderOutputBufferRenderer` from Player API. * Remove `setVideoDecoderOutputBufferRenderer` from Player API. Clients
Clients should use `setOutputSurface` directly instead. should use `setOutputSurface` directly instead.
* Extractors: * Extractors:
* Populate codecs string for H.264/AVC in MP4, Matroska and FLV streams to * Populate codecs string for H.264/AVC in MP4, Matroska and FLV streams to
allow decoder capability checks based on codec profile/level allow decoder capability checks based on codec profile/level
......
...@@ -19,9 +19,7 @@ import static com.google.android.exoplayer2.util.Assertions.checkNotNull; ...@@ -19,9 +19,7 @@ import static com.google.android.exoplayer2.util.Assertions.checkNotNull;
import static com.google.android.exoplayer2.util.Util.castNonNull; import static com.google.android.exoplayer2.util.Util.castNonNull;
import android.net.Uri; import android.net.Uri;
import android.os.Handler;
import androidx.annotation.Nullable; import androidx.annotation.Nullable;
import com.google.android.exoplayer2.C;
import com.google.android.exoplayer2.Format; import com.google.android.exoplayer2.Format;
import com.google.android.exoplayer2.MediaItem; import com.google.android.exoplayer2.MediaItem;
import com.google.android.exoplayer2.Timeline; import com.google.android.exoplayer2.Timeline;
...@@ -31,7 +29,6 @@ import com.google.android.exoplayer2.upstream.DataSpec; ...@@ -31,7 +29,6 @@ import com.google.android.exoplayer2.upstream.DataSpec;
import com.google.android.exoplayer2.upstream.DefaultLoadErrorHandlingPolicy; import com.google.android.exoplayer2.upstream.DefaultLoadErrorHandlingPolicy;
import com.google.android.exoplayer2.upstream.LoadErrorHandlingPolicy; import com.google.android.exoplayer2.upstream.LoadErrorHandlingPolicy;
import com.google.android.exoplayer2.upstream.TransferListener; import com.google.android.exoplayer2.upstream.TransferListener;
import java.io.IOException;
import java.util.Collections; import java.util.Collections;
/** /**
...@@ -39,24 +36,6 @@ import java.util.Collections; ...@@ -39,24 +36,6 @@ import java.util.Collections;
*/ */
public final class SingleSampleMediaSource extends BaseMediaSource { public final class SingleSampleMediaSource extends BaseMediaSource {
/**
* Listener of {@link SingleSampleMediaSource} events.
*
* @deprecated Use {@link MediaSourceEventListener}.
*/
@Deprecated
public interface EventListener {
/**
* Called when an error occurs loading media data.
*
* @param sourceId The id of the reporting {@link SingleSampleMediaSource}.
* @param e The cause of the failure.
*/
void onLoadError(int sourceId, IOException e);
}
/** Factory for {@link SingleSampleMediaSource}. */ /** Factory for {@link SingleSampleMediaSource}. */
public static final class Factory { public static final class Factory {
...@@ -195,67 +174,6 @@ public final class SingleSampleMediaSource extends BaseMediaSource { ...@@ -195,67 +174,6 @@ public final class SingleSampleMediaSource extends BaseMediaSource {
@Nullable private TransferListener transferListener; @Nullable private TransferListener transferListener;
/** @deprecated Use {@link Factory} instead. */
@Deprecated
@SuppressWarnings("deprecation")
public SingleSampleMediaSource(
Uri uri, DataSource.Factory dataSourceFactory, Format format, long durationUs) {
this(
uri,
dataSourceFactory,
format,
durationUs,
DefaultLoadErrorHandlingPolicy.DEFAULT_MIN_LOADABLE_RETRY_COUNT);
}
/** @deprecated Use {@link Factory} instead. */
@SuppressWarnings("deprecation")
@Deprecated
public SingleSampleMediaSource(
Uri uri,
DataSource.Factory dataSourceFactory,
Format format,
long durationUs,
int minLoadableRetryCount) {
this(
uri,
dataSourceFactory,
format,
durationUs,
minLoadableRetryCount,
/* eventHandler= */ null,
/* eventListener= */ null,
/* ignored */ C.INDEX_UNSET,
/* treatLoadErrorsAsEndOfStream= */ false);
}
/** @deprecated Use {@link Factory} instead. */
@SuppressWarnings("deprecation")
@Deprecated
public SingleSampleMediaSource(
Uri uri,
DataSource.Factory dataSourceFactory,
Format format,
long durationUs,
int minLoadableRetryCount,
@Nullable Handler eventHandler,
@Nullable EventListener eventListener,
int eventSourceId,
boolean treatLoadErrorsAsEndOfStream) {
this(
/* trackId= */ null,
new MediaItem.Subtitle(
uri, checkNotNull(format.sampleMimeType), format.language, format.selectionFlags),
dataSourceFactory,
durationUs,
new DefaultLoadErrorHandlingPolicy(minLoadableRetryCount),
treatLoadErrorsAsEndOfStream,
/* tag= */ null);
if (eventHandler != null && eventListener != null) {
addEventListener(eventHandler, new EventListenerWrapper(eventListener, eventSourceId));
}
}
private SingleSampleMediaSource( private SingleSampleMediaSource(
@Nullable String trackId, @Nullable String trackId,
MediaItem.Subtitle subtitle, MediaItem.Subtitle subtitle,
...@@ -347,32 +265,4 @@ public final class SingleSampleMediaSource extends BaseMediaSource { ...@@ -347,32 +265,4 @@ public final class SingleSampleMediaSource extends BaseMediaSource {
protected void releaseSourceInternal() { protected void releaseSourceInternal() {
// Do nothing. // Do nothing.
} }
/**
* Wraps a deprecated {@link EventListener}, invoking its callback from the equivalent callback in
* {@link MediaSourceEventListener}.
*/
@Deprecated
@SuppressWarnings("deprecation")
private static final class EventListenerWrapper implements MediaSourceEventListener {
private final EventListener eventListener;
private final int eventSourceId;
public EventListenerWrapper(EventListener eventListener, int eventSourceId) {
this.eventListener = checkNotNull(eventListener);
this.eventSourceId = eventSourceId;
}
@Override
public void onLoadError(
int windowIndex,
@Nullable MediaPeriodId mediaPeriodId,
LoadEventInfo loadEventInfo,
MediaLoadData mediaLoadData,
IOException error,
boolean wasCanceled) {
eventListener.onLoadError(eventSourceId, error);
}
}
} }
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