mirror of
https://github.com/androidx/media.git
synced 2025-04-30 06:46:50 +08:00
Remove deprecated format changed methods
Use the overloads with an additional `@Nullable DecoderReuseEvaluation` parameter instead. PiperOrigin-RevId: 637851937
This commit is contained in:
parent
aadcbe332b
commit
c87b7d86cc
@ -218,6 +218,11 @@
|
||||
boolean)`. Use `MediaCodecInfo.canReuseCodec(Format, Format)` instead.
|
||||
* Remove `DrmSessionManager.DUMMY` and `getDummyDrmSessionManager()`
|
||||
method. Use `DrmSessionManager.DRM_UNSUPPORTED` instead.
|
||||
* Remove `AnalyticsListener.onAudioInputFormatChanged(EventTime, Format)`,
|
||||
`AnalyticsListener.onVideoInputFormatChanged(EventTime, Format)`,
|
||||
`AudioRendererEventListener.onAudioInputFormatChanged(Format)`,
|
||||
`VideoRendererEventListener.onVideoInputFormatChanged(Format)`. Use the
|
||||
overloads that take a `DecoderReuseEvaluation` instead.
|
||||
|
||||
## 1.4
|
||||
|
||||
|
@ -996,13 +996,6 @@ public interface AnalyticsListener {
|
||||
default void onAudioDecoderInitialized(
|
||||
EventTime eventTime, String decoderName, long initializationDurationMs) {}
|
||||
|
||||
/**
|
||||
* @deprecated Use {@link #onAudioInputFormatChanged(EventTime, Format, DecoderReuseEvaluation)}.
|
||||
*/
|
||||
@UnstableApi
|
||||
@Deprecated
|
||||
default void onAudioInputFormatChanged(EventTime eventTime, Format format) {}
|
||||
|
||||
/**
|
||||
* Called when the format of the media being consumed by an audio renderer changes.
|
||||
*
|
||||
@ -1206,13 +1199,6 @@ public interface AnalyticsListener {
|
||||
default void onVideoDecoderInitialized(
|
||||
EventTime eventTime, String decoderName, long initializationDurationMs) {}
|
||||
|
||||
/**
|
||||
* @deprecated Use {@link #onVideoInputFormatChanged(EventTime, Format, DecoderReuseEvaluation)}.
|
||||
*/
|
||||
@UnstableApi
|
||||
@Deprecated
|
||||
default void onVideoInputFormatChanged(EventTime eventTime, Format format) {}
|
||||
|
||||
/**
|
||||
* Called when the format of the media being consumed by a video renderer changes.
|
||||
*
|
||||
|
@ -192,7 +192,6 @@ public class DefaultAnalyticsCollector implements AnalyticsCollector {
|
||||
});
|
||||
}
|
||||
|
||||
@SuppressWarnings("deprecation") // Calling deprecated listener method.
|
||||
@Override
|
||||
public final void onAudioInputFormatChanged(
|
||||
Format format, @Nullable DecoderReuseEvaluation decoderReuseEvaluation) {
|
||||
@ -200,10 +199,7 @@ public class DefaultAnalyticsCollector implements AnalyticsCollector {
|
||||
sendEvent(
|
||||
eventTime,
|
||||
AnalyticsListener.EVENT_AUDIO_INPUT_FORMAT_CHANGED,
|
||||
listener -> {
|
||||
listener.onAudioInputFormatChanged(eventTime, format);
|
||||
listener.onAudioInputFormatChanged(eventTime, format, decoderReuseEvaluation);
|
||||
});
|
||||
listener -> listener.onAudioInputFormatChanged(eventTime, format, decoderReuseEvaluation));
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -320,17 +316,13 @@ public class DefaultAnalyticsCollector implements AnalyticsCollector {
|
||||
}
|
||||
|
||||
@Override
|
||||
@SuppressWarnings("deprecation") // Calling deprecated listener method.
|
||||
public final void onVideoInputFormatChanged(
|
||||
Format format, @Nullable DecoderReuseEvaluation decoderReuseEvaluation) {
|
||||
EventTime eventTime = generateReadingMediaPeriodEventTime();
|
||||
sendEvent(
|
||||
eventTime,
|
||||
AnalyticsListener.EVENT_VIDEO_INPUT_FORMAT_CHANGED,
|
||||
listener -> {
|
||||
listener.onVideoInputFormatChanged(eventTime, format);
|
||||
listener.onVideoInputFormatChanged(eventTime, format, decoderReuseEvaluation);
|
||||
});
|
||||
listener -> listener.onVideoInputFormatChanged(eventTime, format, decoderReuseEvaluation));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -59,12 +59,6 @@ public interface AudioRendererEventListener {
|
||||
default void onAudioDecoderInitialized(
|
||||
String decoderName, long initializedTimestampMs, long initializationDurationMs) {}
|
||||
|
||||
/**
|
||||
* @deprecated Use {@link #onAudioInputFormatChanged(Format, DecoderReuseEvaluation)}.
|
||||
*/
|
||||
@Deprecated
|
||||
default void onAudioInputFormatChanged(Format format) {}
|
||||
|
||||
/**
|
||||
* Called when the format of the media being consumed by the renderer changes.
|
||||
*
|
||||
@ -202,16 +196,15 @@ public interface AudioRendererEventListener {
|
||||
}
|
||||
}
|
||||
|
||||
/** Invokes {@link AudioRendererEventListener#onAudioInputFormatChanged(Format)}. */
|
||||
@SuppressWarnings("deprecation") // Calling deprecated listener method.
|
||||
/**
|
||||
* Invokes {@link AudioRendererEventListener#onAudioInputFormatChanged(Format,
|
||||
* DecoderReuseEvaluation)}.
|
||||
*/
|
||||
public void inputFormatChanged(
|
||||
Format format, @Nullable DecoderReuseEvaluation decoderReuseEvaluation) {
|
||||
if (handler != null) {
|
||||
handler.post(
|
||||
() -> {
|
||||
castNonNull(listener).onAudioInputFormatChanged(format);
|
||||
castNonNull(listener).onAudioInputFormatChanged(format, decoderReuseEvaluation);
|
||||
});
|
||||
() -> castNonNull(listener).onAudioInputFormatChanged(format, decoderReuseEvaluation));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -59,12 +59,6 @@ public interface VideoRendererEventListener {
|
||||
default void onVideoDecoderInitialized(
|
||||
String decoderName, long initializedTimestampMs, long initializationDurationMs) {}
|
||||
|
||||
/**
|
||||
* @deprecated Use {@link #onVideoInputFormatChanged(Format, DecoderReuseEvaluation)}.
|
||||
*/
|
||||
@Deprecated
|
||||
default void onVideoInputFormatChanged(Format format) {}
|
||||
|
||||
/**
|
||||
* Called when the format of the media being consumed by the renderer changes.
|
||||
*
|
||||
@ -200,10 +194,7 @@ public interface VideoRendererEventListener {
|
||||
Format format, @Nullable DecoderReuseEvaluation decoderReuseEvaluation) {
|
||||
if (handler != null) {
|
||||
handler.post(
|
||||
() -> {
|
||||
castNonNull(listener).onVideoInputFormatChanged(format);
|
||||
castNonNull(listener).onVideoInputFormatChanged(format, decoderReuseEvaluation);
|
||||
});
|
||||
() -> castNonNull(listener).onVideoInputFormatChanged(format, decoderReuseEvaluation));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -96,6 +96,7 @@ import androidx.media3.common.util.ConditionVariable;
|
||||
import androidx.media3.common.util.HandlerWrapper;
|
||||
import androidx.media3.common.util.Util;
|
||||
import androidx.media3.exoplayer.DecoderCounters;
|
||||
import androidx.media3.exoplayer.DecoderReuseEvaluation;
|
||||
import androidx.media3.exoplayer.ExoPlaybackException;
|
||||
import androidx.media3.exoplayer.ExoPlayer;
|
||||
import androidx.media3.exoplayer.Renderer;
|
||||
@ -2212,7 +2213,10 @@ public final class DefaultAnalyticsCollectorTest {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onAudioInputFormatChanged(EventTime eventTime, Format format) {
|
||||
public void onAudioInputFormatChanged(
|
||||
EventTime eventTime,
|
||||
Format format,
|
||||
@Nullable DecoderReuseEvaluation decoderReuseEvaluation) {
|
||||
reportedEvents.add(new ReportedEvent(EVENT_AUDIO_INPUT_FORMAT_CHANGED, eventTime));
|
||||
}
|
||||
|
||||
@ -2252,7 +2256,10 @@ public final class DefaultAnalyticsCollectorTest {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onVideoInputFormatChanged(EventTime eventTime, Format format) {
|
||||
public void onVideoInputFormatChanged(
|
||||
EventTime eventTime,
|
||||
Format format,
|
||||
@Nullable DecoderReuseEvaluation decoderReuseEvaluation) {
|
||||
reportedEvents.add(new ReportedEvent(EVENT_VIDEO_INPUT_FORMAT_CHANGED, eventTime));
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user