package r2;

import android.text.TextUtils;
import androidx.annotation.Nullable;
import androidx.media3.common.util.Assertions;
import com.google.common.base.h;

/* JADX INFO: loaded from: classes.dex */
public final class a {

    /* JADX INFO: renamed from: a, reason: collision with root package name */
    public final int f32319a;

    /* JADX INFO: renamed from: b, reason: collision with root package name */
    public final int f32320b;

    /* JADX INFO: renamed from: c, reason: collision with root package name */
    public final int f32321c;

    /* JADX INFO: renamed from: d, reason: collision with root package name */
    public final int f32322d;

    /* JADX INFO: renamed from: e, reason: collision with root package name */
    public final int f32323e;

    /* JADX INFO: renamed from: f, reason: collision with root package name */
    public final int f32324f;

    public a(int i10, int i11, int i12, int i13, int i14, int i15) {
        this.f32319a = i10;
        this.f32320b = i11;
        this.f32321c = i12;
        this.f32322d = i13;
        this.f32323e = i14;
        this.f32324f = i15;
    }

    @Nullable
    public static a fromFormatLine(String str) {
        Assertions.checkArgument(str.startsWith("Format:"));
        String[] strArrSplit = TextUtils.split(str.substring(7), ",");
        int i10 = -1;
        int i11 = -1;
        int i12 = -1;
        int i13 = -1;
        int i14 = -1;
        for (int i15 = 0; i15 < strArrSplit.length; i15++) {
            String strQ = h.q(strArrSplit[i15].trim());
            strQ.getClass();
            switch (strQ) {
                case "end":
                    i12 = i15;
                    break;
                case "text":
                    i14 = i15;
                    break;
                case "layer":
                    i10 = i15;
                    break;
                case "start":
                    i11 = i15;
                    break;
                case "style":
                    i13 = i15;
                    break;
            }
        }
        if (i11 == -1 || i12 == -1 || i14 == -1) {
            return null;
        }
        return new a(i10, i11, i12, i13, i14, strArrSplit.length);
    }
}
