ZStore v1.7版本的 MD5 值为:ca9bb200afd8d690876bd39318f8215c
以下内容为反编译后的 aw.java 源代码,内容仅作参考
package com.applovin.exoplayer2;
import android.content.Context;
import android.graphics.Rect;
import android.graphics.SurfaceTexture;
import android.media.AudioTrack;
import android.media.MediaFormat;
import android.os.Handler;
import android.os.Looper;
import android.view.Surface;
import android.view.SurfaceHolder;
import android.view.SurfaceView;
import android.view.TextureView;
import androidx.annotation.Nullable;
import androidx.core.view.PointerIconCompat;
import com.applovin.exoplayer2.an;
import com.applovin.exoplayer2.ao;
import com.applovin.exoplayer2.ay;
import com.applovin.exoplayer2.b;
import com.applovin.exoplayer2.c;
import com.applovin.exoplayer2.k;
import com.applovin.exoplayer2.m.a.i;
import com.applovin.exoplayer2.q;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Iterator;
import java.util.List;
import java.util.concurrent.CopyOnWriteArraySet;
import java.util.concurrent.TimeoutException;
public class aw extends d implements q {
private int A;
private int B;
@Nullable
private com.applovin.exoplayer2.c.e C;
@Nullable
private com.applovin.exoplayer2.c.e D;
private int E;
private com.applovin.exoplayer2.b.d F;
private float G;
private boolean H;
private List<com.applovin.exoplayer2.i.a> I;
private boolean J;
private boolean K;
@Nullable
private com.applovin.exoplayer2.l.aa L;
private boolean M;
private boolean N;
private o O;
private com.applovin.exoplayer2.m.o P;
protected final ar[] b;
private final com.applovin.exoplayer2.l.g c = new com.applovin.exoplayer2.l.g();
private final Context d;
private final r e;
private final b f;
private final c g;
private final CopyOnWriteArraySet<an.d> h;
private final com.applovin.exoplayer2.a.a i;
private final com.applovin.exoplayer2.b j;
private final com.applovin.exoplayer2.c k;
private final ay l;
private final bb m;
private final bc n;
private final long o;
@Nullable
private v p;
@Nullable
private v q;
@Nullable
private AudioTrack r;
@Nullable
private Object s;
@Nullable
private Surface t;
@Nullable
private SurfaceHolder u;
@Nullable
private com.applovin.exoplayer2.m.a.i v;
private boolean w;
@Nullable
private TextureView x;
private int y;
private int z;
@Deprecated
public static final class a {
private boolean A;
private final Context a;
private final au b;
private com.applovin.exoplayer2.l.d c;
private long d;
private com.applovin.exoplayer2.j.j e;
private com.applovin.exoplayer2.h.r f;
private aa g;
private com.applovin.exoplayer2.k.d h;
private com.applovin.exoplayer2.a.a i;
private Looper j;
@Nullable
private com.applovin.exoplayer2.l.aa k;
private com.applovin.exoplayer2.b.d l;
private boolean m;
private int n;
private boolean o;
private boolean p;
private int q;
private int r;
private boolean s;
private av t;
private long u;
private long v;
private z w;
private long x;
private long y;
private boolean z;
@Deprecated
public a(Context context) {
this(context, new n(context), new com.applovin.exoplayer2.e.f());
}
@Deprecated
public a(Context context, au auVar, com.applovin.exoplayer2.e.l lVar) {
this(context, auVar, new com.applovin.exoplayer2.j.c(context), new com.applovin.exoplayer2.h.f(context, lVar), new l(), com.applovin.exoplayer2.k.n.a(context), new com.applovin.exoplayer2.a.a(com.applovin.exoplayer2.l.d.a));
}
@Deprecated
public a(Context context, au auVar, com.applovin.exoplayer2.j.j jVar, com.applovin.exoplayer2.h.r rVar, aa aaVar, com.applovin.exoplayer2.k.d dVar, com.applovin.exoplayer2.a.a aVar) {
this.a = context;
this.b = auVar;
this.e = jVar;
this.f = rVar;
this.g = aaVar;
this.h = dVar;
this.i = aVar;
this.j = com.applovin.exoplayer2.l.ai.c();
this.l = com.applovin.exoplayer2.b.d.a;
this.n = 0;
this.q = 1;
this.r = 0;
this.s = true;
this.t = av.e;
this.u = 5000L;
this.v = 15000L;
this.w = new k.a().a();
this.c = com.applovin.exoplayer2.l.d.a;
this.x = 500L;
this.y = 2000L;
}
@Deprecated
public aw a() {
com.applovin.exoplayer2.l.a.b(!this.A);
this.A = true;
return new aw(this);
}
}
protected aw(a aVar) {
try {
this.d = aVar.a.getApplicationContext();
this.i = aVar.i;
this.L = aVar.k;
this.F = aVar.l;
this.y = aVar.q;
this.z = aVar.r;
this.H = aVar.p;
this.o = aVar.y;
this.f = new b();
this.g = new c();
this.h = new CopyOnWriteArraySet<>();
Handler handler = new Handler(aVar.j);
this.b = aVar.b.a(handler, this.f, this.f, this.f, this.f);
this.G = 1.0f;
if (com.applovin.exoplayer2.l.ai.a < 21) {
this.E = d(0);
} else {
this.E = h.a(this.d);
}
this.I = Collections.emptyList();
this.J = true;
this.e = new r(this.b, aVar.e, aVar.f, aVar.g, aVar.h, this.i, aVar.s, aVar.t, aVar.u, aVar.v, aVar.w, aVar.x, aVar.z, aVar.c, aVar.j, this, new an.a.C0007a().a(20, 21, 22, 23, 24, 25, 26, 27).a());
this.e.a((an.b) this.f);
this.e.a((q.a) this.f);
if (aVar.d > 0) {
this.e.b(aVar.d);
}
this.j = new com.applovin.exoplayer2.b(aVar.a, handler, this.f);
this.j.a(aVar.o);
this.k = new com.applovin.exoplayer2.c(aVar.a, handler, this.f);
this.k.a(aVar.m ? this.F : null);
this.l = new ay(aVar.a, handler, this.f);
this.l.a(com.applovin.exoplayer2.l.ai.g(this.F.d));
this.m = new bb(aVar.a);
this.m.a(aVar.n != 0);
this.n = new bc(aVar.a);
this.n.a(aVar.n == 2);
this.O = b(this.l);
this.P = com.applovin.exoplayer2.m.o.a;
a(1, 10, Integer.valueOf(this.E));
a(2, 10, Integer.valueOf(this.E));
a(1, 3, this.F);
a(2, 4, Integer.valueOf(this.y));
a(2, 5, Integer.valueOf(this.z));
a(1, 9, Boolean.valueOf(this.H));
a(2, 7, this.g);
a(6, 8, this.g);
} finally {
this.c.a();
}
}
public boolean q() {
Z();
return this.e.q();
}
@Override
public com.applovin.exoplayer2.m.o T() {
return this.P;
}
public void v() {
Z();
U();
a((Object) null);
a(0, 0);
}
public void a(@Nullable SurfaceHolder surfaceHolder) {
Z();
if (surfaceHolder == null) {
v();
return;
}
U();
this.w = true;
this.u = surfaceHolder;
surfaceHolder.addCallback(this.f);
Surface surface = surfaceHolder.getSurface();
if (surface != null && surface.isValid()) {
a(surface);
Rect surfaceFrame = surfaceHolder.getSurfaceFrame();
a(surfaceFrame.width(), surfaceFrame.height());
} else {
a((Object) null);
a(0, 0);
}
}
public void b(@Nullable SurfaceHolder surfaceHolder) {
Z();
if (surfaceHolder != null && surfaceHolder == this.u) {
v();
}
}
@Override
public void a(@Nullable SurfaceView surfaceView) {
Z();
if (surfaceView instanceof com.applovin.exoplayer2.m.k) {
U();
a((Object) surfaceView);
c(surfaceView.getHolder());
} else {
if (surfaceView instanceof com.applovin.exoplayer2.m.a.i) {
U();
this.v = (com.applovin.exoplayer2.m.a.i) surfaceView;
this.e.a(this.g).a(10000).a(this.v).i();
this.v.a(this.f);
a(this.v.getVideoSurface());
c(surfaceView.getHolder());
return;
}
a(surfaceView == null ? null : surfaceView.getHolder());
}
}
@Override
public void b(@Nullable SurfaceView surfaceView) {
Z();
b(surfaceView == null ? null : surfaceView.getHolder());
}
@Override
public void a(@Nullable TextureView textureView) {
Z();
if (textureView == null) {
v();
return;
}
U();
this.x = textureView;
if (textureView.getSurfaceTextureListener() != null) {
com.applovin.exoplayer2.l.q.c("SimpleExoPlayer", "Replacing existing SurfaceTextureListener.");
}
textureView.setSurfaceTextureListener(this.f);
SurfaceTexture surfaceTexture = textureView.isAvailable() ? textureView.getSurfaceTexture() : null;
if (surfaceTexture == null) {
a((Object) null);
a(0, 0);
} else {
a(surfaceTexture);
a(textureView.getWidth(), textureView.getHeight());
}
}
@Override
public void b(@Nullable TextureView textureView) {
Z();
if (textureView != null && textureView == this.x) {
v();
}
}
public void a(float f) {
Z();
float a2 = com.applovin.exoplayer2.l.ai.a(f, 0.0f, 1.0f);
if (this.G != a2) {
this.G = a2;
W();
this.i.a(a2);
Iterator<an.d> it = this.h.iterator();
while (it.hasNext()) {
it.next().a(a2);
}
}
}
@Override
public List<com.applovin.exoplayer2.i.a> V() {
Z();
return this.I;
}
@Override
public Looper r() {
return this.e.r();
}
@Override
public void a(an.d dVar) {
com.applovin.exoplayer2.l.a.b(dVar);
this.h.add(dVar);
a((an.b) dVar);
}
@Deprecated
public void a(an.b bVar) {
com.applovin.exoplayer2.l.a.b(bVar);
this.e.a(bVar);
}
@Override
public void b(an.d dVar) {
com.applovin.exoplayer2.l.a.b(dVar);
this.h.remove(dVar);
b((an.b) dVar);
}
@Deprecated
public void b(an.b bVar) {
this.e.b(bVar);
}
@Override
public int t() {
Z();
return this.e.t();
}
@Override
public int u() {
Z();
return this.e.u();
}
@Override
@Nullable
public p e() {
Z();
return this.e.e();
}
@Override
public an.a s() {
Z();
return this.e.s();
}
@Override
public void w() {
Z();
boolean x = x();
int a2 = this.k.a(x, 2);
a(x, a2, b(x, a2));
this.e.w();
}
public void a(com.applovin.exoplayer2.h.p pVar) {
Z();
this.e.a(pVar);
}
@Override
public void a(boolean z) {
Z();
int a2 = this.k.a(z, t());
a(z, a2, b(z, a2));
}
@Override
public boolean x() {
Z();
return this.e.x();
}
@Override
public int y() {
Z();
return this.e.y();
}
@Override
public void c(int i) {
Z();
this.e.c(i);
}
@Override
public void b(boolean z) {
Z();
this.e.b(z);
}
@Override
public boolean z() {
Z();
return this.e.z();
}
@Override
public void a(int i, long j) {
Z();
this.i.d();
this.e.a(i, j);
}
@Override
public long A() {
Z();
return this.e.A();
}
@Override
public long B() {
Z();
return this.e.B();
}
@Override
public long C() {
Z();
return this.e.C();
}
@Override
public am D() {
Z();
return this.e.D();
}
public void E() {
Z();
if (com.applovin.exoplayer2.l.ai.a < 21 && this.r != null) {
this.r.release();
this.r = null;
}
this.j.a(false);
this.l.c();
this.m.b(false);
this.n.b(false);
this.k.b();
this.e.E();
this.i.c();
U();
if (this.t != null) {
this.t.release();
this.t = null;
}
if (this.M) {
((com.applovin.exoplayer2.l.aa) com.applovin.exoplayer2.l.a.b(this.L)).b(0);
this.M = false;
}
this.I = Collections.emptyList();
this.N = true;
}
@Override
public com.applovin.exoplayer2.h.ad P() {
Z();
return this.e.P();
}
@Override
public com.applovin.exoplayer2.j.h Q() {
Z();
return this.e.Q();
}
@Override
public ac R() {
return this.e.R();
}
@Override
public ba S() {
Z();
return this.e.S();
}
@Override
public int F() {
Z();
return this.e.F();
}
@Override
public int G() {
Z();
return this.e.G();
}
@Override
public long H() {
Z();
return this.e.H();
}
@Override
public long I() {
Z();
return this.e.I();
}
@Override
public long J() {
Z();
return this.e.J();
}
@Override
public boolean K() {
Z();
return this.e.K();
}
@Override
public int L() {
Z();
return this.e.L();
}
@Override
public int M() {
Z();
return this.e.M();
}
@Override
public long N() {
Z();
return this.e.N();
}
@Override
public long O() {
Z();
return this.e.O();
}
private void U() {
if (this.v != null) {
this.e.a(this.g).a(10000).a((Object) null).i();
this.v.b(this.f);
this.v = null;
}
if (this.x != null) {
if (this.x.getSurfaceTextureListener() != this.f) {
com.applovin.exoplayer2.l.q.c("SimpleExoPlayer", "SurfaceTextureListener already unset or replaced.");
} else {
this.x.setSurfaceTextureListener(null);
}
this.x = null;
}
if (this.u != null) {
this.u.removeCallback(this.f);
this.u = null;
}
}
public void a(SurfaceTexture surfaceTexture) {
Surface surface = new Surface(surfaceTexture);
a(surface);
this.t = surface;
}
public void a(@Nullable Object obj) {
boolean z;
ArrayList arrayList = new ArrayList();
for (ar arVar : this.b) {
if (arVar.a() == 2) {
arrayList.add(this.e.a(arVar).a(1).a(obj).i());
}
}
if (this.s == null || this.s == obj) {
z = false;
} else {
try {
Iterator it = arrayList.iterator();
while (it.hasNext()) {
((ao) it.next()).a(this.o);
}
z = false;
} catch (InterruptedException e) {
Thread.currentThread().interrupt();
z = false;
} catch (TimeoutException e2) {
z = true;
}
if (this.s == this.t) {
this.t.release();
this.t = null;
}
}
this.s = obj;
if (z) {
this.e.a(false, p.a(new u(3), PointerIconCompat.TYPE_HELP));
}
}
private void c(SurfaceHolder surfaceHolder) {
this.w = false;
this.u = surfaceHolder;
this.u.addCallback(this.f);
Surface surface = this.u.getSurface();
if (surface != null && surface.isValid()) {
Rect surfaceFrame = this.u.getSurfaceFrame();
a(surfaceFrame.width(), surfaceFrame.height());
} else {
a(0, 0);
}
}
public void a(int i, int i2) {
if (i != this.A || i2 != this.B) {
this.A = i;
this.B = i2;
this.i.a(i, i2);
Iterator<an.d> it = this.h.iterator();
while (it.hasNext()) {
it.next().a(i, i2);
}
}
}
public void W() {
a(1, 2, Float.valueOf(this.G * this.k.a()));
}
public void X() {
this.i.a_(this.H);
Iterator<an.d> it = this.h.iterator();
while (it.hasNext()) {
it.next().a_(this.H);
}
}
public void a(boolean z, int i, int i2) {
boolean z2 = z && i != -1;
this.e.a(z2, (!z2 || i == 1) ? 0 : 1, i2);
}
public void Y() {
boolean z = false;
switch (t()) {
case 1:
case 4:
this.m.b(false);
this.n.b(false);
return;
case 2:
case 3:
boolean q = q();
bb bbVar = this.m;
if (x() && !q) {
z = true;
}
bbVar.b(z);
this.n.b(x());
return;
default:
throw new IllegalStateException();
}
}
private void Z() {
this.c.d();
if (Thread.currentThread() != r().getThread()) {
String a2 = com.applovin.exoplayer2.l.ai.a("Player is accessed on the wrong thread.\nCurrent thread: '%s'\nExpected thread: '%s'\nSee https://exoplayer.dev/issues/player-accessed-on-wrong-thread", Thread.currentThread().getName(), r().getThread().getName());
if (this.J) {
throw new IllegalStateException(a2);
}
com.applovin.exoplayer2.l.q.b("SimpleExoPlayer", a2, this.K ? null : new IllegalStateException());
this.K = true;
}
}
private void a(int i, int i2, @Nullable Object obj) {
for (ar arVar : this.b) {
if (arVar.a() == i) {
this.e.a(arVar).a(i2).a(obj).i();
}
}
}
private int d(int i) {
if (this.r != null && this.r.getAudioSessionId() != i) {
this.r.release();
this.r = null;
}
if (this.r == null) {
this.r = new AudioTrack(3, 4000, 4, 2, 2, 0, i);
}
return this.r.getAudioSessionId();
}
public static o b(ay ayVar) {
return new o(0, ayVar.a(), ayVar.b());
}
public static int b(boolean z, int i) {
return (!z || i == 1) ? 1 : 2;
}
public final class b implements SurfaceHolder.Callback, TextureView.SurfaceTextureListener, an.b, ay.a, b.InterfaceC0009b, com.applovin.exoplayer2.b.g, c.b, com.applovin.exoplayer2.g.e, com.applovin.exoplayer2.i.l, i.a, com.applovin.exoplayer2.m.n, q.a {
private b() {
}
@Override
public void a(com.applovin.exoplayer2.c.e eVar) {
aw.this.C = eVar;
aw.this.i.a(eVar);
}
@Override
public void a(String str, long j, long j2) {
aw.this.i.a(str, j, j2);
}
@Override
public void a(v vVar, @Nullable com.applovin.exoplayer2.c.h hVar) {
aw.this.p = vVar;
aw.this.i.a(vVar, hVar);
}
@Override
public void a(int i, long j) {
aw.this.i.a(i, j);
}
@Override
public void a(com.applovin.exoplayer2.m.o oVar) {
aw.this.P = oVar;
aw.this.i.a(oVar);
Iterator it = aw.this.h.iterator();
while (it.hasNext()) {
((an.d) it.next()).a(oVar);
}
}
@Override
public void a(Object obj, long j) {
aw.this.i.a(obj, j);
if (aw.this.s == obj) {
Iterator it = aw.this.h.iterator();
while (it.hasNext()) {
((an.d) it.next()).a();
}
}
}
@Override
public void a(String str) {
aw.this.i.a(str);
}
@Override
public void b(com.applovin.exoplayer2.c.e eVar) {
aw.this.i.b(eVar);
aw.this.p = null;
aw.this.C = null;
}
@Override
public void a(long j, int i) {
aw.this.i.a(j, i);
}
@Override
public void a(Exception exc) {
aw.this.i.a(exc);
}
@Override
public void c(com.applovin.exoplayer2.c.e eVar) {
aw.this.D = eVar;
aw.this.i.c(eVar);
}
@Override
public void b(String str, long j, long j2) {
aw.this.i.b(str, j, j2);
}
@Override
public void b(v vVar, @Nullable com.applovin.exoplayer2.c.h hVar) {
aw.this.q = vVar;
aw.this.i.b(vVar, hVar);
}
@Override
public void a(long j) {
aw.this.i.a(j);
}
@Override
public void a(int i, long j, long j2) {
aw.this.i.a(i, j, j2);
}
@Override
public void b(String str) {
aw.this.i.b(str);
}
@Override
public void d(com.applovin.exoplayer2.c.e eVar) {
aw.this.i.d(eVar);
aw.this.q = null;
aw.this.D = null;
}
@Override
public void a_(boolean z) {
if (aw.this.H != z) {
aw.this.H = z;
aw.this.X();
}
}
@Override
public void b(Exception exc) {
aw.this.i.b(exc);
}
@Override
public void c(Exception exc) {
aw.this.i.c(exc);
}
@Override
public void a(List<com.applovin.exoplayer2.i.a> list) {
aw.this.I = list;
Iterator it = aw.this.h.iterator();
while (it.hasNext()) {
((an.d) it.next()).a(list);
}
}
@Override
public void a(com.applovin.exoplayer2.g.a aVar) {
aw.this.i.a(aVar);
aw.this.e.a(aVar);
Iterator it = aw.this.h.iterator();
while (it.hasNext()) {
((an.d) it.next()).a(aVar);
}
}
@Override
public void surfaceCreated(SurfaceHolder surfaceHolder) {
if (aw.this.w) {
aw.this.a(surfaceHolder.getSurface());
}
}
@Override
public void surfaceChanged(SurfaceHolder surfaceHolder, int i, int i2, int i3) {
aw.this.a(i2, i3);
}
@Override
public void surfaceDestroyed(SurfaceHolder surfaceHolder) {
if (aw.this.w) {
aw.this.a((Object) null);
}
aw.this.a(0, 0);
}
@Override
public void onSurfaceTextureAvailable(SurfaceTexture surfaceTexture, int i, int i2) {
aw.this.a(surfaceTexture);
aw.this.a(i, i2);
}
@Override
public void onSurfaceTextureSizeChanged(SurfaceTexture surfaceTexture, int i, int i2) {
aw.this.a(i, i2);
}
@Override
public boolean onSurfaceTextureDestroyed(SurfaceTexture surfaceTexture) {
aw.this.a((Object) null);
aw.this.a(0, 0);
return true;
}
@Override
public void onSurfaceTextureUpdated(SurfaceTexture surfaceTexture) {
}
@Override
public void a(Surface surface) {
aw.this.a((Object) null);
}
@Override
public void a(float f) {
aw.this.W();
}
@Override
public void a(int i) {
boolean x = aw.this.x();
aw.this.a(x, i, aw.b(x, i));
}
@Override
public void a() {
aw.this.a(false, -1, 3);
}
@Override
public void f(int i) {
o b = aw.b(aw.this.l);
if (!b.equals(aw.this.O)) {
aw.this.O = b;
Iterator it = aw.this.h.iterator();
while (it.hasNext()) {
((an.d) it.next()).a(b);
}
}
}
@Override
public void a(int i, boolean z) {
Iterator it = aw.this.h.iterator();
while (it.hasNext()) {
((an.d) it.next()).a(i, z);
}
}
@Override
public void b_(boolean z) {
if (aw.this.L != null) {
if (z && !aw.this.M) {
aw.this.L.a(0);
aw.this.M = true;
} else if (!z && aw.this.M) {
aw.this.L.b(0);
aw.this.M = false;
}
}
}
@Override
public void b(int i) {
aw.this.Y();
}
@Override
public void b(boolean z, int i) {
aw.this.Y();
}
@Override
public void b(boolean z) {
aw.this.Y();
}
}
public static final class c implements ao.b, com.applovin.exoplayer2.m.a.a, com.applovin.exoplayer2.m.l {
@Nullable
private com.applovin.exoplayer2.m.l a;
@Nullable
private com.applovin.exoplayer2.m.a.a b;
@Nullable
private com.applovin.exoplayer2.m.l c;
@Nullable
private com.applovin.exoplayer2.m.a.a d;
private c() {
}
@Override
public void a(int i, @Nullable Object obj) {
switch (i) {
case 7:
this.a = (com.applovin.exoplayer2.m.l) obj;
return;
case 8:
this.b = (com.applovin.exoplayer2.m.a.a) obj;
return;
case 10000:
com.applovin.exoplayer2.m.a.i iVar = (com.applovin.exoplayer2.m.a.i) obj;
if (iVar == null) {
this.c = null;
this.d = null;
return;
} else {
this.c = iVar.getVideoFrameMetadataListener();
this.d = iVar.getCameraMotionListener();
return;
}
default:
return;
}
}
@Override
public void a(long j, long j2, v vVar, @Nullable MediaFormat mediaFormat) {
if (this.c != null) {
this.c.a(j, j2, vVar, mediaFormat);
}
if (this.a != null) {
this.a.a(j, j2, vVar, mediaFormat);
}
}
@Override
public void a(long j, float[] fArr) {
if (this.d != null) {
this.d.a(j, fArr);
}
if (this.b != null) {
this.b.a(j, fArr);
}
}
@Override
public void a() {
if (this.d != null) {
this.d.a();
}
if (this.b != null) {
this.b.a();
}
}
}
}