package n;

import android.media.AudioMetadata;
import android.media.MediaFormat;
import android.os.Parcel;
import android.os.Parcelable;
import androidx.core.location.LocationRequestCompat;
import b0.AbstractC0399d;
import com.cvte.vman.instance.InvokeCmd;
import java.nio.ByteBuffer;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;

/* JADX INFO: loaded from: classes.dex */
public final class x implements Parcelable {

    /* JADX INFO: renamed from: H, reason: collision with root package name */
    public final List f5829H;

    /* JADX INFO: renamed from: I, reason: collision with root package name */
    public final boolean f5830I;

    /* JADX INFO: renamed from: L, reason: collision with root package name */
    public int f5831L;

    /* JADX INFO: renamed from: M, reason: collision with root package name */
    public int f5832M;

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

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

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

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

    /* JADX INFO: renamed from: b0, reason: collision with root package name */
    public final float f5837b0;

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

    /* JADX INFO: renamed from: d0, reason: collision with root package name */
    public final byte[] f5839d0;

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

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

    /* JADX INFO: renamed from: g, reason: collision with root package name */
    public String f5842g;

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

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

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

    /* JADX INFO: renamed from: j0, reason: collision with root package name */
    public final String f5846j0;

    /* JADX INFO: renamed from: k0, reason: collision with root package name */
    public final long f5847k0;

    /* JADX INFO: renamed from: l0, reason: collision with root package name */
    private int f5848l0;

    /* JADX INFO: renamed from: m0, reason: collision with root package name */
    private MediaFormat f5849m0;

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

    /* JADX INFO: renamed from: o0, reason: collision with root package name */
    public int f5851o0;

    /* JADX INFO: renamed from: p0, reason: collision with root package name */
    public int f5852p0;

    /* JADX INFO: renamed from: q0, reason: collision with root package name */
    public int f5853q0;

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

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

    /* JADX INFO: renamed from: y, reason: collision with root package name */
    public final long f5856y;

    /* JADX INFO: renamed from: r0, reason: collision with root package name */
    public static final AudioMetadata.Key f5828r0 = AudioMetadata.createKey("seq-number", Long.class);
    public static final Parcelable.Creator<x> CREATOR = new a();

    class a implements Parcelable.Creator {
        a() {
        }

        @Override // android.os.Parcelable.Creator
        /* JADX INFO: renamed from: a, reason: merged with bridge method [inline-methods] */
        public x createFromParcel(Parcel parcel) {
            return new x(parcel);
        }

        @Override // android.os.Parcelable.Creator
        /* JADX INFO: renamed from: b, reason: merged with bridge method [inline-methods] */
        public x[] newArray(int i2) {
            return new x[i2];
        }
    }

    x(Parcel parcel) {
        this.f5836b = parcel.readString();
        this.f5842g = parcel.readString();
        this.f5854r = parcel.readInt();
        this.f5855x = parcel.readInt();
        this.f5856y = parcel.readLong();
        this.f5831L = parcel.readInt();
        this.f5832M = parcel.readInt();
        this.f5835a0 = parcel.readInt();
        this.f5837b0 = parcel.readFloat();
        this.f5840e0 = parcel.readInt();
        this.f5841f0 = parcel.readInt();
        this.f5846j0 = parcel.readString();
        this.f5847k0 = parcel.readLong();
        ArrayList arrayList = new ArrayList();
        this.f5829H = arrayList;
        parcel.readList(arrayList, null);
        this.f5830I = parcel.readInt() == 1;
        this.f5833Q = parcel.readInt();
        this.f5834Z = parcel.readInt();
        this.f5843g0 = parcel.readInt();
        this.f5844h0 = parcel.readInt();
        this.f5845i0 = parcel.readInt();
        this.f5839d0 = parcel.readInt() != 0 ? parcel.createByteArray() : null;
        this.f5838c0 = parcel.readInt();
        this.f5850n0 = -1;
        this.f5851o0 = -1;
        this.f5853q0 = 0;
        this.f5852p0 = -1;
    }

    public static x h(String str, String str2, int i2, int i3, long j2, int i4, int i5, List list, String str3) {
        return i(str, str2, i2, i3, j2, i4, i5, list, str3, -1);
    }

    public static x i(String str, String str2, int i2, int i3, long j2, int i4, int i5, List list, String str3, int i6) {
        return new x(str, str2, i2, i3, j2, -1, -1, -1, -1.0f, i4, i5, str3, LocationRequestCompat.PASSIVE_INTERVAL, list, false, -1, -1, i6, -1, -1, null, -1);
    }

    public static x j(String str, String str2, int i2, long j2) {
        return new x(str, str2, i2, -1, j2, -1, -1, -1, -1.0f, -1, -1, null, LocationRequestCompat.PASSIVE_INTERVAL, null, false, -1, -1, -1, -1, -1, null, -1);
    }

    public static x k() {
        return j(null, "application/id3", -1, -1L);
    }

    public static x l(String str, String str2, int i2, long j2, List list, String str3) {
        return new x(str, str2, i2, -1, j2, -1, -1, -1, -1.0f, -1, -1, str3, LocationRequestCompat.PASSIVE_INTERVAL, list, false, -1, -1, -1, -1, -1, null, -1);
    }

    public static x m(String str, String str2, int i2, long j2, String str3) {
        return n(str, str2, i2, j2, str3, LocationRequestCompat.PASSIVE_INTERVAL);
    }

    public static x n(String str, String str2, int i2, long j2, String str3, long j3) {
        return new x(str, str2, i2, -1, j2, -1, -1, -1, -1.0f, -1, -1, str3, j3, null, false, -1, -1, -1, -1, -1, null, -1);
    }

    public static x o(String str, String str2, int i2, int i3, long j2, int i4, int i5, List list) {
        return q(str, str2, i2, i3, j2, i4, i5, list, -1, -1.0f, null, -1);
    }

    public static x p(String str, String str2, int i2, int i3, long j2, int i4, int i5, List list, int i6, float f2) {
        return new x(str, str2, i2, i3, j2, i4, i5, i6, f2, -1, -1, null, LocationRequestCompat.PASSIVE_INTERVAL, list, false, -1, -1, -1, -1, -1, null, -1);
    }

    public static x q(String str, String str2, int i2, int i3, long j2, int i4, int i5, List list, int i6, float f2, byte[] bArr, int i7) {
        return new x(str, str2, i2, i3, j2, i4, i5, i6, f2, -1, -1, null, LocationRequestCompat.PASSIVE_INTERVAL, list, false, -1, -1, -1, -1, -1, bArr, i7);
    }

    private static final void s(MediaFormat mediaFormat, String str, int i2) {
        if (i2 != -1) {
            mediaFormat.setInteger(str, i2);
        }
    }

    private static final void t(MediaFormat mediaFormat, String str, String str2) {
        if (str2 != null) {
            mediaFormat.setString(str, str2);
        }
    }

    public x a(String str) {
        return new x(str, this.f5842g, -1, -1, this.f5856y, -1, -1, -1, -1.0f, -1, -1, null, LocationRequestCompat.PASSIVE_INTERVAL, null, true, this.f5833Q, this.f5834Z, -1, -1, -1, null, this.f5838c0);
    }

    public x b(long j2) {
        return new x(this.f5836b, this.f5842g, this.f5854r, this.f5855x, j2, this.f5831L, this.f5832M, this.f5835a0, this.f5837b0, this.f5840e0, this.f5841f0, this.f5846j0, this.f5847k0, this.f5829H, this.f5830I, this.f5833Q, this.f5834Z, this.f5843g0, this.f5844h0, this.f5845i0, this.f5839d0, this.f5838c0);
    }

    public x c(String str, int i2, int i3, int i4, String str2) {
        return new x(str, this.f5842g, i2, this.f5855x, this.f5856y, i3, i4, this.f5835a0, this.f5837b0, this.f5840e0, this.f5841f0, str2, this.f5847k0, this.f5829H, this.f5830I, -1, -1, this.f5843g0, this.f5844h0, this.f5845i0, this.f5839d0, this.f5838c0);
    }

    public x d(int i2, int i3) {
        return new x(this.f5836b, this.f5842g, this.f5854r, this.f5855x, this.f5856y, this.f5831L, this.f5832M, this.f5835a0, this.f5837b0, this.f5840e0, this.f5841f0, this.f5846j0, this.f5847k0, this.f5829H, this.f5830I, this.f5833Q, this.f5834Z, this.f5843g0, i2, i3, this.f5839d0, this.f5838c0);
    }

    @Override // android.os.Parcelable
    public int describeContents() {
        return 0;
    }

    public x e(String str) {
        return new x(this.f5836b, this.f5842g, this.f5854r, this.f5855x, this.f5856y, this.f5831L, this.f5832M, this.f5835a0, this.f5837b0, this.f5840e0, this.f5841f0, str, this.f5847k0, this.f5829H, this.f5830I, this.f5833Q, this.f5834Z, this.f5843g0, this.f5844h0, this.f5845i0, this.f5839d0, this.f5838c0);
    }

    public boolean equals(Object obj) {
        if (this == obj) {
            return true;
        }
        if (obj != null && x.class == obj.getClass()) {
            x xVar = (x) obj;
            if (this.f5830I == xVar.f5830I && this.f5854r == xVar.f5854r && this.f5855x == xVar.f5855x && this.f5856y == xVar.f5856y && this.f5831L == xVar.f5831L && this.f5832M == xVar.f5832M && this.f5835a0 == xVar.f5835a0 && this.f5837b0 == xVar.f5837b0 && this.f5833Q == xVar.f5833Q && this.f5834Z == xVar.f5834Z && this.f5840e0 == xVar.f5840e0 && this.f5841f0 == xVar.f5841f0 && this.f5843g0 == xVar.f5843g0 && this.f5844h0 == xVar.f5844h0 && this.f5845i0 == xVar.f5845i0 && this.f5847k0 == xVar.f5847k0 && b0.D.a(this.f5836b, xVar.f5836b) && b0.D.a(this.f5846j0, xVar.f5846j0) && b0.D.a(this.f5842g, xVar.f5842g) && this.f5829H.size() == xVar.f5829H.size() && Arrays.equals(this.f5839d0, xVar.f5839d0) && this.f5838c0 == xVar.f5838c0) {
                for (int i2 = 0; i2 < this.f5829H.size(); i2++) {
                    if (!Arrays.equals((byte[]) this.f5829H.get(i2), (byte[]) xVar.f5829H.get(i2))) {
                        return false;
                    }
                }
                return true;
            }
        }
        return false;
    }

    public x f(int i2, int i3) {
        return new x(this.f5836b, this.f5842g, this.f5854r, this.f5855x, this.f5856y, this.f5831L, this.f5832M, this.f5835a0, this.f5837b0, this.f5840e0, this.f5841f0, this.f5846j0, this.f5847k0, this.f5829H, this.f5830I, i2, i3, this.f5843g0, this.f5844h0, this.f5845i0, this.f5839d0, this.f5838c0);
    }

    public x g(long j2) {
        return new x(this.f5836b, this.f5842g, this.f5854r, this.f5855x, this.f5856y, this.f5831L, this.f5832M, this.f5835a0, this.f5837b0, this.f5840e0, this.f5841f0, this.f5846j0, j2, this.f5829H, this.f5830I, this.f5833Q, this.f5834Z, this.f5843g0, this.f5844h0, this.f5845i0, this.f5839d0, this.f5838c0);
    }

    public int hashCode() {
        if (this.f5848l0 == 0) {
            String str = this.f5836b;
            int iHashCode = (InvokeCmd.CMD_XBUG_SET_VMAN_DOCROR_NBT + (str == null ? 0 : str.hashCode())) * 31;
            String str2 = this.f5842g;
            int iHashCode2 = (((((((((((((((((((((((((((((((iHashCode + (str2 == null ? 0 : str2.hashCode())) * 31) + this.f5854r) * 31) + this.f5855x) * 31) + this.f5831L) * 31) + this.f5832M) * 31) + this.f5835a0) * 31) + Float.floatToRawIntBits(this.f5837b0)) * 31) + ((int) this.f5856y)) * 31) + (this.f5830I ? 1231 : 1237)) * 31) + this.f5833Q) * 31) + this.f5834Z) * 31) + this.f5840e0) * 31) + this.f5841f0) * 31) + this.f5843g0) * 31) + this.f5844h0) * 31) + this.f5845i0) * 31;
            String str3 = this.f5846j0;
            int iHashCode3 = ((iHashCode2 + (str3 == null ? 0 : str3.hashCode())) * 31) + ((int) this.f5847k0);
            for (int i2 = 0; i2 < this.f5829H.size(); i2++) {
                iHashCode3 = (iHashCode3 * 31) + Arrays.hashCode((byte[]) this.f5829H.get(i2));
            }
            this.f5848l0 = (((iHashCode3 * 31) + Arrays.hashCode(this.f5839d0)) * 31) + this.f5838c0;
        }
        return this.f5848l0;
    }

    public final MediaFormat r() {
        if (this.f5849m0 == null) {
            MediaFormat mediaFormat = new MediaFormat();
            mediaFormat.setString("mime", this.f5842g);
            t(mediaFormat, "language", this.f5846j0);
            s(mediaFormat, "max-input-size", this.f5855x);
            s(mediaFormat, "width", this.f5831L);
            s(mediaFormat, "height", this.f5832M);
            s(mediaFormat, "rotation-degrees", this.f5835a0);
            s(mediaFormat, "max-width", this.f5833Q);
            s(mediaFormat, "max-height", this.f5834Z);
            s(mediaFormat, "channel-count", this.f5840e0);
            s(mediaFormat, "sample-rate", this.f5841f0);
            s(mediaFormat, "encoder-delay", this.f5844h0);
            s(mediaFormat, "encoder-padding", this.f5845i0);
            s(mediaFormat, "frame-rate", this.f5851o0);
            for (int i2 = 0; i2 < this.f5829H.size(); i2++) {
                mediaFormat.setByteBuffer("csd-" + i2, ByteBuffer.wrap((byte[]) this.f5829H.get(i2)));
            }
            long j2 = this.f5856y;
            if (j2 != -1) {
                mediaFormat.setLong("durationUs", j2);
            }
            this.f5849m0 = mediaFormat;
        }
        return this.f5849m0;
    }

    public String toString() {
        return "MediaFormat(" + this.f5836b + ", " + this.f5842g + ", " + this.f5854r + ", " + this.f5855x + ", " + this.f5831L + ", " + this.f5832M + ", " + this.f5835a0 + ", " + this.f5837b0 + ", " + this.f5840e0 + ", " + this.f5841f0 + ", " + this.f5846j0 + ", " + this.f5856y + ", " + this.f5830I + ", " + this.f5833Q + ", " + this.f5834Z + ", " + this.f5843g0 + ", " + this.f5844h0 + ", " + this.f5845i0 + ")";
    }

    final void u(MediaFormat mediaFormat) {
        this.f5849m0 = mediaFormat;
    }

    @Override // android.os.Parcelable
    public void writeToParcel(Parcel parcel, int i2) {
        parcel.writeString(this.f5836b);
        parcel.writeString(this.f5842g);
        parcel.writeInt(this.f5854r);
        parcel.writeInt(this.f5855x);
        parcel.writeLong(this.f5856y);
        parcel.writeInt(this.f5831L);
        parcel.writeInt(this.f5832M);
        parcel.writeInt(this.f5835a0);
        parcel.writeFloat(this.f5837b0);
        parcel.writeInt(this.f5840e0);
        parcel.writeInt(this.f5841f0);
        parcel.writeString(this.f5846j0);
        parcel.writeLong(this.f5847k0);
        parcel.writeList(this.f5829H);
        parcel.writeInt(this.f5830I ? 1 : 0);
        parcel.writeInt(this.f5833Q);
        parcel.writeInt(this.f5834Z);
        parcel.writeInt(this.f5843g0);
        parcel.writeInt(this.f5844h0);
        parcel.writeInt(this.f5845i0);
        parcel.writeInt(this.f5839d0 != null ? 1 : 0);
        byte[] bArr = this.f5839d0;
        if (bArr != null) {
            parcel.writeByteArray(bArr);
        }
        parcel.writeInt(this.f5838c0);
    }

    x(String str, String str2, int i2, int i3, long j2, int i4, int i5, int i6, float f2, int i7, int i8, String str3, long j3, List list, boolean z2, int i9, int i10, int i11, int i12, int i13, byte[] bArr, int i14) {
        this.f5836b = str;
        this.f5842g = AbstractC0399d.c(str2);
        this.f5854r = i2;
        this.f5855x = i3;
        this.f5856y = j2;
        this.f5831L = i4;
        this.f5832M = i5;
        this.f5835a0 = i6;
        this.f5837b0 = f2;
        this.f5840e0 = i7;
        this.f5841f0 = i8;
        this.f5846j0 = str3;
        this.f5847k0 = j3;
        this.f5829H = list == null ? Collections.emptyList() : list;
        this.f5830I = z2;
        this.f5833Q = i9;
        this.f5834Z = i10;
        this.f5843g0 = i11;
        this.f5844h0 = i12;
        this.f5845i0 = i13;
        this.f5839d0 = bArr;
        this.f5838c0 = i14;
        this.f5850n0 = -1;
        this.f5851o0 = -1;
        this.f5853q0 = 0;
        this.f5852p0 = -1;
    }

    x(String str, String str2, int i2, int i3, long j2, int i4, int i5, int i6, float f2, int i7, int i8, String str3, long j3, List list, boolean z2, int i9, int i10, int i11, int i12, int i13, byte[] bArr, int i14, int i15, int i16, int i17) {
        this.f5836b = str;
        this.f5842g = AbstractC0399d.c(str2);
        this.f5854r = i2;
        this.f5855x = i3;
        this.f5856y = j2;
        this.f5831L = i4;
        this.f5832M = i5;
        this.f5835a0 = i6;
        this.f5837b0 = f2;
        this.f5840e0 = i7;
        this.f5841f0 = i8;
        this.f5846j0 = str3;
        this.f5847k0 = j3;
        this.f5829H = list == null ? Collections.emptyList() : list;
        this.f5830I = z2;
        this.f5833Q = i9;
        this.f5834Z = i10;
        this.f5843g0 = i11;
        this.f5844h0 = i12;
        this.f5845i0 = i13;
        this.f5839d0 = bArr;
        this.f5838c0 = i14;
        this.f5850n0 = i15;
        this.f5851o0 = i16;
        this.f5853q0 = i17;
    }
}
