Rabbit-R1/switch port/java/sources/androidx/media3/exoplayer/NoSampleRenderer.java
2024-05-21 17:08:36 -04:00

175 lines
5.1 KiB
Java

package androidx.media3.exoplayer;
import androidx.media3.common.Format;
import androidx.media3.common.util.Assertions;
import androidx.media3.exoplayer.analytics.PlayerId;
import androidx.media3.exoplayer.source.SampleStream;
import java.io.IOException;
/* loaded from: classes2.dex */
public abstract class NoSampleRenderer implements Renderer, RendererCapabilities {
private RendererConfiguration configuration;
private int index;
private int state;
private SampleStream stream;
private boolean streamIsFinal;
@Override // androidx.media3.exoplayer.Renderer
public final RendererCapabilities getCapabilities() {
return this;
}
protected final RendererConfiguration getConfiguration() {
return this.configuration;
}
protected final int getIndex() {
return this.index;
}
@Override // androidx.media3.exoplayer.Renderer
public MediaClock getMediaClock() {
return null;
}
@Override // androidx.media3.exoplayer.Renderer
public long getReadingPositionUs() {
return Long.MIN_VALUE;
}
@Override // androidx.media3.exoplayer.Renderer
public final int getState() {
return this.state;
}
@Override // androidx.media3.exoplayer.Renderer
public final SampleStream getStream() {
return this.stream;
}
@Override // androidx.media3.exoplayer.Renderer, androidx.media3.exoplayer.RendererCapabilities
public final int getTrackType() {
return -2;
}
@Override // androidx.media3.exoplayer.PlayerMessage.Target
public void handleMessage(int i, Object obj) throws ExoPlaybackException {
}
@Override // androidx.media3.exoplayer.Renderer
public final boolean hasReadStreamToEnd() {
return true;
}
@Override // androidx.media3.exoplayer.Renderer
public final void init(int i, PlayerId playerId) {
this.index = i;
}
@Override // androidx.media3.exoplayer.Renderer
public final boolean isCurrentStreamFinal() {
return this.streamIsFinal;
}
@Override // androidx.media3.exoplayer.Renderer
public boolean isEnded() {
return true;
}
@Override // androidx.media3.exoplayer.Renderer
public boolean isReady() {
return true;
}
@Override // androidx.media3.exoplayer.Renderer
public final void maybeThrowStreamError() throws IOException {
}
protected void onDisabled() {
}
protected void onEnabled(boolean z) throws ExoPlaybackException {
}
protected void onPositionReset(long j, boolean z) throws ExoPlaybackException {
}
protected void onRendererOffsetChanged(long j) throws ExoPlaybackException {
}
protected void onReset() {
}
protected void onStarted() throws ExoPlaybackException {
}
protected void onStopped() {
}
@Override // androidx.media3.exoplayer.Renderer
public final void setCurrentStreamFinal() {
this.streamIsFinal = true;
}
@Override // androidx.media3.exoplayer.RendererCapabilities
public int supportsMixedMimeTypeAdaptation() throws ExoPlaybackException {
return 0;
}
@Override // androidx.media3.exoplayer.Renderer
public final void enable(RendererConfiguration rendererConfiguration, Format[] formatArr, SampleStream sampleStream, long j, boolean z, boolean z2, long j2, long j3) throws ExoPlaybackException {
Assertions.checkState(this.state == 0);
this.configuration = rendererConfiguration;
this.state = 1;
onEnabled(z);
replaceStream(formatArr, sampleStream, j2, j3);
onPositionReset(j, z);
}
@Override // androidx.media3.exoplayer.Renderer
public final void start() throws ExoPlaybackException {
Assertions.checkState(this.state == 1);
this.state = 2;
onStarted();
}
@Override // androidx.media3.exoplayer.Renderer
public final void replaceStream(Format[] formatArr, SampleStream sampleStream, long j, long j2) throws ExoPlaybackException {
Assertions.checkState(!this.streamIsFinal);
this.stream = sampleStream;
onRendererOffsetChanged(j2);
}
@Override // androidx.media3.exoplayer.Renderer
public final void resetPosition(long j) throws ExoPlaybackException {
this.streamIsFinal = false;
onPositionReset(j, false);
}
@Override // androidx.media3.exoplayer.Renderer
public final void stop() {
Assertions.checkState(this.state == 2);
this.state = 1;
onStopped();
}
@Override // androidx.media3.exoplayer.Renderer
public final void disable() {
Assertions.checkState(this.state == 1);
this.state = 0;
this.stream = null;
this.streamIsFinal = false;
onDisabled();
}
@Override // androidx.media3.exoplayer.Renderer
public final void reset() {
Assertions.checkState(this.state == 0);
onReset();
}
@Override // androidx.media3.exoplayer.RendererCapabilities
public int supportsFormat(Format format) throws ExoPlaybackException {
return RendererCapabilities.create(0);
}
}