mirror of
https://github.com/VibedByKaKi/alexandroid.git
synced 2026-12-06 20:39:26 +01:00
95 lines
2.9 KiB
Java
95 lines
2.9 KiB
Java
package com.google.android.exoplayer2.source;
|
|
|
|
import android.os.Parcel;
|
|
import android.os.Parcelable;
|
|
import androidx.annotation.Nullable;
|
|
import com.google.android.exoplayer2.Format;
|
|
import com.google.android.exoplayer2.util.Assertions;
|
|
import java.util.Arrays;
|
|
|
|
/* compiled from: r8-map-id-b9432e0f623b4a4bff4ba50a8a24c4aafad2c1e11092747b9fb5e6a22af5a940 */
|
|
/* loaded from: classes7.dex */
|
|
public final class TrackGroup implements Parcelable {
|
|
public static final Parcelable.Creator<TrackGroup> CREATOR = new Parcelable.Creator<TrackGroup>() { // from class: com.google.android.exoplayer2.source.TrackGroup.1
|
|
/* JADX WARN: Can't rename method to resolve collision */
|
|
@Override // android.os.Parcelable.Creator
|
|
public TrackGroup createFromParcel(Parcel parcel) {
|
|
return new TrackGroup(parcel);
|
|
}
|
|
|
|
/* JADX WARN: Can't rename method to resolve collision */
|
|
@Override // android.os.Parcelable.Creator
|
|
public TrackGroup[] newArray(int i) {
|
|
return new TrackGroup[i];
|
|
}
|
|
};
|
|
private final Format[] formats;
|
|
private int hashCode;
|
|
public final int length;
|
|
|
|
public TrackGroup(Parcel parcel) {
|
|
int readInt = parcel.readInt();
|
|
this.length = readInt;
|
|
this.formats = new Format[readInt];
|
|
for (int i = 0; i < this.length; i++) {
|
|
this.formats[i] = (Format) parcel.readParcelable(Format.class.getClassLoader());
|
|
}
|
|
}
|
|
|
|
@Override // android.os.Parcelable
|
|
public int describeContents() {
|
|
return 0;
|
|
}
|
|
|
|
public boolean equals(@Nullable Object obj) {
|
|
if (this == obj) {
|
|
return true;
|
|
}
|
|
if (obj != null && TrackGroup.class == obj.getClass()) {
|
|
TrackGroup trackGroup = (TrackGroup) obj;
|
|
if (this.length == trackGroup.length && Arrays.equals(this.formats, trackGroup.formats)) {
|
|
return true;
|
|
}
|
|
}
|
|
return false;
|
|
}
|
|
|
|
public Format getFormat(int i) {
|
|
return this.formats[i];
|
|
}
|
|
|
|
public int hashCode() {
|
|
if (this.hashCode == 0) {
|
|
this.hashCode = 527 + Arrays.hashCode(this.formats);
|
|
}
|
|
return this.hashCode;
|
|
}
|
|
|
|
public int indexOf(Format format) {
|
|
int i = 0;
|
|
while (true) {
|
|
Format[] formatArr = this.formats;
|
|
if (i >= formatArr.length) {
|
|
return -1;
|
|
}
|
|
if (format == formatArr[i]) {
|
|
return i;
|
|
}
|
|
i++;
|
|
}
|
|
}
|
|
|
|
@Override // android.os.Parcelable
|
|
public void writeToParcel(Parcel parcel, int i) {
|
|
parcel.writeInt(this.length);
|
|
for (int i2 = 0; i2 < this.length; i2++) {
|
|
parcel.writeParcelable(this.formats[i2], 0);
|
|
}
|
|
}
|
|
|
|
public TrackGroup(Format... formatArr) {
|
|
Assertions.checkState(formatArr.length > 0);
|
|
this.formats = formatArr;
|
|
this.length = formatArr.length;
|
|
}
|
|
}
|