Add decompiled APK source code (JADX)

- 28,932 files
- Full Java source code
- Smali files
- Resources

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This commit is contained in:
2026-02-18 14:52:23 -08:00
parent cc210a65ea
commit f9d20bb3fc
26991 changed files with 2541449 additions and 0 deletions

View File

@@ -0,0 +1,293 @@
package com.fyber.inneractive.sdk.player.exoplayer2.mediacodec;
import android.annotation.TargetApi;
import android.graphics.Point;
import android.media.MediaCodecInfo;
import android.util.Log;
import android.util.Pair;
import com.fyber.inneractive.sdk.player.exoplayer2.util.h;
import com.fyber.inneractive.sdk.player.exoplayer2.util.s;
import com.ironsource.v8;
import com.mbridge.msdk.playercommon.exoplayer2.util.MimeTypes;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
@TargetApi(16)
/* loaded from: classes2.dex */
public final class a {
public final String a;
public final boolean b;
public final boolean c;
public final String d;
public final MediaCodecInfo.CodecCapabilities e;
public a(String str, String str2, MediaCodecInfo.CodecCapabilities codecCapabilities, boolean z) {
this.a = (String) com.fyber.inneractive.sdk.player.exoplayer2.util.a.a(str);
this.d = str2;
this.e = codecCapabilities;
this.b = (z || codecCapabilities == null || !a(codecCapabilities)) ? false : true;
this.c = codecCapabilities != null && b(codecCapabilities);
}
@TargetApi(21)
public final boolean b(int i) {
MediaCodecInfo.CodecCapabilities codecCapabilities = this.e;
if (codecCapabilities == null) {
b("sampleRate.caps");
return false;
}
MediaCodecInfo.AudioCapabilities audioCapabilities = codecCapabilities.getAudioCapabilities();
if (audioCapabilities == null) {
b("sampleRate.aCaps");
return false;
}
if (audioCapabilities.isSampleRateSupported(i)) {
return true;
}
b("sampleRate.support, " + i);
return false;
}
/* JADX WARN: Failed to restore switch over string. Please report as a decompilation issue */
public final boolean a(String str) {
String a;
MediaCodecInfo.CodecProfileLevel[] codecProfileLevelArr;
Integer valueOf;
Integer valueOf2;
if (str == null || this.d == null || (a = h.a(str)) == null) {
return true;
}
if (!this.d.equals(a)) {
b("codec.mime " + str + ", " + a);
return false;
}
Pattern pattern = d.a;
String[] split = str.split("\\.");
String str2 = split[0];
str2.getClass();
int i = 2;
char c = 65535;
switch (str2.hashCode()) {
case 3006243:
if (str2.equals("avc1")) {
c = 0;
break;
}
break;
case 3006244:
if (str2.equals("avc2")) {
c = 1;
break;
}
break;
case 3199032:
if (str2.equals("hev1")) {
c = 2;
break;
}
break;
case 3214780:
if (str2.equals("hvc1")) {
c = 3;
break;
}
break;
}
Pair pair = null;
switch (c) {
case 0:
case 1:
if (split.length < 2) {
Log.w("MediaCodecUtil", "Ignoring malformed AVC codec string: ".concat(str));
break;
} else {
try {
if (split[1].length() == 6) {
valueOf = Integer.valueOf(Integer.parseInt(split[1].substring(0, 2), 16));
valueOf2 = Integer.valueOf(Integer.parseInt(split[1].substring(4), 16));
} else if (split.length >= 3) {
valueOf = Integer.valueOf(Integer.parseInt(split[1]));
valueOf2 = Integer.valueOf(Integer.parseInt(split[2]));
} else {
Log.w("MediaCodecUtil", "Ignoring malformed AVC codec string: ".concat(str));
break;
}
Integer valueOf3 = Integer.valueOf(d.c.get(valueOf.intValue()));
if (valueOf3 != null) {
Integer valueOf4 = Integer.valueOf(d.d.get(valueOf2.intValue()));
if (valueOf4 != null) {
pair = new Pair(valueOf3, valueOf4);
break;
} else {
Log.w("MediaCodecUtil", "Unknown AVC level: " + valueOf2);
break;
}
} else {
Log.w("MediaCodecUtil", "Unknown AVC profile: " + valueOf);
break;
}
} catch (NumberFormatException unused) {
Log.w("MediaCodecUtil", "Ignoring malformed AVC codec string: ".concat(str));
break;
}
}
case 2:
case 3:
if (split.length < 4) {
Log.w("MediaCodecUtil", "Ignoring malformed HEVC codec string: ".concat(str));
break;
} else {
Matcher matcher = d.a.matcher(split[1]);
if (!matcher.matches()) {
Log.w("MediaCodecUtil", "Ignoring malformed HEVC codec string: ".concat(str));
break;
} else {
String group = matcher.group(1);
if ("1".equals(group)) {
i = 1;
} else if (!"2".equals(group)) {
Log.w("MediaCodecUtil", "Unknown HEVC profile string: " + group);
break;
}
Integer num = (Integer) d.e.get(split[3]);
if (num != null) {
pair = new Pair(Integer.valueOf(i), num);
break;
} else {
Log.w("MediaCodecUtil", "Unknown HEVC level string: " + matcher.group(1));
break;
}
}
}
}
if (pair == null) {
return true;
}
MediaCodecInfo.CodecCapabilities codecCapabilities = this.e;
if (codecCapabilities == null || (codecProfileLevelArr = codecCapabilities.profileLevels) == null) {
codecProfileLevelArr = new MediaCodecInfo.CodecProfileLevel[0];
}
for (MediaCodecInfo.CodecProfileLevel codecProfileLevel : codecProfileLevelArr) {
if (codecProfileLevel.profile == ((Integer) pair.first).intValue() && codecProfileLevel.level >= ((Integer) pair.second).intValue()) {
return true;
}
}
b("codec.profileLevel, " + str + ", " + a);
return false;
}
public final void b(String str) {
StringBuilder sb = new StringBuilder("NoSupport [");
sb.append(str);
sb.append("] [");
sb.append(this.a);
sb.append(", ");
sb.append(this.d);
sb.append("] [");
sb.append(s.e);
sb.append(v8.i.e);
}
public static boolean b(MediaCodecInfo.CodecCapabilities codecCapabilities) {
return s.a >= 21 && codecCapabilities.isFeatureSupported("tunneled-playback");
}
@TargetApi(21)
public final boolean a(int i, int i2, double d) {
boolean isSizeSupported;
boolean isSizeSupported2;
MediaCodecInfo.CodecCapabilities codecCapabilities = this.e;
if (codecCapabilities == null) {
b("sizeAndRate.caps");
return false;
}
MediaCodecInfo.VideoCapabilities videoCapabilities = codecCapabilities.getVideoCapabilities();
if (videoCapabilities == null) {
b("sizeAndRate.vCaps");
return false;
}
if (d != -1.0d && d > 0.0d) {
isSizeSupported = videoCapabilities.areSizeAndRateSupported(i, i2, d);
} else {
isSizeSupported = videoCapabilities.isSizeSupported(i, i2);
}
if (isSizeSupported) {
return true;
}
if (i < i2) {
if (d != -1.0d && d > 0.0d) {
isSizeSupported2 = videoCapabilities.areSizeAndRateSupported(i2, i, d);
} else {
isSizeSupported2 = videoCapabilities.isSizeSupported(i2, i);
}
if (isSizeSupported2) {
String str = "sizeAndRate.rotated, " + i + "x" + i2 + "x" + d;
StringBuilder sb = new StringBuilder("AssumedSupport [");
sb.append(str);
sb.append("] [");
sb.append(this.a);
sb.append(", ");
sb.append(this.d);
sb.append("] [");
sb.append(s.e);
sb.append(v8.i.e);
return true;
}
}
b("sizeAndRate.support, " + i + "x" + i2 + "x" + d);
return false;
}
@TargetApi(21)
public final Point a(int i, int i2) {
MediaCodecInfo.CodecCapabilities codecCapabilities = this.e;
if (codecCapabilities == null) {
b("align.caps");
return null;
}
MediaCodecInfo.VideoCapabilities videoCapabilities = codecCapabilities.getVideoCapabilities();
if (videoCapabilities == null) {
b("align.vCaps");
return null;
}
int widthAlignment = videoCapabilities.getWidthAlignment();
int heightAlignment = videoCapabilities.getHeightAlignment();
return new Point(s.a(i, widthAlignment) * widthAlignment, s.a(i2, heightAlignment) * heightAlignment);
}
@TargetApi(21)
public final boolean a(int i) {
int i2;
MediaCodecInfo.CodecCapabilities codecCapabilities = this.e;
if (codecCapabilities == null) {
b("channelCount.caps");
return false;
}
MediaCodecInfo.AudioCapabilities audioCapabilities = codecCapabilities.getAudioCapabilities();
if (audioCapabilities == null) {
b("channelCount.aCaps");
return false;
}
String str = this.a;
String str2 = this.d;
int maxInputChannelCount = audioCapabilities.getMaxInputChannelCount();
if (maxInputChannelCount <= 1 && ((s.a < 26 || maxInputChannelCount <= 0) && !MimeTypes.AUDIO_MPEG.equals(str2) && !MimeTypes.AUDIO_AMR_NB.equals(str2) && !MimeTypes.AUDIO_AMR_WB.equals(str2) && !MimeTypes.AUDIO_AAC.equals(str2) && !MimeTypes.AUDIO_VORBIS.equals(str2) && !MimeTypes.AUDIO_OPUS.equals(str2) && !MimeTypes.AUDIO_RAW.equals(str2) && !MimeTypes.AUDIO_FLAC.equals(str2) && !MimeTypes.AUDIO_ALAW.equals(str2) && !MimeTypes.AUDIO_MLAW.equals(str2) && !MimeTypes.AUDIO_MSGSM.equals(str2))) {
if (MimeTypes.AUDIO_AC3.equals(str2)) {
i2 = 6;
} else {
i2 = MimeTypes.AUDIO_E_AC3.equals(str2) ? 16 : 30;
}
Log.w(com.mbridge.msdk.playercommon.exoplayer2.mediacodec.MediaCodecInfo.TAG, "AssumedMaxChannelAdjustment: " + str + ", [" + maxInputChannelCount + " to " + i2 + v8.i.e);
maxInputChannelCount = i2;
}
if (maxInputChannelCount >= i) {
return true;
}
b("channelCount.support, " + i);
return false;
}
public static boolean a(MediaCodecInfo.CodecCapabilities codecCapabilities) {
return s.a >= 19 && codecCapabilities.isFeatureSupported("adaptive-playback");
}
}

View File

@@ -0,0 +1,598 @@
package com.fyber.inneractive.sdk.player.exoplayer2.mediacodec;
import android.annotation.TargetApi;
import android.media.MediaCodec;
import android.media.MediaFormat;
import com.applovin.exoplayer2.common.base.Ascii;
import com.fyber.inneractive.sdk.player.exoplayer2.decoder.DecoderCounters;
import com.fyber.inneractive.sdk.player.exoplayer2.j;
import com.fyber.inneractive.sdk.player.exoplayer2.k;
import com.fyber.inneractive.sdk.player.exoplayer2.mediacodec.c;
import com.fyber.inneractive.sdk.player.exoplayer2.mediacodec.d;
import com.fyber.inneractive.sdk.player.exoplayer2.util.i;
import com.fyber.inneractive.sdk.player.exoplayer2.util.q;
import com.fyber.inneractive.sdk.player.exoplayer2.util.s;
import com.mbridge.msdk.playercommon.exoplayer2.C;
import java.nio.ByteBuffer;
import java.util.ArrayList;
@TargetApi(16)
/* loaded from: classes2.dex */
public abstract class b extends com.fyber.inneractive.sdk.player.exoplayer2.a {
public static final byte[] O;
public ByteBuffer[] A;
public long B;
public int C;
public int D;
public boolean E;
public boolean F;
public int G;
public int H;
public boolean I;
public boolean J;
public boolean K;
public boolean L;
public boolean M;
public DecoderCounters N;
public final c h;
public final com.fyber.inneractive.sdk.player.exoplayer2.decoder.b i;
public final com.fyber.inneractive.sdk.player.exoplayer2.decoder.b j;
public final k k;
public final ArrayList l;
public final MediaCodec.BufferInfo m;
public j n;
public MediaCodec o;
public boolean p;
public boolean q;
public boolean r;
public boolean s;
public boolean t;
public boolean u;
public boolean v;
public boolean w;
public boolean x;
public boolean y;
public ByteBuffer[] z;
static {
int i = s.a;
byte[] bArr = new byte[38];
for (int i2 = 0; i2 < 38; i2++) {
int i3 = i2 * 2;
bArr[i2] = (byte) (Character.digit("0000016742C00BDA259000000168CE0F13200000016588840DCE7118A0002FBF1C31C3275D78".charAt(i3 + 1), 16) + (Character.digit("0000016742C00BDA259000000168CE0F13200000016588840DCE7118A0002FBF1C31C3275D78".charAt(i3), 16) << 4));
}
O = bArr;
}
/* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
public b(int i, boolean z) {
super(i);
c.a aVar = c.a;
com.fyber.inneractive.sdk.player.exoplayer2.util.a.b(s.a >= 16);
this.h = (c) com.fyber.inneractive.sdk.player.exoplayer2.util.a.a(aVar);
this.i = new com.fyber.inneractive.sdk.player.exoplayer2.decoder.b();
this.j = com.fyber.inneractive.sdk.player.exoplayer2.decoder.b.b();
this.k = new k();
this.l = new ArrayList();
this.m = new MediaCodec.BufferInfo();
this.G = 0;
this.H = 0;
}
public com.fyber.inneractive.sdk.player.exoplayer2.mediacodec.a a(c cVar, j jVar) throws d.b {
return cVar.a(false, jVar.f);
}
public abstract void a(MediaCodec mediaCodec, MediaFormat mediaFormat) throws com.fyber.inneractive.sdk.player.exoplayer2.d;
public abstract void a(com.fyber.inneractive.sdk.player.exoplayer2.mediacodec.a aVar, MediaCodec mediaCodec, j jVar) throws d.b;
public abstract void a(String str, long j, long j2);
@Override // com.fyber.inneractive.sdk.player.exoplayer2.o
public boolean a() {
return this.L;
}
public abstract boolean a(long j, long j2, MediaCodec mediaCodec, ByteBuffer byteBuffer, int i, long j3, boolean z) throws com.fyber.inneractive.sdk.player.exoplayer2.d;
public boolean a(boolean z, j jVar, j jVar2) {
return false;
}
public abstract int b(c cVar, j jVar) throws d.b;
/* JADX WARN: Removed duplicated region for block: B:75:0x016f */
/* JADX WARN: Removed duplicated region for block: B:78:0x0177 */
/*
Code decompiled incorrectly, please refer to instructions dump.
To view partially-correct add '--show-bad-code' argument
*/
public final void r() throws com.fyber.inneractive.sdk.player.exoplayer2.d {
/*
Method dump skipped, instructions count: 445
To view this dump add '--comments-level debug' option
*/
throw new UnsupportedOperationException("Method not decompiled: com.fyber.inneractive.sdk.player.exoplayer2.mediacodec.b.r():void");
}
public void s() {
}
public void v() throws com.fyber.inneractive.sdk.player.exoplayer2.d {
}
public boolean w() {
return this.o == null && this.n != null;
}
public final void t() throws com.fyber.inneractive.sdk.player.exoplayer2.d {
if (this.H == 2) {
u();
r();
} else {
this.L = true;
v();
}
}
public static class a extends Exception {
public a(j jVar, d.b bVar, int i) {
super("Decoder init failed: [" + i + "], " + jVar, bVar);
String str = jVar.f;
a(i);
}
public static void a(int i) {
}
@TargetApi(21)
public static void a(Exception exc) {
if (exc instanceof MediaCodec.CodecException) {
((MediaCodec.CodecException) exc).getDiagnosticInfo();
}
}
public a(j jVar, Exception exc, String str) {
super("Decoder init failed: " + str + ", " + jVar, exc);
String str2 = jVar.f;
if (s.a >= 21) {
a(exc);
}
}
}
public final void u() {
if (this.o != null) {
this.B = C.TIME_UNSET;
this.C = -1;
this.D = -1;
this.E = false;
this.l.clear();
this.z = null;
this.A = null;
this.F = false;
this.I = false;
this.p = false;
this.q = false;
this.r = false;
this.s = false;
this.t = false;
this.u = false;
this.w = false;
this.x = false;
this.y = false;
this.J = false;
this.G = 0;
this.H = 0;
this.N.decoderReleaseCount++;
this.i.c = null;
try {
this.o.stop();
try {
this.o.release();
} finally {
}
} catch (Throwable th) {
try {
this.o.release();
throw th;
} finally {
}
}
}
}
public final boolean q() throws com.fyber.inneractive.sdk.player.exoplayer2.d {
MediaCodec mediaCodec = this.o;
if (mediaCodec == null || this.H == 2 || this.K) {
return false;
}
if (this.C < 0) {
int dequeueInputBuffer = mediaCodec.dequeueInputBuffer(0L);
this.C = dequeueInputBuffer;
if (dequeueInputBuffer < 0) {
return false;
}
com.fyber.inneractive.sdk.player.exoplayer2.decoder.b bVar = this.i;
bVar.c = this.z[dequeueInputBuffer];
bVar.a();
}
if (this.H == 1) {
if (!this.t) {
this.J = true;
this.o.queueInputBuffer(this.C, 0, 0, 0L, 4);
this.C = -1;
}
this.H = 2;
return false;
}
if (this.x) {
this.x = false;
ByteBuffer byteBuffer = this.i.c;
byte[] bArr = O;
byteBuffer.put(bArr);
this.o.queueInputBuffer(this.C, 0, bArr.length, 0L, 0);
this.C = -1;
this.I = true;
return true;
}
if (this.G == 1) {
for (int i = 0; i < this.n.h.size(); i++) {
this.i.c.put(this.n.h.get(i));
}
this.G = 2;
}
int position = this.i.c.position();
int a2 = a(this.k, this.i, false);
if (a2 == -3) {
return false;
}
if (a2 == -5) {
if (this.G == 2) {
this.i.a();
this.G = 1;
}
a(this.k.a);
return true;
}
if (this.i.a(4)) {
if (this.G == 2) {
this.i.a();
this.G = 1;
}
this.K = true;
if (!this.I) {
t();
return false;
}
try {
if (!this.t) {
this.J = true;
this.o.queueInputBuffer(this.C, 0, 0, 0L, 4);
this.C = -1;
}
return false;
} catch (MediaCodec.CryptoException e) {
throw new com.fyber.inneractive.sdk.player.exoplayer2.d(e);
}
}
if (this.M && !this.i.a(1)) {
this.i.a();
if (this.G == 2) {
this.G = 1;
}
return true;
}
this.M = false;
boolean a3 = this.i.a(1073741824);
if (this.q && !a3) {
ByteBuffer byteBuffer2 = this.i.c;
byte[] bArr2 = i.a;
int position2 = byteBuffer2.position();
int i2 = 0;
int i3 = 0;
while (true) {
int i4 = i2 + 1;
if (i4 < position2) {
int i5 = byteBuffer2.get(i2) & 255;
if (i3 == 3) {
if (i5 == 1 && (byteBuffer2.get(i4) & Ascii.US) == 7) {
ByteBuffer duplicate = byteBuffer2.duplicate();
duplicate.position(i2 - 3);
duplicate.limit(position2);
byteBuffer2.position(0);
byteBuffer2.put(duplicate);
break;
}
} else if (i5 == 0) {
i3++;
}
if (i5 != 0) {
i3 = 0;
}
i2 = i4;
} else {
byteBuffer2.clear();
break;
}
}
if (this.i.c.position() == 0) {
return true;
}
this.q = false;
}
try {
com.fyber.inneractive.sdk.player.exoplayer2.decoder.b bVar2 = this.i;
long j = bVar2.d;
if (bVar2.a(Integer.MIN_VALUE)) {
this.l.add(Long.valueOf(j));
}
this.i.c.flip();
s();
if (a3) {
MediaCodec.CryptoInfo cryptoInfo = this.i.b.d;
if (position != 0) {
if (cryptoInfo.numBytesOfClearData == null) {
cryptoInfo.numBytesOfClearData = new int[1];
}
int[] iArr = cryptoInfo.numBytesOfClearData;
iArr[0] = iArr[0] + position;
}
this.o.queueSecureInputBuffer(this.C, 0, cryptoInfo, j, 0);
} else {
this.o.queueInputBuffer(this.C, 0, this.i.c.limit(), j, 0);
}
this.C = -1;
this.I = true;
this.G = 0;
this.N.inputBufferCount++;
return true;
} catch (MediaCodec.CryptoException e2) {
throw new com.fyber.inneractive.sdk.player.exoplayer2.d(e2);
}
}
@Override // com.fyber.inneractive.sdk.player.exoplayer2.a
public void a(boolean z, long j) throws com.fyber.inneractive.sdk.player.exoplayer2.d {
this.K = false;
this.L = false;
if (this.o != null) {
this.B = C.TIME_UNSET;
this.C = -1;
this.D = -1;
this.M = true;
this.E = false;
this.l.clear();
this.x = false;
this.y = false;
if (this.r || (this.u && this.J)) {
u();
r();
} else if (this.H != 0) {
u();
r();
} else {
this.o.flush();
this.I = false;
}
if (!this.F || this.n == null) {
return;
}
this.G = 1;
}
}
@Override // com.fyber.inneractive.sdk.player.exoplayer2.o
public final void a(long j, long j2) throws com.fyber.inneractive.sdk.player.exoplayer2.d {
boolean a2;
boolean z;
if (this.L) {
v();
return;
}
if (this.n == null) {
this.j.a();
int a3 = a(this.k, this.j, true);
if (a3 != -5) {
if (a3 == -4) {
com.fyber.inneractive.sdk.player.exoplayer2.util.a.b(this.j.a(4));
this.K = true;
t();
return;
}
return;
}
a(this.k.a);
}
r();
if (this.o != null) {
q.a("drainAndFeed");
while (true) {
if (this.D < 0) {
if (this.v && this.J) {
try {
this.D = this.o.dequeueOutputBuffer(this.m, 0L);
} catch (IllegalStateException unused) {
t();
if (this.L) {
u();
}
}
} else {
this.D = this.o.dequeueOutputBuffer(this.m, 0L);
}
int i = this.D;
if (i >= 0) {
if (this.y) {
this.y = false;
this.o.releaseOutputBuffer(i, false);
this.D = -1;
} else {
MediaCodec.BufferInfo bufferInfo = this.m;
if ((bufferInfo.flags & 4) != 0) {
t();
this.D = -1;
break;
}
ByteBuffer byteBuffer = this.A[i];
if (byteBuffer != null) {
byteBuffer.position(bufferInfo.offset);
MediaCodec.BufferInfo bufferInfo2 = this.m;
byteBuffer.limit(bufferInfo2.offset + bufferInfo2.size);
}
long j3 = this.m.presentationTimeUs;
int size = this.l.size();
int i2 = 0;
while (true) {
if (i2 >= size) {
z = false;
break;
} else {
if (((Long) this.l.get(i2)).longValue() == j3) {
this.l.remove(i2);
z = true;
break;
}
i2++;
}
}
this.E = z;
}
} else if (i == -2) {
MediaFormat outputFormat = this.o.getOutputFormat();
if (this.s && outputFormat.getInteger("width") == 32 && outputFormat.getInteger("height") == 32) {
this.y = true;
} else {
if (this.w) {
outputFormat.setInteger("channel-count", 1);
}
a(this.o, outputFormat);
}
} else if (i == -3) {
this.A = this.o.getOutputBuffers();
} else if (this.t && (this.K || this.H == 2)) {
t();
}
}
if (this.v && this.J) {
try {
MediaCodec mediaCodec = this.o;
ByteBuffer[] byteBufferArr = this.A;
int i3 = this.D;
ByteBuffer byteBuffer2 = byteBufferArr[i3];
MediaCodec.BufferInfo bufferInfo3 = this.m;
int i4 = bufferInfo3.flags;
a2 = a(j, j2, mediaCodec, byteBuffer2, i3, bufferInfo3.presentationTimeUs, this.E);
} catch (IllegalStateException unused2) {
t();
if (this.L) {
u();
}
}
} else {
MediaCodec mediaCodec2 = this.o;
ByteBuffer[] byteBufferArr2 = this.A;
int i5 = this.D;
ByteBuffer byteBuffer3 = byteBufferArr2[i5];
MediaCodec.BufferInfo bufferInfo4 = this.m;
int i6 = bufferInfo4.flags;
a2 = a(j, j2, mediaCodec2, byteBuffer3, i5, bufferInfo4.presentationTimeUs, this.E);
}
if (!a2) {
break;
}
long j4 = this.m.presentationTimeUs;
this.D = -1;
}
while (q()) {
}
q.a();
} else {
this.d.a(j - this.e);
this.j.a();
int a4 = a(this.k, this.j, false);
if (a4 == -5) {
a(this.k.a);
} else if (a4 == -4) {
com.fyber.inneractive.sdk.player.exoplayer2.util.a.b(this.j.a(4));
this.K = true;
t();
}
}
this.N.ensureUpdated();
}
/* JADX WARN: Code restructure failed: missing block: B:20:0x004a, code lost:
if (r5.k == r0.k) goto L25;
*/
/*
Code decompiled incorrectly, please refer to instructions dump.
To view partially-correct add '--show-bad-code' argument
*/
public void a(com.fyber.inneractive.sdk.player.exoplayer2.j r5) throws com.fyber.inneractive.sdk.player.exoplayer2.d {
/*
r4 = this;
com.fyber.inneractive.sdk.player.exoplayer2.j r0 = r4.n
r4.n = r5
com.fyber.inneractive.sdk.player.exoplayer2.drm.a r5 = r5.i
if (r0 != 0) goto La
r1 = 0
goto Lc
La:
com.fyber.inneractive.sdk.player.exoplayer2.drm.a r1 = r0.i
Lc:
boolean r5 = com.fyber.inneractive.sdk.player.exoplayer2.util.s.a(r5, r1)
r1 = 1
r5 = r5 ^ r1
if (r5 == 0) goto L28
com.fyber.inneractive.sdk.player.exoplayer2.j r5 = r4.n
com.fyber.inneractive.sdk.player.exoplayer2.drm.a r5 = r5.i
if (r5 != 0) goto L1b
goto L28
L1b:
java.lang.IllegalStateException r5 = new java.lang.IllegalStateException
java.lang.String r0 = "Media requires a DrmSessionManager"
r5.<init>(r0)
com.fyber.inneractive.sdk.player.exoplayer2.d r0 = new com.fyber.inneractive.sdk.player.exoplayer2.d
r0.<init>(r5)
throw r0
L28:
android.media.MediaCodec r5 = r4.o
if (r5 == 0) goto L51
boolean r5 = r4.p
com.fyber.inneractive.sdk.player.exoplayer2.j r2 = r4.n
boolean r5 = r4.a(r5, r0, r2)
if (r5 == 0) goto L51
r4.F = r1
r4.G = r1
boolean r5 = r4.s
if (r5 == 0) goto L4d
com.fyber.inneractive.sdk.player.exoplayer2.j r5 = r4.n
int r2 = r5.j
int r3 = r0.j
if (r2 != r3) goto L4d
int r5 = r5.k
int r0 = r0.k
if (r5 != r0) goto L4d
goto L4e
L4d:
r1 = 0
L4e:
r4.x = r1
goto L5e
L51:
boolean r5 = r4.I
if (r5 == 0) goto L58
r4.H = r1
goto L5e
L58:
r4.u()
r4.r()
L5e:
return
*/
throw new UnsupportedOperationException("Method not decompiled: com.fyber.inneractive.sdk.player.exoplayer2.mediacodec.b.a(com.fyber.inneractive.sdk.player.exoplayer2.j):void");
}
}

View File

@@ -0,0 +1,17 @@
package com.fyber.inneractive.sdk.player.exoplayer2.mediacodec;
import com.fyber.inneractive.sdk.player.exoplayer2.mediacodec.d;
/* loaded from: classes2.dex */
public interface c {
public static final a a = new a();
public class a implements c {
@Override // com.fyber.inneractive.sdk.player.exoplayer2.mediacodec.c
public final com.fyber.inneractive.sdk.player.exoplayer2.mediacodec.a a(boolean z, String str) throws d.b {
return d.a(z, str);
}
}
com.fyber.inneractive.sdk.player.exoplayer2.mediacodec.a a(boolean z, String str) throws d.b;
}

View File

@@ -0,0 +1,400 @@
package com.fyber.inneractive.sdk.player.exoplayer2.mediacodec;
import android.annotation.SuppressLint;
import android.annotation.TargetApi;
import android.media.MediaCodecInfo;
import android.media.MediaCodecList;
import android.text.TextUtils;
import android.util.Log;
import android.util.SparseIntArray;
import com.fyber.inneractive.sdk.player.exoplayer2.util.s;
import java.util.ArrayList;
import java.util.Collections;
import java.util.HashMap;
import java.util.List;
import java.util.regex.Pattern;
@SuppressLint({"InlinedApi"})
@TargetApi(16)
/* loaded from: classes2.dex */
public final class d {
public static final Pattern a;
public static final HashMap<a, List<com.fyber.inneractive.sdk.player.exoplayer2.mediacodec.a>> b;
public static final SparseIntArray c;
public static final SparseIntArray d;
public static final HashMap e;
public static int f;
public static final class a {
public final String a;
public final boolean b;
public a(boolean z, String str) {
this.a = str;
this.b = z;
}
public final boolean equals(Object obj) {
if (this == obj) {
return true;
}
if (obj == null || obj.getClass() != a.class) {
return false;
}
a aVar = (a) obj;
return TextUtils.equals(this.a, aVar.a) && this.b == aVar.b;
}
public final int hashCode() {
String str = this.a;
return (((str == null ? 0 : str.hashCode()) + 31) * 31) + (this.b ? 1231 : 1237);
}
}
public static class b extends Exception {
public b(Exception exc) {
super("Failed to query underlying media codecs", exc);
}
}
public interface c {
int a();
MediaCodecInfo a(int i);
boolean a(String str, MediaCodecInfo.CodecCapabilities codecCapabilities);
boolean b();
}
/* renamed from: com.fyber.inneractive.sdk.player.exoplayer2.mediacodec.d$d, reason: collision with other inner class name */
public static final class C0095d implements c {
@Override // com.fyber.inneractive.sdk.player.exoplayer2.mediacodec.d.c
public final int a() {
return MediaCodecList.getCodecCount();
}
@Override // com.fyber.inneractive.sdk.player.exoplayer2.mediacodec.d.c
public final boolean b() {
return false;
}
@Override // com.fyber.inneractive.sdk.player.exoplayer2.mediacodec.d.c
public final MediaCodecInfo a(int i) {
return MediaCodecList.getCodecInfoAt(i);
}
@Override // com.fyber.inneractive.sdk.player.exoplayer2.mediacodec.d.c
public final boolean a(String str, MediaCodecInfo.CodecCapabilities codecCapabilities) {
return "video/avc".equals(str);
}
}
public static com.fyber.inneractive.sdk.player.exoplayer2.mediacodec.a a(boolean z, String str) throws b {
List<com.fyber.inneractive.sdk.player.exoplayer2.mediacodec.a> list;
synchronized (d.class) {
try {
a aVar = new a(z, str);
list = b.get(aVar);
if (list == null) {
int i = s.a;
ArrayList a2 = a(aVar, i >= 21 ? new e(z) : new C0095d());
if (z && a2.isEmpty() && 21 <= i && i <= 23) {
a2 = a(aVar, new C0095d());
if (!a2.isEmpty()) {
Log.w("MediaCodecUtil", "MediaCodecList API didn't list secure decoder for: " + str + ". Assuming: " + ((com.fyber.inneractive.sdk.player.exoplayer2.mediacodec.a) a2.get(0)).a);
}
}
if (i < 26) {
int i2 = 1;
if (a2.size() > 1 && "OMX.MTK.AUDIO.DECODER.RAW".equals(((com.fyber.inneractive.sdk.player.exoplayer2.mediacodec.a) a2.get(0)).a)) {
while (true) {
if (i2 >= a2.size()) {
break;
}
com.fyber.inneractive.sdk.player.exoplayer2.mediacodec.a aVar2 = (com.fyber.inneractive.sdk.player.exoplayer2.mediacodec.a) a2.get(i2);
if ("OMX.google.raw.decoder".equals(aVar2.a)) {
a2.remove(i2);
a2.add(0, aVar2);
break;
}
i2++;
}
}
}
list = Collections.unmodifiableList(a2);
b.put(aVar, list);
}
} catch (Throwable th) {
throw th;
}
}
if (list.isEmpty()) {
return null;
}
return list.get(0);
}
@TargetApi(21)
public static final class e implements c {
public final int a;
public MediaCodecInfo[] b;
public e(boolean z) {
this.a = z ? 1 : 0;
}
@Override // com.fyber.inneractive.sdk.player.exoplayer2.mediacodec.d.c
public final boolean a(String str, MediaCodecInfo.CodecCapabilities codecCapabilities) {
return codecCapabilities.isFeatureSupported("secure-playback");
}
@Override // com.fyber.inneractive.sdk.player.exoplayer2.mediacodec.d.c
public final boolean b() {
return true;
}
@Override // com.fyber.inneractive.sdk.player.exoplayer2.mediacodec.d.c
public final int a() {
if (this.b == null) {
this.b = new MediaCodecList(this.a).getCodecInfos();
}
return this.b.length;
}
@Override // com.fyber.inneractive.sdk.player.exoplayer2.mediacodec.d.c
public final MediaCodecInfo a(int i) {
if (this.b == null) {
this.b = new MediaCodecList(this.a).getCodecInfos();
}
return this.b[i];
}
}
static {
a = Pattern.compile("^\\D?(\\d+)$");
b = new HashMap<>();
f = -1;
SparseIntArray sparseIntArray = new SparseIntArray();
c = sparseIntArray;
sparseIntArray.put(66, 1);
sparseIntArray.put(77, 2);
sparseIntArray.put(88, 4);
sparseIntArray.put(100, 8);
SparseIntArray sparseIntArray2 = new SparseIntArray();
d = sparseIntArray2;
sparseIntArray2.put(10, 1);
sparseIntArray2.put(11, 4);
sparseIntArray2.put(12, 8);
sparseIntArray2.put(13, 16);
sparseIntArray2.put(20, 32);
sparseIntArray2.put(21, 64);
sparseIntArray2.put(22, 128);
sparseIntArray2.put(30, 256);
sparseIntArray2.put(31, 512);
sparseIntArray2.put(32, 1024);
sparseIntArray2.put(40, 2048);
sparseIntArray2.put(41, 4096);
sparseIntArray2.put(42, 8192);
sparseIntArray2.put(50, 16384);
sparseIntArray2.put(51, 32768);
sparseIntArray2.put(52, 65536);
HashMap hashMap = new HashMap();
e = hashMap;
hashMap.put("L30", 1);
hashMap.put("L60", 4);
hashMap.put("L63", 16);
hashMap.put("L90", 64);
hashMap.put("L93", 256);
hashMap.put("L120", 1024);
hashMap.put("L123", 4096);
hashMap.put("L150", 16384);
hashMap.put("L153", 65536);
hashMap.put("L156", 262144);
hashMap.put("L180", 1048576);
hashMap.put("L183", 4194304);
hashMap.put("L186", 16777216);
hashMap.put("H30", 2);
hashMap.put("H60", 8);
hashMap.put("H63", 32);
hashMap.put("H90", 128);
hashMap.put("H93", 512);
hashMap.put("H120", 2048);
hashMap.put("H123", 8192);
hashMap.put("H150", 32768);
hashMap.put("H153", 131072);
hashMap.put("H156", 524288);
hashMap.put("H180", 2097152);
hashMap.put("H183", 8388608);
hashMap.put("H186", 33554432);
}
public static int a() throws b {
MediaCodecInfo.CodecProfileLevel[] codecProfileLevelArr;
int i;
if (f == -1) {
int i2 = 0;
com.fyber.inneractive.sdk.player.exoplayer2.mediacodec.a a2 = a(false, "video/avc");
if (a2 != null) {
MediaCodecInfo.CodecCapabilities codecCapabilities = a2.e;
if (codecCapabilities == null || (codecProfileLevelArr = codecCapabilities.profileLevels) == null) {
codecProfileLevelArr = new MediaCodecInfo.CodecProfileLevel[0];
}
int length = codecProfileLevelArr.length;
int i3 = 0;
while (i2 < length) {
int i4 = codecProfileLevelArr[i2].level;
if (i4 != 1 && i4 != 2) {
switch (i4) {
case 8:
case 16:
case 32:
i = 101376;
break;
case 64:
i = 202752;
break;
case 128:
case 256:
i = 414720;
break;
case 512:
i = 921600;
break;
case 1024:
i = 1310720;
break;
case 2048:
case 4096:
i = 2097152;
break;
case 8192:
i = 2228224;
break;
case 16384:
i = 5652480;
break;
case 32768:
case 65536:
i = 9437184;
break;
default:
i = -1;
break;
}
} else {
i = 25344;
}
i3 = Math.max(i, i3);
i2++;
}
i2 = Math.max(i3, s.a >= 21 ? 345600 : 172800);
}
f = i2;
}
return f;
}
public static ArrayList a(a aVar, c cVar) throws b {
boolean z;
c cVar2 = cVar;
try {
ArrayList arrayList = new ArrayList();
String str = aVar.a;
int a2 = cVar.a();
boolean b2 = cVar.b();
int i = 0;
while (i < a2) {
MediaCodecInfo a3 = cVar2.a(i);
String name = a3.getName();
if (a(a3, name, b2)) {
String[] supportedTypes = a3.getSupportedTypes();
int length = supportedTypes.length;
int i2 = 0;
while (i2 < length) {
String str2 = supportedTypes[i2];
if (str2.equalsIgnoreCase(str)) {
try {
MediaCodecInfo.CodecCapabilities capabilitiesForType = a3.getCapabilitiesForType(str2);
boolean a4 = cVar2.a(str, capabilitiesForType);
if (s.a <= 22) {
String str3 = s.d;
if (!str3.equals("ODROID-XU3")) {
if (str3.equals("Nexus 10")) {
}
}
if ("OMX.Exynos.AVC.Decoder".equals(name) || "OMX.Exynos.AVC.Decoder.secure".equals(name)) {
z = true;
if ((!b2 && aVar.b == a4) || (!b2 && !aVar.b)) {
arrayList.add(new com.fyber.inneractive.sdk.player.exoplayer2.mediacodec.a(name, str, capabilitiesForType, z));
} else if (!b2 && a4) {
arrayList.add(new com.fyber.inneractive.sdk.player.exoplayer2.mediacodec.a(name + ".secure", str, capabilitiesForType, z));
return arrayList;
}
}
}
z = false;
if (!b2) {
}
if (!b2) {
arrayList.add(new com.fyber.inneractive.sdk.player.exoplayer2.mediacodec.a(name + ".secure", str, capabilitiesForType, z));
return arrayList;
}
continue;
} catch (Exception e2) {
if (s.a <= 23 && !arrayList.isEmpty()) {
Log.e("MediaCodecUtil", "Skipping codec " + name + " (failed to query capabilities)");
} else {
Log.e("MediaCodecUtil", "Failed to query codec " + name + " (" + str2 + ")");
throw e2;
}
}
}
i2++;
cVar2 = cVar;
}
}
i++;
cVar2 = cVar;
}
return arrayList;
} catch (Exception e3) {
throw new b(e3);
}
}
public static boolean a(MediaCodecInfo mediaCodecInfo, String str, boolean z) {
if (mediaCodecInfo.isEncoder() || (!z && str.endsWith(".secure"))) {
return false;
}
int i = s.a;
if (i < 21 && ("CIPAACDecoder".equals(str) || "CIPMP3Decoder".equals(str) || "CIPVorbisDecoder".equals(str) || "CIPAMRNBDecoder".equals(str) || "AACDecoder".equals(str) || "MP3Decoder".equals(str))) {
return false;
}
if (i < 18 && "OMX.SEC.MP3.Decoder".equals(str)) {
return false;
}
if (i < 18 && "OMX.MTK.AUDIO.DECODER.AAC".equals(str) && "a70".equals(s.b)) {
return false;
}
if (i == 16 && "OMX.qcom.audio.decoder.mp3".equals(str)) {
String str2 = s.b;
if ("dlxu".equals(str2) || "protou".equals(str2) || "ville".equals(str2) || "villeplus".equals(str2) || "villec2".equals(str2) || str2.startsWith("gee") || "C6602".equals(str2) || "C6603".equals(str2) || "C6606".equals(str2) || "C6616".equals(str2) || "L36h".equals(str2) || "SO-02E".equals(str2)) {
return false;
}
}
if (i == 16 && "OMX.qcom.audio.decoder.aac".equals(str)) {
String str3 = s.b;
if ("C1504".equals(str3) || "C1505".equals(str3) || "C1604".equals(str3) || "C1605".equals(str3)) {
return false;
}
}
if (i <= 19 && "OMX.SEC.vp8.dec".equals(str) && "samsung".equals(s.c)) {
String str4 = s.b;
if (str4.startsWith("d2") || str4.startsWith("serrano") || str4.startsWith("jflte") || str4.startsWith("santos") || str4.startsWith("t0")) {
return false;
}
}
return (i <= 19 && s.b.startsWith("jflte") && "OMX.qcom.video.decoder.vp8".equals(str)) ? false : true;
}
}