Currency Plus v2.10.8版本的 MD5 值为:8586f74edd9ace5aa261a19c9da51484

以下内容为反编译后的 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 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 com.google.android.gms.location.DeviceOrientationRequest;
import com.vungle.ads.VungleError;
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 com.applovin.exoplayer2.b.d N;
    protected final ar[] bB;
    private final com.applovin.exoplayer2.a.a bM;
    private final bc hA;
    private final long hB;
    private v hC;
    private v hD;
    private AudioTrack hE;
    private Object hF;
    private Surface hG;
    private SurfaceHolder hH;
    private com.applovin.exoplayer2.m.a.i hI;
    private boolean hJ;
    private TextureView hK;
    private int hL;
    private int hM;
    private int hN;
    private int hO;
    private com.applovin.exoplayer2.c.e hP;
    private com.applovin.exoplayer2.c.e hQ;
    private int hR;
    private float hS;
    private boolean hT;
    private List<com.applovin.exoplayer2.i.a> hU;
    private boolean hV;
    private boolean hW;
    private com.applovin.exoplayer2.l.aa hX;
    private boolean hY;
    private boolean hZ;
    private final com.applovin.exoplayer2.l.g hq;
    private final Context hr;
    private final r hs;
    private final b ht;
    private final c hu;
    private final CopyOnWriteArraySet<an.d> hv;
    private final com.applovin.exoplayer2.b hw;
    private final com.applovin.exoplayer2.c hx;
    private final ay hy;
    private final bb hz;
    private o f7165ia;
    private com.applovin.exoplayer2.m.o f7166ib;

    @Deprecated
    public static final class a {
        private final Context E;
        private com.applovin.exoplayer2.b.d N;
        private com.applovin.exoplayer2.j.j bC;
        private boolean bK;
        private com.applovin.exoplayer2.h.r bL;
        private com.applovin.exoplayer2.a.a bM;
        private com.applovin.exoplayer2.k.d bO;
        private long bP;
        private long bQ;
        private com.applovin.exoplayer2.l.d bR;
        private av bY;
        private boolean bZ;
        private aa f7167cl;
        private z ct;
        private long cu;
        private Looper gU;
        private long hB;
        private int hL;
        private int hM;
        private boolean hT;
        private com.applovin.exoplayer2.l.aa hX;
        private final au f7168ic;
        private long f7169id;
        private boolean f7170ie;
        private int f0if;
        private boolean f7171ig;
        private boolean f7172ih;

        @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.i(context), new com.applovin.exoplayer2.a.a(com.applovin.exoplayer2.l.d.abJ));
        }

        @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.E = context;
            this.f7168ic = auVar;
            this.bC = jVar;
            this.bL = rVar;
            this.f7167cl = aaVar;
            this.bO = dVar;
            this.bM = aVar;
            this.gU = com.applovin.exoplayer2.l.ai.pZ();
            this.N = com.applovin.exoplayer2.b.d.jD;
            this.f0if = 0;
            this.hL = 1;
            this.hM = 0;
            this.bK = true;
            this.bY = av.f7162hn;
            this.bP = DeviceOrientationRequest.OUTPUT_PERIOD_FAST;
            this.bQ = 15000L;
            this.ct = new k.a().ao();
            this.bR = com.applovin.exoplayer2.l.d.abJ;
            this.cu = 500L;
            this.hB = 2000L;
        }

        @Deprecated
        public aw cY() {
            com.applovin.exoplayer2.l.a.checkState(!this.f7172ih);
            this.f7172ih = true;
            return new aw(this);
        }
    }

    public final class b implements SurfaceHolder.Callback, TextureView.SurfaceTextureListener, an.b, ay.a, b.InterfaceC0130b, 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(boolean z10) {
            if (aw.this.hT == z10) {
                return;
            }
            aw.this.hT = z10;
            aw.this.cV();
        }

        @Override
        public void Z(int i10) {
            aw.this.cW();
        }

        @Override
        public void a(int i10, long j10, long j11) {
            aw.this.bM.a(i10, j10, j11);
        }

        @Override
        public void a(long j10, int i10) {
            aw.this.bM.a(j10, i10);
        }

        @Override
        public void a(Surface surface) {
            aw.this.i((Object) null);
        }

        @Override
        public final void a(ab abVar, int i10) {
            c0.b(this, abVar, i10);
        }

        @Override
        public final void a(ac acVar) {
            c0.c(this, acVar);
        }

        @Override
        public final void a(ak akVar) {
            c0.d(this, akVar);
        }

        @Override
        public final void a(an.e eVar, an.e eVar2, int i10) {
            c0.e(this, eVar, eVar2, i10);
        }

        @Override
        public final void a(an anVar, an.c cVar) {
            c0.f(this, anVar, cVar);
        }

        @Override
        public void a(com.applovin.exoplayer2.c.e eVar) {
            aw.this.hP = eVar;
            aw.this.bM.a(eVar);
        }

        @Override
        public void a(com.applovin.exoplayer2.g.a aVar) {
            aw.this.bM.a(aVar);
            aw.this.hs.a(aVar);
            Iterator it = aw.this.hv.iterator();
            while (it.hasNext()) {
                ((an.d) it.next()).a(aVar);
            }
        }

        @Override
        public final void a(com.applovin.exoplayer2.h.ad adVar, com.applovin.exoplayer2.j.h hVar) {
            c0.g(this, adVar, hVar);
        }

        @Override
        public void a(com.applovin.exoplayer2.m.o oVar) {
            aw.this.f7166ib = oVar;
            aw.this.bM.a(oVar);
            Iterator it = aw.this.hv.iterator();
            while (it.hasNext()) {
                ((an.d) it.next()).a(oVar);
            }
        }

        @Override
        public void a(v vVar, com.applovin.exoplayer2.c.h hVar) {
            aw.this.hC = vVar;
            aw.this.bM.a(vVar, hVar);
        }

        @Override
        public void a(Exception exc) {
            aw.this.bM.a(exc);
        }

        @Override
        public void a(Object obj, long j10) {
            aw.this.bM.a(obj, j10);
            if (aw.this.hF == obj) {
                Iterator it = aw.this.hv.iterator();
                while (it.hasNext()) {
                    ((an.d) it.next()).cE();
                }
            }
        }

        @Override
        public void a(String str, long j10, long j11) {
            aw.this.bM.a(str, j10, j11);
        }

        @Override
        public final void aa(int i10) {
            c0.h(this, i10);
        }

        @Override
        public final void ab(int i10) {
            c0.i(this, i10);
        }

        @Override
        public final void ac(int i10) {
            c0.j(this, i10);
        }

        @Override
        public void ai(int i10) {
            o a10 = aw.a(aw.this.hy);
            if (a10.equals(aw.this.f7165ia)) {
                return;
            }
            aw.this.f7165ia = a10;
            Iterator it = aw.this.hv.iterator();
            while (it.hasNext()) {
                ((an.d) it.next()).a(a10);
            }
        }

        @Override
        public void b(float f10) {
            aw.this.cU();
        }

        @Override
        public void b(int i10, long j10) {
            aw.this.bM.b(i10, j10);
        }

        @Override
        public final void b(ak akVar) {
            c0.k(this, akVar);
        }

        @Override
        public final void b(am amVar) {
            c0.l(this, amVar);
        }

        @Override
        public final void b(ba baVar, int i10) {
            c0.m(this, baVar, i10);
        }

        @Override
        public void b(com.applovin.exoplayer2.c.e eVar) {
            aw.this.bM.b(eVar);
            aw.this.hC = null;
            aw.this.hP = null;
        }

        @Override
        public void b(v vVar, com.applovin.exoplayer2.c.h hVar) {
            aw.this.hD = vVar;
            aw.this.bM.b(vVar, hVar);
        }

        @Override
        public void b(Exception exc) {
            aw.this.bM.b(exc);
        }

        @Override
        public void b(String str, long j10, long j11) {
            aw.this.bM.b(str, j10, j11);
        }

        @Override
        public void c(com.applovin.exoplayer2.c.e eVar) {
            aw.this.hQ = eVar;
            aw.this.bM.c(eVar);
        }

        @Override
        public final void c(v vVar) {
            com.applovin.exoplayer2.b.z.g(this, vVar);
        }

        @Override
        public void c(Exception exc) {
            aw.this.bM.c(exc);
        }

        @Override
        public final void cD() {
            c0.n(this);
        }

        @Override
        public final void d(an.a aVar) {
            c0.o(this, aVar);
        }

        @Override
        public void d(com.applovin.exoplayer2.c.e eVar) {
            aw.this.bM.d(eVar);
            aw.this.hD = null;
            aw.this.hQ = null;
        }

        @Override
        public final void d(boolean z10, int i10) {
            c0.p(this, z10, i10);
        }

        @Override
        public void e(List<com.applovin.exoplayer2.i.a> list) {
            aw.this.hU = list;
            Iterator it = aw.this.hv.iterator();
            while (it.hasNext()) {
                ((an.d) it.next()).e(list);
            }
        }

        @Override
        public void e(boolean z10, int i10) {
            aw.this.cW();
        }

        @Override
        public void f(int i10, boolean z10) {
            Iterator it = aw.this.hv.iterator();
            while (it.hasNext()) {
                ((an.d) it.next()).e(i10, z10);
            }
        }

        @Override
        public final void i(boolean z10) {
            k0.a(this, z10);
        }

        @Override
        public void j(boolean z10) {
            aw.this.cW();
        }

        @Override
        public void l(int i10) {
            boolean aE = aw.this.aE();
            aw.this.b(aE, i10, aw.f(aE, i10));
        }

        @Override
        public void m() {
            aw.this.b(false, -1, 3);
        }

        @Override
        public void onSurfaceTextureAvailable(SurfaceTexture surfaceTexture, int i10, int i11) {
            aw.this.a(surfaceTexture);
            aw.this.g(i10, i11);
        }

        @Override
        public boolean onSurfaceTextureDestroyed(SurfaceTexture surfaceTexture) {
            aw.this.i((Object) null);
            aw.this.g(0, 0);
            return true;
        }

        @Override
        public void onSurfaceTextureSizeChanged(SurfaceTexture surfaceTexture, int i10, int i11) {
            aw.this.g(i10, i11);
        }

        @Override
        public void onSurfaceTextureUpdated(SurfaceTexture surfaceTexture) {
        }

        @Override
        public void r(String str) {
            aw.this.bM.r(str);
        }

        @Override
        public void s(String str) {
            aw.this.bM.s(str);
        }

        @Override
        public void surfaceChanged(SurfaceHolder surfaceHolder, int i10, int i11, int i12) {
            aw.this.g(i11, i12);
        }

        @Override
        public void surfaceCreated(SurfaceHolder surfaceHolder) {
            if (aw.this.hJ) {
                aw.this.i(surfaceHolder.getSurface());
            }
        }

        @Override
        public void surfaceDestroyed(SurfaceHolder surfaceHolder) {
            if (aw.this.hJ) {
                aw.this.i((Object) null);
            }
            aw.this.g(0, 0);
        }

        @Override
        public void w(boolean z10) {
            if (aw.this.hX != null) {
                if (z10 && !aw.this.hY) {
                    aw.this.hX.cR(0);
                    aw.this.hY = true;
                } else if (z10 || !aw.this.hY) {
                } else {
                    aw.this.hX.fF(0);
                    aw.this.hY = false;
                }
            }
        }

        @Override
        public final void x(boolean z10) {
            c0.s(this, z10);
        }

        @Override
        public final void y(v vVar) {
            com.applovin.exoplayer2.m.q.k(this, vVar);
        }

        @Override
        public final void y(boolean z10) {
            c0.t(this, z10);
        }

        @Override
        public void z(long j10) {
            aw.this.bM.z(j10);
        }

        @Override
        public final void z(boolean z10) {
            c0.u(this, z10);
        }
    }

    public static final class c implements ao.b, com.applovin.exoplayer2.m.a.a, com.applovin.exoplayer2.m.l {
        private com.applovin.exoplayer2.m.l f7174ij;
        private com.applovin.exoplayer2.m.a.a f7175ik;
        private com.applovin.exoplayer2.m.l f7176il;
        private com.applovin.exoplayer2.m.a.a f7177im;

        private c() {
        }

        @Override
        public void a(int i10, Object obj) {
            if (i10 == 7) {
                this.f7174ij = (com.applovin.exoplayer2.m.l) obj;
            } else if (i10 == 8) {
                this.f7175ik = (com.applovin.exoplayer2.m.a.a) obj;
            } else if (i10 != 10000) {
            } else {
                com.applovin.exoplayer2.m.a.i iVar = (com.applovin.exoplayer2.m.a.i) obj;
                if (iVar == null) {
                    this.f7176il = null;
                    this.f7177im = null;
                    return;
                }
                this.f7176il = iVar.getVideoFrameMetadataListener();
                this.f7177im = iVar.getCameraMotionListener();
            }
        }

        @Override
        public void a(long j10, long j11, v vVar, MediaFormat mediaFormat) {
            com.applovin.exoplayer2.m.l lVar = this.f7176il;
            if (lVar != null) {
                lVar.a(j10, j11, vVar, mediaFormat);
            }
            com.applovin.exoplayer2.m.l lVar2 = this.f7174ij;
            if (lVar2 != null) {
                lVar2.a(j10, j11, vVar, mediaFormat);
            }
        }

        @Override
        public void a(long j10, float[] fArr) {
            com.applovin.exoplayer2.m.a.a aVar = this.f7177im;
            if (aVar != null) {
                aVar.a(j10, fArr);
            }
            com.applovin.exoplayer2.m.a.a aVar2 = this.f7175ik;
            if (aVar2 != null) {
                aVar2.a(j10, fArr);
            }
        }

        @Override
        public void cZ() {
            com.applovin.exoplayer2.m.a.a aVar = this.f7177im;
            if (aVar != null) {
                aVar.cZ();
            }
            com.applovin.exoplayer2.m.a.a aVar2 = this.f7175ik;
            if (aVar2 != null) {
                aVar2.cZ();
            }
        }
    }

    public aw(a aVar) {
        aw awVar;
        b bVar;
        c cVar;
        Handler handler;
        r rVar;
        com.applovin.exoplayer2.l.g gVar = new com.applovin.exoplayer2.l.g();
        this.hq = gVar;
        try {
            Context applicationContext = aVar.E.getApplicationContext();
            this.hr = applicationContext;
            com.applovin.exoplayer2.a.a aVar2 = aVar.bM;
            this.bM = aVar2;
            this.hX = aVar.hX;
            this.N = aVar.N;
            this.hL = aVar.hL;
            this.hM = aVar.hM;
            this.hT = aVar.hT;
            this.hB = aVar.hB;
            bVar = new b();
            this.ht = bVar;
            cVar = new c();
            this.hu = cVar;
            this.hv = new CopyOnWriteArraySet<>();
            handler = new Handler(aVar.gU);
            ar[] a10 = aVar.f7168ic.a(handler, bVar, bVar, bVar, bVar);
            this.bB = a10;
            this.hS = 1.0f;
            if (com.applovin.exoplayer2.l.ai.acV < 21) {
                this.hR = ah(0);
            } else {
                this.hR = h.c(applicationContext);
            }
            this.hU = Collections.emptyList();
            this.hV = true;
            try {
                rVar = new r(a10, aVar.bC, aVar.bL, aVar.f7167cl, aVar.bO, aVar2, aVar.bK, aVar.bY, aVar.bP, aVar.bQ, aVar.ct, aVar.cu, aVar.bZ, aVar.bR, aVar.gU, this, new an.a.C0128a().a(20, 21, 22, 23, 24, 25, 26, 27).cC());
                awVar = this;
            } catch (Throwable th2) {
                th = th2;
                awVar = this;
            }
        } catch (Throwable th3) {
            th = th3;
            awVar = this;
        }
        try {
            awVar.hs = rVar;
            rVar.a((an.b) bVar);
            rVar.a((q.a) bVar);
            if (aVar.f7169id > 0) {
                rVar.j(aVar.f7169id);
            }
            com.applovin.exoplayer2.b bVar2 = new com.applovin.exoplayer2.b(aVar.E, handler, bVar);
            awVar.hw = bVar2;
            bVar2.setEnabled(aVar.f7171ig);
            com.applovin.exoplayer2.c cVar2 = new com.applovin.exoplayer2.c(aVar.E, handler, bVar);
            awVar.hx = cVar2;
            cVar2.a(aVar.f7170ie ? awVar.N : null);
            ay ayVar = new ay(aVar.E, handler, bVar);
            awVar.hy = ayVar;
            ayVar.aj(com.applovin.exoplayer2.l.ai.fM(awVar.N.jG));
            bb bbVar = new bb(aVar.E);
            awVar.hz = bbVar;
            bbVar.setEnabled(aVar.f0if != 0);
            bc bcVar = new bc(aVar.E);
            awVar.hA = bcVar;
            bcVar.setEnabled(aVar.f0if == 2);
            awVar.f7165ia = a(ayVar);
            awVar.f7166ib = com.applovin.exoplayer2.m.o.afk;
            awVar.a(1, 10, Integer.valueOf(awVar.hR));
            awVar.a(2, 10, Integer.valueOf(awVar.hR));
            awVar.a(1, 3, awVar.N);
            awVar.a(2, 4, Integer.valueOf(awVar.hL));
            awVar.a(2, 5, Integer.valueOf(awVar.hM));
            awVar.a(1, 9, Boolean.valueOf(awVar.hT));
            awVar.a(2, 7, cVar);
            awVar.a(6, 8, cVar);
            gVar.oN();
        } catch (Throwable th4) {
            th = th4;
            awVar.hq.oN();
            throw th;
        }
    }

    public static o a(ay ayVar) {
        return new o(0, ayVar.da(), ayVar.db());
    }

    private void a(int i10, int i11, Object obj) {
        ar[] arVarArr;
        for (ar arVar : this.bB) {
            if (arVar.M() == i10) {
                this.hs.a(arVar).ad(i11).h(obj).cM();
            }
        }
    }

    public void a(SurfaceTexture surfaceTexture) {
        Surface surface = new Surface(surfaceTexture);
        i(surface);
        this.hG = surface;
    }

    private int ah(int i10) {
        AudioTrack audioTrack = this.hE;
        if (audioTrack != null && audioTrack.getAudioSessionId() != i10) {
            this.hE.release();
            this.hE = null;
        }
        if (this.hE == null) {
            this.hE = new AudioTrack(3, 4000, 4, 2, 2, 0, i10);
        }
        return this.hE.getAudioSessionId();
    }

    public void b(boolean z10, int i10, int i11) {
        int i12 = 0;
        boolean z11 = z10 && i10 != -1;
        if (z11 && i10 != 1) {
            i12 = 1;
        }
        this.hs.a(z11, i12, i11);
    }

    private void c(SurfaceHolder surfaceHolder) {
        this.hJ = false;
        this.hH = surfaceHolder;
        surfaceHolder.addCallback(this.ht);
        Surface surface = this.hH.getSurface();
        if (surface == null || !surface.isValid()) {
            g(0, 0);
            return;
        }
        Rect surfaceFrame = this.hH.getSurfaceFrame();
        g(surfaceFrame.width(), surfaceFrame.height());
    }

    private void cT() {
        if (this.hI != null) {
            this.hs.a(this.hu).ad(VungleError.DEFAULT).h(null).cM();
            this.hI.b(this.ht);
            this.hI = null;
        }
        TextureView textureView = this.hK;
        if (textureView != null) {
            if (textureView.getSurfaceTextureListener() != this.ht) {
                com.applovin.exoplayer2.l.q.h("SimpleExoPlayer", "SurfaceTextureListener already unset or replaced.");
            } else {
                this.hK.setSurfaceTextureListener(null);
            }
            this.hK = null;
        }
        SurfaceHolder surfaceHolder = this.hH;
        if (surfaceHolder != null) {
            surfaceHolder.removeCallback(this.ht);
            this.hH = null;
        }
    }

    public void cU() {
        a(1, 2, Float.valueOf(this.hS * this.hx.n()));
    }

    public void cV() {
        this.bM.A(this.hT);
        Iterator<an.d> it = this.hv.iterator();
        while (it.hasNext()) {
            it.next().A(this.hT);
        }
    }

    public void cW() {
        int aB = aB();
        boolean z10 = true;
        if (aB != 1) {
            if (aB == 2 || aB == 3) {
                boolean ay = ay();
                bb bbVar = this.hz;
                if (!aE() || ay) {
                    z10 = false;
                }
                bbVar.C(z10);
                this.hA.C(aE());
                return;
            } else if (aB != 4) {
                throw new IllegalStateException();
            }
        }
        this.hz.C(false);
        this.hA.C(false);
    }

    private void cX() {
        this.hq.oQ();
        if (Thread.currentThread() != az().getThread()) {
            String a10 = 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(), az().getThread().getName());
            if (this.hV) {
                throw new IllegalStateException(a10);
            }
            com.applovin.exoplayer2.l.q.b("SimpleExoPlayer", a10, this.hW ? null : new IllegalStateException());
            this.hW = true;
        }
    }

    public static int f(boolean z10, int i10) {
        return (!z10 || i10 == 1) ? 1 : 2;
    }

    public void g(int i10, int i11) {
        if (i10 == this.hN && i11 == this.hO) {
            return;
        }
        this.hN = i10;
        this.hO = i11;
        this.bM.f(i10, i11);
        Iterator<an.d> it = this.hv.iterator();
        while (it.hasNext()) {
            it.next().f(i10, i11);
        }
    }

    public void i(Object obj) {
        boolean z10;
        ArrayList arrayList = new ArrayList();
        ar[] arVarArr = this.bB;
        int length = arVarArr.length;
        int i10 = 0;
        while (true) {
            z10 = true;
            if (i10 >= length) {
                break;
            }
            ar arVar = arVarArr[i10];
            if (arVar.M() == 2) {
                arrayList.add(this.hs.a(arVar).ad(1).h(obj).cM());
            }
            i10++;
        }
        Object obj2 = this.hF;
        if (obj2 == null || obj2 == obj) {
            z10 = false;
        } else {
            try {
                Iterator it = arrayList.iterator();
                while (it.hasNext()) {
                    ((ao) it.next()).y(this.hB);
                }
            } catch (InterruptedException unused) {
                Thread.currentThread().interrupt();
            } catch (TimeoutException unused2) {
            }
            z10 = false;
            Object obj3 = this.hF;
            Surface surface = this.hG;
            if (obj3 == surface) {
                surface.release();
                this.hG = null;
            }
        }
        this.hF = obj;
        if (z10) {
            this.hs.a(false, p.a(new u(3), 1003));
        }
    }

    @Override
    public void a(int i10, long j10) {
        cX();
        this.bM.dq();
        this.hs.a(i10, j10);
    }

    public void a(SurfaceHolder surfaceHolder) {
        cX();
        if (surfaceHolder == null) {
            cS();
            return;
        }
        cT();
        this.hJ = true;
        this.hH = surfaceHolder;
        surfaceHolder.addCallback(this.ht);
        Surface surface = surfaceHolder.getSurface();
        if (surface == null || !surface.isValid()) {
            i((Object) null);
            g(0, 0);
            return;
        }
        i(surface);
        Rect surfaceFrame = surfaceHolder.getSurfaceFrame();
        g(surfaceFrame.width(), surfaceFrame.height());
    }

    @Override
    public void a(SurfaceView surfaceView) {
        cX();
        if (surfaceView instanceof com.applovin.exoplayer2.m.k) {
            cT();
            i(surfaceView);
            c(surfaceView.getHolder());
        } else if (!(surfaceView instanceof com.applovin.exoplayer2.m.a.i)) {
            a(surfaceView == null ? null : surfaceView.getHolder());
        } else {
            cT();
            this.hI = (com.applovin.exoplayer2.m.a.i) surfaceView;
            this.hs.a(this.hu).ad(VungleError.DEFAULT).h(this.hI).cM();
            this.hI.a(this.ht);
            i(this.hI.getVideoSurface());
            c(surfaceView.getHolder());
        }
    }

    @Override
    public void a(TextureView textureView) {
        cX();
        if (textureView == null) {
            cS();
            return;
        }
        cT();
        this.hK = textureView;
        if (textureView.getSurfaceTextureListener() != null) {
            com.applovin.exoplayer2.l.q.h("SimpleExoPlayer", "Replacing existing SurfaceTextureListener.");
        }
        textureView.setSurfaceTextureListener(this.ht);
        SurfaceTexture surfaceTexture = textureView.isAvailable() ? textureView.getSurfaceTexture() : null;
        if (surfaceTexture == null) {
            i((Object) null);
            g(0, 0);
            return;
        }
        a(surfaceTexture);
        g(textureView.getWidth(), textureView.getHeight());
    }

    @Override
    public void a(an.d dVar) {
        com.applovin.exoplayer2.l.a.checkNotNull(dVar);
        this.hv.add(dVar);
        f(dVar);
    }

    public void a(com.applovin.exoplayer2.h.p pVar) {
        cX();
        this.hs.a(pVar);
    }

    @Override
    public an.a aA() {
        cX();
        return this.hs.aA();
    }

    @Override
    public int aB() {
        cX();
        return this.hs.aB();
    }

    @Override
    public int aC() {
        cX();
        return this.hs.aC();
    }

    @Override
    public void aD() {
        cX();
        boolean aE = aE();
        int a10 = this.hx.a(aE, 2);
        b(aE, a10, f(aE, a10));
        this.hs.aD();
    }

    @Override
    public boolean aE() {
        cX();
        return this.hs.aE();
    }

    @Override
    public int aF() {
        cX();
        return this.hs.aF();
    }

    @Override
    public boolean aG() {
        cX();
        return this.hs.aG();
    }

    @Override
    public long aH() {
        cX();
        return this.hs.aH();
    }

    @Override
    public long aI() {
        cX();
        return this.hs.aI();
    }

    @Override
    public long aJ() {
        cX();
        return this.hs.aJ();
    }

    @Override
    public int aK() {
        cX();
        return this.hs.aK();
    }

    @Override
    public int aL() {
        cX();
        return this.hs.aL();
    }

    @Override
    public long aM() {
        cX();
        return this.hs.aM();
    }

    @Override
    public long aN() {
        cX();
        return this.hs.aN();
    }

    @Override
    public long aO() {
        cX();
        return this.hs.aO();
    }

    @Override
    public boolean aP() {
        cX();
        return this.hs.aP();
    }

    @Override
    public int aQ() {
        cX();
        return this.hs.aQ();
    }

    @Override
    public int aR() {
        cX();
        return this.hs.aR();
    }

    @Override
    public long aS() {
        cX();
        return this.hs.aS();
    }

    @Override
    public long aT() {
        cX();
        return this.hs.aT();
    }

    @Override
    public com.applovin.exoplayer2.h.ad aU() {
        cX();
        return this.hs.aU();
    }

    @Override
    public com.applovin.exoplayer2.j.h aV() {
        cX();
        return this.hs.aV();
    }

    @Override
    public ac aW() {
        return this.hs.aW();
    }

    @Override
    public ba aX() {
        cX();
        return this.hs.aX();
    }

    @Override
    public com.applovin.exoplayer2.m.o aY() {
        return this.f7166ib;
    }

    @Override
    public am av() {
        cX();
        return this.hs.av();
    }

    @Override
    public p ax() {
        cX();
        return this.hs.ax();
    }

    public boolean ay() {
        cX();
        return this.hs.ay();
    }

    @Override
    public Looper az() {
        return this.hs.az();
    }

    public void b(SurfaceHolder surfaceHolder) {
        cX();
        if (surfaceHolder == null || surfaceHolder != this.hH) {
            return;
        }
        cS();
    }

    @Override
    public void b(SurfaceView surfaceView) {
        cX();
        b(surfaceView == null ? null : surfaceView.getHolder());
    }

    @Override
    public void b(TextureView textureView) {
        cX();
        if (textureView == null || textureView != this.hK) {
            return;
        }
        cS();
    }

    @Override
    public void b(an.d dVar) {
        com.applovin.exoplayer2.l.a.checkNotNull(dVar);
        this.hv.remove(dVar);
        g(dVar);
    }

    @Override
    public List<com.applovin.exoplayer2.i.a> bd() {
        cX();
        return this.hU;
    }

    public void cS() {
        cX();
        cT();
        i((Object) null);
        g(0, 0);
    }

    @Deprecated
    public void f(an.b bVar) {
        com.applovin.exoplayer2.l.a.checkNotNull(bVar);
        this.hs.a(bVar);
    }

    @Deprecated
    public void g(an.b bVar) {
        this.hs.b(bVar);
    }

    public void h(float f10) {
        cX();
        float a10 = com.applovin.exoplayer2.l.ai.a(f10, 0.0f, 1.0f);
        if (this.hS == a10) {
            return;
        }
        this.hS = a10;
        cU();
        this.bM.g(a10);
        Iterator<an.d> it = this.hv.iterator();
        while (it.hasNext()) {
            it.next().g(a10);
        }
    }

    @Override
    public void k(boolean z10) {
        cX();
        int a10 = this.hx.a(z10, aB());
        b(z10, a10, f(z10, a10));
    }

    @Override
    public void l(boolean z10) {
        cX();
        this.hs.l(z10);
    }

    public void release() {
        AudioTrack audioTrack;
        cX();
        if (com.applovin.exoplayer2.l.ai.acV < 21 && (audioTrack = this.hE) != null) {
            audioTrack.release();
            this.hE = null;
        }
        this.hw.setEnabled(false);
        this.hy.release();
        this.hz.C(false);
        this.hA.C(false);
        this.hx.release();
        this.hs.release();
        this.bM.release();
        cT();
        Surface surface = this.hG;
        if (surface != null) {
            surface.release();
            this.hG = null;
        }
        if (this.hY) {
            ((com.applovin.exoplayer2.l.aa) com.applovin.exoplayer2.l.a.checkNotNull(this.hX)).fF(0);
            this.hY = false;
        }
        this.hU = Collections.emptyList();
        this.hZ = true;
    }

    @Override
    public void u(int i10) {
        cX();
        this.hs.u(i10);
    }
}