package p138.p176.p177.p190;

import android.content.Context;
import android.graphics.Rect;
import android.graphics.SurfaceTexture;
import android.os.Handler;
import android.os.Looper;
import android.util.Log;
import android.view.Surface;
import android.view.SurfaceHolder;
import android.view.TextureView;
import com.google.android.exoplayer2.ExoPlaybackException;
import com.google.android.exoplayer2.drm.DefaultDrmSessionManager;
import com.google.android.exoplayer2.util.PriorityTaskManager;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Iterator;
import java.util.List;
import java.util.concurrent.CopyOnWriteArraySet;
import p000.p001.p002.p003.p004.C0567;
import p138.p176.p177.p190.AbstractC3410;
import p138.p176.p177.p190.C3404;
import p138.p176.p177.p190.C3407;
import p138.p176.p177.p190.InterfaceC3442;
import p138.p176.p177.p190.p191.C3463;
import p138.p176.p177.p190.p191.InterfaceC3466;
import p138.p176.p177.p190.p192.C3478;
import p138.p176.p177.p190.p192.InterfaceC3481;
import p138.p176.p177.p190.p192.InterfaceC3482;
import p138.p176.p177.p190.p193.C3510;
import p138.p176.p177.p190.p194.C3531;
import p138.p176.p177.p190.p194.C3542;
import p138.p176.p177.p190.p194.InterfaceC3532;
import p138.p176.p177.p190.p210.C3710;
import p138.p176.p177.p190.p210.InterfaceC3718;
import p138.p176.p177.p190.p217.C3829;
import p138.p176.p177.p190.p217.InterfaceC3800;
import p138.p176.p177.p190.p226.C3946;
import p138.p176.p177.p190.p226.InterfaceC3955;
import p138.p176.p177.p190.p235.AbstractC4043;
import p138.p176.p177.p190.p235.C4039;
import p138.p176.p177.p190.p238.InterfaceC4090;
import p138.p176.p177.p190.p239.C4131;
import p138.p176.p177.p190.p239.InterfaceC4120;
import p138.p176.p177.p190.p240.InterfaceC4168;
import p138.p176.p177.p190.p240.InterfaceC4170;
import p138.p176.p177.p190.p240.InterfaceC4175;
import p138.p176.p177.p190.p240.InterfaceC4176;
import p138.p176.p177.p190.p240.p241.InterfaceC4178;

/* JADX INFO: renamed from: ދ.ހ.֏.ؠ.ࢥ, reason: contains not printable characters */
/* JADX INFO: loaded from: classes.dex */
public class C3454 extends AbstractC3410 implements InterfaceC3420, InterfaceC3442.InterfaceC3445, InterfaceC3442.InterfaceC3444 {

    /* JADX INFO: renamed from: ؠ, reason: contains not printable characters */
    public final InterfaceC3450[] f10185;

    /* JADX INFO: renamed from: ހ, reason: contains not printable characters */
    public final C3421 f10186;

    /* JADX INFO: renamed from: ށ, reason: contains not printable characters */
    public final Handler f10187;

    /* JADX INFO: renamed from: ނ, reason: contains not printable characters */
    public final SurfaceHolderCallbackC3456 f10188;

    /* JADX INFO: renamed from: ރ, reason: contains not printable characters */
    public final CopyOnWriteArraySet<InterfaceC4175> f10189;

    /* JADX INFO: renamed from: ބ, reason: contains not printable characters */
    public final CopyOnWriteArraySet<InterfaceC3481> f10190;

    /* JADX INFO: renamed from: ޅ, reason: contains not printable characters */
    public final CopyOnWriteArraySet<InterfaceC3955> f10191;

    /* JADX INFO: renamed from: ކ, reason: contains not printable characters */
    public final CopyOnWriteArraySet<InterfaceC3718> f10192;

    /* JADX INFO: renamed from: އ, reason: contains not printable characters */
    public final CopyOnWriteArraySet<InterfaceC4176> f10193;

    /* JADX INFO: renamed from: ވ, reason: contains not printable characters */
    public final CopyOnWriteArraySet<InterfaceC3482> f10194;

    /* JADX INFO: renamed from: މ, reason: contains not printable characters */
    public final InterfaceC4090 f10195;

    /* JADX INFO: renamed from: ފ, reason: contains not printable characters */
    public final C3463 f10196;

    /* JADX INFO: renamed from: ދ, reason: contains not printable characters */
    public final C3404 f10197;

    /* JADX INFO: renamed from: ތ, reason: contains not printable characters */
    public final C3407 f10198;

    /* JADX INFO: renamed from: ލ, reason: contains not printable characters */
    public final C3461 f10199;

    /* JADX INFO: renamed from: ގ, reason: contains not printable characters */
    public final C3462 f10200;

    /* JADX INFO: renamed from: ޏ, reason: contains not printable characters */
    public C3431 f10201;

    /* JADX INFO: renamed from: ސ, reason: contains not printable characters */
    public C3431 f10202;

    /* JADX INFO: renamed from: ޑ, reason: contains not printable characters */
    public Surface f10203;

    /* JADX INFO: renamed from: ޒ, reason: contains not printable characters */
    public boolean f10204;

    /* JADX INFO: renamed from: ޓ, reason: contains not printable characters */
    public SurfaceHolder f10205;

    /* JADX INFO: renamed from: ޔ, reason: contains not printable characters */
    public TextureView f10206;

    /* JADX INFO: renamed from: ޕ, reason: contains not printable characters */
    public int f10207;

    /* JADX INFO: renamed from: ޖ, reason: contains not printable characters */
    public int f10208;

    /* JADX INFO: renamed from: ޗ, reason: contains not printable characters */
    public C3510 f10209;

    /* JADX INFO: renamed from: ޘ, reason: contains not printable characters */
    public C3510 f10210;

    /* JADX INFO: renamed from: ޙ, reason: contains not printable characters */
    public int f10211;

    /* JADX INFO: renamed from: ޚ, reason: contains not printable characters */
    public C3478 f10212;

    /* JADX INFO: renamed from: ޛ, reason: contains not printable characters */
    public float f10213;

    /* JADX INFO: renamed from: ޜ, reason: contains not printable characters */
    public InterfaceC3800 f10214;

    /* JADX INFO: renamed from: ޝ, reason: contains not printable characters */
    public List<C3946> f10215;

    /* JADX INFO: renamed from: ޞ, reason: contains not printable characters */
    public InterfaceC4170 f10216;

    /* JADX INFO: renamed from: ޟ, reason: contains not printable characters */
    public InterfaceC4178 f10217;

    /* JADX INFO: renamed from: ޠ, reason: contains not printable characters */
    public boolean f10218;

    /* JADX INFO: renamed from: ޡ, reason: contains not printable characters */
    public PriorityTaskManager f10219;

    /* JADX INFO: renamed from: ޢ, reason: contains not printable characters */
    public boolean f10220;

    /* JADX INFO: renamed from: ޣ, reason: contains not printable characters */
    public boolean f10221;

    /* JADX INFO: renamed from: ދ.ހ.֏.ؠ.ࢥ$ؠ, reason: contains not printable characters */
    public final class SurfaceHolderCallbackC3456 implements InterfaceC4176, InterfaceC3482, InterfaceC3955, InterfaceC3718, SurfaceHolder.Callback, TextureView.SurfaceTextureListener, C3407.InterfaceC3409, C3404.InterfaceC3406, InterfaceC3442.InterfaceC3443 {
        public /* synthetic */ SurfaceHolderCallbackC3456(C3455 c3455) {
        }

        @Override // android.view.TextureView.SurfaceTextureListener
        public void onSurfaceTextureAvailable(SurfaceTexture surfaceTexture, int i, int i2) {
            C3454.this.m5654(new Surface(surfaceTexture), true);
            C3454.this.m5652(i, i2);
        }

        @Override // android.view.TextureView.SurfaceTextureListener
        public boolean onSurfaceTextureDestroyed(SurfaceTexture surfaceTexture) {
            C3454.this.m5654((Surface) null, true);
            C3454.this.m5652(0, 0);
            return true;
        }

        @Override // android.view.TextureView.SurfaceTextureListener
        public void onSurfaceTextureSizeChanged(SurfaceTexture surfaceTexture, int i, int i2) {
            C3454.this.m5652(i, i2);
        }

        @Override // android.view.TextureView.SurfaceTextureListener
        public void onSurfaceTextureUpdated(SurfaceTexture surfaceTexture) {
        }

        @Override // android.view.SurfaceHolder.Callback
        public void surfaceChanged(SurfaceHolder surfaceHolder, int i, int i2, int i3) {
            C3454.this.m5652(i2, i3);
        }

        @Override // android.view.SurfaceHolder.Callback
        public void surfaceCreated(SurfaceHolder surfaceHolder) {
            C3454.this.m5654(surfaceHolder.getSurface(), false);
        }

        @Override // android.view.SurfaceHolder.Callback
        public void surfaceDestroyed(SurfaceHolder surfaceHolder) {
            C3454.this.m5654((Surface) null, false);
            C3454.this.m5652(0, 0);
        }

        @Override // p138.p176.p177.p190.p192.InterfaceC3482
        /* JADX INFO: renamed from: ֏, reason: contains not printable characters */
        public void mo5663(int i) {
            C3454 c3454 = C3454.this;
            if (c3454.f10211 == i) {
                return;
            }
            c3454.f10211 = i;
            for (InterfaceC3481 interfaceC3481 : c3454.f10190) {
                if (!C3454.this.f10194.contains(interfaceC3481)) {
                    interfaceC3481.m5760(i);
                }
            }
            Iterator<InterfaceC3482> it = C3454.this.f10194.iterator();
            while (it.hasNext()) {
                it.next().mo5663(i);
            }
        }

        @Override // p138.p176.p177.p190.p240.InterfaceC4176
        /* JADX INFO: renamed from: ֏, reason: contains not printable characters */
        public void mo5664(int i, int i2, int i3, float f) {
            for (InterfaceC4175 interfaceC4175 : C3454.this.f10189) {
                if (!C3454.this.f10193.contains(interfaceC4175)) {
                    interfaceC4175.mo6561(i, i2, i3, f);
                }
            }
            Iterator<InterfaceC4176> it = C3454.this.f10193.iterator();
            while (it.hasNext()) {
                it.next().mo5664(i, i2, i3, f);
            }
        }

        @Override // p138.p176.p177.p190.p240.InterfaceC4176
        /* JADX INFO: renamed from: ֏, reason: contains not printable characters */
        public void mo5665(int i, long j) {
            Iterator<InterfaceC4176> it = C3454.this.f10193.iterator();
            while (it.hasNext()) {
                it.next().mo5665(i, j);
            }
        }

        @Override // p138.p176.p177.p190.p192.InterfaceC3482
        /* JADX INFO: renamed from: ֏, reason: contains not printable characters */
        public void mo5666(int i, long j, long j2) {
            Iterator<InterfaceC3482> it = C3454.this.f10194.iterator();
            while (it.hasNext()) {
                it.next().mo5666(i, j, j2);
            }
        }

        @Override // p138.p176.p177.p190.p240.InterfaceC4176
        /* JADX INFO: renamed from: ֏, reason: contains not printable characters */
        public void mo5667(Surface surface) {
            C3454 c3454 = C3454.this;
            if (c3454.f10203 == surface) {
                Iterator<InterfaceC4175> it = c3454.f10189.iterator();
                while (it.hasNext()) {
                    it.next().mo5699();
                }
            }
            Iterator<InterfaceC4176> it2 = C3454.this.f10193.iterator();
            while (it2.hasNext()) {
                it2.next().mo5667(surface);
            }
        }

        @Override // p138.p176.p177.p190.InterfaceC3442.InterfaceC3443
        /* JADX INFO: renamed from: ֏ */
        public /* synthetic */ void mo1956(ExoPlaybackException exoPlaybackException) {
            C3441.m5633(this, exoPlaybackException);
        }

        @Override // p138.p176.p177.p190.p240.InterfaceC4176
        /* JADX INFO: renamed from: ֏, reason: contains not printable characters */
        public void mo5668(String str, long j, long j2) {
            Iterator<InterfaceC4176> it = C3454.this.f10193.iterator();
            while (it.hasNext()) {
                it.next().mo5668(str, j, j2);
            }
        }

        @Override // p138.p176.p177.p190.p226.InterfaceC3955
        /* JADX INFO: renamed from: ֏ */
        public void mo1278(List<C3946> list) {
            C3454 c3454 = C3454.this;
            c3454.f10215 = list;
            Iterator<InterfaceC3955> it = c3454.f10191.iterator();
            while (it.hasNext()) {
                it.next().mo1278(list);
            }
        }

        @Override // p138.p176.p177.p190.p240.InterfaceC4176
        /* JADX INFO: renamed from: ֏, reason: contains not printable characters */
        public void mo5669(C3431 c3431) {
            C3454 c3454 = C3454.this;
            c3454.f10201 = c3431;
            Iterator<InterfaceC4176> it = c3454.f10193.iterator();
            while (it.hasNext()) {
                it.next().mo5669(c3431);
            }
        }

        @Override // p138.p176.p177.p190.InterfaceC3442.InterfaceC3443
        /* JADX INFO: renamed from: ֏ */
        public /* synthetic */ void mo1957(C3439 c3439) {
            C3441.m5634(this, c3439);
        }

        @Override // p138.p176.p177.p190.InterfaceC3442.InterfaceC3443
        /* JADX INFO: renamed from: ֏ */
        public /* synthetic */ void mo1958(AbstractC3457 abstractC3457, int i) {
            C3441.m5635(this, abstractC3457, i);
        }

        @Override // p138.p176.p177.p190.InterfaceC3442.InterfaceC3443
        @Deprecated
        /* JADX INFO: renamed from: ֏ */
        public /* synthetic */ void mo1959(AbstractC3457 abstractC3457, Object obj, int i) {
            C3441.m5636(this, abstractC3457, obj, i);
        }

        @Override // p138.p176.p177.p190.p192.InterfaceC3482
        /* JADX INFO: renamed from: ֏, reason: contains not printable characters */
        public void mo5670(C3510 c3510) {
            Iterator<InterfaceC3482> it = C3454.this.f10194.iterator();
            while (it.hasNext()) {
                it.next().mo5670(c3510);
            }
            C3454 c3454 = C3454.this;
            c3454.f10202 = null;
            c3454.f10211 = 0;
        }

        @Override // p138.p176.p177.p190.p210.InterfaceC3718
        /* JADX INFO: renamed from: ֏, reason: contains not printable characters */
        public void mo5671(C3710 c3710) {
            Iterator<InterfaceC3718> it = C3454.this.f10192.iterator();
            while (it.hasNext()) {
                it.next().mo5671(c3710);
            }
        }

        @Override // p138.p176.p177.p190.InterfaceC3442.InterfaceC3443
        /* JADX INFO: renamed from: ֏ */
        public /* synthetic */ void mo1960(C3829 c3829, C4039 c4039) {
            C3441.m5637(this, c3829, c4039);
        }

        @Override // p138.p176.p177.p190.InterfaceC3442.InterfaceC3443
        /* JADX INFO: renamed from: ֏ */
        public void mo1961(boolean z) {
            C3454 c3454 = C3454.this;
            PriorityTaskManager priorityTaskManager = c3454.f10219;
            if (priorityTaskManager != null) {
                if (z && !c3454.f10220) {
                    priorityTaskManager.m1303(0);
                    C3454.this.f10220 = true;
                } else {
                    if (z) {
                        return;
                    }
                    C3454 c34542 = C3454.this;
                    if (c34542.f10220) {
                        c34542.f10219.m1304(0);
                        C3454.this.f10220 = false;
                    }
                }
            }
        }

        @Override // p138.p176.p177.p190.InterfaceC3442.InterfaceC3443
        /* JADX INFO: renamed from: ֏ */
        public void mo1962(boolean z, int i) {
            C3454 c3454 = C3454.this;
            int iMo5493 = c3454.mo5493();
            if (iMo5493 != 1) {
                if (iMo5493 == 2 || iMo5493 == 3) {
                    c3454.f10199.f10240 = c3454.mo5500();
                    c3454.f10200.f10241 = c3454.mo5500();
                    return;
                }
                if (iMo5493 != 4) {
                    throw new IllegalStateException();
                }
            }
            c3454.f10199.f10240 = false;
            c3454.f10200.f10241 = false;
        }

        @Override // p138.p176.p177.p190.InterfaceC3442.InterfaceC3443
        /* JADX INFO: renamed from: ؠ */
        public /* synthetic */ void mo1963() {
            C3441.m5631(this);
        }

        @Override // p138.p176.p177.p190.InterfaceC3442.InterfaceC3443
        /* JADX INFO: renamed from: ؠ */
        public /* synthetic */ void mo1964(int i) {
            C3441.m5641(this, i);
        }

        @Override // p138.p176.p177.p190.p192.InterfaceC3482
        /* JADX INFO: renamed from: ؠ, reason: contains not printable characters */
        public void mo5672(String str, long j, long j2) {
            Iterator<InterfaceC3482> it = C3454.this.f10194.iterator();
            while (it.hasNext()) {
                it.next().mo5672(str, j, j2);
            }
        }

        @Override // p138.p176.p177.p190.p192.InterfaceC3482
        /* JADX INFO: renamed from: ؠ, reason: contains not printable characters */
        public void mo5673(C3431 c3431) {
            C3454 c3454 = C3454.this;
            c3454.f10202 = c3431;
            Iterator<InterfaceC3482> it = c3454.f10194.iterator();
            while (it.hasNext()) {
                it.next().mo5673(c3431);
            }
        }

        @Override // p138.p176.p177.p190.p192.InterfaceC3482
        /* JADX INFO: renamed from: ؠ, reason: contains not printable characters */
        public void mo5674(C3510 c3510) {
            C3454 c3454 = C3454.this;
            c3454.f10210 = c3510;
            Iterator<InterfaceC3482> it = c3454.f10194.iterator();
            while (it.hasNext()) {
                it.next().mo5674(c3510);
            }
        }

        @Override // p138.p176.p177.p190.InterfaceC3442.InterfaceC3443
        /* JADX INFO: renamed from: ؠ */
        public /* synthetic */ void mo1965(boolean z) {
            C3441.m5642(this, z);
        }

        @Override // p138.p176.p177.p190.InterfaceC3442.InterfaceC3443
        /* JADX INFO: renamed from: ހ */
        public /* synthetic */ void mo1966(int i) {
            C3441.m5632(this, i);
        }

        @Override // p138.p176.p177.p190.p240.InterfaceC4176
        /* JADX INFO: renamed from: ހ, reason: contains not printable characters */
        public void mo5675(C3510 c3510) {
            C3454 c3454 = C3454.this;
            c3454.f10209 = c3510;
            Iterator<InterfaceC4176> it = c3454.f10193.iterator();
            while (it.hasNext()) {
                it.next().mo5675(c3510);
            }
        }

        @Override // p138.p176.p177.p190.InterfaceC3442.InterfaceC3443
        /* JADX INFO: renamed from: ހ */
        public /* synthetic */ void mo1967(boolean z) {
            C3441.m5638(this, z);
        }

        @Override // p138.p176.p177.p190.InterfaceC3442.InterfaceC3443
        /* JADX INFO: renamed from: ށ */
        public /* synthetic */ void mo1968(int i) {
            C3441.m5639(this, i);
        }

        @Override // p138.p176.p177.p190.p240.InterfaceC4176
        /* JADX INFO: renamed from: ށ, reason: contains not printable characters */
        public void mo5676(C3510 c3510) {
            Iterator<InterfaceC4176> it = C3454.this.f10193.iterator();
            while (it.hasNext()) {
                it.next().mo5676(c3510);
            }
            C3454.this.f10201 = null;
        }
    }

    public C3454(Context context, InterfaceC3452 interfaceC3452, AbstractC4043 abstractC4043, InterfaceC3434 interfaceC3434, InterfaceC4090 interfaceC4090, C3463 c3463, InterfaceC4120 interfaceC4120, Looper looper) {
        InterfaceC3532<C3542> interfaceC3532M5830 = C3531.m5830();
        this.f10195 = interfaceC4090;
        this.f10196 = c3463;
        this.f10188 = new SurfaceHolderCallbackC3456(null);
        this.f10189 = new CopyOnWriteArraySet<>();
        this.f10190 = new CopyOnWriteArraySet<>();
        this.f10191 = new CopyOnWriteArraySet<>();
        this.f10192 = new CopyOnWriteArraySet<>();
        this.f10193 = new CopyOnWriteArraySet<>();
        this.f10194 = new CopyOnWriteArraySet<>();
        Handler handler = new Handler(looper);
        this.f10187 = handler;
        SurfaceHolderCallbackC3456 surfaceHolderCallbackC3456 = this.f10188;
        this.f10185 = interfaceC3452.m5650(handler, surfaceHolderCallbackC3456, surfaceHolderCallbackC3456, surfaceHolderCallbackC3456, surfaceHolderCallbackC3456, interfaceC3532M5830);
        this.f10213 = 1.0f;
        this.f10211 = 0;
        this.f10212 = C3478.f10285;
        this.f10215 = Collections.emptyList();
        C3421 c3421 = new C3421(this.f10185, abstractC4043, interfaceC3434, interfaceC4090, interfaceC4120, looper);
        this.f10186 = c3421;
        C0567.m1932(c3463.f10246 == null || c3463.f10245.f10250.isEmpty());
        c3463.f10246 = c3421;
        this.f10186.f10002.addIfAbsent(new AbstractC3410.C3411(c3463));
        this.f10186.mo5484(this.f10188);
        this.f10193.add(c3463);
        this.f10189.add(c3463);
        this.f10194.add(c3463);
        this.f10190.add(c3463);
        this.f10192.add(c3463);
        interfaceC4090.mo6576(this.f10187, c3463);
        if (interfaceC3532M5830 instanceof DefaultDrmSessionManager) {
            ((DefaultDrmSessionManager) interfaceC3532M5830).f1639.m6631(this.f10187, c3463);
        }
        this.f10197 = new C3404(context, this.f10187, this.f10188);
        this.f10198 = new C3407(context, this.f10187, this.f10188);
        this.f10199 = new C3461(context);
        this.f10200 = new C3462(context);
    }

    @Override // p138.p176.p177.p190.InterfaceC3442
    /* JADX INFO: renamed from: ֏ */
    public int mo5476(int i) {
        m5662();
        return this.f10186.f9997[i].mo5455();
    }

    /* JADX INFO: renamed from: ֏, reason: contains not printable characters */
    public void m5651() {
        m5662();
        m5657((InterfaceC4168) null);
    }

    /* JADX INFO: renamed from: ֏, reason: contains not printable characters */
    public final void m5652(int i, int i2) {
        if (i == this.f10207 && i2 == this.f10208) {
            return;
        }
        this.f10207 = i;
        this.f10208 = i2;
        Iterator<InterfaceC4175> it = this.f10189.iterator();
        while (it.hasNext()) {
            it.next().mo5701(i, i2);
        }
    }

    @Override // p138.p176.p177.p190.InterfaceC3442
    /* JADX INFO: renamed from: ֏ */
    public void mo5480(int i, long j) {
        m5662();
        C3463 c3463 = this.f10196;
        if (!c3463.f10245.f10257) {
            c3463.m5706();
            c3463.f10245.f10257 = true;
            Iterator<InterfaceC3466> it = c3463.f10242.iterator();
            while (it.hasNext()) {
                it.next().m5745();
            }
        }
        this.f10186.mo5480(i, j);
    }

    /* JADX INFO: renamed from: ֏, reason: contains not printable characters */
    public void m5653(Surface surface) {
        m5662();
        if (surface == null || surface != this.f10203) {
            return;
        }
        m5662();
        m5659();
        m5654((Surface) null, false);
        m5652(0, 0);
    }

    /* JADX INFO: renamed from: ֏, reason: contains not printable characters */
    public final void m5654(Surface surface, boolean z) {
        ArrayList arrayList = new ArrayList();
        for (InterfaceC3450 interfaceC3450 : this.f10185) {
            if (interfaceC3450.mo5455() == 2) {
                C3446 c3446M5479 = this.f10186.m5479(interfaceC3450);
                c3446M5479.m5643(1);
                C0567.m1932(true ^ c3446M5479.f10176);
                c3446M5479.f10171 = surface;
                c3446M5479.m5648();
                arrayList.add(c3446M5479);
            }
        }
        Surface surface2 = this.f10203;
        if (surface2 != null && surface2 != surface) {
            try {
                Iterator it = arrayList.iterator();
                while (it.hasNext()) {
                    ((C3446) it.next()).m5646();
                }
            } catch (InterruptedException unused) {
                Thread.currentThread().interrupt();
            }
            if (this.f10204) {
                this.f10203.release();
            }
        }
        this.f10203 = surface;
        this.f10204 = z;
    }

    /* JADX INFO: renamed from: ֏, reason: contains not printable characters */
    public void m5655(SurfaceHolder surfaceHolder) {
        m5662();
        m5659();
        if (surfaceHolder != null) {
            m5651();
        }
        this.f10205 = surfaceHolder;
        if (surfaceHolder == null) {
            m5654((Surface) null, false);
            m5652(0, 0);
            return;
        }
        surfaceHolder.addCallback(this.f10188);
        Surface surface = surfaceHolder.getSurface();
        if (surface == null || !surface.isValid()) {
            m5654((Surface) null, false);
            m5652(0, 0);
        } else {
            m5654(surface, false);
            Rect surfaceFrame = surfaceHolder.getSurfaceFrame();
            m5652(surfaceFrame.width(), surfaceFrame.height());
        }
    }

    /* JADX INFO: renamed from: ֏, reason: contains not printable characters */
    public void m5656(TextureView textureView) {
        m5662();
        m5659();
        if (textureView != null) {
            m5651();
        }
        this.f10206 = textureView;
        if (textureView == null) {
            m5654((Surface) null, true);
            m5652(0, 0);
            return;
        }
        if (textureView.getSurfaceTextureListener() != null) {
            Log.w("SimpleExoPlayer", "Replacing existing SurfaceTextureListener.");
        }
        textureView.setSurfaceTextureListener(this.f10188);
        SurfaceTexture surfaceTexture = textureView.isAvailable() ? textureView.getSurfaceTexture() : null;
        if (surfaceTexture == null) {
            m5654((Surface) null, true);
            m5652(0, 0);
        } else {
            m5654(new Surface(surfaceTexture), true);
            m5652(textureView.getWidth(), textureView.getHeight());
        }
    }

    @Override // p138.p176.p177.p190.InterfaceC3442
    /* JADX INFO: renamed from: ֏ */
    public void mo5484(InterfaceC3442.InterfaceC3443 interfaceC3443) {
        m5662();
        this.f10186.f10002.addIfAbsent(new AbstractC3410.C3411(interfaceC3443));
    }

    /* JADX INFO: renamed from: ֏, reason: contains not printable characters */
    public final void m5657(InterfaceC4168 interfaceC4168) {
        for (InterfaceC3450 interfaceC3450 : this.f10185) {
            if (interfaceC3450.mo5455() == 2) {
                C3446 c3446M5479 = this.f10186.m5479(interfaceC3450);
                c3446M5479.m5643(8);
                C0567.m1932(!c3446M5479.f10176);
                c3446M5479.f10171 = interfaceC4168;
                c3446M5479.m5648();
            }
        }
    }

    @Override // p138.p176.p177.p190.InterfaceC3442
    /* JADX INFO: renamed from: ֏ */
    public void mo5485(boolean z) {
        m5662();
        m5658(z, this.f10198.m5427(z, mo5493()));
    }

    /* JADX INFO: renamed from: ֏, reason: contains not printable characters */
    public final void m5658(boolean z, int i) {
        int i2 = 0;
        boolean z2 = z && i != -1;
        if (z2 && i != 1) {
            i2 = 1;
        }
        this.f10186.m5486(z2, i2);
    }

    /* JADX INFO: renamed from: ؠ, reason: contains not printable characters */
    public final void m5659() {
        TextureView textureView = this.f10206;
        if (textureView != null) {
            if (textureView.getSurfaceTextureListener() != this.f10188) {
                Log.w("SimpleExoPlayer", "SurfaceTextureListener already unset or replaced.");
            } else {
                this.f10206.setSurfaceTextureListener(null);
            }
            this.f10206 = null;
        }
        SurfaceHolder surfaceHolder = this.f10205;
        if (surfaceHolder != null) {
            surfaceHolder.removeCallback(this.f10188);
            this.f10205 = null;
        }
    }

    /* JADX INFO: renamed from: ؠ, reason: contains not printable characters */
    public void m5660(Surface surface) {
        m5662();
        m5659();
        if (surface != null) {
            m5651();
        }
        m5654(surface, false);
        int i = surface != null ? -1 : 0;
        m5652(i, i);
    }

    @Override // p138.p176.p177.p190.InterfaceC3442
    /* JADX INFO: renamed from: ؠ */
    public void mo5488(InterfaceC3442.InterfaceC3443 interfaceC3443) {
        m5662();
        this.f10186.mo5488(interfaceC3443);
    }

    @Override // p138.p176.p177.p190.InterfaceC3442
    /* JADX INFO: renamed from: ؠ */
    public void mo5489(boolean z) {
        m5662();
        this.f10186.mo5489(z);
    }

    @Override // p138.p176.p177.p190.InterfaceC3442
    /* JADX INFO: renamed from: ހ */
    public C3439 mo5490() {
        m5662();
        return this.f10186.f10013;
    }

    @Override // p138.p176.p177.p190.InterfaceC3442
    /* JADX INFO: renamed from: ހ */
    public void mo5491(int i) {
        m5662();
        this.f10186.mo5491(i);
    }

    @Override // p138.p176.p177.p190.InterfaceC3442
    /* JADX INFO: renamed from: ހ */
    public void mo5492(boolean z) {
        m5662();
        this.f10198.m5427(mo5500(), 1);
        this.f10186.mo5492(z);
        InterfaceC3800 interfaceC3800 = this.f10214;
        if (interfaceC3800 != null) {
            interfaceC3800.mo6101(this.f10196);
            this.f10196.m5712();
            if (z) {
                this.f10214 = null;
            }
        }
        this.f10215 = Collections.emptyList();
    }

    /* JADX INFO: renamed from: ށ, reason: contains not printable characters */
    public final void m5661() {
        float f = this.f10213 * this.f10198.f9953;
        for (InterfaceC3450 interfaceC3450 : this.f10185) {
            if (interfaceC3450.mo5455() == 1) {
                C3446 c3446M5479 = this.f10186.m5479(interfaceC3450);
                c3446M5479.m5643(2);
                c3446M5479.m5644(Float.valueOf(f));
                c3446M5479.m5648();
            }
        }
    }

    @Override // p138.p176.p177.p190.InterfaceC3442
    /* JADX INFO: renamed from: ނ */
    public int mo5493() {
        m5662();
        return this.f10186.f10014.f10153;
    }

    @Override // p138.p176.p177.p190.InterfaceC3442
    /* JADX INFO: renamed from: ރ */
    public long mo5494() {
        m5662();
        return this.f10186.mo5494();
    }

    @Override // p138.p176.p177.p190.InterfaceC3442
    /* JADX INFO: renamed from: ބ */
    public InterfaceC3442.InterfaceC3445 mo5495() {
        return this;
    }

    @Override // p138.p176.p177.p190.InterfaceC3442
    /* JADX INFO: renamed from: ޅ */
    public boolean mo5496() {
        m5662();
        return this.f10186.mo5496();
    }

    @Override // p138.p176.p177.p190.InterfaceC3442
    /* JADX INFO: renamed from: ކ */
    public long mo5497() {
        m5662();
        return this.f10186.mo5497();
    }

    @Override // p138.p176.p177.p190.InterfaceC3442
    /* JADX INFO: renamed from: އ */
    public int mo5498() {
        m5662();
        return this.f10186.f10007;
    }

    @Override // p138.p176.p177.p190.InterfaceC3442
    /* JADX INFO: renamed from: ވ */
    public long mo5499() {
        m5662();
        return C3414.m5459(this.f10186.f10014.f10160);
    }

    @Override // p138.p176.p177.p190.InterfaceC3442
    /* JADX INFO: renamed from: ފ */
    public boolean mo5500() {
        m5662();
        return this.f10186.f10005;
    }

    @Override // p138.p176.p177.p190.InterfaceC3442
    /* JADX INFO: renamed from: ދ */
    public ExoPlaybackException mo5501() {
        m5662();
        return this.f10186.f10014.f10154;
    }

    @Override // p138.p176.p177.p190.InterfaceC3442
    /* JADX INFO: renamed from: ގ */
    public int mo5502() {
        m5662();
        C3421 c3421 = this.f10186;
        if (c3421.mo5496()) {
            return c3421.f10014.f10150.f11630;
        }
        return -1;
    }

    @Override // p138.p176.p177.p190.InterfaceC3442
    /* JADX INFO: renamed from: ސ */
    public int mo5503() {
        m5662();
        C3421 c3421 = this.f10186;
        if (c3421.mo5496()) {
            return c3421.f10014.f10150.f11631;
        }
        return -1;
    }

    @Override // p138.p176.p177.p190.InterfaceC3442
    /* JADX INFO: renamed from: ޑ */
    public int mo5504() {
        m5662();
        return this.f10186.f10006;
    }

    @Override // p138.p176.p177.p190.InterfaceC3442
    /* JADX INFO: renamed from: ޒ */
    public C3829 mo5505() {
        m5662();
        return this.f10186.f10014.f10156;
    }

    @Override // p138.p176.p177.p190.InterfaceC3442
    /* JADX INFO: renamed from: ޓ */
    public AbstractC3457 mo5506() {
        m5662();
        return this.f10186.f10014.f10149;
    }

    @Override // p138.p176.p177.p190.InterfaceC3442
    /* JADX INFO: renamed from: ޔ */
    public Looper mo5507() {
        return this.f10186.mo5507();
    }

    @Override // p138.p176.p177.p190.InterfaceC3442
    /* JADX INFO: renamed from: ޕ */
    public boolean mo5508() {
        m5662();
        return this.f10186.f10008;
    }

    @Override // p138.p176.p177.p190.InterfaceC3442
    /* JADX INFO: renamed from: ޖ */
    public long mo5509() {
        m5662();
        return this.f10186.mo5509();
    }

    @Override // p138.p176.p177.p190.InterfaceC3442
    /* JADX INFO: renamed from: ޗ */
    public int mo5510() {
        m5662();
        return this.f10186.mo5510();
    }

    @Override // p138.p176.p177.p190.InterfaceC3442
    /* JADX INFO: renamed from: ޘ */
    public C4039 mo5511() {
        m5662();
        return this.f10186.f10014.f10157.f12846;
    }

    @Override // p138.p176.p177.p190.InterfaceC3442
    /* JADX INFO: renamed from: ޙ */
    public long mo5512() {
        m5662();
        return this.f10186.mo5512();
    }

    @Override // p138.p176.p177.p190.InterfaceC3442
    /* JADX INFO: renamed from: ޚ */
    public InterfaceC3442.InterfaceC3444 mo5513() {
        return this;
    }

    /* JADX INFO: renamed from: ޛ, reason: contains not printable characters */
    public final void m5662() {
        if (Looper.myLooper() != mo5507()) {
            C4131.m6646("SimpleExoPlayer", "Player is accessed on the wrong thread. See https://exoplayer.dev/issues/player-accessed-on-wrong-thread", this.f10218 ? null : new IllegalStateException());
            this.f10218 = true;
        }
    }
}
