- Added realracing3-community.apk (71.57 MB) - Removed 32-bit support (armeabi-v7a) - Only includes arm64-v8a libraries - Decompiled source code included - Added README-community.md with analysis
204 lines
6.7 KiB
Java
204 lines
6.7 KiB
Java
package com.mbridge.msdk.playercommon.exoplayer2;
|
|
|
|
import androidx.annotation.Nullable;
|
|
import com.mbridge.msdk.playercommon.exoplayer2.decoder.DecoderInputBuffer;
|
|
import com.mbridge.msdk.playercommon.exoplayer2.drm.DrmInitData;
|
|
import com.mbridge.msdk.playercommon.exoplayer2.drm.DrmSessionManager;
|
|
import com.mbridge.msdk.playercommon.exoplayer2.source.SampleStream;
|
|
import com.mbridge.msdk.playercommon.exoplayer2.util.Assertions;
|
|
import com.mbridge.msdk.playercommon.exoplayer2.util.MediaClock;
|
|
import java.io.IOException;
|
|
|
|
/* loaded from: classes4.dex */
|
|
public abstract class BaseRenderer implements Renderer, RendererCapabilities {
|
|
private RendererConfiguration configuration;
|
|
private int index;
|
|
private boolean readEndOfStream = true;
|
|
private int state;
|
|
private SampleStream stream;
|
|
private Format[] streamFormats;
|
|
private boolean streamIsFinal;
|
|
private long streamOffsetUs;
|
|
private final int trackType;
|
|
|
|
@Override // com.mbridge.msdk.playercommon.exoplayer2.Renderer
|
|
public final RendererCapabilities getCapabilities() {
|
|
return this;
|
|
}
|
|
|
|
public final RendererConfiguration getConfiguration() {
|
|
return this.configuration;
|
|
}
|
|
|
|
public final int getIndex() {
|
|
return this.index;
|
|
}
|
|
|
|
@Override // com.mbridge.msdk.playercommon.exoplayer2.Renderer
|
|
public MediaClock getMediaClock() {
|
|
return null;
|
|
}
|
|
|
|
@Override // com.mbridge.msdk.playercommon.exoplayer2.Renderer
|
|
public final int getState() {
|
|
return this.state;
|
|
}
|
|
|
|
@Override // com.mbridge.msdk.playercommon.exoplayer2.Renderer
|
|
public final SampleStream getStream() {
|
|
return this.stream;
|
|
}
|
|
|
|
public final Format[] getStreamFormats() {
|
|
return this.streamFormats;
|
|
}
|
|
|
|
@Override // com.mbridge.msdk.playercommon.exoplayer2.Renderer, com.mbridge.msdk.playercommon.exoplayer2.RendererCapabilities
|
|
public final int getTrackType() {
|
|
return this.trackType;
|
|
}
|
|
|
|
@Override // com.mbridge.msdk.playercommon.exoplayer2.PlayerMessage.Target
|
|
public void handleMessage(int i, Object obj) throws ExoPlaybackException {
|
|
}
|
|
|
|
@Override // com.mbridge.msdk.playercommon.exoplayer2.Renderer
|
|
public final boolean hasReadStreamToEnd() {
|
|
return this.readEndOfStream;
|
|
}
|
|
|
|
@Override // com.mbridge.msdk.playercommon.exoplayer2.Renderer
|
|
public final boolean isCurrentStreamFinal() {
|
|
return this.streamIsFinal;
|
|
}
|
|
|
|
public void onDisabled() {
|
|
}
|
|
|
|
public void onEnabled(boolean z) throws ExoPlaybackException {
|
|
}
|
|
|
|
public void onPositionReset(long j, boolean z) throws ExoPlaybackException {
|
|
}
|
|
|
|
public void onStarted() throws ExoPlaybackException {
|
|
}
|
|
|
|
public void onStopped() throws ExoPlaybackException {
|
|
}
|
|
|
|
public void onStreamChanged(Format[] formatArr, long j) throws ExoPlaybackException {
|
|
}
|
|
|
|
@Override // com.mbridge.msdk.playercommon.exoplayer2.Renderer
|
|
public final void setCurrentStreamFinal() {
|
|
this.streamIsFinal = true;
|
|
}
|
|
|
|
@Override // com.mbridge.msdk.playercommon.exoplayer2.Renderer
|
|
public final void setIndex(int i) {
|
|
this.index = i;
|
|
}
|
|
|
|
@Override // com.mbridge.msdk.playercommon.exoplayer2.RendererCapabilities
|
|
public int supportsMixedMimeTypeAdaptation() throws ExoPlaybackException {
|
|
return 0;
|
|
}
|
|
|
|
public BaseRenderer(int i) {
|
|
this.trackType = i;
|
|
}
|
|
|
|
@Override // com.mbridge.msdk.playercommon.exoplayer2.Renderer
|
|
public final void enable(RendererConfiguration rendererConfiguration, Format[] formatArr, SampleStream sampleStream, long j, boolean z, long j2) throws ExoPlaybackException {
|
|
Assertions.checkState(this.state == 0);
|
|
this.configuration = rendererConfiguration;
|
|
this.state = 1;
|
|
onEnabled(z);
|
|
replaceStream(formatArr, sampleStream, j2);
|
|
onPositionReset(j, z);
|
|
}
|
|
|
|
@Override // com.mbridge.msdk.playercommon.exoplayer2.Renderer
|
|
public final void start() throws ExoPlaybackException {
|
|
Assertions.checkState(this.state == 1);
|
|
this.state = 2;
|
|
onStarted();
|
|
}
|
|
|
|
@Override // com.mbridge.msdk.playercommon.exoplayer2.Renderer
|
|
public final void replaceStream(Format[] formatArr, SampleStream sampleStream, long j) throws ExoPlaybackException {
|
|
Assertions.checkState(!this.streamIsFinal);
|
|
this.stream = sampleStream;
|
|
this.readEndOfStream = false;
|
|
this.streamFormats = formatArr;
|
|
this.streamOffsetUs = j;
|
|
onStreamChanged(formatArr, j);
|
|
}
|
|
|
|
@Override // com.mbridge.msdk.playercommon.exoplayer2.Renderer
|
|
public final void maybeThrowStreamError() throws IOException {
|
|
this.stream.maybeThrowError();
|
|
}
|
|
|
|
@Override // com.mbridge.msdk.playercommon.exoplayer2.Renderer
|
|
public final void resetPosition(long j) throws ExoPlaybackException {
|
|
this.streamIsFinal = false;
|
|
this.readEndOfStream = false;
|
|
onPositionReset(j, false);
|
|
}
|
|
|
|
@Override // com.mbridge.msdk.playercommon.exoplayer2.Renderer
|
|
public final void stop() throws ExoPlaybackException {
|
|
Assertions.checkState(this.state == 2);
|
|
this.state = 1;
|
|
onStopped();
|
|
}
|
|
|
|
@Override // com.mbridge.msdk.playercommon.exoplayer2.Renderer
|
|
public final void disable() {
|
|
Assertions.checkState(this.state == 1);
|
|
this.state = 0;
|
|
this.stream = null;
|
|
this.streamFormats = null;
|
|
this.streamIsFinal = false;
|
|
onDisabled();
|
|
}
|
|
|
|
public final int readSource(FormatHolder formatHolder, DecoderInputBuffer decoderInputBuffer, boolean z) {
|
|
int readData = this.stream.readData(formatHolder, decoderInputBuffer, z);
|
|
if (readData == -4) {
|
|
if (decoderInputBuffer.isEndOfStream()) {
|
|
this.readEndOfStream = true;
|
|
return this.streamIsFinal ? -4 : -3;
|
|
}
|
|
decoderInputBuffer.timeUs += this.streamOffsetUs;
|
|
} else if (readData == -5) {
|
|
Format format = formatHolder.format;
|
|
long j = format.subsampleOffsetUs;
|
|
if (j != Long.MAX_VALUE) {
|
|
formatHolder.format = format.copyWithSubsampleOffsetUs(j + this.streamOffsetUs);
|
|
}
|
|
}
|
|
return readData;
|
|
}
|
|
|
|
public int skipSource(long j) {
|
|
return this.stream.skipData(j - this.streamOffsetUs);
|
|
}
|
|
|
|
public final boolean isSourceReady() {
|
|
return this.readEndOfStream ? this.streamIsFinal : this.stream.isReady();
|
|
}
|
|
|
|
public static boolean supportsFormatDrm(@Nullable DrmSessionManager<?> drmSessionManager, @Nullable DrmInitData drmInitData) {
|
|
if (drmInitData == null) {
|
|
return true;
|
|
}
|
|
if (drmSessionManager == null) {
|
|
return false;
|
|
}
|
|
return drmSessionManager.canAcquireSession(drmInitData);
|
|
}
|
|
}
|