暗网解密 v2.0.4版本的 MD5 值为:d3a04548fef88e775cbe4c3c6e7d81ad

以下内容为反编译后的 i2.java 源代码,内容仅作参考


package c.g.a.a;

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.camera.camera2.internal.Camera2CameraImpl;
import androidx.camera.core.FocusMeteringAction;
import c.g.a.a.e1;
import c.g.a.a.j2;
import c.g.a.a.r0;
import c.g.a.a.s0;
import c.g.a.a.v1;
import c.g.a.a.y1;
import c.g.a.a.z0;
import com.google.android.exoplayer2.ExoPlaybackException;
import com.google.android.exoplayer2.ExoTimeoutException;
import com.google.android.exoplayer2.Format;
import com.google.android.exoplayer2.PlaybackException;
import com.google.android.exoplayer2.metadata.Metadata;
import com.google.android.exoplayer2.source.TrackGroupArray;
import com.google.android.exoplayer2.trackselection.DefaultTrackSelector;
import com.google.android.exoplayer2.util.PriorityTaskManager;
import com.google.android.exoplayer2.video.spherical.SphericalGLSurfaceView;
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 i2 extends t0 implements e1 {
    public boolean A;
    @Nullable
    public TextureView B;
    public int C;
    public int D;
    public int E;
    @Nullable
    public c.g.a.a.q2.d F;
    @Nullable
    public c.g.a.a.q2.d G;
    public int H;
    public c.g.a.a.o2.p I;
    public float J;
    public boolean K;
    public List<c.g.a.a.a3.c> L;
    public boolean M;
    public boolean N;
    @Nullable
    public PriorityTaskManager O;
    public boolean P;
    public boolean Q;
    public c.g.a.a.r2.b R;
    public c.g.a.a.f3.z S;
    public final c2[] f2294b;
    public final c.g.a.a.e3.l f2295c;
    public final Context f2296d;
    public final f1 f2297e;
    public final c f2298f;
    public final d f2299g;
    public final CopyOnWriteArraySet<c.g.a.a.f3.w> f2300h;
    public final CopyOnWriteArraySet<c.g.a.a.o2.r> i;
    public final CopyOnWriteArraySet<c.g.a.a.a3.k> j;
    public final CopyOnWriteArraySet<c.g.a.a.w2.e> k;
    public final CopyOnWriteArraySet<c.g.a.a.r2.c> l;
    public final c.g.a.a.n2.h1 m;
    public final r0 n;
    public final s0 o;
    public final j2 p;
    public final l2 q;
    public final m2 r;
    public final long s;
    @Nullable
    public Format t;
    @Nullable
    public Format u;
    @Nullable
    public AudioTrack v;
    @Nullable
    public Object w;
    @Nullable
    public Surface x;
    @Nullable
    public SurfaceHolder y;
    @Nullable
    public SphericalGLSurfaceView z;

    public static final class b {
        public final Context f2301a;
        public final g2 f2302b;
        public c.g.a.a.e3.i f2303c;
        public long f2304d;
        public c.g.a.a.b3.m f2305e;
        public c.g.a.a.z2.h0 f2306f;
        public l1 f2307g;
        public c.g.a.a.d3.g f2308h;
        public c.g.a.a.n2.h1 i;
        public Looper j;
        @Nullable
        public PriorityTaskManager k;
        public c.g.a.a.o2.p l;
        public boolean m;
        public int n;
        public boolean o;
        public boolean p;
        public int q;
        public boolean r;
        public h2 s;
        public long t;
        public long u;
        public k1 v;
        public long w;
        public long x;
        public boolean y;
        public boolean z;

        public b(Context context, g2 g2Var) {
            this(context, g2Var, new c.g.a.a.u2.h());
        }

        public b A(l1 l1Var) {
            c.g.a.a.e3.g.f(!this.z);
            this.f2307g = l1Var;
            return this;
        }

        public b B(Looper looper) {
            c.g.a.a.e3.g.f(!this.z);
            this.j = looper;
            return this;
        }

        public b C(c.g.a.a.b3.m mVar) {
            c.g.a.a.e3.g.f(!this.z);
            this.f2305e = mVar;
            return this;
        }

        public i2 z() {
            c.g.a.a.e3.g.f(!this.z);
            this.z = true;
            return new i2(this);
        }

        public b(Context context, g2 g2Var, c.g.a.a.u2.o oVar) {
            this(context, g2Var, new DefaultTrackSelector(context), new c.g.a.a.z2.t(context, oVar), new a1(), c.g.a.a.d3.q.l(context), new c.g.a.a.n2.h1(c.g.a.a.e3.i.f2003a));
        }

        public b(Context context, g2 g2Var, c.g.a.a.b3.m mVar, c.g.a.a.z2.h0 h0Var, l1 l1Var, c.g.a.a.d3.g gVar, c.g.a.a.n2.h1 h1Var) {
            this.f2301a = context;
            this.f2302b = g2Var;
            this.f2305e = mVar;
            this.f2306f = h0Var;
            this.f2307g = l1Var;
            this.f2308h = gVar;
            this.i = h1Var;
            this.j = c.g.a.a.e3.r0.O();
            this.l = c.g.a.a.o2.p.f2678a;
            this.n = 0;
            this.q = 1;
            this.r = true;
            this.s = h2.f2287e;
            this.t = FocusMeteringAction.DEFAULT_AUTOCANCEL_DURATION;
            this.u = 15000L;
            this.v = new z0.b().a();
            this.f2303c = c.g.a.a.e3.i.f2003a;
            this.w = 500L;
            this.x = 2000L;
        }
    }

    public final class c implements c.g.a.a.f3.y, c.g.a.a.o2.t, c.g.a.a.a3.k, c.g.a.a.w2.e, SurfaceHolder.Callback, TextureView.SurfaceTextureListener, SphericalGLSurfaceView.b, s0.b, r0.b, j2.b, v1.c, e1.a {
        public c() {
        }

        @Override
        public void a(int i) {
            c.g.a.a.r2.b V0 = i2.V0(i2.this.p);
            if (V0.equals(i2.this.R)) {
                return;
            }
            i2.this.R = V0;
            Iterator it = i2.this.l.iterator();
            while (it.hasNext()) {
                ((c.g.a.a.r2.c) it.next()).onDeviceInfoChanged(V0);
            }
        }

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

        @Override
        public void c(boolean z) {
            i2.this.x1();
        }

        @Override
        public void d(float f2) {
            i2.this.n1();
        }

        @Override
        public void e(int i) {
            boolean i2 = i2.this.i();
            i2.this.w1(i2, i, i2.X0(i2, i));
        }

        @Override
        public void f(Surface surface) {
            i2.this.s1(null);
        }

        @Override
        public void g(Surface surface) {
            i2.this.s1(surface);
        }

        @Override
        public void h(int i, boolean z) {
            Iterator it = i2.this.l.iterator();
            while (it.hasNext()) {
                ((c.g.a.a.r2.c) it.next()).onDeviceVolumeChanged(i, z);
            }
        }

        @Override
        public void i(boolean z) {
            d1.a(this, z);
        }

        @Override
        public void onAudioCodecError(Exception exc) {
            i2.this.m.onAudioCodecError(exc);
        }

        @Override
        public void onAudioDecoderInitialized(String str, long j, long j2) {
            i2.this.m.onAudioDecoderInitialized(str, j, j2);
        }

        @Override
        public void onAudioDecoderReleased(String str) {
            i2.this.m.onAudioDecoderReleased(str);
        }

        @Override
        public void onAudioDisabled(c.g.a.a.q2.d dVar) {
            i2.this.m.onAudioDisabled(dVar);
            i2.this.u = null;
            i2.this.G = null;
        }

        @Override
        public void onAudioEnabled(c.g.a.a.q2.d dVar) {
            i2.this.G = dVar;
            i2.this.m.onAudioEnabled(dVar);
        }

        @Override
        public void onAudioInputFormatChanged(Format format) {
            c.g.a.a.o2.s.c(this, format);
        }

        @Override
        public void onAudioInputFormatChanged(Format format, @Nullable c.g.a.a.q2.e eVar) {
            i2.this.u = format;
            i2.this.m.onAudioInputFormatChanged(format, eVar);
        }

        @Override
        public void onAudioPositionAdvancing(long j) {
            i2.this.m.onAudioPositionAdvancing(j);
        }

        @Override
        public void onAudioSinkError(Exception exc) {
            i2.this.m.onAudioSinkError(exc);
        }

        @Override
        public void onAudioUnderrun(int i, long j, long j2) {
            i2.this.m.onAudioUnderrun(i, j, j2);
        }

        @Override
        public void onAvailableCommandsChanged(v1.b bVar) {
            w1.a(this, bVar);
        }

        @Override
        public void onCues(List<c.g.a.a.a3.c> list) {
            i2.this.L = list;
            Iterator it = i2.this.j.iterator();
            while (it.hasNext()) {
                ((c.g.a.a.a3.k) it.next()).onCues(list);
            }
        }

        @Override
        public void onDroppedFrames(int i, long j) {
            i2.this.m.onDroppedFrames(i, j);
        }

        @Override
        public void onEvents(v1 v1Var, v1.d dVar) {
            w1.b(this, v1Var, dVar);
        }

        @Override
        public void onIsLoadingChanged(boolean z) {
            if (i2.this.O != null) {
                if (!z || i2.this.P) {
                    if (z || !i2.this.P) {
                        return;
                    }
                    i2.this.O.c(0);
                    i2.this.P = false;
                    return;
                }
                i2.this.O.a(0);
                i2.this.P = true;
            }
        }

        @Override
        public void onIsPlayingChanged(boolean z) {
            w1.c(this, z);
        }

        @Override
        public void onLoadingChanged(boolean z) {
            w1.d(this, z);
        }

        @Override
        public void onMediaItemTransition(m1 m1Var, int i) {
            w1.f(this, m1Var, i);
        }

        @Override
        public void onMediaMetadataChanged(n1 n1Var) {
            w1.g(this, n1Var);
        }

        @Override
        public void onMetadata(Metadata metadata) {
            i2.this.m.onMetadata(metadata);
            i2.this.f2297e.e1(metadata);
            Iterator it = i2.this.k.iterator();
            while (it.hasNext()) {
                ((c.g.a.a.w2.e) it.next()).onMetadata(metadata);
            }
        }

        @Override
        public void onPlayWhenReadyChanged(boolean z, int i) {
            i2.this.x1();
        }

        @Override
        public void onPlaybackParametersChanged(u1 u1Var) {
            w1.h(this, u1Var);
        }

        @Override
        public void onPlaybackStateChanged(int i) {
            i2.this.x1();
        }

        @Override
        public void onPlaybackSuppressionReasonChanged(int i) {
            w1.i(this, i);
        }

        @Override
        public void onPlayerError(PlaybackException playbackException) {
            w1.j(this, playbackException);
        }

        @Override
        public void onPlayerErrorChanged(PlaybackException playbackException) {
            w1.k(this, playbackException);
        }

        @Override
        public void onPlayerStateChanged(boolean z, int i) {
            w1.l(this, z, i);
        }

        @Override
        public void onPositionDiscontinuity(int i) {
            w1.m(this, i);
        }

        @Override
        public void onPositionDiscontinuity(v1.f fVar, v1.f fVar2, int i) {
            w1.n(this, fVar, fVar2, i);
        }

        @Override
        public void onRenderedFirstFrame(Object obj, long j) {
            i2.this.m.onRenderedFirstFrame(obj, j);
            if (i2.this.w == obj) {
                Iterator it = i2.this.f2300h.iterator();
                while (it.hasNext()) {
                    ((c.g.a.a.f3.w) it.next()).onRenderedFirstFrame();
                }
            }
        }

        @Override
        public void onRepeatModeChanged(int i) {
            w1.o(this, i);
        }

        @Override
        public void onSeekProcessed() {
            w1.p(this);
        }

        @Override
        public void onShuffleModeEnabledChanged(boolean z) {
            w1.q(this, z);
        }

        @Override
        public void onSkipSilenceEnabledChanged(boolean z) {
            if (i2.this.K == z) {
                return;
            }
            i2.this.K = z;
            i2.this.d1();
        }

        @Override
        public void onStaticMetadataChanged(List list) {
            w1.r(this, list);
        }

        @Override
        public void onSurfaceTextureAvailable(SurfaceTexture surfaceTexture, int i, int i2) {
            i2.this.r1(surfaceTexture);
            i2.this.c1(i, i2);
        }

        @Override
        public boolean onSurfaceTextureDestroyed(SurfaceTexture surfaceTexture) {
            i2.this.s1(null);
            i2.this.c1(0, 0);
            return true;
        }

        @Override
        public void onSurfaceTextureSizeChanged(SurfaceTexture surfaceTexture, int i, int i2) {
            i2.this.c1(i, i2);
        }

        @Override
        public void onSurfaceTextureUpdated(SurfaceTexture surfaceTexture) {
        }

        @Override
        public void onTimelineChanged(k2 k2Var, int i) {
            w1.s(this, k2Var, i);
        }

        @Override
        public void onTracksChanged(TrackGroupArray trackGroupArray, c.g.a.a.b3.k kVar) {
            w1.t(this, trackGroupArray, kVar);
        }

        @Override
        public void onVideoCodecError(Exception exc) {
            i2.this.m.onVideoCodecError(exc);
        }

        @Override
        public void onVideoDecoderInitialized(String str, long j, long j2) {
            i2.this.m.onVideoDecoderInitialized(str, j, j2);
        }

        @Override
        public void onVideoDecoderReleased(String str) {
            i2.this.m.onVideoDecoderReleased(str);
        }

        @Override
        public void onVideoDisabled(c.g.a.a.q2.d dVar) {
            i2.this.m.onVideoDisabled(dVar);
            i2.this.t = null;
            i2.this.F = null;
        }

        @Override
        public void onVideoEnabled(c.g.a.a.q2.d dVar) {
            i2.this.F = dVar;
            i2.this.m.onVideoEnabled(dVar);
        }

        @Override
        public void onVideoFrameProcessingOffset(long j, int i) {
            i2.this.m.onVideoFrameProcessingOffset(j, i);
        }

        @Override
        public void onVideoInputFormatChanged(Format format) {
            c.g.a.a.f3.x.d(this, format);
        }

        @Override
        public void onVideoInputFormatChanged(Format format, @Nullable c.g.a.a.q2.e eVar) {
            i2.this.t = format;
            i2.this.m.onVideoInputFormatChanged(format, eVar);
        }

        @Override
        public void onVideoSizeChanged(c.g.a.a.f3.z zVar) {
            i2.this.S = zVar;
            i2.this.m.onVideoSizeChanged(zVar);
            Iterator it = i2.this.f2300h.iterator();
            while (it.hasNext()) {
                c.g.a.a.f3.w wVar = (c.g.a.a.f3.w) it.next();
                wVar.onVideoSizeChanged(zVar);
                wVar.onVideoSizeChanged(zVar.f2234c, zVar.f2235d, zVar.f2236e, zVar.f2237f);
            }
        }

        @Override
        public void surfaceChanged(SurfaceHolder surfaceHolder, int i, int i2, int i3) {
            i2.this.c1(i2, i3);
        }

        @Override
        public void surfaceCreated(SurfaceHolder surfaceHolder) {
            if (i2.this.A) {
                i2.this.s1(surfaceHolder.getSurface());
            }
        }

        @Override
        public void surfaceDestroyed(SurfaceHolder surfaceHolder) {
            if (i2.this.A) {
                i2.this.s1(null);
            }
            i2.this.c1(0, 0);
        }
    }

    public static final class d implements c.g.a.a.f3.t, c.g.a.a.f3.a0.d, y1.b {
        @Nullable
        public c.g.a.a.f3.t f2310a;
        @Nullable
        public c.g.a.a.f3.a0.d f2311b;
        @Nullable
        public c.g.a.a.f3.t f2312d;
        @Nullable
        public c.g.a.a.f3.a0.d f2313e;

        public d() {
        }

        @Override
        public void a(long j, float[] fArr) {
            c.g.a.a.f3.a0.d dVar = this.f2313e;
            if (dVar != null) {
                dVar.a(j, fArr);
            }
            c.g.a.a.f3.a0.d dVar2 = this.f2311b;
            if (dVar2 != null) {
                dVar2.a(j, fArr);
            }
        }

        @Override
        public void c() {
            c.g.a.a.f3.a0.d dVar = this.f2313e;
            if (dVar != null) {
                dVar.c();
            }
            c.g.a.a.f3.a0.d dVar2 = this.f2311b;
            if (dVar2 != null) {
                dVar2.c();
            }
        }

        @Override
        public void d(long j, long j2, Format format, @Nullable MediaFormat mediaFormat) {
            c.g.a.a.f3.t tVar = this.f2312d;
            if (tVar != null) {
                tVar.d(j, j2, format, mediaFormat);
            }
            c.g.a.a.f3.t tVar2 = this.f2310a;
            if (tVar2 != null) {
                tVar2.d(j, j2, format, mediaFormat);
            }
        }

        @Override
        public void q(int i, @Nullable Object obj) {
            if (i == 6) {
                this.f2310a = (c.g.a.a.f3.t) obj;
            } else if (i == 7) {
                this.f2311b = (c.g.a.a.f3.a0.d) obj;
            } else if (i != 10000) {
            } else {
                SphericalGLSurfaceView sphericalGLSurfaceView = (SphericalGLSurfaceView) obj;
                if (sphericalGLSurfaceView == null) {
                    this.f2312d = null;
                    this.f2313e = null;
                    return;
                }
                this.f2312d = sphericalGLSurfaceView.getVideoFrameMetadataListener();
                this.f2313e = sphericalGLSurfaceView.getCameraMotionListener();
            }
        }
    }

    public i2(b bVar) {
        i2 i2Var;
        c.g.a.a.e3.l lVar = new c.g.a.a.e3.l();
        this.f2295c = lVar;
        try {
            Context applicationContext = bVar.f2301a.getApplicationContext();
            this.f2296d = applicationContext;
            c.g.a.a.n2.h1 h1Var = bVar.i;
            this.m = h1Var;
            this.O = bVar.k;
            this.I = bVar.l;
            this.C = bVar.q;
            this.K = bVar.p;
            this.s = bVar.x;
            c cVar = new c();
            this.f2298f = cVar;
            d dVar = new d();
            this.f2299g = dVar;
            this.f2300h = new CopyOnWriteArraySet<>();
            this.i = new CopyOnWriteArraySet<>();
            this.j = new CopyOnWriteArraySet<>();
            this.k = new CopyOnWriteArraySet<>();
            this.l = new CopyOnWriteArraySet<>();
            Handler handler = new Handler(bVar.j);
            c2[] a2 = bVar.f2302b.a(handler, cVar, cVar, cVar, cVar);
            this.f2294b = a2;
            this.J = 1.0f;
            if (c.g.a.a.e3.r0.f2053a < 21) {
                this.H = b1(0);
            } else {
                this.H = w0.a(applicationContext);
            }
            this.L = Collections.emptyList();
            this.M = true;
            try {
                f1 f1Var = new f1(a2, bVar.f2305e, bVar.f2306f, bVar.f2307g, bVar.f2308h, h1Var, bVar.r, bVar.s, bVar.t, bVar.u, bVar.v, bVar.w, bVar.y, bVar.f2303c, bVar.j, this, new v1.b.a().c(20, 21, 22, 23, 24, 25, 26, 27).e());
                i2Var = this;
                try {
                    i2Var.f2297e = f1Var;
                    f1Var.i0(cVar);
                    f1Var.h0(cVar);
                    if (bVar.f2304d > 0) {
                        f1Var.o0(bVar.f2304d);
                    }
                    r0 r0Var = new r0(bVar.f2301a, handler, cVar);
                    i2Var.n = r0Var;
                    r0Var.b(bVar.o);
                    s0 s0Var = new s0(bVar.f2301a, handler, cVar);
                    i2Var.o = s0Var;
                    s0Var.m(bVar.m ? i2Var.I : null);
                    j2 j2Var = new j2(bVar.f2301a, handler, cVar);
                    i2Var.p = j2Var;
                    j2Var.h(c.g.a.a.e3.r0.b0(i2Var.I.f2682e));
                    l2 l2Var = new l2(bVar.f2301a);
                    i2Var.q = l2Var;
                    l2Var.a(bVar.n != 0);
                    m2 m2Var = new m2(bVar.f2301a);
                    i2Var.r = m2Var;
                    m2Var.a(bVar.n == 2);
                    i2Var.R = V0(j2Var);
                    i2Var.S = c.g.a.a.f3.z.f2232a;
                    i2Var.m1(1, 102, Integer.valueOf(i2Var.H));
                    i2Var.m1(2, 102, Integer.valueOf(i2Var.H));
                    i2Var.m1(1, 3, i2Var.I);
                    i2Var.m1(2, 4, Integer.valueOf(i2Var.C));
                    i2Var.m1(1, 101, Boolean.valueOf(i2Var.K));
                    i2Var.m1(2, 6, dVar);
                    i2Var.m1(6, 7, dVar);
                    lVar.e();
                } catch (Throwable th) {
                    th = th;
                    i2Var.f2295c.e();
                    throw th;
                }
            } catch (Throwable th2) {
                th = th2;
                i2Var = this;
            }
        } catch (Throwable th3) {
            th = th3;
            i2Var = this;
        }
    }

    public static c.g.a.a.r2.b V0(j2 j2Var) {
        return new c.g.a.a.r2.b(0, j2Var.d(), j2Var.c());
    }

    public static int X0(boolean z, int i) {
        return (!z || i == 1) ? 1 : 2;
    }

    @Override
    public long A() {
        y1();
        return this.f2297e.A();
    }

    @Override
    public List<c.g.a.a.a3.c> B() {
        y1();
        return this.L;
    }

    @Override
    public int C() {
        y1();
        return this.f2297e.C();
    }

    @Override
    public void E(@Nullable SurfaceView surfaceView) {
        y1();
        U0(surfaceView == null ? null : surfaceView.getHolder());
    }

    @Override
    public int F() {
        y1();
        return this.f2297e.F();
    }

    @Override
    public TrackGroupArray G() {
        y1();
        return this.f2297e.G();
    }

    @Override
    public k2 H() {
        y1();
        return this.f2297e.H();
    }

    @Override
    public Looper I() {
        return this.f2297e.I();
    }

    @Override
    public boolean J() {
        y1();
        return this.f2297e.J();
    }

    @Override
    public long K() {
        y1();
        return this.f2297e.K();
    }

    public void M0(c.g.a.a.n2.j1 j1Var) {
        c.g.a.a.e3.g.e(j1Var);
        this.m.i(j1Var);
    }

    @Override
    public void N(@Nullable TextureView textureView) {
        y1();
        if (textureView == null) {
            T0();
            return;
        }
        j1();
        this.B = textureView;
        if (textureView.getSurfaceTextureListener() != null) {
            c.g.a.a.e3.v.h("SimpleExoPlayer", "Replacing existing SurfaceTextureListener.");
        }
        textureView.setSurfaceTextureListener(this.f2298f);
        SurfaceTexture surfaceTexture = textureView.isAvailable() ? textureView.getSurfaceTexture() : null;
        if (surfaceTexture == null) {
            s1(null);
            c1(0, 0);
            return;
        }
        r1(surfaceTexture);
        c1(textureView.getWidth(), textureView.getHeight());
    }

    @Deprecated
    public void N0(c.g.a.a.o2.r rVar) {
        c.g.a.a.e3.g.e(rVar);
        this.i.add(rVar);
    }

    @Override
    public c.g.a.a.b3.k O() {
        y1();
        return this.f2297e.O();
    }

    @Deprecated
    public void O0(c.g.a.a.r2.c cVar) {
        c.g.a.a.e3.g.e(cVar);
        this.l.add(cVar);
    }

    @Deprecated
    public void P0(v1.c cVar) {
        c.g.a.a.e3.g.e(cVar);
        this.f2297e.i0(cVar);
    }

    @Override
    public n1 Q() {
        return this.f2297e.Q();
    }

    @Deprecated
    public void Q0(c.g.a.a.w2.e eVar) {
        c.g.a.a.e3.g.e(eVar);
        this.k.add(eVar);
    }

    @Override
    public long R() {
        y1();
        return this.f2297e.R();
    }

    @Deprecated
    public void R0(c.g.a.a.a3.k kVar) {
        c.g.a.a.e3.g.e(kVar);
        this.j.add(kVar);
    }

    @Deprecated
    public void S0(c.g.a.a.f3.w wVar) {
        c.g.a.a.e3.g.e(wVar);
        this.f2300h.add(wVar);
    }

    public void T0() {
        y1();
        j1();
        s1(null);
        c1(0, 0);
    }

    public void U0(@Nullable SurfaceHolder surfaceHolder) {
        y1();
        if (surfaceHolder == null || surfaceHolder != this.y) {
            return;
        }
        T0();
    }

    public boolean W0() {
        y1();
        return this.f2297e.n0();
    }

    @Override
    @Nullable
    public ExoPlaybackException v() {
        y1();
        return this.f2297e.v();
    }

    public int Z0() {
        y1();
        return this.f2297e.x0();
    }

    @Override
    @Nullable
    public c.g.a.a.b3.m a() {
        y1();
        return this.f2297e.a();
    }

    public int a1(int i) {
        y1();
        return this.f2297e.y0(i);
    }

    public final int b1(int i) {
        AudioTrack audioTrack = this.v;
        if (audioTrack != null && audioTrack.getAudioSessionId() != i) {
            this.v.release();
            this.v = null;
        }
        if (this.v == null) {
            this.v = new AudioTrack(3, 4000, 4, 2, 2, 0, i);
        }
        return this.v.getAudioSessionId();
    }

    @Override
    public u1 c() {
        y1();
        return this.f2297e.c();
    }

    public final void c1(int i, int i2) {
        if (i == this.D && i2 == this.E) {
            return;
        }
        this.D = i;
        this.E = i2;
        this.m.onSurfaceSizeChanged(i, i2);
        Iterator<c.g.a.a.f3.w> it = this.f2300h.iterator();
        while (it.hasNext()) {
            it.next().onSurfaceSizeChanged(i, i2);
        }
    }

    @Override
    public void d(u1 u1Var) {
        y1();
        this.f2297e.d(u1Var);
    }

    public final void d1() {
        this.m.onSkipSilenceEnabledChanged(this.K);
        Iterator<c.g.a.a.o2.r> it = this.i.iterator();
        while (it.hasNext()) {
            it.next().onSkipSilenceEnabledChanged(this.K);
        }
    }

    @Override
    public boolean e() {
        y1();
        return this.f2297e.e();
    }

    public void e1() {
        AudioTrack audioTrack;
        y1();
        if (c.g.a.a.e3.r0.f2053a < 21 && (audioTrack = this.v) != null) {
            audioTrack.release();
            this.v = null;
        }
        this.n.b(false);
        this.p.g();
        this.q.b(false);
        this.r.b(false);
        this.o.i();
        this.f2297e.g1();
        this.m.A0();
        j1();
        Surface surface = this.x;
        if (surface != null) {
            surface.release();
            this.x = null;
        }
        if (this.P) {
            ((PriorityTaskManager) c.g.a.a.e3.g.e(this.O)).c(0);
            this.P = false;
        }
        this.L = Collections.emptyList();
        this.Q = true;
    }

    @Override
    public long f() {
        y1();
        return this.f2297e.f();
    }

    @Deprecated
    public void f1(c.g.a.a.o2.r rVar) {
        this.i.remove(rVar);
    }

    @Override
    public void g(int i, long j) {
        y1();
        this.m.z0();
        this.f2297e.g(i, j);
    }

    @Deprecated
    public void g1(c.g.a.a.r2.c cVar) {
        this.l.remove(cVar);
    }

    @Override
    public long getCurrentPosition() {
        y1();
        return this.f2297e.getCurrentPosition();
    }

    @Override
    public long getDuration() {
        y1();
        return this.f2297e.getDuration();
    }

    @Override
    public int getPlaybackState() {
        y1();
        return this.f2297e.getPlaybackState();
    }

    @Override
    public int getRepeatMode() {
        y1();
        return this.f2297e.getRepeatMode();
    }

    @Override
    public v1.b h() {
        y1();
        return this.f2297e.h();
    }

    @Deprecated
    public void h1(v1.c cVar) {
        this.f2297e.h1(cVar);
    }

    @Override
    public boolean i() {
        y1();
        return this.f2297e.i();
    }

    @Deprecated
    public void i1(c.g.a.a.w2.e eVar) {
        this.k.remove(eVar);
    }

    @Override
    public void j(boolean z) {
        y1();
        this.f2297e.j(z);
    }

    public final void j1() {
        if (this.z != null) {
            this.f2297e.l0(this.f2299g).n(Camera2CameraImpl.StateCallback.CameraReopenMonitor.REOPEN_LIMIT_MS).m(null).l();
            this.z.i(this.f2298f);
            this.z = null;
        }
        TextureView textureView = this.B;
        if (textureView != null) {
            if (textureView.getSurfaceTextureListener() != this.f2298f) {
                c.g.a.a.e3.v.h("SimpleExoPlayer", "SurfaceTextureListener already unset or replaced.");
            } else {
                this.B.setSurfaceTextureListener(null);
            }
            this.B = null;
        }
        SurfaceHolder surfaceHolder = this.y;
        if (surfaceHolder != null) {
            surfaceHolder.removeCallback(this.f2298f);
            this.y = null;
        }
    }

    @Override
    @Deprecated
    public void k(boolean z) {
        y1();
        this.o.p(i(), 1);
        this.f2297e.k(z);
        this.L = Collections.emptyList();
    }

    @Deprecated
    public void k1(c.g.a.a.a3.k kVar) {
        this.j.remove(kVar);
    }

    @Override
    public int l() {
        y1();
        return this.f2297e.l();
    }

    @Deprecated
    public void l1(c.g.a.a.f3.w wVar) {
        this.f2300h.remove(wVar);
    }

    @Override
    public int m() {
        y1();
        return this.f2297e.m();
    }

    public final void m1(int i, int i2, @Nullable Object obj) {
        c2[] c2VarArr;
        for (c2 c2Var : this.f2294b) {
            if (c2Var.getTrackType() == i) {
                this.f2297e.l0(c2Var).n(i2).m(obj).l();
            }
        }
    }

    public final void n1() {
        m1(1, 2, Float.valueOf(this.J * this.o.g()));
    }

    @Override
    public void o(@Nullable TextureView textureView) {
        y1();
        if (textureView == null || textureView != this.B) {
            return;
        }
        T0();
    }

    public void o1(c.g.a.a.z2.e0 e0Var) {
        y1();
        this.f2297e.k1(e0Var);
    }

    @Override
    public c.g.a.a.f3.z p() {
        return this.S;
    }

    public final void p1(SurfaceHolder surfaceHolder) {
        this.A = false;
        this.y = surfaceHolder;
        surfaceHolder.addCallback(this.f2298f);
        Surface surface = this.y.getSurface();
        if (surface != null && surface.isValid()) {
            Rect surfaceFrame = this.y.getSurfaceFrame();
            c1(surfaceFrame.width(), surfaceFrame.height());
            return;
        }
        c1(0, 0);
    }

    @Override
    public void prepare() {
        y1();
        boolean i = i();
        int p = this.o.p(i, 2);
        w1(i, p, X0(i, p));
        this.f2297e.prepare();
    }

    @Override
    public void q(v1.e eVar) {
        c.g.a.a.e3.g.e(eVar);
        f1(eVar);
        l1(eVar);
        k1(eVar);
        i1(eVar);
        g1(eVar);
        h1(eVar);
    }

    public void q1(@Nullable h2 h2Var) {
        y1();
        this.f2297e.p1(h2Var);
    }

    @Override
    public int r() {
        y1();
        return this.f2297e.r();
    }

    public final void r1(SurfaceTexture surfaceTexture) {
        Surface surface = new Surface(surfaceTexture);
        s1(surface);
        this.x = surface;
    }

    @Override
    public void s(@Nullable SurfaceView surfaceView) {
        y1();
        if (surfaceView instanceof c.g.a.a.f3.s) {
            j1();
            s1(surfaceView);
            p1(surfaceView.getHolder());
        } else if (surfaceView instanceof SphericalGLSurfaceView) {
            j1();
            this.z = (SphericalGLSurfaceView) surfaceView;
            this.f2297e.l0(this.f2299g).n(Camera2CameraImpl.StateCallback.CameraReopenMonitor.REOPEN_LIMIT_MS).m(this.z).l();
            this.z.b(this.f2298f);
            s1(this.z.getVideoSurface());
            p1(surfaceView.getHolder());
        } else {
            u1(surfaceView == null ? null : surfaceView.getHolder());
        }
    }

    public final void s1(@Nullable Object obj) {
        boolean z;
        ArrayList<y1> arrayList = new ArrayList();
        c2[] c2VarArr = this.f2294b;
        int length = c2VarArr.length;
        int i = 0;
        while (true) {
            z = true;
            if (i >= length) {
                break;
            }
            c2 c2Var = c2VarArr[i];
            if (c2Var.getTrackType() == 2) {
                arrayList.add(this.f2297e.l0(c2Var).n(1).m(obj).l());
            }
            i++;
        }
        Object obj2 = this.w;
        if (obj2 == null || obj2 == obj) {
            z = false;
        } else {
            try {
                for (y1 y1Var : arrayList) {
                    y1Var.a(this.s);
                }
            } catch (InterruptedException unused) {
                Thread.currentThread().interrupt();
            } catch (TimeoutException unused2) {
            }
            z = false;
            Object obj3 = this.w;
            Surface surface = this.x;
            if (obj3 == surface) {
                surface.release();
                this.x = null;
            }
        }
        this.w = obj;
        if (z) {
            this.f2297e.q1(false, ExoPlaybackException.createForUnexpected(new ExoTimeoutException(3), 1003));
        }
    }

    @Override
    public void setRepeatMode(int i) {
        y1();
        this.f2297e.setRepeatMode(i);
    }

    @Override
    public int t() {
        y1();
        return this.f2297e.t();
    }

    public void t1(@Nullable Surface surface) {
        y1();
        j1();
        s1(surface);
        int i = surface == null ? 0 : -1;
        c1(i, i);
    }

    public void u1(@Nullable SurfaceHolder surfaceHolder) {
        y1();
        if (surfaceHolder == null) {
            T0();
            return;
        }
        j1();
        this.A = true;
        this.y = surfaceHolder;
        surfaceHolder.addCallback(this.f2298f);
        Surface surface = surfaceHolder.getSurface();
        if (surface != null && surface.isValid()) {
            s1(surface);
            Rect surfaceFrame = surfaceHolder.getSurfaceFrame();
            c1(surfaceFrame.width(), surfaceFrame.height());
            return;
        }
        s1(null);
        c1(0, 0);
    }

    public void v1(float f2) {
        y1();
        float p = c.g.a.a.e3.r0.p(f2, 0.0f, 1.0f);
        if (this.J == p) {
            return;
        }
        this.J = p;
        n1();
        this.m.onVolumeChanged(p);
        Iterator<c.g.a.a.o2.r> it = this.i.iterator();
        while (it.hasNext()) {
            it.next().onVolumeChanged(p);
        }
    }

    @Override
    public void w(boolean z) {
        y1();
        int p = this.o.p(z, getPlaybackState());
        w1(z, p, X0(z, p));
    }

    public final void w1(boolean z, int i, int i2) {
        int i3 = 0;
        boolean z2 = z && i != -1;
        if (z2 && i != 1) {
            i3 = 1;
        }
        this.f2297e.o1(z2, i3, i2);
    }

    @Override
    public long x() {
        y1();
        return this.f2297e.x();
    }

    public final void x1() {
        int playbackState = getPlaybackState();
        boolean z = true;
        if (playbackState != 1) {
            if (playbackState == 2 || playbackState == 3) {
                this.q.b((!i() || W0()) ? false : false);
                this.r.b(i());
                return;
            } else if (playbackState != 4) {
                throw new IllegalStateException();
            }
        }
        this.q.b(false);
        this.r.b(false);
    }

    @Override
    public long y() {
        y1();
        return this.f2297e.y();
    }

    public final void y1() {
        this.f2295c.b();
        if (Thread.currentThread() != I().getThread()) {
            String C = c.g.a.a.e3.r0.C("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(), I().getThread().getName());
            if (!this.M) {
                c.g.a.a.e3.v.i("SimpleExoPlayer", C, this.N ? null : new IllegalStateException());
                this.N = true;
                return;
            }
            throw new IllegalStateException(C);
        }
    }

    @Override
    public void z(v1.e eVar) {
        c.g.a.a.e3.g.e(eVar);
        N0(eVar);
        S0(eVar);
        R0(eVar);
        Q0(eVar);
        O0(eVar);
        P0(eVar);
    }
}