- 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
207 lines
6.2 KiB
Java
207 lines
6.2 KiB
Java
package com.applovin.impl;
|
|
|
|
import android.media.MediaCodec;
|
|
import android.media.MediaFormat;
|
|
import android.os.Bundle;
|
|
import android.os.Handler;
|
|
import android.view.Surface;
|
|
import com.applovin.impl.hd;
|
|
import java.io.IOException;
|
|
import java.nio.ByteBuffer;
|
|
|
|
/* loaded from: classes.dex */
|
|
public class ul implements hd {
|
|
private final MediaCodec a;
|
|
private final Surface b;
|
|
private ByteBuffer[] c;
|
|
private ByteBuffer[] d;
|
|
|
|
@Override // com.applovin.impl.hd
|
|
public boolean c() {
|
|
return false;
|
|
}
|
|
|
|
public static class c implements hd.b {
|
|
/* JADX WARN: Multi-variable type inference failed */
|
|
/* JADX WARN: Type inference failed for: r0v0, types: [com.applovin.impl.ul$a] */
|
|
/* JADX WARN: Type inference failed for: r0v1, types: [android.view.Surface] */
|
|
/* JADX WARN: Type inference failed for: r0v3 */
|
|
/* JADX WARN: Type inference failed for: r0v4 */
|
|
/* JADX WARN: Type inference failed for: r0v5 */
|
|
@Override // com.applovin.impl.hd.b
|
|
public hd a(hd.a aVar) {
|
|
MediaCodec mediaCodec;
|
|
Surface surface;
|
|
?? r0 = 0;
|
|
r0 = 0;
|
|
r0 = 0;
|
|
try {
|
|
mediaCodec = b(aVar);
|
|
try {
|
|
ko.a("configureCodec");
|
|
mediaCodec.configure(aVar.b, aVar.d, aVar.e, aVar.f);
|
|
ko.a();
|
|
if (!aVar.g) {
|
|
surface = null;
|
|
} else if (xp.a >= 18) {
|
|
surface = b.a(mediaCodec);
|
|
} else {
|
|
throw new IllegalStateException("Encoding from a surface is only supported on API 18 and up.");
|
|
}
|
|
} catch (IOException e) {
|
|
e = e;
|
|
} catch (RuntimeException e2) {
|
|
e = e2;
|
|
}
|
|
try {
|
|
ko.a("startCodec");
|
|
mediaCodec.start();
|
|
ko.a();
|
|
return new ul(mediaCodec, surface);
|
|
} catch (IOException | RuntimeException e3) {
|
|
r0 = surface;
|
|
e = e3;
|
|
if (r0 != 0) {
|
|
r0.release();
|
|
}
|
|
if (mediaCodec != null) {
|
|
mediaCodec.release();
|
|
}
|
|
throw e;
|
|
}
|
|
} catch (IOException | RuntimeException e4) {
|
|
e = e4;
|
|
mediaCodec = null;
|
|
}
|
|
}
|
|
|
|
public MediaCodec b(hd.a aVar) {
|
|
b1.a(aVar.a);
|
|
String str = aVar.a.a;
|
|
ko.a("createCodec:" + str);
|
|
MediaCodec createByCodecName = MediaCodec.createByCodecName(str);
|
|
ko.a();
|
|
return createByCodecName;
|
|
}
|
|
}
|
|
|
|
private ul(MediaCodec mediaCodec, Surface surface) {
|
|
this.a = mediaCodec;
|
|
this.b = surface;
|
|
if (xp.a < 21) {
|
|
this.c = mediaCodec.getInputBuffers();
|
|
this.d = mediaCodec.getOutputBuffers();
|
|
}
|
|
}
|
|
|
|
@Override // com.applovin.impl.hd
|
|
public int d() {
|
|
return this.a.dequeueInputBuffer(0L);
|
|
}
|
|
|
|
@Override // com.applovin.impl.hd
|
|
public int a(MediaCodec.BufferInfo bufferInfo) {
|
|
int dequeueOutputBuffer;
|
|
do {
|
|
dequeueOutputBuffer = this.a.dequeueOutputBuffer(bufferInfo, 0L);
|
|
if (dequeueOutputBuffer == -3 && xp.a < 21) {
|
|
this.d = this.a.getOutputBuffers();
|
|
}
|
|
} while (dequeueOutputBuffer == -3);
|
|
return dequeueOutputBuffer;
|
|
}
|
|
|
|
@Override // com.applovin.impl.hd
|
|
public MediaFormat e() {
|
|
return this.a.getOutputFormat();
|
|
}
|
|
|
|
@Override // com.applovin.impl.hd
|
|
public void b() {
|
|
this.a.flush();
|
|
}
|
|
|
|
@Override // com.applovin.impl.hd
|
|
public ByteBuffer b(int i) {
|
|
if (xp.a >= 21) {
|
|
return this.a.getOutputBuffer(i);
|
|
}
|
|
return ((ByteBuffer[]) xp.a((Object) this.d))[i];
|
|
}
|
|
|
|
@Override // com.applovin.impl.hd
|
|
public void c(int i) {
|
|
this.a.setVideoScalingMode(i);
|
|
}
|
|
|
|
public static final class b {
|
|
public static Surface a(MediaCodec mediaCodec) {
|
|
return mediaCodec.createInputSurface();
|
|
}
|
|
}
|
|
|
|
/* JADX INFO: Access modifiers changed from: private */
|
|
public /* synthetic */ void a(hd.c cVar, MediaCodec mediaCodec, long j, long j2) {
|
|
cVar.a(this, j, j2);
|
|
}
|
|
|
|
@Override // com.applovin.impl.hd
|
|
public void a(int i, int i2, int i3, long j, int i4) {
|
|
this.a.queueInputBuffer(i, i2, i3, j, i4);
|
|
}
|
|
|
|
@Override // com.applovin.impl.hd
|
|
public void a(int i, int i2, a5 a5Var, long j, int i3) {
|
|
this.a.queueSecureInputBuffer(i, i2, a5Var.a(), j, i3);
|
|
}
|
|
|
|
@Override // com.applovin.impl.hd
|
|
public void a() {
|
|
this.c = null;
|
|
this.d = null;
|
|
Surface surface = this.b;
|
|
if (surface != null) {
|
|
surface.release();
|
|
}
|
|
this.a.release();
|
|
}
|
|
|
|
@Override // com.applovin.impl.hd
|
|
public void a(int i, long j) {
|
|
this.a.releaseOutputBuffer(i, j);
|
|
}
|
|
|
|
@Override // com.applovin.impl.hd
|
|
public void a(int i, boolean z) {
|
|
this.a.releaseOutputBuffer(i, z);
|
|
}
|
|
|
|
@Override // com.applovin.impl.hd
|
|
public void a(final hd.c cVar, Handler handler) {
|
|
this.a.setOnFrameRenderedListener(new MediaCodec.OnFrameRenderedListener() { // from class: com.applovin.impl.ul$$ExternalSyntheticLambda0
|
|
@Override // android.media.MediaCodec.OnFrameRenderedListener
|
|
public final void onFrameRendered(MediaCodec mediaCodec, long j, long j2) {
|
|
ul.this.a(cVar, mediaCodec, j, j2);
|
|
}
|
|
}, handler);
|
|
}
|
|
|
|
@Override // com.applovin.impl.hd
|
|
public void a(Surface surface) {
|
|
this.a.setOutputSurface(surface);
|
|
}
|
|
|
|
@Override // com.applovin.impl.hd
|
|
public void a(Bundle bundle) {
|
|
this.a.setParameters(bundle);
|
|
}
|
|
|
|
@Override // com.applovin.impl.hd
|
|
public ByteBuffer a(int i) {
|
|
if (xp.a >= 21) {
|
|
return this.a.getInputBuffer(i);
|
|
}
|
|
return ((ByteBuffer[]) xp.a((Object) this.c))[i];
|
|
}
|
|
}
|