package defpackage;

import java.util.Locale;

/* JADX INFO: renamed from: ˆᵳ, reason: contains not printable characters */
/* JADX INFO: loaded from: classes3.dex */
public final class C0900 implements InterfaceC0728 {

    /* JADX INFO: renamed from: ʽˈˋ, reason: contains not printable characters */
    public final C3176 f3970;

    /* JADX INFO: renamed from: ˊᵫᵗ, reason: contains not printable characters */
    public long f3971;

    /* JADX INFO: renamed from: ːˏᵟᵯ, reason: contains not printable characters */
    public InterfaceC5226 f3972;

    /* JADX INFO: renamed from: ᵝᵶ, reason: contains not printable characters */
    public boolean f3973;

    /* JADX INFO: renamed from: ᵨᵣ, reason: contains not printable characters */
    public long f3974;

    /* JADX INFO: renamed from: ᵮᵣᵗˈ, reason: contains not printable characters */
    public boolean f3975;

    /* JADX INFO: renamed from: ᵱᵽʡᵚ, reason: contains not printable characters */
    public int f3976;

    /* JADX INFO: renamed from: ᵲᵶᵳˈ, reason: contains not printable characters */
    public final /* synthetic */ int f3977;

    /* JADX INFO: renamed from: ᵵᵽ, reason: contains not printable characters */
    public int f3978;

    /* JADX INFO: renamed from: ᵶᵥᵝ, reason: contains not printable characters */
    public boolean f3979;

    /* JADX INFO: renamed from: ᵷᵺʾᵖ, reason: contains not printable characters */
    public long f3980;

    /* JADX INFO: renamed from: ᵻʽᵯ, reason: contains not printable characters */
    public int f3981;

    /* JADX INFO: renamed from: ᵻˈᵦʼ, reason: contains not printable characters */
    public int f3982;

    public C0900(C3176 c3176, int i) {
        this.f3977 = i;
        switch (i) {
            case 1:
                this.f3970 = c3176;
                this.f3980 = -9223372036854775807L;
                this.f3978 = -1;
                this.f3971 = -9223372036854775807L;
                this.f3974 = 0L;
                this.f3982 = -1;
                this.f3981 = -1;
                this.f3976 = -1;
                break;
            default:
                this.f3970 = c3176;
                this.f3980 = -9223372036854775807L;
                this.f3978 = -1;
                break;
        }
    }

    @Override // defpackage.InterfaceC0728
    /* JADX INFO: renamed from: ʽˈˋ */
    public final void mo2599(long j, long j2) {
        switch (this.f3977) {
            case 0:
                this.f3980 = j;
                this.f3982 = 0;
                this.f3974 = j2;
                break;
            default:
                this.f3980 = j;
                this.f3978 = -1;
                this.f3974 = j2;
                break;
        }
    }

    @Override // defpackage.InterfaceC0728
    /* JADX INFO: renamed from: ːˏᵟᵯ */
    public final void mo2600(InterfaceC4550 interfaceC4550, int i) {
        int i2 = this.f3977;
        C3176 c3176 = this.f3970;
        switch (i2) {
            case 0:
                InterfaceC5226 interfaceC5226Mo2743 = interfaceC4550.mo2743(i, 2);
                this.f3972 = interfaceC5226Mo2743;
                interfaceC5226Mo2743.mo1742(c3176.f12057);
                break;
            default:
                InterfaceC5226 interfaceC5226Mo27432 = interfaceC4550.mo2743(i, 2);
                this.f3972 = interfaceC5226Mo27432;
                interfaceC5226Mo27432.mo1742(c3176.f12057);
                break;
        }
    }

    @Override // defpackage.InterfaceC0728
    /* JADX INFO: renamed from: ᵲᵶᵳˈ */
    public final void mo2601(long j) {
        switch (this.f3977) {
            case 0:
                ᵻᵪ.ˌᴵ(this.f3980 == -9223372036854775807L);
                this.f3980 = j;
                break;
            default:
                ᵻᵪ.ˌᴵ(this.f3980 == -9223372036854775807L);
                this.f3980 = j;
                break;
        }
    }

    /* JADX WARN: Multi-variable type inference failed */
    /* JADX WARN: Type inference fix 'apply assigned field type' failed
    java.lang.UnsupportedOperationException: ArgType.getObject(), call class: class jadx.core.dex.instructions.args.ArgType$PrimitiveArg
    	at jadx.core.dex.instructions.args.ArgType.getObject(ArgType.java:593)
    	at jadx.core.dex.attributes.nodes.ClassTypeVarsAttr.getTypeVarsMapFor(ClassTypeVarsAttr.java:35)
    	at jadx.core.dex.nodes.utils.TypeUtils.replaceClassGenerics(TypeUtils.java:177)
    	at jadx.core.dex.visitors.typeinference.FixTypesVisitor.insertExplicitUseCast(FixTypesVisitor.java:397)
    	at jadx.core.dex.visitors.typeinference.FixTypesVisitor.tryFieldTypeWithNewCasts(FixTypesVisitor.java:359)
    	at jadx.core.dex.visitors.typeinference.FixTypesVisitor.applyFieldType(FixTypesVisitor.java:309)
    	at jadx.core.dex.visitors.typeinference.FixTypesVisitor.visit(FixTypesVisitor.java:94)
     */
    @Override // defpackage.InterfaceC0728
    /* JADX INFO: renamed from: ᵷᵺʾᵖ */
    public final void mo2602(C4545 c4545, long j, int i, boolean z) {
        int i2;
        int i3;
        int i4 = this.f3977;
        C3176 c3176 = this.f3970;
        switch (i4) {
            case 0:
                this.f3972.getClass();
                int i5 = c4545.f17282;
                int iM9598 = c4545.m9598();
                Object[] objArr = (iM9598 & 1024) > 0;
                if ((iM9598 & 512) == 0 && (iM9598 & 504) == 0 && (iM9598 & 7) == 0) {
                    boolean z2 = this.f3973;
                    if (objArr == true) {
                        if (z2 && this.f3982 > 0) {
                            InterfaceC5226 interfaceC5226 = this.f3972;
                            interfaceC5226.getClass();
                            interfaceC5226.mo1741(this.f3971, this.f3979 ? 1 : 0, this.f3982, 0, null);
                            this.f3982 = 0;
                            this.f3971 = -9223372036854775807L;
                            this.f3979 = false;
                            this.f3973 = false;
                        }
                        this.f3973 = true;
                        if ((c4545.m9622() & 252) < 128) {
                            ˋˀᵧ.ʿٴˇ("Picture start Code (PSC) missing, dropping packet.");
                        } else {
                            byte[] bArr = c4545.f17284;
                            bArr[i5] = 0;
                            bArr[i5 + 1] = 0;
                            c4545.m9624(i5);
                        }
                    } else if (z2) {
                        int iM10653 = C5141.m10653(this.f3978);
                        if (i < iM10653) {
                            String str = AbstractC0956.f4222;
                            Locale locale = Locale.US;
                            ˋˀᵧ.ʿٴˇ("Received RTP packet with unexpected sequence number. Expected: " + iM10653 + "; received: " + i + ". Dropping packet.");
                        }
                    } else {
                        ˋˀᵧ.ʿٴˇ("First payload octet of the H263 packet is not the beginning of a new H263 partition, Dropping current packet.");
                    }
                    if (this.f3982 == 0) {
                        boolean z3 = this.f3975;
                        int i6 = c4545.f17282;
                        if (((c4545.m9606() >> 10) & 63) == 32) {
                            int iM9622 = c4545.m9622();
                            int i7 = (iM9622 >> 1) & 1;
                            if (!z3 && i7 == 0) {
                                int i8 = (iM9622 >> 2) & 7;
                                if (i8 == 1) {
                                    this.f3981 = 128;
                                    this.f3976 = 96;
                                } else {
                                    int i9 = i8 - 2;
                                    this.f3981 = 176 << i9;
                                    this.f3976 = 144 << i9;
                                }
                            }
                            c4545.m9624(i6);
                            this.f3979 = i7 == 0;
                        } else {
                            c4545.m9624(i6);
                            this.f3979 = false;
                        }
                        if (!this.f3975 && this.f3979) {
                            int i10 = this.f3981;
                            C5286 c5286 = c3176.f12057;
                            if (i10 != c5286.f19973 || this.f3976 != c5286.f19981) {
                                InterfaceC5226 interfaceC52262 = this.f3972;
                                C4753 c4753M10878 = c5286.m10878();
                                c4753M10878.f18098 = this.f3981;
                                c4753M10878.f18102 = this.f3976;
                                AbstractC0659.m2415(c4753M10878, interfaceC52262);
                            }
                            this.f3975 = true;
                        }
                    }
                    int iM9623 = c4545.m9623();
                    this.f3972.mo1740(iM9623, c4545);
                    this.f3982 += iM9623;
                    this.f3971 = ᵸᵺᵜ.ˁˌᵩ(90000, this.f3974, j, this.f3980);
                    if (z) {
                        InterfaceC5226 interfaceC52263 = this.f3972;
                        interfaceC52263.getClass();
                        interfaceC52263.mo1741(this.f3971, this.f3979 ? 1 : 0, this.f3982, 0, null);
                        this.f3982 = 0;
                        this.f3971 = -9223372036854775807L;
                        this.f3979 = false;
                        this.f3973 = false;
                    }
                    this.f3978 = i;
                } else {
                    ˋˀᵧ.ʿٴˇ("Dropping packet: video reduncancy coding is not supported, packet header VRC, or PLEN or PEBIT is non-zero");
                }
                break;
            default:
                this.f3972.getClass();
                int iM9626 = c4545.m9626();
                int i11 = iM9626 & 8;
                boolean z4 = this.f3979;
                if (i11 == 8) {
                    if (z4 && this.f3978 > 0) {
                        InterfaceC5226 interfaceC52264 = this.f3972;
                        interfaceC52264.getClass();
                        interfaceC52264.mo1741(this.f3971, this.f3973 ? 1 : 0, this.f3978, 0, null);
                        this.f3978 = -1;
                        this.f3971 = -9223372036854775807L;
                        this.f3979 = false;
                    }
                    this.f3979 = true;
                } else if (z4) {
                    int iM106532 = C5141.m10653(this.f3982);
                    if (i < iM106532) {
                        String str2 = AbstractC0956.f4222;
                        Locale locale2 = Locale.US;
                        ˋˀᵧ.ʿٴˇ("Received RTP packet with unexpected sequence number. Expected: " + iM106532 + "; received: " + i + ". Dropping packet.");
                    }
                } else {
                    ˋˀᵧ.ʿٴˇ("First payload octet of the RTP packet is not the beginning of a new VP9 partition, Dropping current packet.");
                }
                if ((iM9626 & 128) == 0 || (c4545.m9626() & 128) == 0 || c4545.m9623() >= 1) {
                    int i12 = iM9626 & 16;
                    ᵻᵪ.ᵻʽᵯ("VP9 flexible mode is not supported.", i12 == 0);
                    if ((iM9626 & 32) != 0) {
                        c4545.m9609(1);
                        if (c4545.m9623() >= 1) {
                            if (i12 == 0) {
                                c4545.m9609(1);
                            }
                        }
                    }
                    if ((iM9626 & 2) != 0) {
                        int iM96262 = c4545.m9626();
                        int i13 = (iM96262 >> 5) & 7;
                        if ((iM96262 & 16) != 0) {
                            int i14 = i13 + 1;
                            if (c4545.m9623() >= i14 * 4) {
                                for (int i15 = 0; i15 < i14; i15++) {
                                    this.f3981 = c4545.m9598();
                                    this.f3976 = c4545.m9598();
                                }
                            }
                        }
                        if ((iM96262 & 8) != 0) {
                            int iM96263 = c4545.m9626();
                            if (c4545.m9623() >= iM96263) {
                                for (int i16 = 0; i16 < iM96263; i16++) {
                                    int iM95982 = (c4545.m9598() & 12) >> 2;
                                    if (c4545.m9623() >= iM95982) {
                                        c4545.m9609(iM95982);
                                    }
                                    break;
                                }
                            }
                        }
                    }
                    if (this.f3978 == -1 && this.f3979) {
                        this.f3973 = (c4545.m9622() & 4) == 0;
                    }
                    if (!this.f3975 && (i2 = this.f3981) != -1 && (i3 = this.f3976) != -1) {
                        C5286 c52862 = c3176.f12057;
                        if (i2 != c52862.f19973 || i3 != c52862.f19981) {
                            InterfaceC5226 interfaceC52265 = this.f3972;
                            C4753 c4753M108782 = c52862.m10878();
                            c4753M108782.f18098 = this.f3981;
                            c4753M108782.f18102 = this.f3976;
                            AbstractC0659.m2415(c4753M108782, interfaceC52265);
                        }
                        this.f3975 = true;
                    }
                    int iM96232 = c4545.m9623();
                    this.f3972.mo1740(iM96232, c4545);
                    int i17 = this.f3978;
                    if (i17 == -1) {
                        this.f3978 = iM96232;
                    } else {
                        this.f3978 = i17 + iM96232;
                    }
                    this.f3971 = ᵸᵺᵜ.ˁˌᵩ(90000, this.f3974, j, this.f3980);
                    if (z) {
                        InterfaceC5226 interfaceC52266 = this.f3972;
                        interfaceC52266.getClass();
                        interfaceC52266.mo1741(this.f3971, this.f3973 ? 1 : 0, this.f3978, 0, null);
                        this.f3978 = -1;
                        this.f3971 = -9223372036854775807L;
                        this.f3979 = false;
                    }
                    this.f3982 = i;
                }
                break;
        }
    }
}
