- 28,932 files - Full Java source code - Smali files - Resources Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
150 lines
5.6 KiB
Java
150 lines
5.6 KiB
Java
package com.google.android.exoplayer2.metadata.mp4;
|
|
|
|
import android.os.Parcel;
|
|
import android.os.Parcelable;
|
|
import com.google.android.exoplayer2.metadata.Metadata;
|
|
import com.google.android.exoplayer2.metadata.mp4.SlowMotionData;
|
|
import com.google.android.exoplayer2.util.Assertions;
|
|
import com.google.android.exoplayer2.util.Util;
|
|
import com.google.common.base.Objects;
|
|
import com.google.common.collect.ComparisonChain;
|
|
import java.util.ArrayList;
|
|
import java.util.Comparator;
|
|
import java.util.List;
|
|
|
|
/* loaded from: classes2.dex */
|
|
public final class SlowMotionData implements Metadata.Entry {
|
|
public static final Parcelable.Creator<SlowMotionData> CREATOR = new Parcelable.Creator() { // from class: com.google.android.exoplayer2.metadata.mp4.SlowMotionData.1
|
|
@Override // android.os.Parcelable.Creator
|
|
public SlowMotionData createFromParcel(Parcel parcel) {
|
|
ArrayList arrayList = new ArrayList();
|
|
parcel.readList(arrayList, Segment.class.getClassLoader());
|
|
return new SlowMotionData(arrayList);
|
|
}
|
|
|
|
@Override // android.os.Parcelable.Creator
|
|
public SlowMotionData[] newArray(int i) {
|
|
return new SlowMotionData[i];
|
|
}
|
|
};
|
|
public final List segments;
|
|
|
|
@Override // android.os.Parcelable
|
|
public int describeContents() {
|
|
return 0;
|
|
}
|
|
|
|
public static final class Segment implements Parcelable {
|
|
public static final Comparator BY_START_THEN_END_THEN_DIVISOR = new Comparator() { // from class: com.google.android.exoplayer2.metadata.mp4.SlowMotionData$Segment$$ExternalSyntheticLambda0
|
|
@Override // java.util.Comparator
|
|
public final int compare(Object obj, Object obj2) {
|
|
int lambda$static$0;
|
|
lambda$static$0 = SlowMotionData.Segment.lambda$static$0((SlowMotionData.Segment) obj, (SlowMotionData.Segment) obj2);
|
|
return lambda$static$0;
|
|
}
|
|
};
|
|
public static final Parcelable.Creator<Segment> CREATOR = new Parcelable.Creator() { // from class: com.google.android.exoplayer2.metadata.mp4.SlowMotionData.Segment.1
|
|
@Override // android.os.Parcelable.Creator
|
|
public Segment createFromParcel(Parcel parcel) {
|
|
return new Segment(parcel.readLong(), parcel.readLong(), parcel.readInt());
|
|
}
|
|
|
|
@Override // android.os.Parcelable.Creator
|
|
public Segment[] newArray(int i) {
|
|
return new Segment[i];
|
|
}
|
|
};
|
|
public final long endTimeMs;
|
|
public final int speedDivisor;
|
|
public final long startTimeMs;
|
|
|
|
@Override // android.os.Parcelable
|
|
public int describeContents() {
|
|
return 0;
|
|
}
|
|
|
|
public static /* synthetic */ int lambda$static$0(Segment segment, Segment segment2) {
|
|
return ComparisonChain.start().compare(segment.startTimeMs, segment2.startTimeMs).compare(segment.endTimeMs, segment2.endTimeMs).compare(segment.speedDivisor, segment2.speedDivisor).result();
|
|
}
|
|
|
|
public Segment(long j, long j2, int i) {
|
|
Assertions.checkArgument(j < j2);
|
|
this.startTimeMs = j;
|
|
this.endTimeMs = j2;
|
|
this.speedDivisor = i;
|
|
}
|
|
|
|
public String toString() {
|
|
return Util.formatInvariant("Segment: startTimeMs=%d, endTimeMs=%d, speedDivisor=%d", Long.valueOf(this.startTimeMs), Long.valueOf(this.endTimeMs), Integer.valueOf(this.speedDivisor));
|
|
}
|
|
|
|
public boolean equals(Object obj) {
|
|
if (this == obj) {
|
|
return true;
|
|
}
|
|
if (obj == null || Segment.class != obj.getClass()) {
|
|
return false;
|
|
}
|
|
Segment segment = (Segment) obj;
|
|
return this.startTimeMs == segment.startTimeMs && this.endTimeMs == segment.endTimeMs && this.speedDivisor == segment.speedDivisor;
|
|
}
|
|
|
|
public int hashCode() {
|
|
return Objects.hashCode(Long.valueOf(this.startTimeMs), Long.valueOf(this.endTimeMs), Integer.valueOf(this.speedDivisor));
|
|
}
|
|
|
|
@Override // android.os.Parcelable
|
|
public void writeToParcel(Parcel parcel, int i) {
|
|
parcel.writeLong(this.startTimeMs);
|
|
parcel.writeLong(this.endTimeMs);
|
|
parcel.writeInt(this.speedDivisor);
|
|
}
|
|
}
|
|
|
|
public SlowMotionData(List list) {
|
|
this.segments = list;
|
|
Assertions.checkArgument(!doSegmentsOverlap(list));
|
|
}
|
|
|
|
public String toString() {
|
|
String valueOf = String.valueOf(this.segments);
|
|
StringBuilder sb = new StringBuilder(valueOf.length() + 21);
|
|
sb.append("SlowMotion: segments=");
|
|
sb.append(valueOf);
|
|
return sb.toString();
|
|
}
|
|
|
|
public boolean equals(Object obj) {
|
|
if (this == obj) {
|
|
return true;
|
|
}
|
|
if (obj == null || SlowMotionData.class != obj.getClass()) {
|
|
return false;
|
|
}
|
|
return this.segments.equals(((SlowMotionData) obj).segments);
|
|
}
|
|
|
|
public int hashCode() {
|
|
return this.segments.hashCode();
|
|
}
|
|
|
|
@Override // android.os.Parcelable
|
|
public void writeToParcel(Parcel parcel, int i) {
|
|
parcel.writeList(this.segments);
|
|
}
|
|
|
|
public static boolean doSegmentsOverlap(List list) {
|
|
if (list.isEmpty()) {
|
|
return false;
|
|
}
|
|
long j = ((Segment) list.get(0)).endTimeMs;
|
|
for (int i = 1; i < list.size(); i++) {
|
|
if (((Segment) list.get(i)).startTimeMs < j) {
|
|
return true;
|
|
}
|
|
j = ((Segment) list.get(i)).endTimeMs;
|
|
}
|
|
return false;
|
|
}
|
|
}
|