package com.google.android.exoplayer2; import android.net.Uri; import android.os.Bundle; import com.google.android.exoplayer2.Bundleable; import com.google.android.exoplayer2.MediaItem; import com.google.android.exoplayer2.offline.StreamKey; import com.google.android.exoplayer2.util.Assertions; import com.google.android.exoplayer2.util.Util; import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableMap; import java.util.ArrayList; import java.util.Arrays; import java.util.Collection; import java.util.Collections; import java.util.List; import java.util.Map; import java.util.UUID; /* loaded from: classes2.dex */ public final class MediaItem implements Bundleable { public static final String DEFAULT_MEDIA_ID = ""; public final ClippingConfiguration clippingConfiguration; @Deprecated public final ClippingProperties clippingProperties; public final LiveConfiguration liveConfiguration; public final LocalConfiguration localConfiguration; public final String mediaId; public final MediaMetadata mediaMetadata; @Deprecated public final PlaybackProperties playbackProperties; public final RequestMetadata requestMetadata; public static final MediaItem EMPTY = new Builder().build(); private static final String FIELD_MEDIA_ID = Util.intToStringMaxRadix(0); private static final String FIELD_LIVE_CONFIGURATION = Util.intToStringMaxRadix(1); private static final String FIELD_MEDIA_METADATA = Util.intToStringMaxRadix(2); private static final String FIELD_CLIPPING_PROPERTIES = Util.intToStringMaxRadix(3); private static final String FIELD_REQUEST_METADATA = Util.intToStringMaxRadix(4); public static final Bundleable.Creator CREATOR = new Bundleable.Creator() { // from class: com.google.android.exoplayer2.MediaItem$$ExternalSyntheticLambda0 @Override // com.google.android.exoplayer2.Bundleable.Creator public final Bundleable fromBundle(Bundle bundle) { MediaItem fromBundle; fromBundle = MediaItem.fromBundle(bundle); return fromBundle; } }; public static MediaItem fromUri(String str) { return new Builder().setUri(str).build(); } public static MediaItem fromUri(Uri uri) { return new Builder().setUri(uri).build(); } /* loaded from: classes2.dex */ public static final class Builder { private AdsConfiguration adsConfiguration; private ClippingConfiguration.Builder clippingConfiguration; private String customCacheKey; private DrmConfiguration.Builder drmConfiguration; private LiveConfiguration.Builder liveConfiguration; private String mediaId; private MediaMetadata mediaMetadata; private String mimeType; private RequestMetadata requestMetadata; private List streamKeys; private ImmutableList subtitleConfigurations; private Object tag; private Uri uri; public Builder setAdsConfiguration(AdsConfiguration adsConfiguration) { this.adsConfiguration = adsConfiguration; return this; } public Builder setCustomCacheKey(String str) { this.customCacheKey = str; return this; } public Builder setMediaMetadata(MediaMetadata mediaMetadata) { this.mediaMetadata = mediaMetadata; return this; } public Builder setMimeType(String str) { this.mimeType = str; return this; } public Builder setRequestMetadata(RequestMetadata requestMetadata) { this.requestMetadata = requestMetadata; return this; } public Builder setTag(Object obj) { this.tag = obj; return this; } public Builder setUri(Uri uri) { this.uri = uri; return this; } public Builder() { this.clippingConfiguration = new ClippingConfiguration.Builder(); this.drmConfiguration = new DrmConfiguration.Builder(); this.streamKeys = Collections.emptyList(); this.subtitleConfigurations = ImmutableList.of(); this.liveConfiguration = new LiveConfiguration.Builder(); this.requestMetadata = RequestMetadata.EMPTY; } private Builder(MediaItem mediaItem) { this(); DrmConfiguration.Builder builder; this.clippingConfiguration = mediaItem.clippingConfiguration.buildUpon(); this.mediaId = mediaItem.mediaId; this.mediaMetadata = mediaItem.mediaMetadata; this.liveConfiguration = mediaItem.liveConfiguration.buildUpon(); this.requestMetadata = mediaItem.requestMetadata; LocalConfiguration localConfiguration = mediaItem.localConfiguration; if (localConfiguration != null) { this.customCacheKey = localConfiguration.customCacheKey; this.mimeType = localConfiguration.mimeType; this.uri = localConfiguration.uri; this.streamKeys = localConfiguration.streamKeys; this.subtitleConfigurations = localConfiguration.subtitleConfigurations; this.tag = localConfiguration.tag; if (localConfiguration.drmConfiguration != null) { builder = localConfiguration.drmConfiguration.buildUpon(); } else { builder = new DrmConfiguration.Builder(); } this.drmConfiguration = builder; this.adsConfiguration = localConfiguration.adsConfiguration; } } public Builder setMediaId(String str) { this.mediaId = (String) Assertions.checkNotNull(str); return this; } public Builder setUri(String str) { return setUri(str == null ? null : Uri.parse(str)); } public Builder setClippingConfiguration(ClippingConfiguration clippingConfiguration) { this.clippingConfiguration = clippingConfiguration.buildUpon(); return this; } @Deprecated public Builder setClipStartPositionMs(long j) { this.clippingConfiguration.setStartPositionMs(j); return this; } @Deprecated public Builder setClipEndPositionMs(long j) { this.clippingConfiguration.setEndPositionMs(j); return this; } @Deprecated public Builder setClipRelativeToLiveWindow(boolean z) { this.clippingConfiguration.setRelativeToLiveWindow(z); return this; } @Deprecated public Builder setClipRelativeToDefaultPosition(boolean z) { this.clippingConfiguration.setRelativeToDefaultPosition(z); return this; } @Deprecated public Builder setClipStartsAtKeyFrame(boolean z) { this.clippingConfiguration.setStartsAtKeyFrame(z); return this; } public Builder setDrmConfiguration(DrmConfiguration drmConfiguration) { this.drmConfiguration = drmConfiguration != null ? drmConfiguration.buildUpon() : new DrmConfiguration.Builder(); return this; } @Deprecated public Builder setDrmLicenseUri(Uri uri) { this.drmConfiguration.setLicenseUri(uri); return this; } @Deprecated public Builder setDrmLicenseUri(String str) { this.drmConfiguration.setLicenseUri(str); return this; } @Deprecated public Builder setDrmLicenseRequestHeaders(Map map) { DrmConfiguration.Builder builder = this.drmConfiguration; if (map == null) { map = ImmutableMap.of(); } builder.setLicenseRequestHeaders(map); return this; } @Deprecated public Builder setDrmUuid(UUID uuid) { this.drmConfiguration.setNullableScheme(uuid); return this; } @Deprecated public Builder setDrmMultiSession(boolean z) { this.drmConfiguration.setMultiSession(z); return this; } @Deprecated public Builder setDrmForceDefaultLicenseUri(boolean z) { this.drmConfiguration.setForceDefaultLicenseUri(z); return this; } @Deprecated public Builder setDrmPlayClearContentWithoutKey(boolean z) { this.drmConfiguration.setPlayClearContentWithoutKey(z); return this; } @Deprecated public Builder setDrmSessionForClearPeriods(boolean z) { this.drmConfiguration.setForceSessionsForAudioAndVideoTracks(z); return this; } @Deprecated public Builder setDrmSessionForClearTypes(List list) { DrmConfiguration.Builder builder = this.drmConfiguration; if (list == null) { list = ImmutableList.of(); } builder.setForcedSessionTrackTypes(list); return this; } @Deprecated public Builder setDrmKeySetId(byte[] bArr) { this.drmConfiguration.setKeySetId(bArr); return this; } public Builder setStreamKeys(List list) { List emptyList; if (list != null && !list.isEmpty()) { emptyList = Collections.unmodifiableList(new ArrayList(list)); } else { emptyList = Collections.emptyList(); } this.streamKeys = emptyList; return this; } @Deprecated public Builder setSubtitles(List list) { this.subtitleConfigurations = list != null ? ImmutableList.copyOf((Collection) list) : ImmutableList.of(); return this; } public Builder setSubtitleConfigurations(List list) { this.subtitleConfigurations = ImmutableList.copyOf((Collection) list); return this; } @Deprecated public Builder setAdTagUri(String str) { return setAdTagUri(str != null ? Uri.parse(str) : null); } @Deprecated public Builder setAdTagUri(Uri uri) { return setAdTagUri(uri, null); } @Deprecated public Builder setAdTagUri(Uri uri, Object obj) { this.adsConfiguration = uri != null ? new AdsConfiguration.Builder(uri).setAdsId(obj).build() : null; return this; } public Builder setLiveConfiguration(LiveConfiguration liveConfiguration) { this.liveConfiguration = liveConfiguration.buildUpon(); return this; } @Deprecated public Builder setLiveTargetOffsetMs(long j) { this.liveConfiguration.setTargetOffsetMs(j); return this; } @Deprecated public Builder setLiveMinOffsetMs(long j) { this.liveConfiguration.setMinOffsetMs(j); return this; } @Deprecated public Builder setLiveMaxOffsetMs(long j) { this.liveConfiguration.setMaxOffsetMs(j); return this; } @Deprecated public Builder setLiveMinPlaybackSpeed(float f) { this.liveConfiguration.setMinPlaybackSpeed(f); return this; } @Deprecated public Builder setLiveMaxPlaybackSpeed(float f) { this.liveConfiguration.setMaxPlaybackSpeed(f); return this; } public MediaItem build() { PlaybackProperties playbackProperties; Assertions.checkState(this.drmConfiguration.licenseUri == null || this.drmConfiguration.scheme != null); Uri uri = this.uri; if (uri != null) { playbackProperties = new PlaybackProperties(uri, this.mimeType, this.drmConfiguration.scheme != null ? this.drmConfiguration.build() : null, this.adsConfiguration, this.streamKeys, this.customCacheKey, this.subtitleConfigurations, this.tag); } else { playbackProperties = null; } String str = this.mediaId; if (str == null) { str = ""; } String str2 = str; ClippingProperties buildClippingProperties = this.clippingConfiguration.buildClippingProperties(); LiveConfiguration build = this.liveConfiguration.build(); MediaMetadata mediaMetadata = this.mediaMetadata; if (mediaMetadata == null) { mediaMetadata = MediaMetadata.EMPTY; } return new MediaItem(str2, buildClippingProperties, playbackProperties, build, mediaMetadata, this.requestMetadata); } } /* loaded from: classes2.dex */ public static final class DrmConfiguration { public final boolean forceDefaultLicenseUri; public final ImmutableList forcedSessionTrackTypes; private final byte[] keySetId; public final ImmutableMap licenseRequestHeaders; public final Uri licenseUri; public final boolean multiSession; public final boolean playClearContentWithoutKey; @Deprecated public final ImmutableMap requestHeaders; public final UUID scheme; @Deprecated public final ImmutableList sessionForClearTypes; @Deprecated public final UUID uuid; /* loaded from: classes2.dex */ public static final class Builder { private boolean forceDefaultLicenseUri; private ImmutableList forcedSessionTrackTypes; private byte[] keySetId; private ImmutableMap licenseRequestHeaders; private Uri licenseUri; private boolean multiSession; private boolean playClearContentWithoutKey; private UUID scheme; /* JADX INFO: Access modifiers changed from: private */ @Deprecated public Builder setNullableScheme(UUID uuid) { this.scheme = uuid; return this; } public Builder setForceDefaultLicenseUri(boolean z) { this.forceDefaultLicenseUri = z; return this; } public Builder setLicenseUri(Uri uri) { this.licenseUri = uri; return this; } public Builder setMultiSession(boolean z) { this.multiSession = z; return this; } public Builder setPlayClearContentWithoutKey(boolean z) { this.playClearContentWithoutKey = z; return this; } public Builder setScheme(UUID uuid) { this.scheme = uuid; return this; } public Builder(UUID uuid) { this.scheme = uuid; this.licenseRequestHeaders = ImmutableMap.of(); this.forcedSessionTrackTypes = ImmutableList.of(); } @Deprecated private Builder() { this.licenseRequestHeaders = ImmutableMap.of(); this.forcedSessionTrackTypes = ImmutableList.of(); } private Builder(DrmConfiguration drmConfiguration) { this.scheme = drmConfiguration.scheme; this.licenseUri = drmConfiguration.licenseUri; this.licenseRequestHeaders = drmConfiguration.licenseRequestHeaders; this.multiSession = drmConfiguration.multiSession; this.playClearContentWithoutKey = drmConfiguration.playClearContentWithoutKey; this.forceDefaultLicenseUri = drmConfiguration.forceDefaultLicenseUri; this.forcedSessionTrackTypes = drmConfiguration.forcedSessionTrackTypes; this.keySetId = drmConfiguration.keySetId; } public Builder setLicenseUri(String str) { this.licenseUri = str == null ? null : Uri.parse(str); return this; } public Builder setLicenseRequestHeaders(Map map) { this.licenseRequestHeaders = ImmutableMap.copyOf((Map) map); return this; } @Deprecated public Builder forceSessionsForAudioAndVideoTracks(boolean z) { return setForceSessionsForAudioAndVideoTracks(z); } public Builder setForceSessionsForAudioAndVideoTracks(boolean z) { ImmutableList of; if (z) { of = ImmutableList.of(2, 1); } else { of = ImmutableList.of(); } setForcedSessionTrackTypes(of); return this; } public Builder setForcedSessionTrackTypes(List list) { this.forcedSessionTrackTypes = ImmutableList.copyOf((Collection) list); return this; } public Builder setKeySetId(byte[] bArr) { this.keySetId = bArr != null ? Arrays.copyOf(bArr, bArr.length) : null; return this; } public DrmConfiguration build() { return new DrmConfiguration(this); } } private DrmConfiguration(Builder builder) { Assertions.checkState((builder.forceDefaultLicenseUri && builder.licenseUri == null) ? false : true); UUID uuid = (UUID) Assertions.checkNotNull(builder.scheme); this.scheme = uuid; this.uuid = uuid; this.licenseUri = builder.licenseUri; this.requestHeaders = builder.licenseRequestHeaders; this.licenseRequestHeaders = builder.licenseRequestHeaders; this.multiSession = builder.multiSession; this.forceDefaultLicenseUri = builder.forceDefaultLicenseUri; this.playClearContentWithoutKey = builder.playClearContentWithoutKey; this.sessionForClearTypes = builder.forcedSessionTrackTypes; this.forcedSessionTrackTypes = builder.forcedSessionTrackTypes; this.keySetId = builder.keySetId != null ? Arrays.copyOf(builder.keySetId, builder.keySetId.length) : null; } public byte[] getKeySetId() { byte[] bArr = this.keySetId; if (bArr != null) { return Arrays.copyOf(bArr, bArr.length); } return null; } public Builder buildUpon() { return new Builder(); } public boolean equals(Object obj) { if (this == obj) { return true; } if (!(obj instanceof DrmConfiguration)) { return false; } DrmConfiguration drmConfiguration = (DrmConfiguration) obj; return this.scheme.equals(drmConfiguration.scheme) && Util.areEqual(this.licenseUri, drmConfiguration.licenseUri) && Util.areEqual(this.licenseRequestHeaders, drmConfiguration.licenseRequestHeaders) && this.multiSession == drmConfiguration.multiSession && this.forceDefaultLicenseUri == drmConfiguration.forceDefaultLicenseUri && this.playClearContentWithoutKey == drmConfiguration.playClearContentWithoutKey && this.forcedSessionTrackTypes.equals(drmConfiguration.forcedSessionTrackTypes) && Arrays.equals(this.keySetId, drmConfiguration.keySetId); } public int hashCode() { int hashCode = this.scheme.hashCode() * 31; Uri uri = this.licenseUri; return ((((((((((((hashCode + (uri != null ? uri.hashCode() : 0)) * 31) + this.licenseRequestHeaders.hashCode()) * 31) + (this.multiSession ? 1 : 0)) * 31) + (this.forceDefaultLicenseUri ? 1 : 0)) * 31) + (this.playClearContentWithoutKey ? 1 : 0)) * 31) + this.forcedSessionTrackTypes.hashCode()) * 31) + Arrays.hashCode(this.keySetId); } } /* loaded from: classes2.dex */ public static final class AdsConfiguration { public final Uri adTagUri; public final Object adsId; /* loaded from: classes2.dex */ public static final class Builder { private Uri adTagUri; private Object adsId; public Builder setAdTagUri(Uri uri) { this.adTagUri = uri; return this; } public Builder setAdsId(Object obj) { this.adsId = obj; return this; } public Builder(Uri uri) { this.adTagUri = uri; } public AdsConfiguration build() { return new AdsConfiguration(this); } } private AdsConfiguration(Builder builder) { this.adTagUri = builder.adTagUri; this.adsId = builder.adsId; } public Builder buildUpon() { return new Builder(this.adTagUri).setAdsId(this.adsId); } public boolean equals(Object obj) { if (this == obj) { return true; } if (!(obj instanceof AdsConfiguration)) { return false; } AdsConfiguration adsConfiguration = (AdsConfiguration) obj; return this.adTagUri.equals(adsConfiguration.adTagUri) && Util.areEqual(this.adsId, adsConfiguration.adsId); } public int hashCode() { int hashCode = this.adTagUri.hashCode() * 31; Object obj = this.adsId; return hashCode + (obj != null ? obj.hashCode() : 0); } } /* loaded from: classes2.dex */ public static class LocalConfiguration { public final AdsConfiguration adsConfiguration; public final String customCacheKey; public final DrmConfiguration drmConfiguration; public final String mimeType; public final List streamKeys; public final ImmutableList subtitleConfigurations; @Deprecated public final List subtitles; public final Object tag; public final Uri uri; private LocalConfiguration(Uri uri, String str, DrmConfiguration drmConfiguration, AdsConfiguration adsConfiguration, List list, String str2, ImmutableList immutableList, Object obj) { this.uri = uri; this.mimeType = str; this.drmConfiguration = drmConfiguration; this.adsConfiguration = adsConfiguration; this.streamKeys = list; this.customCacheKey = str2; this.subtitleConfigurations = immutableList; ImmutableList.Builder builder = ImmutableList.builder(); for (int i = 0; i < immutableList.size(); i++) { builder.add((ImmutableList.Builder) immutableList.get(i).buildUpon().buildSubtitle()); } this.subtitles = builder.build(); this.tag = obj; } public boolean equals(Object obj) { if (this == obj) { return true; } if (!(obj instanceof LocalConfiguration)) { return false; } LocalConfiguration localConfiguration = (LocalConfiguration) obj; return this.uri.equals(localConfiguration.uri) && Util.areEqual(this.mimeType, localConfiguration.mimeType) && Util.areEqual(this.drmConfiguration, localConfiguration.drmConfiguration) && Util.areEqual(this.adsConfiguration, localConfiguration.adsConfiguration) && this.streamKeys.equals(localConfiguration.streamKeys) && Util.areEqual(this.customCacheKey, localConfiguration.customCacheKey) && this.subtitleConfigurations.equals(localConfiguration.subtitleConfigurations) && Util.areEqual(this.tag, localConfiguration.tag); } public int hashCode() { int hashCode = this.uri.hashCode() * 31; String str = this.mimeType; int hashCode2 = (hashCode + (str == null ? 0 : str.hashCode())) * 31; DrmConfiguration drmConfiguration = this.drmConfiguration; int hashCode3 = (hashCode2 + (drmConfiguration == null ? 0 : drmConfiguration.hashCode())) * 31; AdsConfiguration adsConfiguration = this.adsConfiguration; int hashCode4 = (((hashCode3 + (adsConfiguration == null ? 0 : adsConfiguration.hashCode())) * 31) + this.streamKeys.hashCode()) * 31; String str2 = this.customCacheKey; int hashCode5 = (((hashCode4 + (str2 == null ? 0 : str2.hashCode())) * 31) + this.subtitleConfigurations.hashCode()) * 31; Object obj = this.tag; return hashCode5 + (obj != null ? obj.hashCode() : 0); } } @Deprecated /* loaded from: classes2.dex */ public static final class PlaybackProperties extends LocalConfiguration { private PlaybackProperties(Uri uri, String str, DrmConfiguration drmConfiguration, AdsConfiguration adsConfiguration, List list, String str2, ImmutableList immutableList, Object obj) { super(uri, str, drmConfiguration, adsConfiguration, list, str2, immutableList, obj); } } /* loaded from: classes2.dex */ public static final class LiveConfiguration implements Bundleable { public final long maxOffsetMs; public final float maxPlaybackSpeed; public final long minOffsetMs; public final float minPlaybackSpeed; public final long targetOffsetMs; public static final LiveConfiguration UNSET = new Builder().build(); private static final String FIELD_TARGET_OFFSET_MS = Util.intToStringMaxRadix(0); private static final String FIELD_MIN_OFFSET_MS = Util.intToStringMaxRadix(1); private static final String FIELD_MAX_OFFSET_MS = Util.intToStringMaxRadix(2); private static final String FIELD_MIN_PLAYBACK_SPEED = Util.intToStringMaxRadix(3); private static final String FIELD_MAX_PLAYBACK_SPEED = Util.intToStringMaxRadix(4); public static final Bundleable.Creator CREATOR = new Bundleable.Creator() { // from class: com.google.android.exoplayer2.MediaItem$LiveConfiguration$$ExternalSyntheticLambda0 @Override // com.google.android.exoplayer2.Bundleable.Creator public final Bundleable fromBundle(Bundle bundle) { return MediaItem.LiveConfiguration.lambda$static$0(bundle); } }; /* loaded from: classes2.dex */ public static final class Builder { private long maxOffsetMs; private float maxPlaybackSpeed; private long minOffsetMs; private float minPlaybackSpeed; private long targetOffsetMs; public Builder setMaxOffsetMs(long j) { this.maxOffsetMs = j; return this; } public Builder setMaxPlaybackSpeed(float f) { this.maxPlaybackSpeed = f; return this; } public Builder setMinOffsetMs(long j) { this.minOffsetMs = j; return this; } public Builder setMinPlaybackSpeed(float f) { this.minPlaybackSpeed = f; return this; } public Builder setTargetOffsetMs(long j) { this.targetOffsetMs = j; return this; } public Builder() { this.targetOffsetMs = -9223372036854775807L; this.minOffsetMs = -9223372036854775807L; this.maxOffsetMs = -9223372036854775807L; this.minPlaybackSpeed = -3.4028235E38f; this.maxPlaybackSpeed = -3.4028235E38f; } private Builder(LiveConfiguration liveConfiguration) { this.targetOffsetMs = liveConfiguration.targetOffsetMs; this.minOffsetMs = liveConfiguration.minOffsetMs; this.maxOffsetMs = liveConfiguration.maxOffsetMs; this.minPlaybackSpeed = liveConfiguration.minPlaybackSpeed; this.maxPlaybackSpeed = liveConfiguration.maxPlaybackSpeed; } public LiveConfiguration build() { return new LiveConfiguration(this); } } private LiveConfiguration(Builder builder) { this(builder.targetOffsetMs, builder.minOffsetMs, builder.maxOffsetMs, builder.minPlaybackSpeed, builder.maxPlaybackSpeed); } @Deprecated public LiveConfiguration(long j, long j2, long j3, float f, float f2) { this.targetOffsetMs = j; this.minOffsetMs = j2; this.maxOffsetMs = j3; this.minPlaybackSpeed = f; this.maxPlaybackSpeed = f2; } public Builder buildUpon() { return new Builder(); } public boolean equals(Object obj) { if (this == obj) { return true; } if (!(obj instanceof LiveConfiguration)) { return false; } LiveConfiguration liveConfiguration = (LiveConfiguration) obj; return this.targetOffsetMs == liveConfiguration.targetOffsetMs && this.minOffsetMs == liveConfiguration.minOffsetMs && this.maxOffsetMs == liveConfiguration.maxOffsetMs && this.minPlaybackSpeed == liveConfiguration.minPlaybackSpeed && this.maxPlaybackSpeed == liveConfiguration.maxPlaybackSpeed; } public int hashCode() { long j = this.targetOffsetMs; long j2 = this.minOffsetMs; int i = ((((int) (j ^ (j >>> 32))) * 31) + ((int) (j2 ^ (j2 >>> 32)))) * 31; long j3 = this.maxOffsetMs; int i2 = (i + ((int) ((j3 >>> 32) ^ j3))) * 31; float f = this.minPlaybackSpeed; int floatToIntBits = (i2 + (f != 0.0f ? Float.floatToIntBits(f) : 0)) * 31; float f2 = this.maxPlaybackSpeed; return floatToIntBits + (f2 != 0.0f ? Float.floatToIntBits(f2) : 0); } @Override // com.google.android.exoplayer2.Bundleable public Bundle toBundle() { Bundle bundle = new Bundle(); long j = this.targetOffsetMs; LiveConfiguration liveConfiguration = UNSET; if (j != liveConfiguration.targetOffsetMs) { bundle.putLong(FIELD_TARGET_OFFSET_MS, j); } long j2 = this.minOffsetMs; if (j2 != liveConfiguration.minOffsetMs) { bundle.putLong(FIELD_MIN_OFFSET_MS, j2); } long j3 = this.maxOffsetMs; if (j3 != liveConfiguration.maxOffsetMs) { bundle.putLong(FIELD_MAX_OFFSET_MS, j3); } float f = this.minPlaybackSpeed; if (f != liveConfiguration.minPlaybackSpeed) { bundle.putFloat(FIELD_MIN_PLAYBACK_SPEED, f); } float f2 = this.maxPlaybackSpeed; if (f2 != liveConfiguration.maxPlaybackSpeed) { bundle.putFloat(FIELD_MAX_PLAYBACK_SPEED, f2); } return bundle; } /* JADX INFO: Access modifiers changed from: package-private */ public static /* synthetic */ LiveConfiguration lambda$static$0(Bundle bundle) { String str = FIELD_TARGET_OFFSET_MS; LiveConfiguration liveConfiguration = UNSET; return new LiveConfiguration(bundle.getLong(str, liveConfiguration.targetOffsetMs), bundle.getLong(FIELD_MIN_OFFSET_MS, liveConfiguration.minOffsetMs), bundle.getLong(FIELD_MAX_OFFSET_MS, liveConfiguration.maxOffsetMs), bundle.getFloat(FIELD_MIN_PLAYBACK_SPEED, liveConfiguration.minPlaybackSpeed), bundle.getFloat(FIELD_MAX_PLAYBACK_SPEED, liveConfiguration.maxPlaybackSpeed)); } } /* loaded from: classes2.dex */ public static class SubtitleConfiguration { public final String id; public final String label; public final String language; public final String mimeType; public final int roleFlags; public final int selectionFlags; public final Uri uri; /* loaded from: classes2.dex */ public static final class Builder { private String id; private String label; private String language; private String mimeType; private int roleFlags; private int selectionFlags; private Uri uri; public Builder setId(String str) { this.id = str; return this; } public Builder setLabel(String str) { this.label = str; return this; } public Builder setLanguage(String str) { this.language = str; return this; } public Builder setMimeType(String str) { this.mimeType = str; return this; } public Builder setRoleFlags(int i) { this.roleFlags = i; return this; } public Builder setSelectionFlags(int i) { this.selectionFlags = i; return this; } public Builder setUri(Uri uri) { this.uri = uri; return this; } public Builder(Uri uri) { this.uri = uri; } private Builder(SubtitleConfiguration subtitleConfiguration) { this.uri = subtitleConfiguration.uri; this.mimeType = subtitleConfiguration.mimeType; this.language = subtitleConfiguration.language; this.selectionFlags = subtitleConfiguration.selectionFlags; this.roleFlags = subtitleConfiguration.roleFlags; this.label = subtitleConfiguration.label; this.id = subtitleConfiguration.id; } public SubtitleConfiguration build() { return new SubtitleConfiguration(this); } /* JADX INFO: Access modifiers changed from: private */ public Subtitle buildSubtitle() { return new Subtitle(this); } } private SubtitleConfiguration(Uri uri, String str, String str2, int i, int i2, String str3, String str4) { this.uri = uri; this.mimeType = str; this.language = str2; this.selectionFlags = i; this.roleFlags = i2; this.label = str3; this.id = str4; } private SubtitleConfiguration(Builder builder) { this.uri = builder.uri; this.mimeType = builder.mimeType; this.language = builder.language; this.selectionFlags = builder.selectionFlags; this.roleFlags = builder.roleFlags; this.label = builder.label; this.id = builder.id; } public Builder buildUpon() { return new Builder(); } public boolean equals(Object obj) { if (this == obj) { return true; } if (!(obj instanceof SubtitleConfiguration)) { return false; } SubtitleConfiguration subtitleConfiguration = (SubtitleConfiguration) obj; return this.uri.equals(subtitleConfiguration.uri) && Util.areEqual(this.mimeType, subtitleConfiguration.mimeType) && Util.areEqual(this.language, subtitleConfiguration.language) && this.selectionFlags == subtitleConfiguration.selectionFlags && this.roleFlags == subtitleConfiguration.roleFlags && Util.areEqual(this.label, subtitleConfiguration.label) && Util.areEqual(this.id, subtitleConfiguration.id); } public int hashCode() { int hashCode = this.uri.hashCode() * 31; String str = this.mimeType; int hashCode2 = (hashCode + (str == null ? 0 : str.hashCode())) * 31; String str2 = this.language; int hashCode3 = (((((hashCode2 + (str2 == null ? 0 : str2.hashCode())) * 31) + this.selectionFlags) * 31) + this.roleFlags) * 31; String str3 = this.label; int hashCode4 = (hashCode3 + (str3 == null ? 0 : str3.hashCode())) * 31; String str4 = this.id; return hashCode4 + (str4 != null ? str4.hashCode() : 0); } } @Deprecated /* loaded from: classes2.dex */ public static final class Subtitle extends SubtitleConfiguration { @Deprecated public Subtitle(Uri uri, String str, String str2) { this(uri, str, str2, 0); } @Deprecated public Subtitle(Uri uri, String str, String str2, int i) { this(uri, str, str2, i, 0, null); } @Deprecated public Subtitle(Uri uri, String str, String str2, int i, int i2, String str3) { super(uri, str, str2, i, i2, str3, null); } private Subtitle(SubtitleConfiguration.Builder builder) { super(builder); } } /* loaded from: classes2.dex */ public static class ClippingConfiguration implements Bundleable { public final long endPositionMs; public final boolean relativeToDefaultPosition; public final boolean relativeToLiveWindow; public final long startPositionMs; public final boolean startsAtKeyFrame; public static final ClippingConfiguration UNSET = new Builder().build(); private static final String FIELD_START_POSITION_MS = Util.intToStringMaxRadix(0); private static final String FIELD_END_POSITION_MS = Util.intToStringMaxRadix(1); private static final String FIELD_RELATIVE_TO_LIVE_WINDOW = Util.intToStringMaxRadix(2); private static final String FIELD_RELATIVE_TO_DEFAULT_POSITION = Util.intToStringMaxRadix(3); private static final String FIELD_STARTS_AT_KEY_FRAME = Util.intToStringMaxRadix(4); public static final Bundleable.Creator CREATOR = new Bundleable.Creator() { // from class: com.google.android.exoplayer2.MediaItem$ClippingConfiguration$$ExternalSyntheticLambda0 @Override // com.google.android.exoplayer2.Bundleable.Creator public final Bundleable fromBundle(Bundle bundle) { return MediaItem.ClippingConfiguration.lambda$static$0(bundle); } }; public int hashCode() { long j = this.startPositionMs; int i = ((int) (j ^ (j >>> 32))) * 31; long j2 = this.endPositionMs; return ((((((i + ((int) ((j2 >>> 32) ^ j2))) * 31) + (this.relativeToLiveWindow ? 1 : 0)) * 31) + (this.relativeToDefaultPosition ? 1 : 0)) * 31) + (this.startsAtKeyFrame ? 1 : 0); } /* loaded from: classes2.dex */ public static final class Builder { private long endPositionMs; private boolean relativeToDefaultPosition; private boolean relativeToLiveWindow; private long startPositionMs; private boolean startsAtKeyFrame; public Builder setRelativeToDefaultPosition(boolean z) { this.relativeToDefaultPosition = z; return this; } public Builder setRelativeToLiveWindow(boolean z) { this.relativeToLiveWindow = z; return this; } public Builder setStartsAtKeyFrame(boolean z) { this.startsAtKeyFrame = z; return this; } public Builder() { this.endPositionMs = Long.MIN_VALUE; } private Builder(ClippingConfiguration clippingConfiguration) { this.startPositionMs = clippingConfiguration.startPositionMs; this.endPositionMs = clippingConfiguration.endPositionMs; this.relativeToLiveWindow = clippingConfiguration.relativeToLiveWindow; this.relativeToDefaultPosition = clippingConfiguration.relativeToDefaultPosition; this.startsAtKeyFrame = clippingConfiguration.startsAtKeyFrame; } public Builder setStartPositionMs(long j) { Assertions.checkArgument(j >= 0); this.startPositionMs = j; return this; } public Builder setEndPositionMs(long j) { Assertions.checkArgument(j == Long.MIN_VALUE || j >= 0); this.endPositionMs = j; return this; } public ClippingConfiguration build() { return buildClippingProperties(); } @Deprecated public ClippingProperties buildClippingProperties() { return new ClippingProperties(this); } } private ClippingConfiguration(Builder builder) { this.startPositionMs = builder.startPositionMs; this.endPositionMs = builder.endPositionMs; this.relativeToLiveWindow = builder.relativeToLiveWindow; this.relativeToDefaultPosition = builder.relativeToDefaultPosition; this.startsAtKeyFrame = builder.startsAtKeyFrame; } public Builder buildUpon() { return new Builder(); } public boolean equals(Object obj) { if (this == obj) { return true; } if (!(obj instanceof ClippingConfiguration)) { return false; } ClippingConfiguration clippingConfiguration = (ClippingConfiguration) obj; return this.startPositionMs == clippingConfiguration.startPositionMs && this.endPositionMs == clippingConfiguration.endPositionMs && this.relativeToLiveWindow == clippingConfiguration.relativeToLiveWindow && this.relativeToDefaultPosition == clippingConfiguration.relativeToDefaultPosition && this.startsAtKeyFrame == clippingConfiguration.startsAtKeyFrame; } @Override // com.google.android.exoplayer2.Bundleable public Bundle toBundle() { Bundle bundle = new Bundle(); long j = this.startPositionMs; ClippingConfiguration clippingConfiguration = UNSET; if (j != clippingConfiguration.startPositionMs) { bundle.putLong(FIELD_START_POSITION_MS, j); } long j2 = this.endPositionMs; if (j2 != clippingConfiguration.endPositionMs) { bundle.putLong(FIELD_END_POSITION_MS, j2); } boolean z = this.relativeToLiveWindow; if (z != clippingConfiguration.relativeToLiveWindow) { bundle.putBoolean(FIELD_RELATIVE_TO_LIVE_WINDOW, z); } boolean z2 = this.relativeToDefaultPosition; if (z2 != clippingConfiguration.relativeToDefaultPosition) { bundle.putBoolean(FIELD_RELATIVE_TO_DEFAULT_POSITION, z2); } boolean z3 = this.startsAtKeyFrame; if (z3 != clippingConfiguration.startsAtKeyFrame) { bundle.putBoolean(FIELD_STARTS_AT_KEY_FRAME, z3); } return bundle; } /* JADX INFO: Access modifiers changed from: package-private */ public static /* synthetic */ ClippingProperties lambda$static$0(Bundle bundle) { Builder builder = new Builder(); String str = FIELD_START_POSITION_MS; ClippingConfiguration clippingConfiguration = UNSET; return builder.setStartPositionMs(bundle.getLong(str, clippingConfiguration.startPositionMs)).setEndPositionMs(bundle.getLong(FIELD_END_POSITION_MS, clippingConfiguration.endPositionMs)).setRelativeToLiveWindow(bundle.getBoolean(FIELD_RELATIVE_TO_LIVE_WINDOW, clippingConfiguration.relativeToLiveWindow)).setRelativeToDefaultPosition(bundle.getBoolean(FIELD_RELATIVE_TO_DEFAULT_POSITION, clippingConfiguration.relativeToDefaultPosition)).setStartsAtKeyFrame(bundle.getBoolean(FIELD_STARTS_AT_KEY_FRAME, clippingConfiguration.startsAtKeyFrame)).buildClippingProperties(); } } @Deprecated /* loaded from: classes2.dex */ public static final class ClippingProperties extends ClippingConfiguration { public static final ClippingProperties UNSET = new ClippingConfiguration.Builder().buildClippingProperties(); private ClippingProperties(ClippingConfiguration.Builder builder) { super(builder); } } /* loaded from: classes2.dex */ public static final class RequestMetadata implements Bundleable { public final Bundle extras; public final Uri mediaUri; public final String searchQuery; public static final RequestMetadata EMPTY = new Builder().build(); private static final String FIELD_MEDIA_URI = Util.intToStringMaxRadix(0); private static final String FIELD_SEARCH_QUERY = Util.intToStringMaxRadix(1); private static final String FIELD_EXTRAS = Util.intToStringMaxRadix(2); public static final Bundleable.Creator CREATOR = new Bundleable.Creator() { // from class: com.google.android.exoplayer2.MediaItem$RequestMetadata$$ExternalSyntheticLambda0 @Override // com.google.android.exoplayer2.Bundleable.Creator public final Bundleable fromBundle(Bundle bundle) { MediaItem.RequestMetadata build; build = new MediaItem.RequestMetadata.Builder().setMediaUri((Uri) bundle.getParcelable(MediaItem.RequestMetadata.FIELD_MEDIA_URI)).setSearchQuery(bundle.getString(MediaItem.RequestMetadata.FIELD_SEARCH_QUERY)).setExtras(bundle.getBundle(MediaItem.RequestMetadata.FIELD_EXTRAS)).build(); return build; } }; /* loaded from: classes2.dex */ public static final class Builder { private Bundle extras; private Uri mediaUri; private String searchQuery; public Builder setExtras(Bundle bundle) { this.extras = bundle; return this; } public Builder setMediaUri(Uri uri) { this.mediaUri = uri; return this; } public Builder setSearchQuery(String str) { this.searchQuery = str; return this; } public Builder() { } private Builder(RequestMetadata requestMetadata) { this.mediaUri = requestMetadata.mediaUri; this.searchQuery = requestMetadata.searchQuery; this.extras = requestMetadata.extras; } public RequestMetadata build() { return new RequestMetadata(this); } } private RequestMetadata(Builder builder) { this.mediaUri = builder.mediaUri; this.searchQuery = builder.searchQuery; this.extras = builder.extras; } public Builder buildUpon() { return new Builder(); } public boolean equals(Object obj) { if (this == obj) { return true; } if (!(obj instanceof RequestMetadata)) { return false; } RequestMetadata requestMetadata = (RequestMetadata) obj; return Util.areEqual(this.mediaUri, requestMetadata.mediaUri) && Util.areEqual(this.searchQuery, requestMetadata.searchQuery); } public int hashCode() { Uri uri = this.mediaUri; int hashCode = (uri == null ? 0 : uri.hashCode()) * 31; String str = this.searchQuery; return hashCode + (str != null ? str.hashCode() : 0); } @Override // com.google.android.exoplayer2.Bundleable public Bundle toBundle() { Bundle bundle = new Bundle(); Uri uri = this.mediaUri; if (uri != null) { bundle.putParcelable(FIELD_MEDIA_URI, uri); } String str = this.searchQuery; if (str != null) { bundle.putString(FIELD_SEARCH_QUERY, str); } Bundle bundle2 = this.extras; if (bundle2 != null) { bundle.putBundle(FIELD_EXTRAS, bundle2); } return bundle; } } private MediaItem(String str, ClippingProperties clippingProperties, PlaybackProperties playbackProperties, LiveConfiguration liveConfiguration, MediaMetadata mediaMetadata, RequestMetadata requestMetadata) { this.mediaId = str; this.localConfiguration = playbackProperties; this.playbackProperties = playbackProperties; this.liveConfiguration = liveConfiguration; this.mediaMetadata = mediaMetadata; this.clippingConfiguration = clippingProperties; this.clippingProperties = clippingProperties; this.requestMetadata = requestMetadata; } public Builder buildUpon() { return new Builder(); } public boolean equals(Object obj) { if (this == obj) { return true; } if (!(obj instanceof MediaItem)) { return false; } MediaItem mediaItem = (MediaItem) obj; return Util.areEqual(this.mediaId, mediaItem.mediaId) && this.clippingConfiguration.equals(mediaItem.clippingConfiguration) && Util.areEqual(this.localConfiguration, mediaItem.localConfiguration) && Util.areEqual(this.liveConfiguration, mediaItem.liveConfiguration) && Util.areEqual(this.mediaMetadata, mediaItem.mediaMetadata) && Util.areEqual(this.requestMetadata, mediaItem.requestMetadata); } public int hashCode() { int hashCode = this.mediaId.hashCode() * 31; LocalConfiguration localConfiguration = this.localConfiguration; return ((((((((hashCode + (localConfiguration != null ? localConfiguration.hashCode() : 0)) * 31) + this.liveConfiguration.hashCode()) * 31) + this.clippingConfiguration.hashCode()) * 31) + this.mediaMetadata.hashCode()) * 31) + this.requestMetadata.hashCode(); } @Override // com.google.android.exoplayer2.Bundleable public Bundle toBundle() { Bundle bundle = new Bundle(); if (!this.mediaId.equals("")) { bundle.putString(FIELD_MEDIA_ID, this.mediaId); } if (!this.liveConfiguration.equals(LiveConfiguration.UNSET)) { bundle.putBundle(FIELD_LIVE_CONFIGURATION, this.liveConfiguration.toBundle()); } if (!this.mediaMetadata.equals(MediaMetadata.EMPTY)) { bundle.putBundle(FIELD_MEDIA_METADATA, this.mediaMetadata.toBundle()); } if (!this.clippingConfiguration.equals(ClippingConfiguration.UNSET)) { bundle.putBundle(FIELD_CLIPPING_PROPERTIES, this.clippingConfiguration.toBundle()); } if (!this.requestMetadata.equals(RequestMetadata.EMPTY)) { bundle.putBundle(FIELD_REQUEST_METADATA, this.requestMetadata.toBundle()); } return bundle; } /* JADX INFO: Access modifiers changed from: private */ public static MediaItem fromBundle(Bundle bundle) { LiveConfiguration fromBundle; MediaMetadata fromBundle2; ClippingProperties fromBundle3; RequestMetadata fromBundle4; String str = (String) Assertions.checkNotNull(bundle.getString(FIELD_MEDIA_ID, "")); Bundle bundle2 = bundle.getBundle(FIELD_LIVE_CONFIGURATION); if (bundle2 == null) { fromBundle = LiveConfiguration.UNSET; } else { fromBundle = LiveConfiguration.CREATOR.fromBundle(bundle2); } LiveConfiguration liveConfiguration = fromBundle; Bundle bundle3 = bundle.getBundle(FIELD_MEDIA_METADATA); if (bundle3 == null) { fromBundle2 = MediaMetadata.EMPTY; } else { fromBundle2 = MediaMetadata.CREATOR.fromBundle(bundle3); } MediaMetadata mediaMetadata = fromBundle2; Bundle bundle4 = bundle.getBundle(FIELD_CLIPPING_PROPERTIES); if (bundle4 == null) { fromBundle3 = ClippingProperties.UNSET; } else { fromBundle3 = ClippingConfiguration.CREATOR.fromBundle(bundle4); } ClippingProperties clippingProperties = fromBundle3; Bundle bundle5 = bundle.getBundle(FIELD_REQUEST_METADATA); if (bundle5 == null) { fromBundle4 = RequestMetadata.EMPTY; } else { fromBundle4 = RequestMetadata.CREATOR.fromBundle(bundle5); } return new MediaItem(str, clippingProperties, null, liveConfiguration, mediaMetadata, fromBundle4); } }