Remove four deprecated AnalyticsListener decoder methods

Use the audio or video specific variants instead.

#minor-release

PiperOrigin-RevId: 534436644
This commit is contained in:
ibaker 2023-05-23 16:42:28 +01:00 committed by tonihei
parent 48348df58a
commit 5a5c3ce3bd
4 changed files with 12 additions and 194 deletions

View File

@ -98,6 +98,18 @@
* Remove deprecated `OfflineLicenseHelper` constructor, use * Remove deprecated `OfflineLicenseHelper` constructor, use
`OfflineLicenseHelper(DefaultDrmSessionManager, `OfflineLicenseHelper(DefaultDrmSessionManager,
DrmSessionEventListener.EventDispatcher)` instead. DrmSessionEventListener.EventDispatcher)` instead.
* Remove four deprecated `AnalyticsListener` methods:
* `onDecoderEnabled`, use `onAudioEnabled` and/or `onVideoEnabled`
instead.
* `onDecoderInitialized`, use `onAudioDecoderInitialized` and/or
`onVideoDecoderInitialized` instead.
* `onDecoderInputFormatChanged`, use `onAudioInputFormatChanged`
and/or `onVideoInputFormatChanged` instead.
* `onDecoderDisabled`, use `onAudioDisabled` and/or `onVideoDisabled`
instead.
* Core library:
* Add `ExoPlayer.setVideoFrameProcessorFactory()` for using `Effect` with
a custom `VideoFrameProcessor.Factory` during video playback.
* Remove `ExoPlayer.setHandleWakeLock(boolean)`, use `setWakeMode(int)` * Remove `ExoPlayer.setHandleWakeLock(boolean)`, use `setWakeMode(int)`
instead. instead.
* Remove deprecated * Remove deprecated

View File

@ -899,39 +899,6 @@ public interface AnalyticsListener {
@UnstableApi @UnstableApi
default void onCues(EventTime eventTime, CueGroup cueGroup) {} default void onCues(EventTime eventTime, CueGroup cueGroup) {}
/**
* @deprecated Use {@link #onAudioEnabled} and {@link #onVideoEnabled} instead.
*/
@Deprecated
@UnstableApi
default void onDecoderEnabled(
EventTime eventTime, int trackType, DecoderCounters decoderCounters) {}
/**
* @deprecated Use {@link #onAudioDecoderInitialized} and {@link #onVideoDecoderInitialized}
* instead.
*/
@UnstableApi
@Deprecated
default void onDecoderInitialized(
EventTime eventTime, int trackType, String decoderName, long initializationDurationMs) {}
/**
* @deprecated Use {@link #onAudioInputFormatChanged(EventTime, Format, DecoderReuseEvaluation)}
* and {@link #onVideoInputFormatChanged(EventTime, Format, DecoderReuseEvaluation)}. instead.
*/
@UnstableApi
@Deprecated
default void onDecoderInputFormatChanged(EventTime eventTime, int trackType, Format format) {}
/**
* @deprecated Use {@link #onAudioDisabled} and {@link #onVideoDisabled} instead.
*/
@UnstableApi
@Deprecated
default void onDecoderDisabled(
EventTime eventTime, int trackType, DecoderCounters decoderCounters) {}
/** /**
* Called when an audio renderer is enabled. * Called when an audio renderer is enabled.
* *

View File

@ -165,7 +165,6 @@ public class DefaultAnalyticsCollector implements AnalyticsCollector {
// Audio events. // Audio events.
@SuppressWarnings("deprecation") // Calling deprecated listener method.
@Override @Override
public final void onAudioEnabled(DecoderCounters counters) { public final void onAudioEnabled(DecoderCounters counters) {
EventTime eventTime = generateReadingMediaPeriodEventTime(); EventTime eventTime = generateReadingMediaPeriodEventTime();
@ -174,7 +173,6 @@ public class DefaultAnalyticsCollector implements AnalyticsCollector {
AnalyticsListener.EVENT_AUDIO_ENABLED, AnalyticsListener.EVENT_AUDIO_ENABLED,
listener -> { listener -> {
listener.onAudioEnabled(eventTime, counters); listener.onAudioEnabled(eventTime, counters);
listener.onDecoderEnabled(eventTime, C.TRACK_TYPE_AUDIO, counters);
}); });
} }
@ -190,8 +188,6 @@ public class DefaultAnalyticsCollector implements AnalyticsCollector {
listener.onAudioDecoderInitialized(eventTime, decoderName, initializationDurationMs); listener.onAudioDecoderInitialized(eventTime, decoderName, initializationDurationMs);
listener.onAudioDecoderInitialized( listener.onAudioDecoderInitialized(
eventTime, decoderName, initializedTimestampMs, initializationDurationMs); eventTime, decoderName, initializedTimestampMs, initializationDurationMs);
listener.onDecoderInitialized(
eventTime, C.TRACK_TYPE_AUDIO, decoderName, initializationDurationMs);
}); });
} }
@ -206,7 +202,6 @@ public class DefaultAnalyticsCollector implements AnalyticsCollector {
listener -> { listener -> {
listener.onAudioInputFormatChanged(eventTime, format); listener.onAudioInputFormatChanged(eventTime, format);
listener.onAudioInputFormatChanged(eventTime, format, decoderReuseEvaluation); listener.onAudioInputFormatChanged(eventTime, format, decoderReuseEvaluation);
listener.onDecoderInputFormatChanged(eventTime, C.TRACK_TYPE_AUDIO, format);
}); });
} }
@ -240,7 +235,6 @@ public class DefaultAnalyticsCollector implements AnalyticsCollector {
} }
@Override @Override
@SuppressWarnings("deprecation") // Calling deprecated listener method.
public final void onAudioDisabled(DecoderCounters counters) { public final void onAudioDisabled(DecoderCounters counters) {
EventTime eventTime = generatePlayingMediaPeriodEventTime(); EventTime eventTime = generatePlayingMediaPeriodEventTime();
sendEvent( sendEvent(
@ -248,7 +242,6 @@ public class DefaultAnalyticsCollector implements AnalyticsCollector {
AnalyticsListener.EVENT_AUDIO_DISABLED, AnalyticsListener.EVENT_AUDIO_DISABLED,
listener -> { listener -> {
listener.onAudioDisabled(eventTime, counters); listener.onAudioDisabled(eventTime, counters);
listener.onDecoderDisabled(eventTime, C.TRACK_TYPE_AUDIO, counters);
}); });
} }
@ -282,7 +275,6 @@ public class DefaultAnalyticsCollector implements AnalyticsCollector {
// Video events. // Video events.
@Override @Override
@SuppressWarnings("deprecation") // Calling deprecated listener method.
public final void onVideoEnabled(DecoderCounters counters) { public final void onVideoEnabled(DecoderCounters counters) {
EventTime eventTime = generateReadingMediaPeriodEventTime(); EventTime eventTime = generateReadingMediaPeriodEventTime();
sendEvent( sendEvent(
@ -290,7 +282,6 @@ public class DefaultAnalyticsCollector implements AnalyticsCollector {
AnalyticsListener.EVENT_VIDEO_ENABLED, AnalyticsListener.EVENT_VIDEO_ENABLED,
listener -> { listener -> {
listener.onVideoEnabled(eventTime, counters); listener.onVideoEnabled(eventTime, counters);
listener.onDecoderEnabled(eventTime, C.TRACK_TYPE_VIDEO, counters);
}); });
} }
@ -306,8 +297,6 @@ public class DefaultAnalyticsCollector implements AnalyticsCollector {
listener.onVideoDecoderInitialized(eventTime, decoderName, initializationDurationMs); listener.onVideoDecoderInitialized(eventTime, decoderName, initializationDurationMs);
listener.onVideoDecoderInitialized( listener.onVideoDecoderInitialized(
eventTime, decoderName, initializedTimestampMs, initializationDurationMs); eventTime, decoderName, initializedTimestampMs, initializationDurationMs);
listener.onDecoderInitialized(
eventTime, C.TRACK_TYPE_VIDEO, decoderName, initializationDurationMs);
}); });
} }
@ -322,7 +311,6 @@ public class DefaultAnalyticsCollector implements AnalyticsCollector {
listener -> { listener -> {
listener.onVideoInputFormatChanged(eventTime, format); listener.onVideoInputFormatChanged(eventTime, format);
listener.onVideoInputFormatChanged(eventTime, format, decoderReuseEvaluation); listener.onVideoInputFormatChanged(eventTime, format, decoderReuseEvaluation);
listener.onDecoderInputFormatChanged(eventTime, C.TRACK_TYPE_VIDEO, format);
}); });
} }
@ -345,7 +333,6 @@ public class DefaultAnalyticsCollector implements AnalyticsCollector {
} }
@Override @Override
@SuppressWarnings("deprecation") // Calling deprecated listener method.
public final void onVideoDisabled(DecoderCounters counters) { public final void onVideoDisabled(DecoderCounters counters) {
EventTime eventTime = generatePlayingMediaPeriodEventTime(); EventTime eventTime = generatePlayingMediaPeriodEventTime();
sendEvent( sendEvent(
@ -353,7 +340,6 @@ public class DefaultAnalyticsCollector implements AnalyticsCollector {
AnalyticsListener.EVENT_VIDEO_DISABLED, AnalyticsListener.EVENT_VIDEO_DISABLED,
listener -> { listener -> {
listener.onVideoDisabled(eventTime, counters); listener.onVideoDisabled(eventTime, counters);
listener.onDecoderDisabled(eventTime, C.TRACK_TYPE_VIDEO, counters);
}); });
} }

View File

@ -148,10 +148,6 @@ public final class DefaultAnalyticsCollectorTest {
private static final long EVENT_PLAYER_STATE_CHANGED = 1L << 63; private static final long EVENT_PLAYER_STATE_CHANGED = 1L << 63;
private static final long EVENT_SEEK_STARTED = 1L << 62; private static final long EVENT_SEEK_STARTED = 1L << 62;
private static final long EVENT_SEEK_PROCESSED = 1L << 61; private static final long EVENT_SEEK_PROCESSED = 1L << 61;
private static final long EVENT_DECODER_ENABLED = 1L << 60;
private static final long EVENT_DECODER_INIT = 1L << 59;
private static final long EVENT_DECODER_FORMAT_CHANGED = 1L << 58;
private static final long EVENT_DECODER_DISABLED = 1L << 57;
private static final UUID DRM_SCHEME_UUID = private static final UUID DRM_SCHEME_UUID =
UUID.nameUUIDFromBytes(TestUtil.createByteArray(7, 8, 9)); UUID.nameUUIDFromBytes(TestUtil.createByteArray(7, 8, 9));
@ -274,15 +270,6 @@ public final class DefaultAnalyticsCollectorTest {
assertThat(listener.getEvents(EVENT_DOWNSTREAM_FORMAT_CHANGED)) assertThat(listener.getEvents(EVENT_DOWNSTREAM_FORMAT_CHANGED))
.containsExactly(period0 /* audio */, period0 /* video */) .containsExactly(period0 /* audio */, period0 /* video */)
.inOrder(); .inOrder();
assertThat(listener.getEvents(EVENT_DECODER_ENABLED))
.containsExactly(period0 /* audio */, period0 /* video */)
.inOrder();
assertThat(listener.getEvents(EVENT_DECODER_INIT))
.containsExactly(period0 /* audio */, period0 /* video */)
.inOrder();
assertThat(listener.getEvents(EVENT_DECODER_FORMAT_CHANGED))
.containsExactly(period0 /* audio */, period0 /* video */)
.inOrder();
assertThat(listener.getEvents(EVENT_AUDIO_ENABLED)).containsExactly(period0); assertThat(listener.getEvents(EVENT_AUDIO_ENABLED)).containsExactly(period0);
assertThat(listener.getEvents(EVENT_AUDIO_DECODER_INITIALIZED)).containsExactly(period0); assertThat(listener.getEvents(EVENT_AUDIO_DECODER_INITIALIZED)).containsExactly(period0);
assertThat(listener.getEvents(EVENT_AUDIO_INPUT_FORMAT_CHANGED)).containsExactly(period0); assertThat(listener.getEvents(EVENT_AUDIO_INPUT_FORMAT_CHANGED)).containsExactly(period0);
@ -354,17 +341,6 @@ public final class DefaultAnalyticsCollectorTest {
.containsExactly( .containsExactly(
period0 /* audio */, period0 /* video */, period1 /* audio */, period1 /* video */) period0 /* audio */, period0 /* video */, period1 /* audio */, period1 /* video */)
.inOrder(); .inOrder();
assertThat(listener.getEvents(EVENT_DECODER_ENABLED))
.containsExactly(period0 /* audio */, period0 /* video */)
.inOrder();
assertThat(listener.getEvents(EVENT_DECODER_INIT))
.containsExactly(
period0 /* audio */, period0 /* video */, period1 /* audio */, period1 /* video */)
.inOrder();
assertThat(listener.getEvents(EVENT_DECODER_FORMAT_CHANGED))
.containsExactly(
period0 /* audio */, period0 /* video */, period1 /* audio */, period1 /* video */)
.inOrder();
assertThat(listener.getEvents(EVENT_AUDIO_ENABLED)).containsExactly(period0); assertThat(listener.getEvents(EVENT_AUDIO_ENABLED)).containsExactly(period0);
assertThat(listener.getEvents(EVENT_AUDIO_DECODER_INITIALIZED)) assertThat(listener.getEvents(EVENT_AUDIO_DECODER_INITIALIZED))
.containsExactly(period0, period1) .containsExactly(period0, period1)
@ -439,16 +415,6 @@ public final class DefaultAnalyticsCollectorTest {
assertThat(listener.getEvents(EVENT_DOWNSTREAM_FORMAT_CHANGED)) assertThat(listener.getEvents(EVENT_DOWNSTREAM_FORMAT_CHANGED))
.containsExactly(period0 /* video */, period1 /* audio */) .containsExactly(period0 /* video */, period1 /* audio */)
.inOrder(); .inOrder();
assertThat(listener.getEvents(EVENT_DECODER_ENABLED))
.containsExactly(period0 /* video */, period1 /* audio */)
.inOrder();
assertThat(listener.getEvents(EVENT_DECODER_INIT))
.containsExactly(period0 /* video */, period1 /* audio */)
.inOrder();
assertThat(listener.getEvents(EVENT_DECODER_FORMAT_CHANGED))
.containsExactly(period0 /* video */, period1 /* audio */)
.inOrder();
assertThat(listener.getEvents(EVENT_DECODER_DISABLED)).containsExactly(period0 /* video */);
assertThat(listener.getEvents(EVENT_AUDIO_ENABLED)).containsExactly(period1); assertThat(listener.getEvents(EVENT_AUDIO_ENABLED)).containsExactly(period1);
assertThat(listener.getEvents(EVENT_AUDIO_DECODER_INITIALIZED)).containsExactly(period1); assertThat(listener.getEvents(EVENT_AUDIO_DECODER_INITIALIZED)).containsExactly(period1);
assertThat(listener.getEvents(EVENT_AUDIO_INPUT_FORMAT_CHANGED)).containsExactly(period1); assertThat(listener.getEvents(EVENT_AUDIO_INPUT_FORMAT_CHANGED)).containsExactly(period1);
@ -529,18 +495,6 @@ public final class DefaultAnalyticsCollectorTest {
assertThat(listener.getEvents(EVENT_DOWNSTREAM_FORMAT_CHANGED)) assertThat(listener.getEvents(EVENT_DOWNSTREAM_FORMAT_CHANGED))
.containsExactly(period0 /* video */, period0 /* audio */, period1 /* audio */) .containsExactly(period0 /* video */, period0 /* audio */, period1 /* audio */)
.inOrder(); .inOrder();
assertThat(listener.getEvents(EVENT_DECODER_ENABLED))
.containsExactly(period0 /* video */, period0 /* audio */, period1 /* audio */)
.inOrder();
assertThat(listener.getEvents(EVENT_DECODER_INIT))
.containsExactly(period0 /* video */, period0 /* audio */, period1 /* audio */)
.inOrder();
assertThat(listener.getEvents(EVENT_DECODER_FORMAT_CHANGED))
.containsExactly(period0 /* video */, period0 /* audio */, period1 /* audio */)
.inOrder();
assertThat(listener.getEvents(EVENT_DECODER_DISABLED))
.containsExactly(period0 /* video */, period0 /* audio */)
.inOrder();
assertThat(listener.getEvents(EVENT_AUDIO_ENABLED)).containsExactly(period0, period1).inOrder(); assertThat(listener.getEvents(EVENT_AUDIO_ENABLED)).containsExactly(period0, period1).inOrder();
assertThat(listener.getEvents(EVENT_AUDIO_DECODER_INITIALIZED)) assertThat(listener.getEvents(EVENT_AUDIO_DECODER_INITIALIZED))
.containsExactly(period0, period1) .containsExactly(period0, period1)
@ -634,16 +588,6 @@ public final class DefaultAnalyticsCollectorTest {
assertThat(listener.getEvents(EVENT_DOWNSTREAM_FORMAT_CHANGED)) assertThat(listener.getEvents(EVENT_DOWNSTREAM_FORMAT_CHANGED))
.containsExactly(period0, period1Seq1, period1Seq1, period1Seq2, period1Seq2) .containsExactly(period0, period1Seq1, period1Seq1, period1Seq2, period1Seq2)
.inOrder(); .inOrder();
assertThat(listener.getEvents(EVENT_DECODER_ENABLED))
.containsExactly(period0, period1, period0, period1Seq2)
.inOrder();
assertThat(listener.getEvents(EVENT_DECODER_INIT))
.containsExactly(period0, period1Seq1, period1Seq1, period1Seq2, period1Seq2)
.inOrder();
assertThat(listener.getEvents(EVENT_DECODER_FORMAT_CHANGED))
.containsExactly(period0, period1Seq1, period1Seq1, period1Seq2, period1Seq2)
.inOrder();
assertThat(listener.getEvents(EVENT_DECODER_DISABLED)).containsExactly(period0, period0);
assertThat(listener.getEvents(EVENT_AUDIO_ENABLED)) assertThat(listener.getEvents(EVENT_AUDIO_ENABLED))
.containsExactly(period1, period1Seq2) .containsExactly(period1, period1Seq2)
.inOrder(); .inOrder();
@ -753,16 +697,6 @@ public final class DefaultAnalyticsCollectorTest {
assertThat(listener.getEvents(EVENT_DOWNSTREAM_FORMAT_CHANGED)) assertThat(listener.getEvents(EVENT_DOWNSTREAM_FORMAT_CHANGED))
.containsExactly(period0Seq0, period0Seq1) .containsExactly(period0Seq0, period0Seq1)
.inOrder(); .inOrder();
assertThat(listener.getEvents(EVENT_DECODER_ENABLED))
.containsExactly(period0Seq0, period0Seq1)
.inOrder();
assertThat(listener.getEvents(EVENT_DECODER_INIT))
.containsExactly(period0Seq0, period0Seq1)
.inOrder();
assertThat(listener.getEvents(EVENT_DECODER_FORMAT_CHANGED))
.containsExactly(period0Seq0, period0Seq1)
.inOrder();
assertThat(listener.getEvents(EVENT_DECODER_DISABLED)).containsExactly(period0Seq0);
assertThat(listener.getEvents(EVENT_VIDEO_ENABLED)) assertThat(listener.getEvents(EVENT_VIDEO_ENABLED))
.containsExactly(period0Seq0, period0Seq1) .containsExactly(period0Seq0, period0Seq1)
.inOrder(); .inOrder();
@ -850,11 +784,6 @@ public final class DefaultAnalyticsCollectorTest {
.inOrder(); .inOrder();
assertThat(listener.getEvents(EVENT_DOWNSTREAM_FORMAT_CHANGED)) assertThat(listener.getEvents(EVENT_DOWNSTREAM_FORMAT_CHANGED))
.containsExactly(period0Seq0, period0Seq0); .containsExactly(period0Seq0, period0Seq0);
assertThat(listener.getEvents(EVENT_DECODER_ENABLED)).containsExactly(period0Seq0, period0Seq0);
assertThat(listener.getEvents(EVENT_DECODER_INIT)).containsExactly(period0Seq0, period0Seq0);
assertThat(listener.getEvents(EVENT_DECODER_FORMAT_CHANGED))
.containsExactly(period0Seq0, period0Seq0);
assertThat(listener.getEvents(EVENT_DECODER_DISABLED)).containsExactly(period0Seq0);
assertThat(listener.getEvents(EVENT_VIDEO_ENABLED)).containsExactly(period0Seq0, period0Seq0); assertThat(listener.getEvents(EVENT_VIDEO_ENABLED)).containsExactly(period0Seq0, period0Seq0);
assertThat(listener.getEvents(EVENT_VIDEO_DECODER_INITIALIZED)) assertThat(listener.getEvents(EVENT_VIDEO_DECODER_INITIALIZED))
.containsExactly(period0Seq0, period0Seq0); .containsExactly(period0Seq0, period0Seq0);
@ -926,16 +855,6 @@ public final class DefaultAnalyticsCollectorTest {
assertThat(listener.getEvents(EVENT_DOWNSTREAM_FORMAT_CHANGED)) assertThat(listener.getEvents(EVENT_DOWNSTREAM_FORMAT_CHANGED))
.containsExactly(window0Period1Seq0, window1Period0Seq1) .containsExactly(window0Period1Seq0, window1Period0Seq1)
.inOrder(); .inOrder();
assertThat(listener.getEvents(EVENT_DECODER_ENABLED))
.containsExactly(window0Period1Seq0, window0Period1Seq0)
.inOrder();
assertThat(listener.getEvents(EVENT_DECODER_INIT))
.containsExactly(window0Period1Seq0, window1Period0Seq1)
.inOrder();
assertThat(listener.getEvents(EVENT_DECODER_FORMAT_CHANGED))
.containsExactly(window0Period1Seq0, window1Period0Seq1)
.inOrder();
assertThat(listener.getEvents(EVENT_DECODER_DISABLED)).containsExactly(window0Period1Seq0);
assertThat(listener.getEvents(EVENT_VIDEO_ENABLED)) assertThat(listener.getEvents(EVENT_VIDEO_ENABLED))
.containsExactly(window0Period1Seq0, window0Period1Seq0) .containsExactly(window0Period1Seq0, window0Period1Seq0)
.inOrder(); .inOrder();
@ -1028,16 +947,6 @@ public final class DefaultAnalyticsCollectorTest {
assertThat(listener.getEvents(EVENT_DOWNSTREAM_FORMAT_CHANGED)) assertThat(listener.getEvents(EVENT_DOWNSTREAM_FORMAT_CHANGED))
.containsExactly(period0Seq0, period1Seq1) .containsExactly(period0Seq0, period1Seq1)
.inOrder(); .inOrder();
assertThat(listener.getEvents(EVENT_DECODER_ENABLED))
.containsExactly(period0Seq0, period0Seq1)
.inOrder();
assertThat(listener.getEvents(EVENT_DECODER_INIT))
.containsExactly(period0Seq0, period1Seq1)
.inOrder();
assertThat(listener.getEvents(EVENT_DECODER_FORMAT_CHANGED))
.containsExactly(period0Seq0, period1Seq1)
.inOrder();
assertThat(listener.getEvents(EVENT_DECODER_DISABLED)).containsExactly(period0Seq0);
assertThat(listener.getEvents(EVENT_VIDEO_ENABLED)) assertThat(listener.getEvents(EVENT_VIDEO_ENABLED))
.containsExactly(period0Seq0, period0Seq1) .containsExactly(period0Seq0, period0Seq1)
.inOrder(); .inOrder();
@ -1257,25 +1166,6 @@ public final class DefaultAnalyticsCollectorTest {
postrollAd, postrollAd,
contentAfterPostroll) contentAfterPostroll)
.inOrder(); .inOrder();
assertThat(listener.getEvents(EVENT_DECODER_ENABLED)).containsExactly(prerollAd);
assertThat(listener.getEvents(EVENT_DECODER_INIT))
.containsExactly(
prerollAd,
contentAfterPreroll,
midrollAd,
contentAfterMidroll,
postrollAd,
contentAfterPostroll)
.inOrder();
assertThat(listener.getEvents(EVENT_DECODER_FORMAT_CHANGED))
.containsExactly(
prerollAd,
contentAfterPreroll,
midrollAd,
contentAfterMidroll,
postrollAd,
contentAfterPostroll)
.inOrder();
assertThat(listener.getEvents(EVENT_VIDEO_ENABLED)).containsExactly(prerollAd); assertThat(listener.getEvents(EVENT_VIDEO_ENABLED)).containsExactly(prerollAd);
assertThat(listener.getEvents(EVENT_VIDEO_DECODER_INITIALIZED)) assertThat(listener.getEvents(EVENT_VIDEO_DECODER_INITIALIZED))
.containsExactly( .containsExactly(
@ -1428,16 +1318,6 @@ public final class DefaultAnalyticsCollectorTest {
assertThat(listener.getEvents(EVENT_DOWNSTREAM_FORMAT_CHANGED)) assertThat(listener.getEvents(EVENT_DOWNSTREAM_FORMAT_CHANGED))
.containsExactly(contentBeforeMidroll, midrollAd, contentAfterMidroll) .containsExactly(contentBeforeMidroll, midrollAd, contentAfterMidroll)
.inOrder(); .inOrder();
assertThat(listener.getEvents(EVENT_DECODER_ENABLED))
.containsExactly(contentBeforeMidroll, midrollAd)
.inOrder();
assertThat(listener.getEvents(EVENT_DECODER_INIT))
.containsExactly(contentBeforeMidroll, midrollAd, contentAfterMidroll)
.inOrder();
assertThat(listener.getEvents(EVENT_DECODER_FORMAT_CHANGED))
.containsExactly(contentBeforeMidroll, midrollAd, contentAfterMidroll)
.inOrder();
assertThat(listener.getEvents(EVENT_DECODER_DISABLED)).containsExactly(contentBeforeMidroll);
assertThat(listener.getEvents(EVENT_VIDEO_ENABLED)) assertThat(listener.getEvents(EVENT_VIDEO_ENABLED))
.containsExactly(contentBeforeMidroll, midrollAd) .containsExactly(contentBeforeMidroll, midrollAd)
.inOrder(); .inOrder();
@ -2335,33 +2215,6 @@ public final class DefaultAnalyticsCollectorTest {
reportedEvents.add(new ReportedEvent(EVENT_METADATA, eventTime)); reportedEvents.add(new ReportedEvent(EVENT_METADATA, eventTime));
} }
@SuppressWarnings("deprecation")
@Override
public void onDecoderEnabled(
EventTime eventTime, int trackType, DecoderCounters decoderCounters) {
reportedEvents.add(new ReportedEvent(EVENT_DECODER_ENABLED, eventTime));
}
@SuppressWarnings("deprecation")
@Override
public void onDecoderInitialized(
EventTime eventTime, int trackType, String decoderName, long initializationDurationMs) {
reportedEvents.add(new ReportedEvent(EVENT_DECODER_INIT, eventTime));
}
@SuppressWarnings("deprecation")
@Override
public void onDecoderInputFormatChanged(EventTime eventTime, int trackType, Format format) {
reportedEvents.add(new ReportedEvent(EVENT_DECODER_FORMAT_CHANGED, eventTime));
}
@SuppressWarnings("deprecation")
@Override
public void onDecoderDisabled(
EventTime eventTime, int trackType, DecoderCounters decoderCounters) {
reportedEvents.add(new ReportedEvent(EVENT_DECODER_DISABLED, eventTime));
}
@Override @Override
public void onAudioEnabled(EventTime eventTime, DecoderCounters decoderCounters) { public void onAudioEnabled(EventTime eventTime, DecoderCounters decoderCounters) {
reportedEvents.add(new ReportedEvent(EVENT_AUDIO_ENABLED, eventTime)); reportedEvents.add(new ReportedEvent(EVENT_AUDIO_ENABLED, eventTime));