alexandroid/decompiled/jadx/sources/com/google/android/exoplayer2/Format.java
KaKi87 a47fad5135 📦 Add decompiled Alexa 2.2.730155.0 (jadx, apktool, Hermes strings)
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-07 00:04:16 +01:00

793 lines
33 KiB
Java

package com.google.android.exoplayer2;
import android.os.Parcel;
import android.os.Parcelable;
import androidx.annotation.Nullable;
import com.google.android.exoplayer2.drm.DrmInitData;
import com.google.android.exoplayer2.drm.ExoMediaCrypto;
import com.google.android.exoplayer2.drm.UnsupportedMediaCrypto;
import com.google.android.exoplayer2.metadata.Metadata;
import com.google.android.exoplayer2.util.Assertions;
import com.google.android.exoplayer2.util.MimeTypes;
import com.google.android.exoplayer2.util.Util;
import com.google.android.exoplayer2.video.ColorInfo;
import defpackage.a$$ExternalSyntheticOutline0;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;
/* compiled from: r8-map-id-b9432e0f623b4a4bff4ba50a8a24c4aafad2c1e11092747b9fb5e6a22af5a940 */
/* loaded from: classes7.dex */
public final class Format implements Parcelable {
public static final Parcelable.Creator<Format> CREATOR = new Parcelable.Creator<Format>() { // from class: com.google.android.exoplayer2.Format.1
/* JADX WARN: Can't rename method to resolve collision */
@Override // android.os.Parcelable.Creator
public Format createFromParcel(Parcel parcel) {
return new Format(parcel);
}
/* JADX WARN: Can't rename method to resolve collision */
@Override // android.os.Parcelable.Creator
public Format[] newArray(int i) {
return new Format[i];
}
};
public static final int NO_VALUE = -1;
public static final long OFFSET_SAMPLE_RELATIVE = Long.MAX_VALUE;
public final int accessibilityChannel;
public final int averageBitrate;
public final int bitrate;
public final int channelCount;
@Nullable
public final String codecs;
@Nullable
public final ColorInfo colorInfo;
@Nullable
public final String containerMimeType;
@Nullable
public final DrmInitData drmInitData;
public final int encoderDelay;
public final int encoderPadding;
@Nullable
public final Class<? extends ExoMediaCrypto> exoMediaCryptoType;
public final float frameRate;
private int hashCode;
public final int height;
@Nullable
public final String id;
public final List<byte[]> initializationData;
@Nullable
public final String label;
@Nullable
public final String language;
public final int maxInputSize;
@Nullable
public final Metadata metadata;
public final int pcmEncoding;
public final int peakBitrate;
public final float pixelWidthHeightRatio;
@Nullable
public final byte[] projectionData;
public final int roleFlags;
public final int rotationDegrees;
@Nullable
public final String sampleMimeType;
public final int sampleRate;
public final int selectionFlags;
public final int stereoMode;
public final long subsampleOffsetUs;
public final int width;
private Format(Builder builder) {
this.id = builder.id;
this.label = builder.label;
this.language = Util.normalizeLanguageCode(builder.language);
this.selectionFlags = builder.selectionFlags;
this.roleFlags = builder.roleFlags;
int i = builder.averageBitrate;
this.averageBitrate = i;
int i2 = builder.peakBitrate;
this.peakBitrate = i2;
this.bitrate = i2 != -1 ? i2 : i;
this.codecs = builder.codecs;
this.metadata = builder.metadata;
this.containerMimeType = builder.containerMimeType;
this.sampleMimeType = builder.sampleMimeType;
this.maxInputSize = builder.maxInputSize;
this.initializationData = builder.initializationData == null ? Collections.EMPTY_LIST : builder.initializationData;
DrmInitData drmInitData = builder.drmInitData;
this.drmInitData = drmInitData;
this.subsampleOffsetUs = builder.subsampleOffsetUs;
this.width = builder.width;
this.height = builder.height;
this.frameRate = builder.frameRate;
this.rotationDegrees = builder.rotationDegrees == -1 ? 0 : builder.rotationDegrees;
this.pixelWidthHeightRatio = builder.pixelWidthHeightRatio == -1.0f ? 1.0f : builder.pixelWidthHeightRatio;
this.projectionData = builder.projectionData;
this.stereoMode = builder.stereoMode;
this.colorInfo = builder.colorInfo;
this.channelCount = builder.channelCount;
this.sampleRate = builder.sampleRate;
this.pcmEncoding = builder.pcmEncoding;
this.encoderDelay = builder.encoderDelay == -1 ? 0 : builder.encoderDelay;
this.encoderPadding = builder.encoderPadding != -1 ? builder.encoderPadding : 0;
this.accessibilityChannel = builder.accessibilityChannel;
if (builder.exoMediaCryptoType != null || drmInitData == null) {
this.exoMediaCryptoType = builder.exoMediaCryptoType;
} else {
this.exoMediaCryptoType = UnsupportedMediaCrypto.class;
}
}
@Deprecated
public static Format createAudioContainerFormat(@Nullable String str, @Nullable String str2, @Nullable String str3, @Nullable String str4, @Nullable String str5, @Nullable Metadata metadata, int i, int i2, int i3, @Nullable List<byte[]> list, int i4, int i5, @Nullable String str6) {
return new Builder().setId(str).setLabel(str2).setLanguage(str6).setSelectionFlags(i4).setRoleFlags(i5).setAverageBitrate(i).setPeakBitrate(i).setCodecs(str5).setMetadata(metadata).setContainerMimeType(str3).setSampleMimeType(str4).setInitializationData(list).setChannelCount(i2).setSampleRate(i3).build();
}
@Deprecated
public static Format createAudioSampleFormat(@Nullable String str, @Nullable String str2, @Nullable String str3, int i, int i2, int i3, int i4, int i5, int i6, int i7, @Nullable List<byte[]> list, @Nullable DrmInitData drmInitData, int i8, @Nullable String str4, @Nullable Metadata metadata) {
return new Builder().setId(str).setLanguage(str4).setSelectionFlags(i8).setAverageBitrate(i).setPeakBitrate(i).setCodecs(str3).setMetadata(metadata).setSampleMimeType(str2).setMaxInputSize(i2).setInitializationData(list).setDrmInitData(drmInitData).setChannelCount(i3).setSampleRate(i4).setPcmEncoding(i5).setEncoderDelay(i6).setEncoderPadding(i7).build();
}
@Deprecated
public static Format createContainerFormat(@Nullable String str, @Nullable String str2, @Nullable String str3, @Nullable String str4, @Nullable String str5, int i, int i2, int i3, @Nullable String str6) {
return new Builder().setId(str).setLabel(str2).setLanguage(str6).setSelectionFlags(i2).setRoleFlags(i3).setAverageBitrate(i).setPeakBitrate(i).setCodecs(str5).setContainerMimeType(str3).setSampleMimeType(str4).build();
}
@Deprecated
public static Format createImageSampleFormat(@Nullable String str, @Nullable String str2, int i, @Nullable List<byte[]> list, @Nullable String str3) {
return new Builder().setId(str).setLanguage(str3).setSelectionFlags(i).setSampleMimeType(str2).setInitializationData(list).build();
}
@Deprecated
public static Format createSampleFormat(@Nullable String str, @Nullable String str2) {
return new Builder().setId(str).setSampleMimeType(str2).build();
}
@Deprecated
public static Format createTextContainerFormat(@Nullable String str, @Nullable String str2, @Nullable String str3, @Nullable String str4, @Nullable String str5, int i, int i2, int i3, @Nullable String str6, int i4) {
return new Builder().setId(str).setLabel(str2).setLanguage(str6).setSelectionFlags(i2).setRoleFlags(i3).setAverageBitrate(i).setPeakBitrate(i).setCodecs(str5).setContainerMimeType(str3).setSampleMimeType(str4).setAccessibilityChannel(i4).build();
}
@Deprecated
public static Format createTextSampleFormat(@Nullable String str, @Nullable String str2, int i, @Nullable String str3, int i2, long j, @Nullable List<byte[]> list) {
return new Builder().setId(str).setLanguage(str3).setSelectionFlags(i).setSampleMimeType(str2).setInitializationData(list).setSubsampleOffsetUs(j).setAccessibilityChannel(i2).build();
}
@Deprecated
public static Format createVideoContainerFormat(@Nullable String str, @Nullable String str2, @Nullable String str3, @Nullable String str4, @Nullable String str5, @Nullable Metadata metadata, int i, int i2, int i3, float f, @Nullable List<byte[]> list, int i4, int i5) {
return new Builder().setId(str).setLabel(str2).setSelectionFlags(i4).setRoleFlags(i5).setAverageBitrate(i).setPeakBitrate(i).setCodecs(str5).setMetadata(metadata).setContainerMimeType(str3).setSampleMimeType(str4).setInitializationData(list).setWidth(i2).setHeight(i3).setFrameRate(f).build();
}
@Deprecated
public static Format createVideoSampleFormat(@Nullable String str, @Nullable String str2, @Nullable String str3, int i, int i2, int i3, int i4, float f, @Nullable List<byte[]> list, int i5, float f2, @Nullable byte[] bArr, int i6, @Nullable ColorInfo colorInfo, @Nullable DrmInitData drmInitData) {
return new Builder().setId(str).setAverageBitrate(i).setPeakBitrate(i).setCodecs(str3).setSampleMimeType(str2).setMaxInputSize(i2).setInitializationData(list).setDrmInitData(drmInitData).setWidth(i3).setHeight(i4).setFrameRate(f).setRotationDegrees(i5).setPixelWidthHeightRatio(f2).setProjectionData(bArr).setStereoMode(i6).setColorInfo(colorInfo).build();
}
public static String toLogString(@Nullable Format format) {
if (format == null) {
return "null";
}
StringBuilder sb = new StringBuilder("id=");
sb.append(format.id);
sb.append(", mimeType=");
sb.append(format.sampleMimeType);
if (format.bitrate != -1) {
sb.append(", bitrate=");
sb.append(format.bitrate);
}
if (format.codecs != null) {
sb.append(", codecs=");
sb.append(format.codecs);
}
if (format.width != -1 && format.height != -1) {
sb.append(", res=");
sb.append(format.width);
sb.append("x");
sb.append(format.height);
}
if (format.frameRate != -1.0f) {
sb.append(", fps=");
sb.append(format.frameRate);
}
if (format.channelCount != -1) {
sb.append(", channels=");
sb.append(format.channelCount);
}
if (format.sampleRate != -1) {
sb.append(", sample_rate=");
sb.append(format.sampleRate);
}
if (format.language != null) {
sb.append(", language=");
sb.append(format.language);
}
if (format.label != null) {
sb.append(", label=");
sb.append(format.label);
}
return sb.toString();
}
public Builder buildUpon() {
return new Builder();
}
@Deprecated
public Format copyWithBitrate(int i) {
return buildUpon().setAverageBitrate(i).setPeakBitrate(i).build();
}
@Deprecated
public Format copyWithDrmInitData(@Nullable DrmInitData drmInitData) {
return buildUpon().setDrmInitData(drmInitData).build();
}
public Format copyWithExoMediaCryptoType(@Nullable Class<? extends ExoMediaCrypto> cls) {
return buildUpon().setExoMediaCryptoType(cls).build();
}
@Deprecated
public Format copyWithFrameRate(float f) {
return buildUpon().setFrameRate(f).build();
}
@Deprecated
public Format copyWithGaplessInfo(int i, int i2) {
return buildUpon().setEncoderDelay(i).setEncoderPadding(i2).build();
}
@Deprecated
public Format copyWithLabel(@Nullable String str) {
return buildUpon().setLabel(str).build();
}
@Deprecated
public Format copyWithManifestFormatInfo(Format format) {
return withManifestFormatInfo(format);
}
@Deprecated
public Format copyWithMaxInputSize(int i) {
return buildUpon().setMaxInputSize(i).build();
}
@Deprecated
public Format copyWithMetadata(@Nullable Metadata metadata) {
return buildUpon().setMetadata(metadata).build();
}
@Deprecated
public Format copyWithSubsampleOffsetUs(long j) {
return buildUpon().setSubsampleOffsetUs(j).build();
}
@Deprecated
public Format copyWithVideoSize(int i, int i2) {
return buildUpon().setWidth(i).setHeight(i2).build();
}
@Override // android.os.Parcelable
public int describeContents() {
return 0;
}
public boolean equals(@Nullable Object obj) {
int i;
if (this == obj) {
return true;
}
if (obj != null && Format.class == obj.getClass()) {
Format format = (Format) obj;
int i2 = this.hashCode;
if ((i2 == 0 || (i = format.hashCode) == 0 || i2 == i) && this.selectionFlags == format.selectionFlags && this.roleFlags == format.roleFlags && this.averageBitrate == format.averageBitrate && this.peakBitrate == format.peakBitrate && this.maxInputSize == format.maxInputSize && this.subsampleOffsetUs == format.subsampleOffsetUs && this.width == format.width && this.height == format.height && this.rotationDegrees == format.rotationDegrees && this.stereoMode == format.stereoMode && this.channelCount == format.channelCount && this.sampleRate == format.sampleRate && this.pcmEncoding == format.pcmEncoding && this.encoderDelay == format.encoderDelay && this.encoderPadding == format.encoderPadding && this.accessibilityChannel == format.accessibilityChannel && Float.compare(this.frameRate, format.frameRate) == 0 && Float.compare(this.pixelWidthHeightRatio, format.pixelWidthHeightRatio) == 0 && Util.areEqual(this.exoMediaCryptoType, format.exoMediaCryptoType) && Util.areEqual(this.id, format.id) && Util.areEqual(this.label, format.label) && Util.areEqual(this.codecs, format.codecs) && Util.areEqual(this.containerMimeType, format.containerMimeType) && Util.areEqual(this.sampleMimeType, format.sampleMimeType) && Util.areEqual(this.language, format.language) && Arrays.equals(this.projectionData, format.projectionData) && Util.areEqual(this.metadata, format.metadata) && Util.areEqual(this.colorInfo, format.colorInfo) && Util.areEqual(this.drmInitData, format.drmInitData) && initializationDataEquals(format)) {
return true;
}
}
return false;
}
public int getPixelCount() {
int i;
int i2 = this.width;
if (i2 == -1 || (i = this.height) == -1) {
return -1;
}
return i2 * i;
}
public int hashCode() {
if (this.hashCode == 0) {
String str = this.id;
int hashCode = (527 + (str == null ? 0 : str.hashCode())) * 31;
String str2 = this.label;
int hashCode2 = (hashCode + (str2 != null ? str2.hashCode() : 0)) * 31;
String str3 = this.language;
int hashCode3 = (((((((((hashCode2 + (str3 == null ? 0 : str3.hashCode())) * 31) + this.selectionFlags) * 31) + this.roleFlags) * 31) + this.averageBitrate) * 31) + this.peakBitrate) * 31;
String str4 = this.codecs;
int hashCode4 = (hashCode3 + (str4 == null ? 0 : str4.hashCode())) * 31;
Metadata metadata = this.metadata;
int hashCode5 = (hashCode4 + (metadata == null ? 0 : metadata.hashCode())) * 31;
String str5 = this.containerMimeType;
int hashCode6 = (hashCode5 + (str5 == null ? 0 : str5.hashCode())) * 31;
String str6 = this.sampleMimeType;
int floatToIntBits = (((((((((((((((Float.floatToIntBits(this.pixelWidthHeightRatio) + ((((Float.floatToIntBits(this.frameRate) + ((((((((((hashCode6 + (str6 == null ? 0 : str6.hashCode())) * 31) + this.maxInputSize) * 31) + ((int) this.subsampleOffsetUs)) * 31) + this.width) * 31) + this.height) * 31)) * 31) + this.rotationDegrees) * 31)) * 31) + this.stereoMode) * 31) + this.channelCount) * 31) + this.sampleRate) * 31) + this.pcmEncoding) * 31) + this.encoderDelay) * 31) + this.encoderPadding) * 31) + this.accessibilityChannel) * 31;
Class<? extends ExoMediaCrypto> cls = this.exoMediaCryptoType;
this.hashCode = floatToIntBits + (cls != null ? cls.hashCode() : 0);
}
return this.hashCode;
}
public boolean initializationDataEquals(Format format) {
if (this.initializationData.size() != format.initializationData.size()) {
return false;
}
for (int i = 0; i < this.initializationData.size(); i++) {
if (!Arrays.equals(this.initializationData.get(i), format.initializationData.get(i))) {
return false;
}
}
return true;
}
public String toString() {
StringBuilder sb = new StringBuilder("Format(");
sb.append(this.id);
sb.append(", ");
sb.append(this.label);
sb.append(", ");
sb.append(this.containerMimeType);
sb.append(", ");
sb.append(this.sampleMimeType);
sb.append(", ");
sb.append(this.codecs);
sb.append(", ");
sb.append(this.bitrate);
sb.append(", ");
sb.append(this.language);
sb.append(", [");
sb.append(this.width);
sb.append(", ");
sb.append(this.height);
sb.append(", ");
sb.append(this.frameRate);
sb.append("], [");
sb.append(this.channelCount);
sb.append(", ");
return a$$ExternalSyntheticOutline0.m(sb, this.sampleRate, "])");
}
public Format withManifestFormatInfo(Format format) {
String str;
if (this == format) {
return this;
}
int trackType = MimeTypes.getTrackType(this.sampleMimeType);
String str2 = format.id;
String str3 = format.label;
if (str3 == null) {
str3 = this.label;
}
String str4 = this.language;
if ((trackType == 3 || trackType == 1) && (str = format.language) != null) {
str4 = str;
}
int i = this.averageBitrate;
if (i == -1) {
i = format.averageBitrate;
}
int i2 = this.peakBitrate;
if (i2 == -1) {
i2 = format.peakBitrate;
}
String str5 = this.codecs;
if (str5 == null) {
String codecsOfType = Util.getCodecsOfType(format.codecs, trackType);
if (Util.splitCodecs(codecsOfType).length == 1) {
str5 = codecsOfType;
}
}
Metadata metadata = this.metadata;
Metadata metadata2 = format.metadata;
if (metadata != null) {
metadata2 = metadata.copyWithAppendedEntriesFrom(metadata2);
}
float f = this.frameRate;
if (f == -1.0f && trackType == 2) {
f = format.frameRate;
}
int i3 = this.selectionFlags | format.selectionFlags;
return buildUpon().setId(str2).setLabel(str3).setLanguage(str4).setSelectionFlags(i3).setRoleFlags(this.roleFlags | format.roleFlags).setAverageBitrate(i).setPeakBitrate(i2).setCodecs(str5).setMetadata(metadata2).setDrmInitData(DrmInitData.createSessionCreationData(format.drmInitData, this.drmInitData)).setFrameRate(f).build();
}
@Override // android.os.Parcelable
public void writeToParcel(Parcel parcel, int i) {
parcel.writeString(this.id);
parcel.writeString(this.label);
parcel.writeString(this.language);
parcel.writeInt(this.selectionFlags);
parcel.writeInt(this.roleFlags);
parcel.writeInt(this.averageBitrate);
parcel.writeInt(this.peakBitrate);
parcel.writeString(this.codecs);
parcel.writeParcelable(this.metadata, 0);
parcel.writeString(this.containerMimeType);
parcel.writeString(this.sampleMimeType);
parcel.writeInt(this.maxInputSize);
int size = this.initializationData.size();
parcel.writeInt(size);
for (int i2 = 0; i2 < size; i2++) {
parcel.writeByteArray(this.initializationData.get(i2));
}
parcel.writeParcelable(this.drmInitData, 0);
parcel.writeLong(this.subsampleOffsetUs);
parcel.writeInt(this.width);
parcel.writeInt(this.height);
parcel.writeFloat(this.frameRate);
parcel.writeInt(this.rotationDegrees);
parcel.writeFloat(this.pixelWidthHeightRatio);
Util.writeBoolean(parcel, this.projectionData != null);
byte[] bArr = this.projectionData;
if (bArr != null) {
parcel.writeByteArray(bArr);
}
parcel.writeInt(this.stereoMode);
parcel.writeParcelable(this.colorInfo, i);
parcel.writeInt(this.channelCount);
parcel.writeInt(this.sampleRate);
parcel.writeInt(this.pcmEncoding);
parcel.writeInt(this.encoderDelay);
parcel.writeInt(this.encoderPadding);
parcel.writeInt(this.accessibilityChannel);
}
/* compiled from: r8-map-id-b9432e0f623b4a4bff4ba50a8a24c4aafad2c1e11092747b9fb5e6a22af5a940 */
public static final class Builder {
private int accessibilityChannel;
private int averageBitrate;
private int channelCount;
@Nullable
private String codecs;
@Nullable
private ColorInfo colorInfo;
@Nullable
private String containerMimeType;
@Nullable
private DrmInitData drmInitData;
private int encoderDelay;
private int encoderPadding;
@Nullable
private Class<? extends ExoMediaCrypto> exoMediaCryptoType;
private float frameRate;
private int height;
@Nullable
private String id;
@Nullable
private List<byte[]> initializationData;
@Nullable
private String label;
@Nullable
private String language;
private int maxInputSize;
@Nullable
private Metadata metadata;
private int pcmEncoding;
private int peakBitrate;
private float pixelWidthHeightRatio;
@Nullable
private byte[] projectionData;
private int roleFlags;
private int rotationDegrees;
@Nullable
private String sampleMimeType;
private int sampleRate;
private int selectionFlags;
private int stereoMode;
private long subsampleOffsetUs;
private int width;
private Builder(Format format) {
this.id = format.id;
this.label = format.label;
this.language = format.language;
this.selectionFlags = format.selectionFlags;
this.roleFlags = format.roleFlags;
this.averageBitrate = format.averageBitrate;
this.peakBitrate = format.peakBitrate;
this.codecs = format.codecs;
this.metadata = format.metadata;
this.containerMimeType = format.containerMimeType;
this.sampleMimeType = format.sampleMimeType;
this.maxInputSize = format.maxInputSize;
this.initializationData = format.initializationData;
this.drmInitData = format.drmInitData;
this.subsampleOffsetUs = format.subsampleOffsetUs;
this.width = format.width;
this.height = format.height;
this.frameRate = format.frameRate;
this.rotationDegrees = format.rotationDegrees;
this.pixelWidthHeightRatio = format.pixelWidthHeightRatio;
this.projectionData = format.projectionData;
this.stereoMode = format.stereoMode;
this.colorInfo = format.colorInfo;
this.channelCount = format.channelCount;
this.sampleRate = format.sampleRate;
this.pcmEncoding = format.pcmEncoding;
this.encoderDelay = format.encoderDelay;
this.encoderPadding = format.encoderPadding;
this.accessibilityChannel = format.accessibilityChannel;
this.exoMediaCryptoType = format.exoMediaCryptoType;
}
public Format build() {
return new Format(this);
}
public Builder setAccessibilityChannel(int i) {
this.accessibilityChannel = i;
return this;
}
public Builder setAverageBitrate(int i) {
this.averageBitrate = i;
return this;
}
public Builder setChannelCount(int i) {
this.channelCount = i;
return this;
}
public Builder setCodecs(@Nullable String str) {
this.codecs = str;
return this;
}
public Builder setColorInfo(@Nullable ColorInfo colorInfo) {
this.colorInfo = colorInfo;
return this;
}
public Builder setContainerMimeType(@Nullable String str) {
this.containerMimeType = str;
return this;
}
public Builder setDrmInitData(@Nullable DrmInitData drmInitData) {
this.drmInitData = drmInitData;
return this;
}
public Builder setEncoderDelay(int i) {
this.encoderDelay = i;
return this;
}
public Builder setEncoderPadding(int i) {
this.encoderPadding = i;
return this;
}
public Builder setExoMediaCryptoType(@Nullable Class<? extends ExoMediaCrypto> cls) {
this.exoMediaCryptoType = cls;
return this;
}
public Builder setFrameRate(float f) {
this.frameRate = f;
return this;
}
public Builder setHeight(int i) {
this.height = i;
return this;
}
public Builder setId(int i) {
this.id = Integer.toString(i);
return this;
}
public Builder setInitializationData(@Nullable List<byte[]> list) {
this.initializationData = list;
return this;
}
public Builder setLabel(@Nullable String str) {
this.label = str;
return this;
}
public Builder setLanguage(@Nullable String str) {
this.language = str;
return this;
}
public Builder setMaxInputSize(int i) {
this.maxInputSize = i;
return this;
}
public Builder setMetadata(@Nullable Metadata metadata) {
this.metadata = metadata;
return this;
}
public Builder setPcmEncoding(int i) {
this.pcmEncoding = i;
return this;
}
public Builder setPeakBitrate(int i) {
this.peakBitrate = i;
return this;
}
public Builder setPixelWidthHeightRatio(float f) {
this.pixelWidthHeightRatio = f;
return this;
}
public Builder setProjectionData(@Nullable byte[] bArr) {
this.projectionData = bArr;
return this;
}
public Builder setRoleFlags(int i) {
this.roleFlags = i;
return this;
}
public Builder setRotationDegrees(int i) {
this.rotationDegrees = i;
return this;
}
public Builder setSampleMimeType(@Nullable String str) {
this.sampleMimeType = str;
return this;
}
public Builder setSampleRate(int i) {
this.sampleRate = i;
return this;
}
public Builder setSelectionFlags(int i) {
this.selectionFlags = i;
return this;
}
public Builder setStereoMode(int i) {
this.stereoMode = i;
return this;
}
public Builder setSubsampleOffsetUs(long j) {
this.subsampleOffsetUs = j;
return this;
}
public Builder setWidth(int i) {
this.width = i;
return this;
}
public Builder setId(@Nullable String str) {
this.id = str;
return this;
}
public Builder() {
this.averageBitrate = -1;
this.peakBitrate = -1;
this.maxInputSize = -1;
this.subsampleOffsetUs = Long.MAX_VALUE;
this.width = -1;
this.height = -1;
this.frameRate = -1.0f;
this.pixelWidthHeightRatio = 1.0f;
this.stereoMode = -1;
this.channelCount = -1;
this.sampleRate = -1;
this.pcmEncoding = -1;
this.accessibilityChannel = -1;
}
}
@Deprecated
public static Format createTextSampleFormat(@Nullable String str, @Nullable String str2, int i, @Nullable String str3) {
return new Builder().setId(str).setLanguage(str3).setSelectionFlags(i).setSampleMimeType(str2).build();
}
@Deprecated
public static Format createTextContainerFormat(@Nullable String str, @Nullable String str2, @Nullable String str3, @Nullable String str4, @Nullable String str5, int i, int i2, int i3, @Nullable String str6) {
return new Builder().setId(str).setLabel(str2).setLanguage(str6).setSelectionFlags(i2).setRoleFlags(i3).setAverageBitrate(i).setPeakBitrate(i).setCodecs(str5).setContainerMimeType(str3).setSampleMimeType(str4).build();
}
@Deprecated
public static Format createAudioSampleFormat(@Nullable String str, @Nullable String str2, @Nullable String str3, int i, int i2, int i3, int i4, int i5, @Nullable List<byte[]> list, @Nullable DrmInitData drmInitData, int i6, @Nullable String str4) {
return new Builder().setId(str).setLanguage(str4).setSelectionFlags(i6).setAverageBitrate(i).setPeakBitrate(i).setCodecs(str3).setSampleMimeType(str2).setMaxInputSize(i2).setInitializationData(list).setDrmInitData(drmInitData).setChannelCount(i3).setSampleRate(i4).setPcmEncoding(i5).build();
}
@Deprecated
public static Format createVideoSampleFormat(@Nullable String str, @Nullable String str2, @Nullable String str3, int i, int i2, int i3, int i4, float f, @Nullable List<byte[]> list, int i5, float f2, @Nullable DrmInitData drmInitData) {
return new Builder().setId(str).setAverageBitrate(i).setPeakBitrate(i).setCodecs(str3).setSampleMimeType(str2).setMaxInputSize(i2).setInitializationData(list).setDrmInitData(drmInitData).setWidth(i3).setHeight(i4).setFrameRate(f).setRotationDegrees(i5).setPixelWidthHeightRatio(f2).build();
}
@Deprecated
public static Format createAudioSampleFormat(@Nullable String str, @Nullable String str2, @Nullable String str3, int i, int i2, int i3, int i4, @Nullable List<byte[]> list, @Nullable DrmInitData drmInitData, int i5, @Nullable String str4) {
return new Builder().setId(str).setLanguage(str4).setSelectionFlags(i5).setAverageBitrate(i).setPeakBitrate(i).setCodecs(str3).setSampleMimeType(str2).setMaxInputSize(i2).setInitializationData(list).setDrmInitData(drmInitData).setChannelCount(i3).setSampleRate(i4).build();
}
@Deprecated
public static Format createVideoSampleFormat(@Nullable String str, @Nullable String str2, @Nullable String str3, int i, int i2, int i3, int i4, float f, @Nullable List<byte[]> list, @Nullable DrmInitData drmInitData) {
return new Builder().setId(str).setAverageBitrate(i).setPeakBitrate(i).setCodecs(str3).setSampleMimeType(str2).setMaxInputSize(i2).setInitializationData(list).setDrmInitData(drmInitData).setWidth(i3).setHeight(i4).setFrameRate(f).build();
}
/* JADX WARN: Multi-variable type inference failed */
public Format(Parcel parcel) {
this.id = parcel.readString();
this.label = parcel.readString();
this.language = parcel.readString();
this.selectionFlags = parcel.readInt();
this.roleFlags = parcel.readInt();
int readInt = parcel.readInt();
this.averageBitrate = readInt;
int readInt2 = parcel.readInt();
this.peakBitrate = readInt2;
this.bitrate = readInt2 != -1 ? readInt2 : readInt;
this.codecs = parcel.readString();
this.metadata = (Metadata) parcel.readParcelable(Metadata.class.getClassLoader());
this.containerMimeType = parcel.readString();
this.sampleMimeType = parcel.readString();
this.maxInputSize = parcel.readInt();
int readInt3 = parcel.readInt();
this.initializationData = new ArrayList(readInt3);
for (int i = 0; i < readInt3; i++) {
this.initializationData.add(Assertions.checkNotNull(parcel.createByteArray()));
}
DrmInitData drmInitData = (DrmInitData) parcel.readParcelable(DrmInitData.class.getClassLoader());
this.drmInitData = drmInitData;
this.subsampleOffsetUs = parcel.readLong();
this.width = parcel.readInt();
this.height = parcel.readInt();
this.frameRate = parcel.readFloat();
this.rotationDegrees = parcel.readInt();
this.pixelWidthHeightRatio = parcel.readFloat();
this.projectionData = Util.readBoolean(parcel) ? parcel.createByteArray() : null;
this.stereoMode = parcel.readInt();
this.colorInfo = (ColorInfo) parcel.readParcelable(ColorInfo.class.getClassLoader());
this.channelCount = parcel.readInt();
this.sampleRate = parcel.readInt();
this.pcmEncoding = parcel.readInt();
this.encoderDelay = parcel.readInt();
this.encoderPadding = parcel.readInt();
this.accessibilityChannel = parcel.readInt();
this.exoMediaCryptoType = drmInitData != null ? UnsupportedMediaCrypto.class : null;
}
}