Rabbit-R1/android (non root)/java/sources/androidx/media3/exoplayer/analytics/DefaultAnalyticsCollector.java
2024-05-21 17:08:36 -04:00

1124 lines
68 KiB
Java

package androidx.media3.exoplayer.analytics;
import android.os.Looper;
import android.util.SparseArray;
import androidx.media3.common.AudioAttributes;
import androidx.media3.common.DeviceInfo;
import androidx.media3.common.FlagSet;
import androidx.media3.common.Format;
import androidx.media3.common.MediaItem;
import androidx.media3.common.MediaMetadata;
import androidx.media3.common.Metadata;
import androidx.media3.common.PlaybackException;
import androidx.media3.common.PlaybackParameters;
import androidx.media3.common.Player;
import androidx.media3.common.Timeline;
import androidx.media3.common.TrackSelectionParameters;
import androidx.media3.common.Tracks;
import androidx.media3.common.VideoSize;
import androidx.media3.common.text.Cue;
import androidx.media3.common.text.CueGroup;
import androidx.media3.common.util.Assertions;
import androidx.media3.common.util.Clock;
import androidx.media3.common.util.HandlerWrapper;
import androidx.media3.common.util.ListenerSet;
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.analytics.AnalyticsListener;
import androidx.media3.exoplayer.source.LoadEventInfo;
import androidx.media3.exoplayer.source.MediaLoadData;
import androidx.media3.exoplayer.source.MediaSource;
import com.google.common.base.Objects;
import com.google.common.collect.ImmutableList;
import com.google.common.collect.ImmutableMap;
import com.google.common.collect.Iterables;
import java.io.IOException;
import java.util.Collection;
import java.util.List;
import org.checkerframework.checker.nullness.qual.RequiresNonNull;
/* loaded from: classes2.dex */
public class DefaultAnalyticsCollector implements AnalyticsCollector {
private final Clock clock;
private final SparseArray<AnalyticsListener.EventTime> eventTimes;
private HandlerWrapper handler;
private boolean isSeeking;
private ListenerSet<AnalyticsListener> listeners;
private final MediaPeriodQueueTracker mediaPeriodQueueTracker;
private final Timeline.Period period;
private Player player;
private final Timeline.Window window;
/* JADX INFO: Access modifiers changed from: package-private */
public static /* synthetic */ void lambda$new$0(AnalyticsListener analyticsListener, FlagSet flagSet) {
}
@Override // androidx.media3.common.Player.Listener
public void onEvents(Player player, Player.Events events) {
}
@Override // androidx.media3.common.Player.Listener
public void onLoadingChanged(boolean z) {
}
@Override // androidx.media3.common.Player.Listener
public void onPositionDiscontinuity(int i) {
}
@Override // androidx.media3.common.Player.Listener
public void onRenderedFirstFrame() {
}
public DefaultAnalyticsCollector(Clock clock) {
this.clock = (Clock) Assertions.checkNotNull(clock);
this.listeners = new ListenerSet<>(Util.getCurrentOrMainLooper(), clock, new ListenerSet.IterationFinishedEvent() { // from class: androidx.media3.exoplayer.analytics.DefaultAnalyticsCollector$$ExternalSyntheticLambda12
@Override // androidx.media3.common.util.ListenerSet.IterationFinishedEvent
public final void invoke(Object obj, FlagSet flagSet) {
DefaultAnalyticsCollector.lambda$new$0((AnalyticsListener) obj, flagSet);
}
});
Timeline.Period period = new Timeline.Period();
this.period = period;
this.window = new Timeline.Window();
this.mediaPeriodQueueTracker = new MediaPeriodQueueTracker(period);
this.eventTimes = new SparseArray<>();
}
@Deprecated
public void setThrowsWhenUsingWrongThread(boolean z) {
this.listeners.setThrowsWhenUsingWrongThread(z);
}
@Override // androidx.media3.exoplayer.analytics.AnalyticsCollector
public void addListener(AnalyticsListener analyticsListener) {
Assertions.checkNotNull(analyticsListener);
this.listeners.add(analyticsListener);
}
@Override // androidx.media3.exoplayer.analytics.AnalyticsCollector
public void removeListener(AnalyticsListener analyticsListener) {
this.listeners.remove(analyticsListener);
}
@Override // androidx.media3.exoplayer.analytics.AnalyticsCollector
public void setPlayer(final Player player, Looper looper) {
Assertions.checkState(this.player == null || this.mediaPeriodQueueTracker.mediaPeriodQueue.isEmpty());
this.player = (Player) Assertions.checkNotNull(player);
this.handler = this.clock.createHandler(looper, null);
this.listeners = this.listeners.copy(looper, new ListenerSet.IterationFinishedEvent() { // from class: androidx.media3.exoplayer.analytics.DefaultAnalyticsCollector$$ExternalSyntheticLambda28
@Override // androidx.media3.common.util.ListenerSet.IterationFinishedEvent
public final void invoke(Object obj, FlagSet flagSet) {
DefaultAnalyticsCollector.this.m5220xfeaa50a6(player, (AnalyticsListener) obj, flagSet);
}
});
}
/* JADX INFO: Access modifiers changed from: package-private */
/* renamed from: lambda$setPlayer$1$androidx-media3-exoplayer-analytics-DefaultAnalyticsCollector, reason: not valid java name */
public /* synthetic */ void m5220xfeaa50a6(Player player, AnalyticsListener analyticsListener, FlagSet flagSet) {
analyticsListener.onEvents(player, new AnalyticsListener.Events(flagSet, this.eventTimes));
}
@Override // androidx.media3.exoplayer.analytics.AnalyticsCollector
public void release() {
((HandlerWrapper) Assertions.checkStateNotNull(this.handler)).post(new Runnable() { // from class: androidx.media3.exoplayer.analytics.DefaultAnalyticsCollector$$ExternalSyntheticLambda58
@Override // java.lang.Runnable
public final void run() {
DefaultAnalyticsCollector.this.releaseInternal();
}
});
}
@Override // androidx.media3.exoplayer.analytics.AnalyticsCollector
public final void updateMediaPeriodQueueInfo(List<MediaSource.MediaPeriodId> list, MediaSource.MediaPeriodId mediaPeriodId) {
this.mediaPeriodQueueTracker.onQueueUpdated(list, mediaPeriodId, (Player) Assertions.checkNotNull(this.player));
}
@Override // androidx.media3.exoplayer.analytics.AnalyticsCollector
public final void notifySeekStarted() {
if (this.isSeeking) {
return;
}
final AnalyticsListener.EventTime generateCurrentPlayerMediaPeriodEventTime = generateCurrentPlayerMediaPeriodEventTime();
this.isSeeking = true;
sendEvent(generateCurrentPlayerMediaPeriodEventTime, -1, new ListenerSet.Event() { // from class: androidx.media3.exoplayer.analytics.DefaultAnalyticsCollector$$ExternalSyntheticLambda60
@Override // androidx.media3.common.util.ListenerSet.Event
public final void invoke(Object obj) {
((AnalyticsListener) obj).onSeekStarted(AnalyticsListener.EventTime.this);
}
});
}
@Override // androidx.media3.exoplayer.analytics.AnalyticsCollector
public final void onAudioEnabled(final DecoderCounters decoderCounters) {
final AnalyticsListener.EventTime generateReadingMediaPeriodEventTime = generateReadingMediaPeriodEventTime();
sendEvent(generateReadingMediaPeriodEventTime, 1007, new ListenerSet.Event() { // from class: androidx.media3.exoplayer.analytics.DefaultAnalyticsCollector$$ExternalSyntheticLambda41
@Override // androidx.media3.common.util.ListenerSet.Event
public final void invoke(Object obj) {
((AnalyticsListener) obj).onAudioEnabled(AnalyticsListener.EventTime.this, decoderCounters);
}
});
}
@Override // androidx.media3.exoplayer.analytics.AnalyticsCollector
public final void onAudioDecoderInitialized(final String str, final long j, final long j2) {
final AnalyticsListener.EventTime generateReadingMediaPeriodEventTime = generateReadingMediaPeriodEventTime();
sendEvent(generateReadingMediaPeriodEventTime, 1008, new ListenerSet.Event() { // from class: androidx.media3.exoplayer.analytics.DefaultAnalyticsCollector$$ExternalSyntheticLambda40
@Override // androidx.media3.common.util.ListenerSet.Event
public final void invoke(Object obj) {
DefaultAnalyticsCollector.lambda$onAudioDecoderInitialized$4(AnalyticsListener.EventTime.this, str, j2, j, (AnalyticsListener) obj);
}
});
}
/* JADX INFO: Access modifiers changed from: package-private */
public static /* synthetic */ void lambda$onAudioDecoderInitialized$4(AnalyticsListener.EventTime eventTime, String str, long j, long j2, AnalyticsListener analyticsListener) {
analyticsListener.onAudioDecoderInitialized(eventTime, str, j);
analyticsListener.onAudioDecoderInitialized(eventTime, str, j2, j);
}
@Override // androidx.media3.exoplayer.analytics.AnalyticsCollector
public final void onAudioInputFormatChanged(final Format format, final DecoderReuseEvaluation decoderReuseEvaluation) {
final AnalyticsListener.EventTime generateReadingMediaPeriodEventTime = generateReadingMediaPeriodEventTime();
sendEvent(generateReadingMediaPeriodEventTime, 1009, new ListenerSet.Event() { // from class: androidx.media3.exoplayer.analytics.DefaultAnalyticsCollector$$ExternalSyntheticLambda54
@Override // androidx.media3.common.util.ListenerSet.Event
public final void invoke(Object obj) {
DefaultAnalyticsCollector.lambda$onAudioInputFormatChanged$5(AnalyticsListener.EventTime.this, format, decoderReuseEvaluation, (AnalyticsListener) obj);
}
});
}
/* JADX INFO: Access modifiers changed from: package-private */
public static /* synthetic */ void lambda$onAudioInputFormatChanged$5(AnalyticsListener.EventTime eventTime, Format format, DecoderReuseEvaluation decoderReuseEvaluation, AnalyticsListener analyticsListener) {
analyticsListener.onAudioInputFormatChanged(eventTime, format);
analyticsListener.onAudioInputFormatChanged(eventTime, format, decoderReuseEvaluation);
}
@Override // androidx.media3.exoplayer.analytics.AnalyticsCollector
public final void onAudioPositionAdvancing(final long j) {
final AnalyticsListener.EventTime generateReadingMediaPeriodEventTime = generateReadingMediaPeriodEventTime();
sendEvent(generateReadingMediaPeriodEventTime, 1010, new ListenerSet.Event() { // from class: androidx.media3.exoplayer.analytics.DefaultAnalyticsCollector$$ExternalSyntheticLambda59
@Override // androidx.media3.common.util.ListenerSet.Event
public final void invoke(Object obj) {
((AnalyticsListener) obj).onAudioPositionAdvancing(AnalyticsListener.EventTime.this, j);
}
});
}
@Override // androidx.media3.exoplayer.analytics.AnalyticsCollector
public final void onAudioUnderrun(final int i, final long j, final long j2) {
final AnalyticsListener.EventTime generateReadingMediaPeriodEventTime = generateReadingMediaPeriodEventTime();
sendEvent(generateReadingMediaPeriodEventTime, 1011, new ListenerSet.Event() { // from class: androidx.media3.exoplayer.analytics.DefaultAnalyticsCollector$$ExternalSyntheticLambda6
@Override // androidx.media3.common.util.ListenerSet.Event
public final void invoke(Object obj) {
((AnalyticsListener) obj).onAudioUnderrun(AnalyticsListener.EventTime.this, i, j, j2);
}
});
}
@Override // androidx.media3.exoplayer.analytics.AnalyticsCollector
public final void onAudioDecoderReleased(final String str) {
final AnalyticsListener.EventTime generateReadingMediaPeriodEventTime = generateReadingMediaPeriodEventTime();
sendEvent(generateReadingMediaPeriodEventTime, 1012, new ListenerSet.Event() { // from class: androidx.media3.exoplayer.analytics.DefaultAnalyticsCollector$$ExternalSyntheticLambda68
@Override // androidx.media3.common.util.ListenerSet.Event
public final void invoke(Object obj) {
((AnalyticsListener) obj).onAudioDecoderReleased(AnalyticsListener.EventTime.this, str);
}
});
}
@Override // androidx.media3.exoplayer.analytics.AnalyticsCollector
public final void onAudioDisabled(final DecoderCounters decoderCounters) {
final AnalyticsListener.EventTime generatePlayingMediaPeriodEventTime = generatePlayingMediaPeriodEventTime();
sendEvent(generatePlayingMediaPeriodEventTime, 1013, new ListenerSet.Event() { // from class: androidx.media3.exoplayer.analytics.DefaultAnalyticsCollector$$ExternalSyntheticLambda56
@Override // androidx.media3.common.util.ListenerSet.Event
public final void invoke(Object obj) {
((AnalyticsListener) obj).onAudioDisabled(AnalyticsListener.EventTime.this, decoderCounters);
}
});
}
@Override // androidx.media3.exoplayer.analytics.AnalyticsCollector
public final void onAudioSinkError(final Exception exc) {
final AnalyticsListener.EventTime generateReadingMediaPeriodEventTime = generateReadingMediaPeriodEventTime();
sendEvent(generateReadingMediaPeriodEventTime, 1014, new ListenerSet.Event() { // from class: androidx.media3.exoplayer.analytics.DefaultAnalyticsCollector$$ExternalSyntheticLambda20
@Override // androidx.media3.common.util.ListenerSet.Event
public final void invoke(Object obj) {
((AnalyticsListener) obj).onAudioSinkError(AnalyticsListener.EventTime.this, exc);
}
});
}
@Override // androidx.media3.exoplayer.analytics.AnalyticsCollector
public final void onAudioCodecError(final Exception exc) {
final AnalyticsListener.EventTime generateReadingMediaPeriodEventTime = generateReadingMediaPeriodEventTime();
sendEvent(generateReadingMediaPeriodEventTime, 1029, new ListenerSet.Event() { // from class: androidx.media3.exoplayer.analytics.DefaultAnalyticsCollector$$ExternalSyntheticLambda26
@Override // androidx.media3.common.util.ListenerSet.Event
public final void invoke(Object obj) {
((AnalyticsListener) obj).onAudioCodecError(AnalyticsListener.EventTime.this, exc);
}
});
}
@Override // androidx.media3.common.Player.Listener
public final void onVolumeChanged(final float f) {
final AnalyticsListener.EventTime generateReadingMediaPeriodEventTime = generateReadingMediaPeriodEventTime();
sendEvent(generateReadingMediaPeriodEventTime, 22, new ListenerSet.Event() { // from class: androidx.media3.exoplayer.analytics.DefaultAnalyticsCollector$$ExternalSyntheticLambda8
@Override // androidx.media3.common.util.ListenerSet.Event
public final void invoke(Object obj) {
((AnalyticsListener) obj).onVolumeChanged(AnalyticsListener.EventTime.this, f);
}
});
}
@Override // androidx.media3.exoplayer.analytics.AnalyticsCollector
public final void onVideoEnabled(final DecoderCounters decoderCounters) {
final AnalyticsListener.EventTime generateReadingMediaPeriodEventTime = generateReadingMediaPeriodEventTime();
sendEvent(generateReadingMediaPeriodEventTime, 1015, new ListenerSet.Event() { // from class: androidx.media3.exoplayer.analytics.DefaultAnalyticsCollector$$ExternalSyntheticLambda36
@Override // androidx.media3.common.util.ListenerSet.Event
public final void invoke(Object obj) {
((AnalyticsListener) obj).onVideoEnabled(AnalyticsListener.EventTime.this, decoderCounters);
}
});
}
@Override // androidx.media3.exoplayer.analytics.AnalyticsCollector
public final void onVideoDecoderInitialized(final String str, final long j, final long j2) {
final AnalyticsListener.EventTime generateReadingMediaPeriodEventTime = generateReadingMediaPeriodEventTime();
sendEvent(generateReadingMediaPeriodEventTime, 1016, new ListenerSet.Event() { // from class: androidx.media3.exoplayer.analytics.DefaultAnalyticsCollector$$ExternalSyntheticLambda31
@Override // androidx.media3.common.util.ListenerSet.Event
public final void invoke(Object obj) {
DefaultAnalyticsCollector.lambda$onVideoDecoderInitialized$14(AnalyticsListener.EventTime.this, str, j2, j, (AnalyticsListener) obj);
}
});
}
/* JADX INFO: Access modifiers changed from: package-private */
public static /* synthetic */ void lambda$onVideoDecoderInitialized$14(AnalyticsListener.EventTime eventTime, String str, long j, long j2, AnalyticsListener analyticsListener) {
analyticsListener.onVideoDecoderInitialized(eventTime, str, j);
analyticsListener.onVideoDecoderInitialized(eventTime, str, j2, j);
}
@Override // androidx.media3.exoplayer.analytics.AnalyticsCollector
public final void onVideoInputFormatChanged(final Format format, final DecoderReuseEvaluation decoderReuseEvaluation) {
final AnalyticsListener.EventTime generateReadingMediaPeriodEventTime = generateReadingMediaPeriodEventTime();
sendEvent(generateReadingMediaPeriodEventTime, 1017, new ListenerSet.Event() { // from class: androidx.media3.exoplayer.analytics.DefaultAnalyticsCollector$$ExternalSyntheticLambda4
@Override // androidx.media3.common.util.ListenerSet.Event
public final void invoke(Object obj) {
DefaultAnalyticsCollector.lambda$onVideoInputFormatChanged$15(AnalyticsListener.EventTime.this, format, decoderReuseEvaluation, (AnalyticsListener) obj);
}
});
}
/* JADX INFO: Access modifiers changed from: package-private */
public static /* synthetic */ void lambda$onVideoInputFormatChanged$15(AnalyticsListener.EventTime eventTime, Format format, DecoderReuseEvaluation decoderReuseEvaluation, AnalyticsListener analyticsListener) {
analyticsListener.onVideoInputFormatChanged(eventTime, format);
analyticsListener.onVideoInputFormatChanged(eventTime, format, decoderReuseEvaluation);
}
@Override // androidx.media3.exoplayer.analytics.AnalyticsCollector
public final void onDroppedFrames(final int i, final long j) {
final AnalyticsListener.EventTime generatePlayingMediaPeriodEventTime = generatePlayingMediaPeriodEventTime();
sendEvent(generatePlayingMediaPeriodEventTime, 1018, new ListenerSet.Event() { // from class: androidx.media3.exoplayer.analytics.DefaultAnalyticsCollector$$ExternalSyntheticLambda35
@Override // androidx.media3.common.util.ListenerSet.Event
public final void invoke(Object obj) {
((AnalyticsListener) obj).onDroppedVideoFrames(AnalyticsListener.EventTime.this, i, j);
}
});
}
@Override // androidx.media3.exoplayer.analytics.AnalyticsCollector
public final void onVideoDecoderReleased(final String str) {
final AnalyticsListener.EventTime generateReadingMediaPeriodEventTime = generateReadingMediaPeriodEventTime();
sendEvent(generateReadingMediaPeriodEventTime, 1019, new ListenerSet.Event() { // from class: androidx.media3.exoplayer.analytics.DefaultAnalyticsCollector$$ExternalSyntheticLambda5
@Override // androidx.media3.common.util.ListenerSet.Event
public final void invoke(Object obj) {
((AnalyticsListener) obj).onVideoDecoderReleased(AnalyticsListener.EventTime.this, str);
}
});
}
@Override // androidx.media3.exoplayer.analytics.AnalyticsCollector
public final void onVideoDisabled(final DecoderCounters decoderCounters) {
final AnalyticsListener.EventTime generatePlayingMediaPeriodEventTime = generatePlayingMediaPeriodEventTime();
sendEvent(generatePlayingMediaPeriodEventTime, 1020, new ListenerSet.Event() { // from class: androidx.media3.exoplayer.analytics.DefaultAnalyticsCollector$$ExternalSyntheticLambda62
@Override // androidx.media3.common.util.ListenerSet.Event
public final void invoke(Object obj) {
((AnalyticsListener) obj).onVideoDisabled(AnalyticsListener.EventTime.this, decoderCounters);
}
});
}
@Override // androidx.media3.exoplayer.analytics.AnalyticsCollector
public final void onRenderedFirstFrame(final Object obj, final long j) {
final AnalyticsListener.EventTime generateReadingMediaPeriodEventTime = generateReadingMediaPeriodEventTime();
sendEvent(generateReadingMediaPeriodEventTime, 26, new ListenerSet.Event() { // from class: androidx.media3.exoplayer.analytics.DefaultAnalyticsCollector$$ExternalSyntheticLambda63
@Override // androidx.media3.common.util.ListenerSet.Event
public final void invoke(Object obj2) {
((AnalyticsListener) obj2).onRenderedFirstFrame(AnalyticsListener.EventTime.this, obj, j);
}
});
}
@Override // androidx.media3.exoplayer.analytics.AnalyticsCollector
public final void onVideoFrameProcessingOffset(final long j, final int i) {
final AnalyticsListener.EventTime generatePlayingMediaPeriodEventTime = generatePlayingMediaPeriodEventTime();
sendEvent(generatePlayingMediaPeriodEventTime, 1021, new ListenerSet.Event() { // from class: androidx.media3.exoplayer.analytics.DefaultAnalyticsCollector$$ExternalSyntheticLambda22
@Override // androidx.media3.common.util.ListenerSet.Event
public final void invoke(Object obj) {
((AnalyticsListener) obj).onVideoFrameProcessingOffset(AnalyticsListener.EventTime.this, j, i);
}
});
}
@Override // androidx.media3.exoplayer.analytics.AnalyticsCollector
public final void onVideoCodecError(final Exception exc) {
final AnalyticsListener.EventTime generateReadingMediaPeriodEventTime = generateReadingMediaPeriodEventTime();
sendEvent(generateReadingMediaPeriodEventTime, 1030, new ListenerSet.Event() { // from class: androidx.media3.exoplayer.analytics.DefaultAnalyticsCollector$$ExternalSyntheticLambda17
@Override // androidx.media3.common.util.ListenerSet.Event
public final void invoke(Object obj) {
((AnalyticsListener) obj).onVideoCodecError(AnalyticsListener.EventTime.this, exc);
}
});
}
@Override // androidx.media3.common.Player.Listener
public final void onSurfaceSizeChanged(final int i, final int i2) {
final AnalyticsListener.EventTime generateReadingMediaPeriodEventTime = generateReadingMediaPeriodEventTime();
sendEvent(generateReadingMediaPeriodEventTime, 24, new ListenerSet.Event() { // from class: androidx.media3.exoplayer.analytics.DefaultAnalyticsCollector$$ExternalSyntheticLambda64
@Override // androidx.media3.common.util.ListenerSet.Event
public final void invoke(Object obj) {
((AnalyticsListener) obj).onSurfaceSizeChanged(AnalyticsListener.EventTime.this, i, i2);
}
});
}
@Override // androidx.media3.exoplayer.source.MediaSourceEventListener
public final void onLoadStarted(int i, MediaSource.MediaPeriodId mediaPeriodId, final LoadEventInfo loadEventInfo, final MediaLoadData mediaLoadData) {
final AnalyticsListener.EventTime generateMediaPeriodEventTime = generateMediaPeriodEventTime(i, mediaPeriodId);
sendEvent(generateMediaPeriodEventTime, 1000, new ListenerSet.Event() { // from class: androidx.media3.exoplayer.analytics.DefaultAnalyticsCollector$$ExternalSyntheticLambda44
@Override // androidx.media3.common.util.ListenerSet.Event
public final void invoke(Object obj) {
((AnalyticsListener) obj).onLoadStarted(AnalyticsListener.EventTime.this, loadEventInfo, mediaLoadData);
}
});
}
@Override // androidx.media3.exoplayer.source.MediaSourceEventListener
public final void onLoadCompleted(int i, MediaSource.MediaPeriodId mediaPeriodId, final LoadEventInfo loadEventInfo, final MediaLoadData mediaLoadData) {
final AnalyticsListener.EventTime generateMediaPeriodEventTime = generateMediaPeriodEventTime(i, mediaPeriodId);
sendEvent(generateMediaPeriodEventTime, 1001, new ListenerSet.Event() { // from class: androidx.media3.exoplayer.analytics.DefaultAnalyticsCollector$$ExternalSyntheticLambda50
@Override // androidx.media3.common.util.ListenerSet.Event
public final void invoke(Object obj) {
((AnalyticsListener) obj).onLoadCompleted(AnalyticsListener.EventTime.this, loadEventInfo, mediaLoadData);
}
});
}
@Override // androidx.media3.exoplayer.source.MediaSourceEventListener
public final void onLoadCanceled(int i, MediaSource.MediaPeriodId mediaPeriodId, final LoadEventInfo loadEventInfo, final MediaLoadData mediaLoadData) {
final AnalyticsListener.EventTime generateMediaPeriodEventTime = generateMediaPeriodEventTime(i, mediaPeriodId);
sendEvent(generateMediaPeriodEventTime, 1002, new ListenerSet.Event() { // from class: androidx.media3.exoplayer.analytics.DefaultAnalyticsCollector$$ExternalSyntheticLambda37
@Override // androidx.media3.common.util.ListenerSet.Event
public final void invoke(Object obj) {
((AnalyticsListener) obj).onLoadCanceled(AnalyticsListener.EventTime.this, loadEventInfo, mediaLoadData);
}
});
}
@Override // androidx.media3.exoplayer.source.MediaSourceEventListener
public final void onLoadError(int i, MediaSource.MediaPeriodId mediaPeriodId, final LoadEventInfo loadEventInfo, final MediaLoadData mediaLoadData, final IOException iOException, final boolean z) {
final AnalyticsListener.EventTime generateMediaPeriodEventTime = generateMediaPeriodEventTime(i, mediaPeriodId);
sendEvent(generateMediaPeriodEventTime, 1003, new ListenerSet.Event() { // from class: androidx.media3.exoplayer.analytics.DefaultAnalyticsCollector$$ExternalSyntheticLambda33
@Override // androidx.media3.common.util.ListenerSet.Event
public final void invoke(Object obj) {
((AnalyticsListener) obj).onLoadError(AnalyticsListener.EventTime.this, loadEventInfo, mediaLoadData, iOException, z);
}
});
}
@Override // androidx.media3.exoplayer.source.MediaSourceEventListener
public final void onUpstreamDiscarded(int i, MediaSource.MediaPeriodId mediaPeriodId, final MediaLoadData mediaLoadData) {
final AnalyticsListener.EventTime generateMediaPeriodEventTime = generateMediaPeriodEventTime(i, mediaPeriodId);
sendEvent(generateMediaPeriodEventTime, 1005, new ListenerSet.Event() { // from class: androidx.media3.exoplayer.analytics.DefaultAnalyticsCollector$$ExternalSyntheticLambda2
@Override // androidx.media3.common.util.ListenerSet.Event
public final void invoke(Object obj) {
((AnalyticsListener) obj).onUpstreamDiscarded(AnalyticsListener.EventTime.this, mediaLoadData);
}
});
}
@Override // androidx.media3.exoplayer.source.MediaSourceEventListener
public final void onDownstreamFormatChanged(int i, MediaSource.MediaPeriodId mediaPeriodId, final MediaLoadData mediaLoadData) {
final AnalyticsListener.EventTime generateMediaPeriodEventTime = generateMediaPeriodEventTime(i, mediaPeriodId);
sendEvent(generateMediaPeriodEventTime, 1004, new ListenerSet.Event() { // from class: androidx.media3.exoplayer.analytics.DefaultAnalyticsCollector$$ExternalSyntheticLambda15
@Override // androidx.media3.common.util.ListenerSet.Event
public final void invoke(Object obj) {
((AnalyticsListener) obj).onDownstreamFormatChanged(AnalyticsListener.EventTime.this, mediaLoadData);
}
});
}
@Override // androidx.media3.common.Player.Listener
public final void onTimelineChanged(Timeline timeline, final int i) {
this.mediaPeriodQueueTracker.onTimelineChanged((Player) Assertions.checkNotNull(this.player));
final AnalyticsListener.EventTime generateCurrentPlayerMediaPeriodEventTime = generateCurrentPlayerMediaPeriodEventTime();
sendEvent(generateCurrentPlayerMediaPeriodEventTime, 0, new ListenerSet.Event() { // from class: androidx.media3.exoplayer.analytics.DefaultAnalyticsCollector$$ExternalSyntheticLambda34
@Override // androidx.media3.common.util.ListenerSet.Event
public final void invoke(Object obj) {
((AnalyticsListener) obj).onTimelineChanged(AnalyticsListener.EventTime.this, i);
}
});
}
@Override // androidx.media3.common.Player.Listener
public final void onMediaItemTransition(final MediaItem mediaItem, final int i) {
final AnalyticsListener.EventTime generateCurrentPlayerMediaPeriodEventTime = generateCurrentPlayerMediaPeriodEventTime();
sendEvent(generateCurrentPlayerMediaPeriodEventTime, 1, new ListenerSet.Event() { // from class: androidx.media3.exoplayer.analytics.DefaultAnalyticsCollector$$ExternalSyntheticLambda49
@Override // androidx.media3.common.util.ListenerSet.Event
public final void invoke(Object obj) {
((AnalyticsListener) obj).onMediaItemTransition(AnalyticsListener.EventTime.this, mediaItem, i);
}
});
}
@Override // androidx.media3.common.Player.Listener
public void onTracksChanged(final Tracks tracks) {
final AnalyticsListener.EventTime generateCurrentPlayerMediaPeriodEventTime = generateCurrentPlayerMediaPeriodEventTime();
sendEvent(generateCurrentPlayerMediaPeriodEventTime, 2, new ListenerSet.Event() { // from class: androidx.media3.exoplayer.analytics.DefaultAnalyticsCollector$$ExternalSyntheticLambda25
@Override // androidx.media3.common.util.ListenerSet.Event
public final void invoke(Object obj) {
((AnalyticsListener) obj).onTracksChanged(AnalyticsListener.EventTime.this, tracks);
}
});
}
@Override // androidx.media3.common.Player.Listener
public final void onIsLoadingChanged(final boolean z) {
final AnalyticsListener.EventTime generateCurrentPlayerMediaPeriodEventTime = generateCurrentPlayerMediaPeriodEventTime();
sendEvent(generateCurrentPlayerMediaPeriodEventTime, 3, new ListenerSet.Event() { // from class: androidx.media3.exoplayer.analytics.DefaultAnalyticsCollector$$ExternalSyntheticLambda66
@Override // androidx.media3.common.util.ListenerSet.Event
public final void invoke(Object obj) {
DefaultAnalyticsCollector.lambda$onIsLoadingChanged$32(AnalyticsListener.EventTime.this, z, (AnalyticsListener) obj);
}
});
}
/* JADX INFO: Access modifiers changed from: package-private */
public static /* synthetic */ void lambda$onIsLoadingChanged$32(AnalyticsListener.EventTime eventTime, boolean z, AnalyticsListener analyticsListener) {
analyticsListener.onLoadingChanged(eventTime, z);
analyticsListener.onIsLoadingChanged(eventTime, z);
}
@Override // androidx.media3.common.Player.Listener
public void onAvailableCommandsChanged(final Player.Commands commands) {
final AnalyticsListener.EventTime generateCurrentPlayerMediaPeriodEventTime = generateCurrentPlayerMediaPeriodEventTime();
sendEvent(generateCurrentPlayerMediaPeriodEventTime, 13, new ListenerSet.Event() { // from class: androidx.media3.exoplayer.analytics.DefaultAnalyticsCollector$$ExternalSyntheticLambda23
@Override // androidx.media3.common.util.ListenerSet.Event
public final void invoke(Object obj) {
((AnalyticsListener) obj).onAvailableCommandsChanged(AnalyticsListener.EventTime.this, commands);
}
});
}
@Override // androidx.media3.common.Player.Listener
public final void onPlayerStateChanged(final boolean z, final int i) {
final AnalyticsListener.EventTime generateCurrentPlayerMediaPeriodEventTime = generateCurrentPlayerMediaPeriodEventTime();
sendEvent(generateCurrentPlayerMediaPeriodEventTime, -1, new ListenerSet.Event() { // from class: androidx.media3.exoplayer.analytics.DefaultAnalyticsCollector$$ExternalSyntheticLambda3
@Override // androidx.media3.common.util.ListenerSet.Event
public final void invoke(Object obj) {
((AnalyticsListener) obj).onPlayerStateChanged(AnalyticsListener.EventTime.this, z, i);
}
});
}
@Override // androidx.media3.common.Player.Listener
public final void onPlaybackStateChanged(final int i) {
final AnalyticsListener.EventTime generateCurrentPlayerMediaPeriodEventTime = generateCurrentPlayerMediaPeriodEventTime();
sendEvent(generateCurrentPlayerMediaPeriodEventTime, 4, new ListenerSet.Event() { // from class: androidx.media3.exoplayer.analytics.DefaultAnalyticsCollector$$ExternalSyntheticLambda48
@Override // androidx.media3.common.util.ListenerSet.Event
public final void invoke(Object obj) {
((AnalyticsListener) obj).onPlaybackStateChanged(AnalyticsListener.EventTime.this, i);
}
});
}
@Override // androidx.media3.common.Player.Listener
public final void onPlayWhenReadyChanged(final boolean z, final int i) {
final AnalyticsListener.EventTime generateCurrentPlayerMediaPeriodEventTime = generateCurrentPlayerMediaPeriodEventTime();
sendEvent(generateCurrentPlayerMediaPeriodEventTime, 5, new ListenerSet.Event() { // from class: androidx.media3.exoplayer.analytics.DefaultAnalyticsCollector$$ExternalSyntheticLambda43
@Override // androidx.media3.common.util.ListenerSet.Event
public final void invoke(Object obj) {
((AnalyticsListener) obj).onPlayWhenReadyChanged(AnalyticsListener.EventTime.this, z, i);
}
});
}
@Override // androidx.media3.common.Player.Listener
public final void onPlaybackSuppressionReasonChanged(final int i) {
final AnalyticsListener.EventTime generateCurrentPlayerMediaPeriodEventTime = generateCurrentPlayerMediaPeriodEventTime();
sendEvent(generateCurrentPlayerMediaPeriodEventTime, 6, new ListenerSet.Event() { // from class: androidx.media3.exoplayer.analytics.DefaultAnalyticsCollector$$ExternalSyntheticLambda65
@Override // androidx.media3.common.util.ListenerSet.Event
public final void invoke(Object obj) {
((AnalyticsListener) obj).onPlaybackSuppressionReasonChanged(AnalyticsListener.EventTime.this, i);
}
});
}
@Override // androidx.media3.common.Player.Listener
public void onIsPlayingChanged(final boolean z) {
final AnalyticsListener.EventTime generateCurrentPlayerMediaPeriodEventTime = generateCurrentPlayerMediaPeriodEventTime();
sendEvent(generateCurrentPlayerMediaPeriodEventTime, 7, new ListenerSet.Event() { // from class: androidx.media3.exoplayer.analytics.DefaultAnalyticsCollector$$ExternalSyntheticLambda45
@Override // androidx.media3.common.util.ListenerSet.Event
public final void invoke(Object obj) {
((AnalyticsListener) obj).onIsPlayingChanged(AnalyticsListener.EventTime.this, z);
}
});
}
@Override // androidx.media3.common.Player.Listener
public final void onRepeatModeChanged(final int i) {
final AnalyticsListener.EventTime generateCurrentPlayerMediaPeriodEventTime = generateCurrentPlayerMediaPeriodEventTime();
sendEvent(generateCurrentPlayerMediaPeriodEventTime, 8, new ListenerSet.Event() { // from class: androidx.media3.exoplayer.analytics.DefaultAnalyticsCollector$$ExternalSyntheticLambda16
@Override // androidx.media3.common.util.ListenerSet.Event
public final void invoke(Object obj) {
((AnalyticsListener) obj).onRepeatModeChanged(AnalyticsListener.EventTime.this, i);
}
});
}
@Override // androidx.media3.common.Player.Listener
public final void onShuffleModeEnabledChanged(final boolean z) {
final AnalyticsListener.EventTime generateCurrentPlayerMediaPeriodEventTime = generateCurrentPlayerMediaPeriodEventTime();
sendEvent(generateCurrentPlayerMediaPeriodEventTime, 9, new ListenerSet.Event() { // from class: androidx.media3.exoplayer.analytics.DefaultAnalyticsCollector$$ExternalSyntheticLambda47
@Override // androidx.media3.common.util.ListenerSet.Event
public final void invoke(Object obj) {
((AnalyticsListener) obj).onShuffleModeChanged(AnalyticsListener.EventTime.this, z);
}
});
}
@Override // androidx.media3.common.Player.Listener
public final void onPlayerError(final PlaybackException playbackException) {
final AnalyticsListener.EventTime eventTimeForErrorEvent = getEventTimeForErrorEvent(playbackException);
sendEvent(eventTimeForErrorEvent, 10, new ListenerSet.Event() { // from class: androidx.media3.exoplayer.analytics.DefaultAnalyticsCollector$$ExternalSyntheticLambda38
@Override // androidx.media3.common.util.ListenerSet.Event
public final void invoke(Object obj) {
((AnalyticsListener) obj).onPlayerError(AnalyticsListener.EventTime.this, playbackException);
}
});
}
@Override // androidx.media3.common.Player.Listener
public void onPlayerErrorChanged(final PlaybackException playbackException) {
final AnalyticsListener.EventTime eventTimeForErrorEvent = getEventTimeForErrorEvent(playbackException);
sendEvent(eventTimeForErrorEvent, 10, new ListenerSet.Event() { // from class: androidx.media3.exoplayer.analytics.DefaultAnalyticsCollector$$ExternalSyntheticLambda51
@Override // androidx.media3.common.util.ListenerSet.Event
public final void invoke(Object obj) {
((AnalyticsListener) obj).onPlayerErrorChanged(AnalyticsListener.EventTime.this, playbackException);
}
});
}
@Override // androidx.media3.common.Player.Listener
public final void onPositionDiscontinuity(final Player.PositionInfo positionInfo, final Player.PositionInfo positionInfo2, final int i) {
if (i == 1) {
this.isSeeking = false;
}
this.mediaPeriodQueueTracker.onPositionDiscontinuity((Player) Assertions.checkNotNull(this.player));
final AnalyticsListener.EventTime generateCurrentPlayerMediaPeriodEventTime = generateCurrentPlayerMediaPeriodEventTime();
sendEvent(generateCurrentPlayerMediaPeriodEventTime, 11, new ListenerSet.Event() { // from class: androidx.media3.exoplayer.analytics.DefaultAnalyticsCollector$$ExternalSyntheticLambda21
@Override // androidx.media3.common.util.ListenerSet.Event
public final void invoke(Object obj) {
DefaultAnalyticsCollector.lambda$onPositionDiscontinuity$43(AnalyticsListener.EventTime.this, i, positionInfo, positionInfo2, (AnalyticsListener) obj);
}
});
}
/* JADX INFO: Access modifiers changed from: package-private */
public static /* synthetic */ void lambda$onPositionDiscontinuity$43(AnalyticsListener.EventTime eventTime, int i, Player.PositionInfo positionInfo, Player.PositionInfo positionInfo2, AnalyticsListener analyticsListener) {
analyticsListener.onPositionDiscontinuity(eventTime, i);
analyticsListener.onPositionDiscontinuity(eventTime, positionInfo, positionInfo2, i);
}
@Override // androidx.media3.common.Player.Listener
public final void onPlaybackParametersChanged(final PlaybackParameters playbackParameters) {
final AnalyticsListener.EventTime generateCurrentPlayerMediaPeriodEventTime = generateCurrentPlayerMediaPeriodEventTime();
sendEvent(generateCurrentPlayerMediaPeriodEventTime, 12, new ListenerSet.Event() { // from class: androidx.media3.exoplayer.analytics.DefaultAnalyticsCollector$$ExternalSyntheticLambda9
@Override // androidx.media3.common.util.ListenerSet.Event
public final void invoke(Object obj) {
((AnalyticsListener) obj).onPlaybackParametersChanged(AnalyticsListener.EventTime.this, playbackParameters);
}
});
}
@Override // androidx.media3.common.Player.Listener
public void onSeekBackIncrementChanged(final long j) {
final AnalyticsListener.EventTime generateCurrentPlayerMediaPeriodEventTime = generateCurrentPlayerMediaPeriodEventTime();
sendEvent(generateCurrentPlayerMediaPeriodEventTime, 16, new ListenerSet.Event() { // from class: androidx.media3.exoplayer.analytics.DefaultAnalyticsCollector$$ExternalSyntheticLambda18
@Override // androidx.media3.common.util.ListenerSet.Event
public final void invoke(Object obj) {
((AnalyticsListener) obj).onSeekBackIncrementChanged(AnalyticsListener.EventTime.this, j);
}
});
}
@Override // androidx.media3.common.Player.Listener
public void onSeekForwardIncrementChanged(final long j) {
final AnalyticsListener.EventTime generateCurrentPlayerMediaPeriodEventTime = generateCurrentPlayerMediaPeriodEventTime();
sendEvent(generateCurrentPlayerMediaPeriodEventTime, 17, new ListenerSet.Event() { // from class: androidx.media3.exoplayer.analytics.DefaultAnalyticsCollector$$ExternalSyntheticLambda55
@Override // androidx.media3.common.util.ListenerSet.Event
public final void invoke(Object obj) {
((AnalyticsListener) obj).onSeekForwardIncrementChanged(AnalyticsListener.EventTime.this, j);
}
});
}
@Override // androidx.media3.common.Player.Listener
public void onMaxSeekToPreviousPositionChanged(final long j) {
final AnalyticsListener.EventTime generateCurrentPlayerMediaPeriodEventTime = generateCurrentPlayerMediaPeriodEventTime();
sendEvent(generateCurrentPlayerMediaPeriodEventTime, 18, new ListenerSet.Event() { // from class: androidx.media3.exoplayer.analytics.DefaultAnalyticsCollector$$ExternalSyntheticLambda11
@Override // androidx.media3.common.util.ListenerSet.Event
public final void invoke(Object obj) {
((AnalyticsListener) obj).onMaxSeekToPreviousPositionChanged(AnalyticsListener.EventTime.this, j);
}
});
}
@Override // androidx.media3.common.Player.Listener
public void onMediaMetadataChanged(final MediaMetadata mediaMetadata) {
final AnalyticsListener.EventTime generateCurrentPlayerMediaPeriodEventTime = generateCurrentPlayerMediaPeriodEventTime();
sendEvent(generateCurrentPlayerMediaPeriodEventTime, 14, new ListenerSet.Event() { // from class: androidx.media3.exoplayer.analytics.DefaultAnalyticsCollector$$ExternalSyntheticLambda52
@Override // androidx.media3.common.util.ListenerSet.Event
public final void invoke(Object obj) {
((AnalyticsListener) obj).onMediaMetadataChanged(AnalyticsListener.EventTime.this, mediaMetadata);
}
});
}
@Override // androidx.media3.common.Player.Listener
public void onPlaylistMetadataChanged(final MediaMetadata mediaMetadata) {
final AnalyticsListener.EventTime generateCurrentPlayerMediaPeriodEventTime = generateCurrentPlayerMediaPeriodEventTime();
sendEvent(generateCurrentPlayerMediaPeriodEventTime, 15, new ListenerSet.Event() { // from class: androidx.media3.exoplayer.analytics.DefaultAnalyticsCollector$$ExternalSyntheticLambda30
@Override // androidx.media3.common.util.ListenerSet.Event
public final void invoke(Object obj) {
((AnalyticsListener) obj).onPlaylistMetadataChanged(AnalyticsListener.EventTime.this, mediaMetadata);
}
});
}
@Override // androidx.media3.common.Player.Listener
public final void onMetadata(final Metadata metadata) {
final AnalyticsListener.EventTime generateCurrentPlayerMediaPeriodEventTime = generateCurrentPlayerMediaPeriodEventTime();
sendEvent(generateCurrentPlayerMediaPeriodEventTime, 28, new ListenerSet.Event() { // from class: androidx.media3.exoplayer.analytics.DefaultAnalyticsCollector$$ExternalSyntheticLambda39
@Override // androidx.media3.common.util.ListenerSet.Event
public final void invoke(Object obj) {
((AnalyticsListener) obj).onMetadata(AnalyticsListener.EventTime.this, metadata);
}
});
}
@Override // androidx.media3.common.Player.Listener
public void onCues(final List<Cue> list) {
final AnalyticsListener.EventTime generateCurrentPlayerMediaPeriodEventTime = generateCurrentPlayerMediaPeriodEventTime();
sendEvent(generateCurrentPlayerMediaPeriodEventTime, 27, new ListenerSet.Event() { // from class: androidx.media3.exoplayer.analytics.DefaultAnalyticsCollector$$ExternalSyntheticLambda29
@Override // androidx.media3.common.util.ListenerSet.Event
public final void invoke(Object obj) {
((AnalyticsListener) obj).onCues(AnalyticsListener.EventTime.this, (List<Cue>) list);
}
});
}
@Override // androidx.media3.common.Player.Listener
public void onCues(final CueGroup cueGroup) {
final AnalyticsListener.EventTime generateCurrentPlayerMediaPeriodEventTime = generateCurrentPlayerMediaPeriodEventTime();
sendEvent(generateCurrentPlayerMediaPeriodEventTime, 27, new ListenerSet.Event() { // from class: androidx.media3.exoplayer.analytics.DefaultAnalyticsCollector$$ExternalSyntheticLambda42
@Override // androidx.media3.common.util.ListenerSet.Event
public final void invoke(Object obj) {
((AnalyticsListener) obj).onCues(AnalyticsListener.EventTime.this, cueGroup);
}
});
}
@Override // androidx.media3.common.Player.Listener
public final void onSkipSilenceEnabledChanged(final boolean z) {
final AnalyticsListener.EventTime generateReadingMediaPeriodEventTime = generateReadingMediaPeriodEventTime();
sendEvent(generateReadingMediaPeriodEventTime, 23, new ListenerSet.Event() { // from class: androidx.media3.exoplayer.analytics.DefaultAnalyticsCollector$$ExternalSyntheticLambda46
@Override // androidx.media3.common.util.ListenerSet.Event
public final void invoke(Object obj) {
((AnalyticsListener) obj).onSkipSilenceEnabledChanged(AnalyticsListener.EventTime.this, z);
}
});
}
@Override // androidx.media3.common.Player.Listener
public final void onAudioSessionIdChanged(final int i) {
final AnalyticsListener.EventTime generateReadingMediaPeriodEventTime = generateReadingMediaPeriodEventTime();
sendEvent(generateReadingMediaPeriodEventTime, 21, new ListenerSet.Event() { // from class: androidx.media3.exoplayer.analytics.DefaultAnalyticsCollector$$ExternalSyntheticLambda1
@Override // androidx.media3.common.util.ListenerSet.Event
public final void invoke(Object obj) {
((AnalyticsListener) obj).onAudioSessionIdChanged(AnalyticsListener.EventTime.this, i);
}
});
}
@Override // androidx.media3.common.Player.Listener
public final void onAudioAttributesChanged(final AudioAttributes audioAttributes) {
final AnalyticsListener.EventTime generateReadingMediaPeriodEventTime = generateReadingMediaPeriodEventTime();
sendEvent(generateReadingMediaPeriodEventTime, 20, new ListenerSet.Event() { // from class: androidx.media3.exoplayer.analytics.DefaultAnalyticsCollector$$ExternalSyntheticLambda57
@Override // androidx.media3.common.util.ListenerSet.Event
public final void invoke(Object obj) {
((AnalyticsListener) obj).onAudioAttributesChanged(AnalyticsListener.EventTime.this, audioAttributes);
}
});
}
@Override // androidx.media3.common.Player.Listener
public final void onVideoSizeChanged(final VideoSize videoSize) {
final AnalyticsListener.EventTime generateReadingMediaPeriodEventTime = generateReadingMediaPeriodEventTime();
sendEvent(generateReadingMediaPeriodEventTime, 25, new ListenerSet.Event() { // from class: androidx.media3.exoplayer.analytics.DefaultAnalyticsCollector$$ExternalSyntheticLambda61
@Override // androidx.media3.common.util.ListenerSet.Event
public final void invoke(Object obj) {
DefaultAnalyticsCollector.lambda$onVideoSizeChanged$56(AnalyticsListener.EventTime.this, videoSize, (AnalyticsListener) obj);
}
});
}
/* JADX INFO: Access modifiers changed from: package-private */
public static /* synthetic */ void lambda$onVideoSizeChanged$56(AnalyticsListener.EventTime eventTime, VideoSize videoSize, AnalyticsListener analyticsListener) {
analyticsListener.onVideoSizeChanged(eventTime, videoSize);
analyticsListener.onVideoSizeChanged(eventTime, videoSize.width, videoSize.height, videoSize.unappliedRotationDegrees, videoSize.pixelWidthHeightRatio);
}
@Override // androidx.media3.common.Player.Listener
public void onTrackSelectionParametersChanged(final TrackSelectionParameters trackSelectionParameters) {
final AnalyticsListener.EventTime generateCurrentPlayerMediaPeriodEventTime = generateCurrentPlayerMediaPeriodEventTime();
sendEvent(generateCurrentPlayerMediaPeriodEventTime, 19, new ListenerSet.Event() { // from class: androidx.media3.exoplayer.analytics.DefaultAnalyticsCollector$$ExternalSyntheticLambda13
@Override // androidx.media3.common.util.ListenerSet.Event
public final void invoke(Object obj) {
((AnalyticsListener) obj).onTrackSelectionParametersChanged(AnalyticsListener.EventTime.this, trackSelectionParameters);
}
});
}
@Override // androidx.media3.common.Player.Listener
public void onDeviceInfoChanged(final DeviceInfo deviceInfo) {
final AnalyticsListener.EventTime generateCurrentPlayerMediaPeriodEventTime = generateCurrentPlayerMediaPeriodEventTime();
sendEvent(generateCurrentPlayerMediaPeriodEventTime, 29, new ListenerSet.Event() { // from class: androidx.media3.exoplayer.analytics.DefaultAnalyticsCollector$$ExternalSyntheticLambda24
@Override // androidx.media3.common.util.ListenerSet.Event
public final void invoke(Object obj) {
((AnalyticsListener) obj).onDeviceInfoChanged(AnalyticsListener.EventTime.this, deviceInfo);
}
});
}
@Override // androidx.media3.common.Player.Listener
public void onDeviceVolumeChanged(final int i, final boolean z) {
final AnalyticsListener.EventTime generateCurrentPlayerMediaPeriodEventTime = generateCurrentPlayerMediaPeriodEventTime();
sendEvent(generateCurrentPlayerMediaPeriodEventTime, 30, new ListenerSet.Event() { // from class: androidx.media3.exoplayer.analytics.DefaultAnalyticsCollector$$ExternalSyntheticLambda27
@Override // androidx.media3.common.util.ListenerSet.Event
public final void invoke(Object obj) {
((AnalyticsListener) obj).onDeviceVolumeChanged(AnalyticsListener.EventTime.this, i, z);
}
});
}
@Override // androidx.media3.exoplayer.upstream.BandwidthMeter.EventListener
public final void onBandwidthSample(final int i, final long j, final long j2) {
final AnalyticsListener.EventTime generateLoadingMediaPeriodEventTime = generateLoadingMediaPeriodEventTime();
sendEvent(generateLoadingMediaPeriodEventTime, 1006, new ListenerSet.Event() { // from class: androidx.media3.exoplayer.analytics.DefaultAnalyticsCollector$$ExternalSyntheticLambda19
@Override // androidx.media3.common.util.ListenerSet.Event
public final void invoke(Object obj) {
((AnalyticsListener) obj).onBandwidthEstimate(AnalyticsListener.EventTime.this, i, j, j2);
}
});
}
@Override // androidx.media3.exoplayer.drm.DrmSessionEventListener
public final void onDrmSessionAcquired(int i, MediaSource.MediaPeriodId mediaPeriodId, final int i2) {
final AnalyticsListener.EventTime generateMediaPeriodEventTime = generateMediaPeriodEventTime(i, mediaPeriodId);
sendEvent(generateMediaPeriodEventTime, 1022, new ListenerSet.Event() { // from class: androidx.media3.exoplayer.analytics.DefaultAnalyticsCollector$$ExternalSyntheticLambda14
@Override // androidx.media3.common.util.ListenerSet.Event
public final void invoke(Object obj) {
DefaultAnalyticsCollector.lambda$onDrmSessionAcquired$61(AnalyticsListener.EventTime.this, i2, (AnalyticsListener) obj);
}
});
}
/* JADX INFO: Access modifiers changed from: package-private */
public static /* synthetic */ void lambda$onDrmSessionAcquired$61(AnalyticsListener.EventTime eventTime, int i, AnalyticsListener analyticsListener) {
analyticsListener.onDrmSessionAcquired(eventTime);
analyticsListener.onDrmSessionAcquired(eventTime, i);
}
@Override // androidx.media3.exoplayer.drm.DrmSessionEventListener
public final void onDrmKeysLoaded(int i, MediaSource.MediaPeriodId mediaPeriodId) {
final AnalyticsListener.EventTime generateMediaPeriodEventTime = generateMediaPeriodEventTime(i, mediaPeriodId);
sendEvent(generateMediaPeriodEventTime, 1023, new ListenerSet.Event() { // from class: androidx.media3.exoplayer.analytics.DefaultAnalyticsCollector$$ExternalSyntheticLambda10
@Override // androidx.media3.common.util.ListenerSet.Event
public final void invoke(Object obj) {
((AnalyticsListener) obj).onDrmKeysLoaded(AnalyticsListener.EventTime.this);
}
});
}
@Override // androidx.media3.exoplayer.drm.DrmSessionEventListener
public final void onDrmSessionManagerError(int i, MediaSource.MediaPeriodId mediaPeriodId, final Exception exc) {
final AnalyticsListener.EventTime generateMediaPeriodEventTime = generateMediaPeriodEventTime(i, mediaPeriodId);
sendEvent(generateMediaPeriodEventTime, 1024, new ListenerSet.Event() { // from class: androidx.media3.exoplayer.analytics.DefaultAnalyticsCollector$$ExternalSyntheticLambda67
@Override // androidx.media3.common.util.ListenerSet.Event
public final void invoke(Object obj) {
((AnalyticsListener) obj).onDrmSessionManagerError(AnalyticsListener.EventTime.this, exc);
}
});
}
@Override // androidx.media3.exoplayer.drm.DrmSessionEventListener
public final void onDrmKeysRestored(int i, MediaSource.MediaPeriodId mediaPeriodId) {
final AnalyticsListener.EventTime generateMediaPeriodEventTime = generateMediaPeriodEventTime(i, mediaPeriodId);
sendEvent(generateMediaPeriodEventTime, 1025, new ListenerSet.Event() { // from class: androidx.media3.exoplayer.analytics.DefaultAnalyticsCollector$$ExternalSyntheticLambda0
@Override // androidx.media3.common.util.ListenerSet.Event
public final void invoke(Object obj) {
((AnalyticsListener) obj).onDrmKeysRestored(AnalyticsListener.EventTime.this);
}
});
}
@Override // androidx.media3.exoplayer.drm.DrmSessionEventListener
public final void onDrmKeysRemoved(int i, MediaSource.MediaPeriodId mediaPeriodId) {
final AnalyticsListener.EventTime generateMediaPeriodEventTime = generateMediaPeriodEventTime(i, mediaPeriodId);
sendEvent(generateMediaPeriodEventTime, 1026, new ListenerSet.Event() { // from class: androidx.media3.exoplayer.analytics.DefaultAnalyticsCollector$$ExternalSyntheticLambda53
@Override // androidx.media3.common.util.ListenerSet.Event
public final void invoke(Object obj) {
((AnalyticsListener) obj).onDrmKeysRemoved(AnalyticsListener.EventTime.this);
}
});
}
@Override // androidx.media3.exoplayer.drm.DrmSessionEventListener
public final void onDrmSessionReleased(int i, MediaSource.MediaPeriodId mediaPeriodId) {
final AnalyticsListener.EventTime generateMediaPeriodEventTime = generateMediaPeriodEventTime(i, mediaPeriodId);
sendEvent(generateMediaPeriodEventTime, 1027, new ListenerSet.Event() { // from class: androidx.media3.exoplayer.analytics.DefaultAnalyticsCollector$$ExternalSyntheticLambda7
@Override // androidx.media3.common.util.ListenerSet.Event
public final void invoke(Object obj) {
((AnalyticsListener) obj).onDrmSessionReleased(AnalyticsListener.EventTime.this);
}
});
}
protected final void sendEvent(AnalyticsListener.EventTime eventTime, int i, ListenerSet.Event<AnalyticsListener> event) {
this.eventTimes.put(i, eventTime);
this.listeners.sendEvent(i, event);
}
protected final AnalyticsListener.EventTime generateCurrentPlayerMediaPeriodEventTime() {
return generateEventTime(this.mediaPeriodQueueTracker.getCurrentPlayerMediaPeriod());
}
@RequiresNonNull({"player"})
protected final AnalyticsListener.EventTime generateEventTime(Timeline timeline, int i, MediaSource.MediaPeriodId mediaPeriodId) {
long contentPosition;
MediaSource.MediaPeriodId mediaPeriodId2 = timeline.isEmpty() ? null : mediaPeriodId;
long elapsedRealtime = this.clock.elapsedRealtime();
boolean z = timeline.equals(this.player.getCurrentTimeline()) && i == this.player.getCurrentMediaItemIndex();
long j = 0;
if (mediaPeriodId2 == null || !mediaPeriodId2.isAd()) {
if (z) {
contentPosition = this.player.getContentPosition();
return new AnalyticsListener.EventTime(elapsedRealtime, timeline, i, mediaPeriodId2, contentPosition, this.player.getCurrentTimeline(), this.player.getCurrentMediaItemIndex(), this.mediaPeriodQueueTracker.getCurrentPlayerMediaPeriod(), this.player.getCurrentPosition(), this.player.getTotalBufferedDuration());
}
if (!timeline.isEmpty()) {
j = timeline.getWindow(i, this.window).getDefaultPositionMs();
}
} else if (z && this.player.getCurrentAdGroupIndex() == mediaPeriodId2.adGroupIndex && this.player.getCurrentAdIndexInAdGroup() == mediaPeriodId2.adIndexInAdGroup) {
j = this.player.getCurrentPosition();
}
contentPosition = j;
return new AnalyticsListener.EventTime(elapsedRealtime, timeline, i, mediaPeriodId2, contentPosition, this.player.getCurrentTimeline(), this.player.getCurrentMediaItemIndex(), this.mediaPeriodQueueTracker.getCurrentPlayerMediaPeriod(), this.player.getCurrentPosition(), this.player.getTotalBufferedDuration());
}
/* JADX INFO: Access modifiers changed from: private */
public void releaseInternal() {
final AnalyticsListener.EventTime generateCurrentPlayerMediaPeriodEventTime = generateCurrentPlayerMediaPeriodEventTime();
sendEvent(generateCurrentPlayerMediaPeriodEventTime, 1028, new ListenerSet.Event() { // from class: androidx.media3.exoplayer.analytics.DefaultAnalyticsCollector$$ExternalSyntheticLambda32
@Override // androidx.media3.common.util.ListenerSet.Event
public final void invoke(Object obj) {
((AnalyticsListener) obj).onPlayerReleased(AnalyticsListener.EventTime.this);
}
});
this.listeners.release();
}
private AnalyticsListener.EventTime generateEventTime(MediaSource.MediaPeriodId mediaPeriodId) {
Assertions.checkNotNull(this.player);
Timeline mediaPeriodIdTimeline = mediaPeriodId == null ? null : this.mediaPeriodQueueTracker.getMediaPeriodIdTimeline(mediaPeriodId);
if (mediaPeriodId == null || mediaPeriodIdTimeline == null) {
int currentMediaItemIndex = this.player.getCurrentMediaItemIndex();
Timeline currentTimeline = this.player.getCurrentTimeline();
if (currentMediaItemIndex >= currentTimeline.getWindowCount()) {
currentTimeline = Timeline.EMPTY;
}
return generateEventTime(currentTimeline, currentMediaItemIndex, null);
}
return generateEventTime(mediaPeriodIdTimeline, mediaPeriodIdTimeline.getPeriodByUid(mediaPeriodId.periodUid, this.period).windowIndex, mediaPeriodId);
}
private AnalyticsListener.EventTime generatePlayingMediaPeriodEventTime() {
return generateEventTime(this.mediaPeriodQueueTracker.getPlayingMediaPeriod());
}
private AnalyticsListener.EventTime generateReadingMediaPeriodEventTime() {
return generateEventTime(this.mediaPeriodQueueTracker.getReadingMediaPeriod());
}
private AnalyticsListener.EventTime generateLoadingMediaPeriodEventTime() {
return generateEventTime(this.mediaPeriodQueueTracker.getLoadingMediaPeriod());
}
private AnalyticsListener.EventTime generateMediaPeriodEventTime(int i, MediaSource.MediaPeriodId mediaPeriodId) {
Assertions.checkNotNull(this.player);
if (mediaPeriodId != null) {
if (this.mediaPeriodQueueTracker.getMediaPeriodIdTimeline(mediaPeriodId) != null) {
return generateEventTime(mediaPeriodId);
}
return generateEventTime(Timeline.EMPTY, i, mediaPeriodId);
}
Timeline currentTimeline = this.player.getCurrentTimeline();
if (i >= currentTimeline.getWindowCount()) {
currentTimeline = Timeline.EMPTY;
}
return generateEventTime(currentTimeline, i, null);
}
private AnalyticsListener.EventTime getEventTimeForErrorEvent(PlaybackException playbackException) {
if (playbackException instanceof ExoPlaybackException) {
ExoPlaybackException exoPlaybackException = (ExoPlaybackException) playbackException;
if (exoPlaybackException.mediaPeriodId != null) {
return generateEventTime(new MediaSource.MediaPeriodId(exoPlaybackException.mediaPeriodId));
}
}
return generateCurrentPlayerMediaPeriodEventTime();
}
/* JADX INFO: Access modifiers changed from: private */
/* loaded from: classes2.dex */
public static final class MediaPeriodQueueTracker {
private MediaSource.MediaPeriodId currentPlayerMediaPeriod;
private ImmutableList<MediaSource.MediaPeriodId> mediaPeriodQueue = ImmutableList.of();
private ImmutableMap<MediaSource.MediaPeriodId, Timeline> mediaPeriodTimelines = ImmutableMap.of();
private final Timeline.Period period;
private MediaSource.MediaPeriodId playingMediaPeriod;
private MediaSource.MediaPeriodId readingMediaPeriod;
public MediaSource.MediaPeriodId getCurrentPlayerMediaPeriod() {
return this.currentPlayerMediaPeriod;
}
public MediaSource.MediaPeriodId getPlayingMediaPeriod() {
return this.playingMediaPeriod;
}
public MediaSource.MediaPeriodId getReadingMediaPeriod() {
return this.readingMediaPeriod;
}
public MediaPeriodQueueTracker(Timeline.Period period) {
this.period = period;
}
public MediaSource.MediaPeriodId getLoadingMediaPeriod() {
if (this.mediaPeriodQueue.isEmpty()) {
return null;
}
return (MediaSource.MediaPeriodId) Iterables.getLast(this.mediaPeriodQueue);
}
public Timeline getMediaPeriodIdTimeline(MediaSource.MediaPeriodId mediaPeriodId) {
return this.mediaPeriodTimelines.get(mediaPeriodId);
}
public void onPositionDiscontinuity(Player player) {
this.currentPlayerMediaPeriod = findCurrentPlayerMediaPeriodInQueue(player, this.mediaPeriodQueue, this.playingMediaPeriod, this.period);
}
public void onTimelineChanged(Player player) {
this.currentPlayerMediaPeriod = findCurrentPlayerMediaPeriodInQueue(player, this.mediaPeriodQueue, this.playingMediaPeriod, this.period);
updateMediaPeriodTimelines(player.getCurrentTimeline());
}
public void onQueueUpdated(List<MediaSource.MediaPeriodId> list, MediaSource.MediaPeriodId mediaPeriodId, Player player) {
this.mediaPeriodQueue = ImmutableList.copyOf((Collection) list);
if (!list.isEmpty()) {
this.playingMediaPeriod = list.get(0);
this.readingMediaPeriod = (MediaSource.MediaPeriodId) Assertions.checkNotNull(mediaPeriodId);
}
if (this.currentPlayerMediaPeriod == null) {
this.currentPlayerMediaPeriod = findCurrentPlayerMediaPeriodInQueue(player, this.mediaPeriodQueue, this.playingMediaPeriod, this.period);
}
updateMediaPeriodTimelines(player.getCurrentTimeline());
}
private void updateMediaPeriodTimelines(Timeline timeline) {
ImmutableMap.Builder<MediaSource.MediaPeriodId, Timeline> builder = ImmutableMap.builder();
if (this.mediaPeriodQueue.isEmpty()) {
addTimelineForMediaPeriodId(builder, this.playingMediaPeriod, timeline);
if (!Objects.equal(this.readingMediaPeriod, this.playingMediaPeriod)) {
addTimelineForMediaPeriodId(builder, this.readingMediaPeriod, timeline);
}
if (!Objects.equal(this.currentPlayerMediaPeriod, this.playingMediaPeriod) && !Objects.equal(this.currentPlayerMediaPeriod, this.readingMediaPeriod)) {
addTimelineForMediaPeriodId(builder, this.currentPlayerMediaPeriod, timeline);
}
} else {
for (int i = 0; i < this.mediaPeriodQueue.size(); i++) {
addTimelineForMediaPeriodId(builder, this.mediaPeriodQueue.get(i), timeline);
}
if (!this.mediaPeriodQueue.contains(this.currentPlayerMediaPeriod)) {
addTimelineForMediaPeriodId(builder, this.currentPlayerMediaPeriod, timeline);
}
}
this.mediaPeriodTimelines = builder.buildOrThrow();
}
private void addTimelineForMediaPeriodId(ImmutableMap.Builder<MediaSource.MediaPeriodId, Timeline> builder, MediaSource.MediaPeriodId mediaPeriodId, Timeline timeline) {
if (mediaPeriodId == null) {
return;
}
if (timeline.getIndexOfPeriod(mediaPeriodId.periodUid) != -1) {
builder.put(mediaPeriodId, timeline);
return;
}
Timeline timeline2 = this.mediaPeriodTimelines.get(mediaPeriodId);
if (timeline2 != null) {
builder.put(mediaPeriodId, timeline2);
}
}
private static MediaSource.MediaPeriodId findCurrentPlayerMediaPeriodInQueue(Player player, ImmutableList<MediaSource.MediaPeriodId> immutableList, MediaSource.MediaPeriodId mediaPeriodId, Timeline.Period period) {
Timeline currentTimeline = player.getCurrentTimeline();
int currentPeriodIndex = player.getCurrentPeriodIndex();
Object uidOfPeriod = currentTimeline.isEmpty() ? null : currentTimeline.getUidOfPeriod(currentPeriodIndex);
int adGroupIndexAfterPositionUs = (player.isPlayingAd() || currentTimeline.isEmpty()) ? -1 : currentTimeline.getPeriod(currentPeriodIndex, period).getAdGroupIndexAfterPositionUs(Util.msToUs(player.getCurrentPosition()) - period.getPositionInWindowUs());
for (int i = 0; i < immutableList.size(); i++) {
MediaSource.MediaPeriodId mediaPeriodId2 = immutableList.get(i);
if (isMatchingMediaPeriod(mediaPeriodId2, uidOfPeriod, player.isPlayingAd(), player.getCurrentAdGroupIndex(), player.getCurrentAdIndexInAdGroup(), adGroupIndexAfterPositionUs)) {
return mediaPeriodId2;
}
}
if (immutableList.isEmpty() && mediaPeriodId != null) {
if (isMatchingMediaPeriod(mediaPeriodId, uidOfPeriod, player.isPlayingAd(), player.getCurrentAdGroupIndex(), player.getCurrentAdIndexInAdGroup(), adGroupIndexAfterPositionUs)) {
return mediaPeriodId;
}
}
return null;
}
private static boolean isMatchingMediaPeriod(MediaSource.MediaPeriodId mediaPeriodId, Object obj, boolean z, int i, int i2, int i3) {
if (mediaPeriodId.periodUid.equals(obj)) {
return (z && mediaPeriodId.adGroupIndex == i && mediaPeriodId.adIndexInAdGroup == i2) || (!z && mediaPeriodId.adGroupIndex == -1 && mediaPeriodId.nextAdGroupIndex == i3);
}
return false;
}
}
}