mirror of
https://github.com/androidx/media.git
synced 2025-04-29 22:36:54 +08:00
Merge pull request #2115 from MGaetan89:use_objects_equals
PiperOrigin-RevId: 730860597 (cherry picked from commit cc44de8757501cab7e4bb70fd0b090c6dc9799e1)
This commit is contained in:
parent
28b70f7e85
commit
a578d43324
@ -61,7 +61,6 @@ import androidx.media3.datasource.DataSourceUtil;
|
||||
import androidx.media3.datasource.DataSpec;
|
||||
import androidx.media3.exoplayer.RenderersFactory;
|
||||
import androidx.media3.exoplayer.offline.DownloadService;
|
||||
import com.google.common.base.Objects;
|
||||
import com.google.common.collect.ImmutableList;
|
||||
import com.google.common.collect.ImmutableMap;
|
||||
import java.io.IOException;
|
||||
@ -74,6 +73,7 @@ import java.util.Collections;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Objects;
|
||||
import java.util.UUID;
|
||||
import java.util.concurrent.ExecutorService;
|
||||
import java.util.concurrent.Executors;
|
||||
@ -524,7 +524,7 @@ public class SampleChooserActivity extends AppCompatActivity
|
||||
|
||||
private PlaylistGroup getGroup(String groupName, List<PlaylistGroup> groups) {
|
||||
for (int i = 0; i < groups.size(); i++) {
|
||||
if (Objects.equal(groupName, groups.get(i).title)) {
|
||||
if (Objects.equals(groupName, groups.get(i).title)) {
|
||||
return groups.get(i);
|
||||
}
|
||||
}
|
||||
|
@ -73,6 +73,7 @@ import com.google.android.gms.common.api.PendingResult;
|
||||
import com.google.android.gms.common.api.ResultCallback;
|
||||
import com.google.common.collect.ImmutableList;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
import org.checkerframework.checker.nullness.qual.RequiresNonNull;
|
||||
|
||||
/**
|
||||
@ -909,7 +910,7 @@ public final class CastPlayer extends BasePlayer {
|
||||
? currentTimeline.getPeriod(currentWindowIndex, period, /* setIds= */ true).uid
|
||||
: null;
|
||||
if (!playingPeriodChangedByTimelineChange
|
||||
&& !Util.areEqual(oldPeriodUid, currentPeriodUid)
|
||||
&& !Objects.equals(oldPeriodUid, currentPeriodUid)
|
||||
&& pendingSeekCount == 0) {
|
||||
// Report discontinuity and media item auto transition.
|
||||
currentTimeline.getPeriod(oldWindowIndex, period, /* setIds= */ true);
|
||||
|
@ -1365,7 +1365,7 @@ public final class AdPlaybackState {
|
||||
return false;
|
||||
}
|
||||
AdPlaybackState that = (AdPlaybackState) o;
|
||||
return Util.areEqual(adsId, that.adsId)
|
||||
return Objects.equals(adsId, that.adsId)
|
||||
&& adGroupCount == that.adGroupCount
|
||||
&& adResumePositionUs == that.adResumePositionUs
|
||||
&& contentDurationUs == that.contentDurationUs
|
||||
|
@ -30,6 +30,7 @@ import java.lang.annotation.Documented;
|
||||
import java.lang.annotation.Retention;
|
||||
import java.lang.annotation.RetentionPolicy;
|
||||
import java.lang.annotation.Target;
|
||||
import java.util.Objects;
|
||||
|
||||
/** Information about the playback device. */
|
||||
public final class DeviceInfo {
|
||||
@ -178,7 +179,7 @@ public final class DeviceInfo {
|
||||
return playbackType == other.playbackType
|
||||
&& minVolume == other.minVolume
|
||||
&& maxVolume == other.maxVolume
|
||||
&& Util.areEqual(routingControllerId, other.routingControllerId);
|
||||
&& Objects.equals(routingControllerId, other.routingControllerId);
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -227,5 +228,4 @@ public final class DeviceInfo {
|
||||
.setRoutingControllerId(routingControllerId)
|
||||
.build();
|
||||
}
|
||||
;
|
||||
}
|
||||
|
@ -28,6 +28,7 @@ import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.Comparator;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
import java.util.UUID;
|
||||
|
||||
/** Initialization data for one or more DRM schemes. */
|
||||
@ -160,7 +161,7 @@ public final class DrmInitData implements Comparator<SchemeData>, Parcelable {
|
||||
*/
|
||||
@CheckResult
|
||||
public DrmInitData copyWithSchemeType(@Nullable String schemeType) {
|
||||
if (Util.areEqual(this.schemeType, schemeType)) {
|
||||
if (Objects.equals(this.schemeType, schemeType)) {
|
||||
return this;
|
||||
}
|
||||
return new DrmInitData(schemeType, false, schemeDatas);
|
||||
@ -204,7 +205,7 @@ public final class DrmInitData implements Comparator<SchemeData>, Parcelable {
|
||||
return false;
|
||||
}
|
||||
DrmInitData other = (DrmInitData) obj;
|
||||
return Util.areEqual(schemeType, other.schemeType)
|
||||
return Objects.equals(schemeType, other.schemeType)
|
||||
&& Arrays.equals(schemeDatas, other.schemeDatas);
|
||||
}
|
||||
|
||||
@ -352,9 +353,9 @@ public final class DrmInitData implements Comparator<SchemeData>, Parcelable {
|
||||
return true;
|
||||
}
|
||||
SchemeData other = (SchemeData) obj;
|
||||
return Util.areEqual(licenseServerUrl, other.licenseServerUrl)
|
||||
&& Util.areEqual(mimeType, other.mimeType)
|
||||
&& Util.areEqual(uuid, other.uuid)
|
||||
return Objects.equals(licenseServerUrl, other.licenseServerUrl)
|
||||
&& Objects.equals(mimeType, other.mimeType)
|
||||
&& Objects.equals(uuid, other.uuid)
|
||||
&& Arrays.equals(data, other.data);
|
||||
}
|
||||
|
||||
|
@ -21,7 +21,7 @@ import android.os.Bundle;
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.media3.common.util.UnstableApi;
|
||||
import androidx.media3.common.util.Util;
|
||||
import com.google.common.base.Objects;
|
||||
import java.util.Objects;
|
||||
|
||||
/**
|
||||
* A rating expressed as "heart" or "no heart". It can be used to indicate whether the content is a
|
||||
@ -60,7 +60,7 @@ public final class HeartRating extends Rating {
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return Objects.hashCode(rated, isHeart);
|
||||
return Objects.hash(rated, isHeart);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -21,6 +21,7 @@ import android.os.Bundle;
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.media3.common.util.UnstableApi;
|
||||
import androidx.media3.common.util.Util;
|
||||
import java.util.Objects;
|
||||
|
||||
/** A label for a {@link Format}. */
|
||||
@UnstableApi
|
||||
@ -55,7 +56,7 @@ public class Label {
|
||||
return false;
|
||||
}
|
||||
Label label = (Label) o;
|
||||
return Util.areEqual(language, label.language) && Util.areEqual(value, label.value);
|
||||
return Objects.equals(language, label.language) && Objects.equals(value, label.value);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -39,6 +39,7 @@ import java.util.Arrays;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Objects;
|
||||
import java.util.UUID;
|
||||
|
||||
/** Representation of a media item. */
|
||||
@ -915,8 +916,8 @@ public final class MediaItem {
|
||||
|
||||
DrmConfiguration other = (DrmConfiguration) obj;
|
||||
return scheme.equals(other.scheme)
|
||||
&& Util.areEqual(licenseUri, other.licenseUri)
|
||||
&& Util.areEqual(licenseRequestHeaders, other.licenseRequestHeaders)
|
||||
&& Objects.equals(licenseUri, other.licenseUri)
|
||||
&& Objects.equals(licenseRequestHeaders, other.licenseRequestHeaders)
|
||||
&& multiSession == other.multiSession
|
||||
&& forceDefaultLicenseUri == other.forceDefaultLicenseUri
|
||||
&& playClearContentWithoutKey == other.playClearContentWithoutKey
|
||||
@ -1090,7 +1091,7 @@ public final class MediaItem {
|
||||
}
|
||||
|
||||
AdsConfiguration other = (AdsConfiguration) obj;
|
||||
return adTagUri.equals(other.adTagUri) && Util.areEqual(adsId, other.adsId);
|
||||
return adTagUri.equals(other.adTagUri) && Objects.equals(adsId, other.adsId);
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -1209,14 +1210,14 @@ public final class MediaItem {
|
||||
LocalConfiguration other = (LocalConfiguration) obj;
|
||||
|
||||
return uri.equals(other.uri)
|
||||
&& Util.areEqual(mimeType, other.mimeType)
|
||||
&& Util.areEqual(drmConfiguration, other.drmConfiguration)
|
||||
&& Util.areEqual(adsConfiguration, other.adsConfiguration)
|
||||
&& Objects.equals(mimeType, other.mimeType)
|
||||
&& Objects.equals(drmConfiguration, other.drmConfiguration)
|
||||
&& Objects.equals(adsConfiguration, other.adsConfiguration)
|
||||
&& streamKeys.equals(other.streamKeys)
|
||||
&& Util.areEqual(customCacheKey, other.customCacheKey)
|
||||
&& Objects.equals(customCacheKey, other.customCacheKey)
|
||||
&& subtitleConfigurations.equals(other.subtitleConfigurations)
|
||||
&& Util.areEqual(tag, other.tag)
|
||||
&& Util.areEqual(imageDurationMs, other.imageDurationMs);
|
||||
&& Objects.equals(tag, other.tag)
|
||||
&& imageDurationMs == other.imageDurationMs;
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -1714,12 +1715,12 @@ public final class MediaItem {
|
||||
SubtitleConfiguration other = (SubtitleConfiguration) obj;
|
||||
|
||||
return uri.equals(other.uri)
|
||||
&& Util.areEqual(mimeType, other.mimeType)
|
||||
&& Util.areEqual(language, other.language)
|
||||
&& Objects.equals(mimeType, other.mimeType)
|
||||
&& Objects.equals(language, other.language)
|
||||
&& selectionFlags == other.selectionFlags
|
||||
&& roleFlags == other.roleFlags
|
||||
&& Util.areEqual(label, other.label)
|
||||
&& Util.areEqual(id, other.id);
|
||||
&& Objects.equals(label, other.label)
|
||||
&& Objects.equals(id, other.id);
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -2216,8 +2217,8 @@ public final class MediaItem {
|
||||
return false;
|
||||
}
|
||||
RequestMetadata that = (RequestMetadata) o;
|
||||
return Util.areEqual(mediaUri, that.mediaUri)
|
||||
&& Util.areEqual(searchQuery, that.searchQuery)
|
||||
return Objects.equals(mediaUri, that.mediaUri)
|
||||
&& Objects.equals(searchQuery, that.searchQuery)
|
||||
&& ((extras == null) == (that.extras == null));
|
||||
}
|
||||
|
||||
@ -2337,12 +2338,12 @@ public final class MediaItem {
|
||||
|
||||
MediaItem other = (MediaItem) obj;
|
||||
|
||||
return Util.areEqual(mediaId, other.mediaId)
|
||||
return Objects.equals(mediaId, other.mediaId)
|
||||
&& clippingConfiguration.equals(other.clippingConfiguration)
|
||||
&& Util.areEqual(localConfiguration, other.localConfiguration)
|
||||
&& Util.areEqual(liveConfiguration, other.liveConfiguration)
|
||||
&& Util.areEqual(mediaMetadata, other.mediaMetadata)
|
||||
&& Util.areEqual(requestMetadata, other.requestMetadata);
|
||||
&& Objects.equals(localConfiguration, other.localConfiguration)
|
||||
&& Objects.equals(liveConfiguration, other.liveConfiguration)
|
||||
&& Objects.equals(mediaMetadata, other.mediaMetadata)
|
||||
&& Objects.equals(requestMetadata, other.requestMetadata);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -29,7 +29,6 @@ import androidx.annotation.IntRange;
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.media3.common.util.UnstableApi;
|
||||
import androidx.media3.common.util.Util;
|
||||
import com.google.common.base.Objects;
|
||||
import com.google.common.collect.ImmutableList;
|
||||
import com.google.errorprone.annotations.CanIgnoreReturnValue;
|
||||
import java.lang.annotation.Documented;
|
||||
@ -39,6 +38,7 @@ import java.lang.annotation.Target;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
|
||||
/**
|
||||
* Metadata of a {@link MediaItem}, playlist, or a combination of multiple sources of {@link
|
||||
@ -249,8 +249,8 @@ public final class MediaMetadata {
|
||||
@CanIgnoreReturnValue
|
||||
public Builder maybeSetArtworkData(byte[] artworkData, @PictureType int artworkDataType) {
|
||||
if (this.artworkData == null
|
||||
|| Util.areEqual(artworkDataType, PICTURE_TYPE_FRONT_COVER)
|
||||
|| !Util.areEqual(this.artworkDataType, PICTURE_TYPE_FRONT_COVER)) {
|
||||
|| artworkDataType == PICTURE_TYPE_FRONT_COVER
|
||||
|| !Objects.equals(this.artworkDataType, PICTURE_TYPE_FRONT_COVER)) {
|
||||
this.artworkData = artworkData.clone();
|
||||
this.artworkDataType = artworkDataType;
|
||||
}
|
||||
@ -1221,47 +1221,47 @@ public final class MediaMetadata {
|
||||
return false;
|
||||
}
|
||||
MediaMetadata that = (MediaMetadata) obj;
|
||||
return Util.areEqual(title, that.title)
|
||||
&& Util.areEqual(artist, that.artist)
|
||||
&& Util.areEqual(albumTitle, that.albumTitle)
|
||||
&& Util.areEqual(albumArtist, that.albumArtist)
|
||||
&& Util.areEqual(displayTitle, that.displayTitle)
|
||||
&& Util.areEqual(subtitle, that.subtitle)
|
||||
&& Util.areEqual(description, that.description)
|
||||
&& Util.areEqual(durationMs, that.durationMs)
|
||||
&& Util.areEqual(userRating, that.userRating)
|
||||
&& Util.areEqual(overallRating, that.overallRating)
|
||||
return Objects.equals(title, that.title)
|
||||
&& Objects.equals(artist, that.artist)
|
||||
&& Objects.equals(albumTitle, that.albumTitle)
|
||||
&& Objects.equals(albumArtist, that.albumArtist)
|
||||
&& Objects.equals(displayTitle, that.displayTitle)
|
||||
&& Objects.equals(subtitle, that.subtitle)
|
||||
&& Objects.equals(description, that.description)
|
||||
&& Objects.equals(durationMs, that.durationMs)
|
||||
&& Objects.equals(userRating, that.userRating)
|
||||
&& Objects.equals(overallRating, that.overallRating)
|
||||
&& Arrays.equals(artworkData, that.artworkData)
|
||||
&& Util.areEqual(artworkDataType, that.artworkDataType)
|
||||
&& Util.areEqual(artworkUri, that.artworkUri)
|
||||
&& Util.areEqual(trackNumber, that.trackNumber)
|
||||
&& Util.areEqual(totalTrackCount, that.totalTrackCount)
|
||||
&& Util.areEqual(folderType, that.folderType)
|
||||
&& Util.areEqual(isBrowsable, that.isBrowsable)
|
||||
&& Util.areEqual(isPlayable, that.isPlayable)
|
||||
&& Util.areEqual(recordingYear, that.recordingYear)
|
||||
&& Util.areEqual(recordingMonth, that.recordingMonth)
|
||||
&& Util.areEqual(recordingDay, that.recordingDay)
|
||||
&& Util.areEqual(releaseYear, that.releaseYear)
|
||||
&& Util.areEqual(releaseMonth, that.releaseMonth)
|
||||
&& Util.areEqual(releaseDay, that.releaseDay)
|
||||
&& Util.areEqual(writer, that.writer)
|
||||
&& Util.areEqual(composer, that.composer)
|
||||
&& Util.areEqual(conductor, that.conductor)
|
||||
&& Util.areEqual(discNumber, that.discNumber)
|
||||
&& Util.areEqual(totalDiscCount, that.totalDiscCount)
|
||||
&& Util.areEqual(genre, that.genre)
|
||||
&& Util.areEqual(compilation, that.compilation)
|
||||
&& Util.areEqual(station, that.station)
|
||||
&& Util.areEqual(mediaType, that.mediaType)
|
||||
&& Util.areEqual(supportedCommands, that.supportedCommands)
|
||||
&& Objects.equals(artworkDataType, that.artworkDataType)
|
||||
&& Objects.equals(artworkUri, that.artworkUri)
|
||||
&& Objects.equals(trackNumber, that.trackNumber)
|
||||
&& Objects.equals(totalTrackCount, that.totalTrackCount)
|
||||
&& Objects.equals(folderType, that.folderType)
|
||||
&& Objects.equals(isBrowsable, that.isBrowsable)
|
||||
&& Objects.equals(isPlayable, that.isPlayable)
|
||||
&& Objects.equals(recordingYear, that.recordingYear)
|
||||
&& Objects.equals(recordingMonth, that.recordingMonth)
|
||||
&& Objects.equals(recordingDay, that.recordingDay)
|
||||
&& Objects.equals(releaseYear, that.releaseYear)
|
||||
&& Objects.equals(releaseMonth, that.releaseMonth)
|
||||
&& Objects.equals(releaseDay, that.releaseDay)
|
||||
&& Objects.equals(writer, that.writer)
|
||||
&& Objects.equals(composer, that.composer)
|
||||
&& Objects.equals(conductor, that.conductor)
|
||||
&& Objects.equals(discNumber, that.discNumber)
|
||||
&& Objects.equals(totalDiscCount, that.totalDiscCount)
|
||||
&& Objects.equals(genre, that.genre)
|
||||
&& Objects.equals(compilation, that.compilation)
|
||||
&& Objects.equals(station, that.station)
|
||||
&& Objects.equals(mediaType, that.mediaType)
|
||||
&& Objects.equals(supportedCommands, that.supportedCommands)
|
||||
&& ((extras == null) == (that.extras == null));
|
||||
}
|
||||
|
||||
@SuppressWarnings("deprecation") // Hashing deprecated fields.
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return Objects.hashCode(
|
||||
return Objects.hash(
|
||||
title,
|
||||
artist,
|
||||
albumTitle,
|
||||
|
@ -22,7 +22,7 @@ import androidx.annotation.FloatRange;
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.media3.common.util.UnstableApi;
|
||||
import androidx.media3.common.util.Util;
|
||||
import com.google.common.base.Objects;
|
||||
import java.util.Objects;
|
||||
|
||||
/** A rating expressed as a percentage. */
|
||||
public final class PercentageRating extends Rating {
|
||||
@ -59,7 +59,7 @@ public final class PercentageRating extends Rating {
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return Objects.hashCode(percent);
|
||||
return Objects.hash(percent);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -36,6 +36,7 @@ import java.lang.annotation.Documented;
|
||||
import java.lang.annotation.Retention;
|
||||
import java.lang.annotation.RetentionPolicy;
|
||||
import java.lang.annotation.Target;
|
||||
import java.util.Objects;
|
||||
|
||||
/** Thrown when a non locally recoverable playback failure occurs. */
|
||||
public class PlaybackException extends Exception {
|
||||
@ -553,17 +554,17 @@ public class PlaybackException extends Exception {
|
||||
@Nullable Throwable thisCause = getCause();
|
||||
@Nullable Throwable thatCause = other.getCause();
|
||||
if (thisCause != null && thatCause != null) {
|
||||
if (!Util.areEqual(thisCause.getMessage(), thatCause.getMessage())) {
|
||||
if (!Objects.equals(thisCause.getMessage(), thatCause.getMessage())) {
|
||||
return false;
|
||||
}
|
||||
if (!Util.areEqual(thisCause.getClass(), thatCause.getClass())) {
|
||||
if (!Objects.equals(thisCause.getClass(), thatCause.getClass())) {
|
||||
return false;
|
||||
}
|
||||
} else if (thisCause != null || thatCause != null) {
|
||||
return false;
|
||||
}
|
||||
return errorCode == other.errorCode
|
||||
&& Util.areEqual(getMessage(), other.getMessage())
|
||||
&& Objects.equals(getMessage(), other.getMessage())
|
||||
&& timestampMs == other.timestampMs;
|
||||
}
|
||||
|
||||
|
@ -37,7 +37,6 @@ import androidx.media3.common.text.CueGroup;
|
||||
import androidx.media3.common.util.Size;
|
||||
import androidx.media3.common.util.UnstableApi;
|
||||
import androidx.media3.common.util.Util;
|
||||
import com.google.common.base.Objects;
|
||||
import com.google.errorprone.annotations.CanIgnoreReturnValue;
|
||||
import java.lang.annotation.Documented;
|
||||
import java.lang.annotation.Retention;
|
||||
@ -45,6 +44,7 @@ import java.lang.annotation.RetentionPolicy;
|
||||
import java.lang.annotation.Target;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
|
||||
/**
|
||||
* A media player interface defining high-level functionality, such as the ability to play, pause,
|
||||
@ -352,13 +352,13 @@ public interface Player {
|
||||
}
|
||||
PositionInfo that = (PositionInfo) o;
|
||||
return equalsForBundling(that)
|
||||
&& Objects.equal(windowUid, that.windowUid)
|
||||
&& Objects.equal(periodUid, that.periodUid);
|
||||
&& Objects.equals(windowUid, that.windowUid)
|
||||
&& Objects.equals(periodUid, that.periodUid);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return Objects.hashCode(
|
||||
return Objects.hash(
|
||||
windowUid,
|
||||
mediaItemIndex,
|
||||
mediaItem,
|
||||
@ -382,7 +382,7 @@ public interface Player {
|
||||
&& contentPositionMs == other.contentPositionMs
|
||||
&& adGroupIndex == other.adGroupIndex
|
||||
&& adIndexInAdGroup == other.adIndexInAdGroup
|
||||
&& Objects.equal(mediaItem, other.mediaItem);
|
||||
&& Objects.equals(mediaItem, other.mediaItem);
|
||||
}
|
||||
|
||||
@VisibleForTesting static final String FIELD_MEDIA_ITEM_INDEX = Util.intToStringMaxRadix(0);
|
||||
|
@ -1793,9 +1793,9 @@ public abstract class SimpleBasePlayer extends BasePlayer {
|
||||
return this.uid.equals(mediaItemData.uid)
|
||||
&& this.tracks.equals(mediaItemData.tracks)
|
||||
&& this.mediaItem.equals(mediaItemData.mediaItem)
|
||||
&& Util.areEqual(this.mediaMetadata, mediaItemData.mediaMetadata)
|
||||
&& Util.areEqual(this.manifest, mediaItemData.manifest)
|
||||
&& Util.areEqual(this.liveConfiguration, mediaItemData.liveConfiguration)
|
||||
&& Objects.equals(this.mediaMetadata, mediaItemData.mediaMetadata)
|
||||
&& Objects.equals(this.manifest, mediaItemData.manifest)
|
||||
&& Objects.equals(this.liveConfiguration, mediaItemData.liveConfiguration)
|
||||
&& this.presentationStartTimeMs == mediaItemData.presentationStartTimeMs
|
||||
&& this.windowStartTimeMs == mediaItemData.windowStartTimeMs
|
||||
&& this.elapsedRealtimeEpochOffsetMs == mediaItemData.elapsedRealtimeEpochOffsetMs
|
||||
@ -3622,7 +3622,7 @@ public abstract class SimpleBasePlayer extends BasePlayer {
|
||||
Player.EVENT_MEDIA_ITEM_TRANSITION,
|
||||
listener -> listener.onMediaItemTransition(mediaItem, mediaItemTransitionReason));
|
||||
}
|
||||
if (!Util.areEqual(previousState.playerError, newState.playerError)) {
|
||||
if (!Objects.equals(previousState.playerError, newState.playerError)) {
|
||||
listeners.queueEvent(
|
||||
Player.EVENT_PLAYER_ERROR,
|
||||
listener -> listener.onPlayerErrorChanged(newState.playerError));
|
||||
|
@ -23,7 +23,7 @@ import androidx.annotation.IntRange;
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.media3.common.util.UnstableApi;
|
||||
import androidx.media3.common.util.Util;
|
||||
import com.google.common.base.Objects;
|
||||
import java.util.Objects;
|
||||
|
||||
/** A rating expressed as a fractional number of stars. */
|
||||
public final class StarRating extends Rating {
|
||||
@ -84,7 +84,7 @@ public final class StarRating extends Rating {
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return Objects.hashCode(maxStars, starRating);
|
||||
return Objects.hash(maxStars, starRating);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -21,7 +21,7 @@ import android.os.Bundle;
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.media3.common.util.UnstableApi;
|
||||
import androidx.media3.common.util.Util;
|
||||
import com.google.common.base.Objects;
|
||||
import java.util.Objects;
|
||||
|
||||
/** A rating expressed as "thumbs up" or "thumbs down". */
|
||||
public final class ThumbRating extends Rating {
|
||||
@ -57,7 +57,7 @@ public final class ThumbRating extends Rating {
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return Objects.hashCode(rated, isThumbsUp);
|
||||
return Objects.hash(rated, isThumbsUp);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -36,6 +36,7 @@ import com.google.errorprone.annotations.CanIgnoreReturnValue;
|
||||
import com.google.errorprone.annotations.InlineMe;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
import org.checkerframework.checker.nullness.qual.NonNull;
|
||||
|
||||
/**
|
||||
@ -371,10 +372,10 @@ public abstract class Timeline {
|
||||
return false;
|
||||
}
|
||||
Window that = (Window) obj;
|
||||
return Util.areEqual(uid, that.uid)
|
||||
&& Util.areEqual(mediaItem, that.mediaItem)
|
||||
&& Util.areEqual(manifest, that.manifest)
|
||||
&& Util.areEqual(liveConfiguration, that.liveConfiguration)
|
||||
return Objects.equals(uid, that.uid)
|
||||
&& Objects.equals(mediaItem, that.mediaItem)
|
||||
&& Objects.equals(manifest, that.manifest)
|
||||
&& Objects.equals(liveConfiguration, that.liveConfiguration)
|
||||
&& presentationStartTimeMs == that.presentationStartTimeMs
|
||||
&& windowStartTimeMs == that.windowStartTimeMs
|
||||
&& elapsedRealtimeEpochOffsetMs == that.elapsedRealtimeEpochOffsetMs
|
||||
@ -871,13 +872,13 @@ public abstract class Timeline {
|
||||
return false;
|
||||
}
|
||||
Period that = (Period) obj;
|
||||
return Util.areEqual(id, that.id)
|
||||
&& Util.areEqual(uid, that.uid)
|
||||
return Objects.equals(id, that.id)
|
||||
&& Objects.equals(uid, that.uid)
|
||||
&& windowIndex == that.windowIndex
|
||||
&& durationUs == that.durationUs
|
||||
&& positionInWindowUs == that.positionInWindowUs
|
||||
&& isPlaceholder == that.isPlaceholder
|
||||
&& Util.areEqual(adPlaybackState, that.adPlaybackState);
|
||||
&& Objects.equals(adPlaybackState, that.adPlaybackState);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -20,9 +20,9 @@ import androidx.media3.common.C;
|
||||
import androidx.media3.common.Format;
|
||||
import androidx.media3.common.util.UnstableApi;
|
||||
import androidx.media3.common.util.Util;
|
||||
import com.google.common.base.Objects;
|
||||
import java.nio.ByteBuffer;
|
||||
import java.nio.ByteOrder;
|
||||
import java.util.Objects;
|
||||
|
||||
/**
|
||||
* Interface for audio processors, which take audio data as input and transform it, potentially
|
||||
@ -107,7 +107,7 @@ public interface AudioProcessor {
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return Objects.hashCode(sampleRate, channelCount, encoding);
|
||||
return Objects.hash(sampleRate, channelCount, encoding);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -40,7 +40,6 @@ import androidx.annotation.Nullable;
|
||||
import androidx.media3.common.util.Assertions;
|
||||
import androidx.media3.common.util.UnstableApi;
|
||||
import androidx.media3.common.util.Util;
|
||||
import com.google.common.base.Objects;
|
||||
import com.google.errorprone.annotations.CanIgnoreReturnValue;
|
||||
import java.io.ByteArrayOutputStream;
|
||||
import java.lang.annotation.Documented;
|
||||
@ -48,6 +47,7 @@ import java.lang.annotation.Retention;
|
||||
import java.lang.annotation.RetentionPolicy;
|
||||
import java.lang.annotation.Target;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Objects;
|
||||
import org.checkerframework.dataflow.qual.Pure;
|
||||
|
||||
/** Contains information about a specific cue, including textual content and formatting data. */
|
||||
@ -396,7 +396,7 @@ public final class Cue {
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return Objects.hashCode(
|
||||
return Objects.hash(
|
||||
text,
|
||||
textAlignment,
|
||||
multiRowAlignment,
|
||||
|
@ -43,6 +43,7 @@ import java.nio.ByteOrder;
|
||||
import java.nio.FloatBuffer;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
import javax.microedition.khronos.egl.EGL10;
|
||||
|
||||
/** OpenGL ES utilities. */
|
||||
@ -209,7 +210,7 @@ public final class GlUtil {
|
||||
*/
|
||||
public static boolean isYuvTargetExtensionSupported() {
|
||||
@Nullable String glExtensions;
|
||||
if (Util.areEqual(EGL14.eglGetCurrentContext(), EGL14.EGL_NO_CONTEXT)) {
|
||||
if (Objects.equals(EGL14.eglGetCurrentContext(), EGL14.EGL_NO_CONTEXT)) {
|
||||
// Create a placeholder context and make it current to allow calling GLES20.glGetString().
|
||||
try {
|
||||
EGLDisplay eglDisplay = getDefaultEglDisplay();
|
||||
|
@ -22,6 +22,7 @@ import android.text.TextUtils;
|
||||
import androidx.annotation.Nullable;
|
||||
import com.google.common.base.Ascii;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
|
||||
/** Utility methods for manipulating URIs. */
|
||||
@UnstableApi
|
||||
@ -306,7 +307,7 @@ public final class UriUtil {
|
||||
baseUriScheme == null
|
||||
? targetUriScheme == null
|
||||
: targetUriScheme != null && Ascii.equalsIgnoreCase(baseUriScheme, targetUriScheme);
|
||||
if (!isSameScheme || !Util.areEqual(baseUri.getAuthority(), targetUri.getAuthority())) {
|
||||
if (!isSameScheme || !Objects.equals(baseUri.getAuthority(), targetUri.getAuthority())) {
|
||||
// Different schemes or authorities, cannot find relative path, return targetUri.
|
||||
return targetUri.toString();
|
||||
}
|
||||
|
@ -563,7 +563,7 @@ public final class Util {
|
||||
@UnstableApi
|
||||
public static boolean contains(@NullableType Object[] items, @Nullable Object item) {
|
||||
for (Object arrayItem : items) {
|
||||
if (areEqual(arrayItem, item)) {
|
||||
if (Objects.equals(arrayItem, item)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
@ -26,7 +26,6 @@ import androidx.media3.common.C;
|
||||
import androidx.media3.common.Format;
|
||||
import androidx.media3.common.util.TraceUtil;
|
||||
import androidx.media3.common.util.UnstableApi;
|
||||
import androidx.media3.common.util.Util;
|
||||
import androidx.media3.decoder.CryptoConfig;
|
||||
import androidx.media3.decoder.Decoder;
|
||||
import androidx.media3.decoder.DecoderInputBuffer;
|
||||
@ -35,6 +34,7 @@ import androidx.media3.exoplayer.DecoderReuseEvaluation;
|
||||
import androidx.media3.exoplayer.RendererCapabilities;
|
||||
import androidx.media3.exoplayer.video.DecoderVideoRenderer;
|
||||
import androidx.media3.exoplayer.video.VideoRendererEventListener;
|
||||
import java.util.Objects;
|
||||
|
||||
// TODO: Merge actual implementation in https://github.com/google/ExoPlayer/pull/7132.
|
||||
/**
|
||||
@ -124,7 +124,7 @@ public final class ExperimentalFfmpegVideoRenderer extends DecoderVideoRenderer
|
||||
@Override
|
||||
protected DecoderReuseEvaluation canReuseDecoder(
|
||||
String decoderName, Format oldFormat, Format newFormat) {
|
||||
boolean sameMimeType = Util.areEqual(oldFormat.sampleMimeType, newFormat.sampleMimeType);
|
||||
boolean sameMimeType = Objects.equals(oldFormat.sampleMimeType, newFormat.sampleMimeType);
|
||||
// TODO: Ability to reuse the decoder may be MIME type dependent.
|
||||
return new DecoderReuseEvaluation(
|
||||
decoderName,
|
||||
|
@ -42,11 +42,11 @@ import androidx.media3.common.util.GlUtil;
|
||||
import androidx.media3.common.util.Log;
|
||||
import androidx.media3.common.util.LongArrayQueue;
|
||||
import androidx.media3.common.util.Size;
|
||||
import androidx.media3.common.util.Util;
|
||||
import androidx.media3.effect.DefaultVideoFrameProcessor.WorkingColorSpace;
|
||||
import com.google.common.collect.ImmutableList;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
import java.util.Queue;
|
||||
import java.util.concurrent.ConcurrentLinkedQueue;
|
||||
import java.util.concurrent.Executor;
|
||||
@ -340,7 +340,7 @@ import org.checkerframework.checker.nullness.qual.MonotonicNonNull;
|
||||
if (textureOutputListener != null) {
|
||||
return;
|
||||
}
|
||||
if (Util.areEqual(this.outputSurfaceInfo, outputSurfaceInfo)) {
|
||||
if (Objects.equals(this.outputSurfaceInfo, outputSurfaceInfo)) {
|
||||
return;
|
||||
}
|
||||
|
||||
@ -479,7 +479,7 @@ import org.checkerframework.checker.nullness.qual.MonotonicNonNull;
|
||||
this.inputHeight = inputHeight;
|
||||
Size outputSizeBeforeSurfaceTransformation =
|
||||
MatrixUtils.configureAndGetOutputSize(inputWidth, inputHeight, matrixTransformations);
|
||||
if (!Util.areEqual(
|
||||
if (!Objects.equals(
|
||||
this.outputSizeBeforeSurfaceTransformation, outputSizeBeforeSurfaceTransformation)) {
|
||||
this.outputSizeBeforeSurfaceTransformation = outputSizeBeforeSurfaceTransformation;
|
||||
videoFrameProcessorListenerExecutor.execute(
|
||||
|
@ -37,13 +37,13 @@ import androidx.media3.common.audio.AudioFocusRequestCompat;
|
||||
import androidx.media3.common.audio.AudioManagerCompat;
|
||||
import androidx.media3.common.util.Assertions;
|
||||
import androidx.media3.common.util.Log;
|
||||
import com.google.common.base.Objects;
|
||||
import com.google.common.base.Supplier;
|
||||
import com.google.common.base.Suppliers;
|
||||
import java.lang.annotation.Documented;
|
||||
import java.lang.annotation.Retention;
|
||||
import java.lang.annotation.RetentionPolicy;
|
||||
import java.lang.annotation.Target;
|
||||
import java.util.Objects;
|
||||
import org.checkerframework.checker.nullness.qual.MonotonicNonNull;
|
||||
|
||||
/** Manages requesting and responding to changes in audio focus. */
|
||||
@ -167,7 +167,7 @@ import org.checkerframework.checker.nullness.qual.MonotonicNonNull;
|
||||
* managed automatically.
|
||||
*/
|
||||
public void setAudioAttributes(@Nullable AudioAttributes audioAttributes) {
|
||||
if (!Objects.equal(this.audioAttributes, audioAttributes)) {
|
||||
if (!Objects.equals(this.audioAttributes, audioAttributes)) {
|
||||
this.audioAttributes = audioAttributes;
|
||||
focusGainToRequest = convertAudioAttributesToFocusGain(audioAttributes);
|
||||
Assertions.checkArgument(
|
||||
|
@ -27,7 +27,6 @@ import androidx.media3.common.Timeline;
|
||||
import androidx.media3.common.util.Assertions;
|
||||
import androidx.media3.common.util.Clock;
|
||||
import androidx.media3.common.util.UnstableApi;
|
||||
import androidx.media3.common.util.Util;
|
||||
import androidx.media3.decoder.DecoderInputBuffer;
|
||||
import androidx.media3.decoder.DecoderInputBuffer.InsufficientCapacityException;
|
||||
import androidx.media3.exoplayer.analytics.PlayerId;
|
||||
@ -37,6 +36,7 @@ import androidx.media3.exoplayer.source.SampleStream;
|
||||
import androidx.media3.exoplayer.source.SampleStream.ReadDataResult;
|
||||
import androidx.media3.exoplayer.source.SampleStream.ReadFlags;
|
||||
import java.io.IOException;
|
||||
import java.util.Objects;
|
||||
import org.checkerframework.checker.nullness.qual.MonotonicNonNull;
|
||||
|
||||
/**
|
||||
@ -208,7 +208,7 @@ public abstract class BaseRenderer implements Renderer, RendererCapabilities {
|
||||
|
||||
@Override
|
||||
public final void setTimeline(Timeline timeline) {
|
||||
if (!Util.areEqual(this.timeline, timeline)) {
|
||||
if (!Objects.equals(this.timeline, timeline)) {
|
||||
this.timeline = timeline;
|
||||
onTimelineChanged(this.timeline);
|
||||
}
|
||||
|
@ -41,6 +41,7 @@ import java.lang.annotation.Documented;
|
||||
import java.lang.annotation.Retention;
|
||||
import java.lang.annotation.RetentionPolicy;
|
||||
import java.lang.annotation.Target;
|
||||
import java.util.Objects;
|
||||
|
||||
/** Thrown when a non locally recoverable playback failure occurs. */
|
||||
public final class ExoPlaybackException extends PlaybackException {
|
||||
@ -320,11 +321,11 @@ public final class ExoPlaybackException extends PlaybackException {
|
||||
// true.
|
||||
ExoPlaybackException other = (ExoPlaybackException) Util.castNonNull(that);
|
||||
return type == other.type
|
||||
&& Util.areEqual(rendererName, other.rendererName)
|
||||
&& Objects.equals(rendererName, other.rendererName)
|
||||
&& rendererIndex == other.rendererIndex
|
||||
&& Util.areEqual(rendererFormat, other.rendererFormat)
|
||||
&& Objects.equals(rendererFormat, other.rendererFormat)
|
||||
&& rendererFormatSupport == other.rendererFormatSupport
|
||||
&& Util.areEqual(mediaPeriodId, other.mediaPeriodId)
|
||||
&& Objects.equals(mediaPeriodId, other.mediaPeriodId)
|
||||
&& isRecoverable == other.isRecoverable;
|
||||
}
|
||||
|
||||
|
@ -120,6 +120,7 @@ import com.google.common.collect.ImmutableList;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
import java.util.concurrent.CopyOnWriteArraySet;
|
||||
|
||||
/** The default implementation of {@link ExoPlayer}. */
|
||||
@ -1461,7 +1462,7 @@ import java.util.concurrent.CopyOnWriteArraySet;
|
||||
if (playerReleased) {
|
||||
return;
|
||||
}
|
||||
if (!Util.areEqual(this.audioAttributes, newAudioAttributes)) {
|
||||
if (!Objects.equals(this.audioAttributes, newAudioAttributes)) {
|
||||
this.audioAttributes = newAudioAttributes;
|
||||
sendRendererMessage(TRACK_TYPE_AUDIO, MSG_SET_AUDIO_ATTRIBUTES, newAudioAttributes);
|
||||
if (streamVolumeManager != null) {
|
||||
@ -1612,7 +1613,7 @@ import java.util.concurrent.CopyOnWriteArraySet;
|
||||
@Override
|
||||
public void setPriorityTaskManager(@Nullable PriorityTaskManager priorityTaskManager) {
|
||||
verifyApplicationThread();
|
||||
if (Util.areEqual(this.priorityTaskManager, priorityTaskManager)) {
|
||||
if (Objects.equals(this.priorityTaskManager, priorityTaskManager)) {
|
||||
return;
|
||||
}
|
||||
if (isPriorityTaskManagerRegistered) {
|
||||
|
@ -77,6 +77,7 @@ import java.io.IOException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
import java.util.concurrent.atomic.AtomicBoolean;
|
||||
|
||||
/** Implements the internal behavior of {@link ExoPlayerImpl}. */
|
||||
@ -2327,7 +2328,7 @@ import java.util.concurrent.atomic.AtomicBoolean;
|
||||
int oldWindowIndex = oldTimeline.getPeriodByUid(oldPeriodId.periodUid, period).windowIndex;
|
||||
oldWindowUid = oldTimeline.getWindow(oldWindowIndex, window).uid;
|
||||
}
|
||||
if (!Util.areEqual(oldWindowUid, windowUid) || forceSetTargetOffsetOverride) {
|
||||
if (!Objects.equals(oldWindowUid, windowUid) || forceSetTargetOffsetOverride) {
|
||||
// Reset overridden target live offset to media values if window changes or if seekTo
|
||||
// default live position.
|
||||
livePlaybackSpeedControl.setTargetLiveOffsetOverrideUs(C.TIME_UNSET);
|
||||
|
@ -21,8 +21,8 @@ import android.os.SystemClock;
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.media3.common.C;
|
||||
import androidx.media3.common.util.UnstableApi;
|
||||
import com.google.common.base.Objects;
|
||||
import com.google.errorprone.annotations.CanIgnoreReturnValue;
|
||||
import java.util.Objects;
|
||||
|
||||
/** Information about the player state when loading is started or continued. */
|
||||
@UnstableApi
|
||||
@ -152,6 +152,6 @@ public final class LoadingInfo {
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return Objects.hashCode(playbackPositionUs, playbackSpeed, lastRebufferRealtimeMs);
|
||||
return Objects.hash(playbackPositionUs, playbackSpeed, lastRebufferRealtimeMs);
|
||||
}
|
||||
}
|
||||
|
@ -18,9 +18,9 @@ package androidx.media3.exoplayer;
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.media3.common.C;
|
||||
import androidx.media3.common.util.Assertions;
|
||||
import androidx.media3.common.util.Util;
|
||||
import androidx.media3.exoplayer.source.MediaPeriod;
|
||||
import androidx.media3.exoplayer.source.MediaSource.MediaPeriodId;
|
||||
import java.util.Objects;
|
||||
|
||||
/** Stores the information required to load and play a {@link MediaPeriod}. */
|
||||
/* package */ final class MediaPeriodInfo {
|
||||
@ -170,7 +170,7 @@ import androidx.media3.exoplayer.source.MediaSource.MediaPeriodId;
|
||||
&& isLastInTimelinePeriod == that.isLastInTimelinePeriod
|
||||
&& isLastInTimelineWindow == that.isLastInTimelineWindow
|
||||
&& isFinal == that.isFinal
|
||||
&& Util.areEqual(id, that.id);
|
||||
&& Objects.equals(id, that.id);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -63,13 +63,13 @@ import androidx.media3.exoplayer.source.MediaLoadData;
|
||||
import androidx.media3.exoplayer.source.MediaSource.MediaPeriodId;
|
||||
import androidx.media3.exoplayer.trackselection.TrackSelection;
|
||||
import androidx.media3.exoplayer.video.VideoDecoderOutputBufferRenderer;
|
||||
import com.google.common.base.Objects;
|
||||
import java.io.IOException;
|
||||
import java.lang.annotation.Documented;
|
||||
import java.lang.annotation.Retention;
|
||||
import java.lang.annotation.RetentionPolicy;
|
||||
import java.lang.annotation.Target;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
|
||||
/**
|
||||
* A listener for analytics events.
|
||||
@ -572,15 +572,15 @@ public interface AnalyticsListener {
|
||||
&& currentWindowIndex == eventTime.currentWindowIndex
|
||||
&& currentPlaybackPositionMs == eventTime.currentPlaybackPositionMs
|
||||
&& totalBufferedDurationMs == eventTime.totalBufferedDurationMs
|
||||
&& Objects.equal(timeline, eventTime.timeline)
|
||||
&& Objects.equal(mediaPeriodId, eventTime.mediaPeriodId)
|
||||
&& Objects.equal(currentTimeline, eventTime.currentTimeline)
|
||||
&& Objects.equal(currentMediaPeriodId, eventTime.currentMediaPeriodId);
|
||||
&& Objects.equals(timeline, eventTime.timeline)
|
||||
&& Objects.equals(mediaPeriodId, eventTime.mediaPeriodId)
|
||||
&& Objects.equals(currentTimeline, eventTime.currentTimeline)
|
||||
&& Objects.equals(currentMediaPeriodId, eventTime.currentMediaPeriodId);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return Objects.hashCode(
|
||||
return Objects.hash(
|
||||
realtimeMs,
|
||||
timeline,
|
||||
windowIndex,
|
||||
|
@ -57,12 +57,12 @@ import androidx.media3.exoplayer.drm.DrmSession;
|
||||
import androidx.media3.exoplayer.source.LoadEventInfo;
|
||||
import androidx.media3.exoplayer.source.MediaLoadData;
|
||||
import androidx.media3.exoplayer.source.MediaSource.MediaPeriodId;
|
||||
import com.google.common.base.Objects;
|
||||
import com.google.common.collect.ImmutableList;
|
||||
import com.google.common.collect.ImmutableMap;
|
||||
import com.google.common.collect.Iterables;
|
||||
import java.io.IOException;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
import org.checkerframework.checker.nullness.qual.MonotonicNonNull;
|
||||
import org.checkerframework.checker.nullness.qual.RequiresNonNull;
|
||||
|
||||
@ -1123,11 +1123,11 @@ public class DefaultAnalyticsCollector implements AnalyticsCollector {
|
||||
ImmutableMap.Builder<MediaPeriodId, Timeline> builder = ImmutableMap.builder();
|
||||
if (mediaPeriodQueue.isEmpty()) {
|
||||
addTimelineForMediaPeriodId(builder, playingMediaPeriod, preferredTimeline);
|
||||
if (!Objects.equal(readingMediaPeriod, playingMediaPeriod)) {
|
||||
if (!Objects.equals(readingMediaPeriod, playingMediaPeriod)) {
|
||||
addTimelineForMediaPeriodId(builder, readingMediaPeriod, preferredTimeline);
|
||||
}
|
||||
if (!Objects.equal(currentPlayerMediaPeriod, playingMediaPeriod)
|
||||
&& !Objects.equal(currentPlayerMediaPeriod, readingMediaPeriod)) {
|
||||
if (!Objects.equals(currentPlayerMediaPeriod, playingMediaPeriod)
|
||||
&& !Objects.equals(currentPlayerMediaPeriod, readingMediaPeriod)) {
|
||||
addTimelineForMediaPeriodId(builder, currentPlayerMediaPeriod, preferredTimeline);
|
||||
}
|
||||
} else {
|
||||
|
@ -76,6 +76,7 @@ import java.io.IOException;
|
||||
import java.net.SocketTimeoutException;
|
||||
import java.net.UnknownHostException;
|
||||
import java.util.HashMap;
|
||||
import java.util.Objects;
|
||||
import java.util.UUID;
|
||||
import java.util.concurrent.Executor;
|
||||
import org.checkerframework.checker.nullness.qual.EnsuresNonNullIf;
|
||||
@ -491,7 +492,7 @@ public final class MediaMetricsListener
|
||||
|
||||
private void maybeUpdateVideoFormat(
|
||||
long realtimeMs, @Nullable Format videoFormat, @C.SelectionReason int trackSelectionReason) {
|
||||
if (Util.areEqual(currentVideoFormat, videoFormat)) {
|
||||
if (Objects.equals(currentVideoFormat, videoFormat)) {
|
||||
return;
|
||||
}
|
||||
if (currentVideoFormat == null && trackSelectionReason == C.SELECTION_REASON_UNKNOWN) {
|
||||
@ -504,7 +505,7 @@ public final class MediaMetricsListener
|
||||
|
||||
private void maybeUpdateAudioFormat(
|
||||
long realtimeMs, @Nullable Format audioFormat, @C.SelectionReason int trackSelectionReason) {
|
||||
if (Util.areEqual(currentAudioFormat, audioFormat)) {
|
||||
if (Objects.equals(currentAudioFormat, audioFormat)) {
|
||||
return;
|
||||
}
|
||||
if (currentAudioFormat == null && trackSelectionReason == C.SELECTION_REASON_UNKNOWN) {
|
||||
@ -517,7 +518,7 @@ public final class MediaMetricsListener
|
||||
|
||||
private void maybeUpdateTextFormat(
|
||||
long realtimeMs, @Nullable Format textFormat, @C.SelectionReason int trackSelectionReason) {
|
||||
if (Util.areEqual(currentTextFormat, textFormat)) {
|
||||
if (Objects.equals(currentTextFormat, textFormat)) {
|
||||
return;
|
||||
}
|
||||
if (currentTextFormat == null && trackSelectionReason == C.SELECTION_REASON_UNKNOWN) {
|
||||
|
@ -46,6 +46,7 @@ import java.util.Collections;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Objects;
|
||||
|
||||
/**
|
||||
* {@link AnalyticsListener} to gather {@link PlaybackStats} from the player.
|
||||
@ -778,7 +779,7 @@ public final class PlaybackStatsListener
|
||||
}
|
||||
|
||||
private void maybeUpdateVideoFormat(EventTime eventTime, @Nullable Format newFormat) {
|
||||
if (Util.areEqual(currentVideoFormat, newFormat)) {
|
||||
if (Objects.equals(currentVideoFormat, newFormat)) {
|
||||
return;
|
||||
}
|
||||
maybeRecordVideoFormatTime(eventTime.realtimeMs);
|
||||
@ -797,7 +798,7 @@ public final class PlaybackStatsListener
|
||||
}
|
||||
|
||||
private void maybeUpdateAudioFormat(EventTime eventTime, @Nullable Format newFormat) {
|
||||
if (Util.areEqual(currentAudioFormat, newFormat)) {
|
||||
if (Objects.equals(currentAudioFormat, newFormat)) {
|
||||
return;
|
||||
}
|
||||
maybeRecordAudioFormatTime(eventTime.realtimeMs);
|
||||
|
@ -50,6 +50,7 @@ import java.util.HashMap;
|
||||
import java.util.HashSet;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Objects;
|
||||
import java.util.Set;
|
||||
|
||||
/** Represents the set of audio formats that a device is capable of playing. */
|
||||
@ -517,7 +518,7 @@ public final class AudioCapabilities {
|
||||
AudioProfile audioProfile = (AudioProfile) other;
|
||||
return encoding == audioProfile.encoding
|
||||
&& maxChannelCount == audioProfile.maxChannelCount
|
||||
&& Util.areEqual(channelMasks, audioProfile.channelMasks);
|
||||
&& Objects.equals(channelMasks, audioProfile.channelMasks);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -33,6 +33,7 @@ import androidx.annotation.RequiresApi;
|
||||
import androidx.media3.common.AudioAttributes;
|
||||
import androidx.media3.common.util.UnstableApi;
|
||||
import androidx.media3.common.util.Util;
|
||||
import java.util.Objects;
|
||||
|
||||
/**
|
||||
* Receives broadcast events indicating changes to the device's audio capabilities, notifying a
|
||||
@ -132,7 +133,7 @@ public final class AudioCapabilitiesReceiver {
|
||||
*/
|
||||
@RequiresApi(23)
|
||||
public void setRoutedDevice(@Nullable AudioDeviceInfo routedDevice) {
|
||||
if (Util.areEqual(
|
||||
if (Objects.equals(
|
||||
routedDevice, this.routedDevice == null ? null : this.routedDevice.audioDeviceInfo)) {
|
||||
return;
|
||||
}
|
||||
|
@ -56,6 +56,7 @@ import java.util.HashMap;
|
||||
import java.util.HashSet;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Objects;
|
||||
import java.util.Set;
|
||||
import java.util.UUID;
|
||||
import org.checkerframework.checker.nullness.qual.EnsuresNonNull;
|
||||
@ -499,7 +500,7 @@ public class DefaultDrmSessionManager implements DrmSessionManager {
|
||||
// Only use an existing session if it has matching init data.
|
||||
session = null;
|
||||
for (DefaultDrmSession existingSession : sessions) {
|
||||
if (Util.areEqual(existingSession.schemeDatas, schemeDatas)) {
|
||||
if (Objects.equals(existingSession.schemeDatas, schemeDatas)) {
|
||||
session = existingSession;
|
||||
break;
|
||||
}
|
||||
|
@ -22,12 +22,12 @@ import androidx.annotation.GuardedBy;
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.media3.common.MediaItem;
|
||||
import androidx.media3.common.util.UnstableApi;
|
||||
import androidx.media3.common.util.Util;
|
||||
import androidx.media3.datasource.DataSource;
|
||||
import androidx.media3.datasource.DefaultHttpDataSource;
|
||||
import androidx.media3.exoplayer.upstream.LoadErrorHandlingPolicy;
|
||||
import com.google.common.primitives.Ints;
|
||||
import java.util.Map;
|
||||
import java.util.Objects;
|
||||
import org.checkerframework.checker.nullness.qual.MonotonicNonNull;
|
||||
|
||||
/** Default implementation of {@link DrmSessionManagerProvider}. */
|
||||
@ -93,7 +93,7 @@ public final class DefaultDrmSessionManagerProvider implements DrmSessionManager
|
||||
}
|
||||
|
||||
synchronized (lock) {
|
||||
if (!Util.areEqual(drmConfiguration, this.drmConfiguration)) {
|
||||
if (!Objects.equals(drmConfiguration, this.drmConfiguration)) {
|
||||
this.drmConfiguration = drmConfiguration;
|
||||
this.manager = createManager(drmConfiguration);
|
||||
}
|
||||
|
@ -433,8 +433,8 @@ public final class FrameworkMediaDrm implements ExoMediaDrm {
|
||||
for (int i = 0; i < schemeDatas.size(); i++) {
|
||||
SchemeData schemeData = schemeDatas.get(i);
|
||||
byte[] schemeDataData = Assertions.checkNotNull(schemeData.data);
|
||||
if (Util.areEqual(schemeData.mimeType, firstSchemeData.mimeType)
|
||||
&& Util.areEqual(schemeData.licenseServerUrl, firstSchemeData.licenseServerUrl)
|
||||
if (Objects.equals(schemeData.mimeType, firstSchemeData.mimeType)
|
||||
&& Objects.equals(schemeData.licenseServerUrl, firstSchemeData.licenseServerUrl)
|
||||
&& PsshAtomUtil.isPsshAtom(schemeDataData)) {
|
||||
concatenatedDataLength += schemeDataData.length;
|
||||
} else {
|
||||
|
@ -51,6 +51,7 @@ import androidx.media3.common.util.UnstableApi;
|
||||
import androidx.media3.common.util.Util;
|
||||
import androidx.media3.exoplayer.DecoderReuseEvaluation;
|
||||
import androidx.media3.exoplayer.DecoderReuseEvaluation.DecoderDiscardReasons;
|
||||
import java.util.Objects;
|
||||
|
||||
/** Information about a {@link MediaCodec} for a given MIME type. */
|
||||
@SuppressWarnings("InlinedApi")
|
||||
@ -407,7 +408,7 @@ public final class MediaCodecInfo {
|
||||
*/
|
||||
public DecoderReuseEvaluation canReuseCodec(Format oldFormat, Format newFormat) {
|
||||
@DecoderDiscardReasons int discardReasons = 0;
|
||||
if (!Util.areEqual(oldFormat.sampleMimeType, newFormat.sampleMimeType)) {
|
||||
if (!Objects.equals(oldFormat.sampleMimeType, newFormat.sampleMimeType)) {
|
||||
discardReasons |= DISCARD_REASON_MIME_TYPE_CHANGED;
|
||||
}
|
||||
|
||||
@ -421,7 +422,7 @@ public final class MediaCodecInfo {
|
||||
}
|
||||
if ((!ColorInfo.isEquivalentToAssumedSdrDefault(oldFormat.colorInfo)
|
||||
|| !ColorInfo.isEquivalentToAssumedSdrDefault(newFormat.colorInfo))
|
||||
&& !Util.areEqual(oldFormat.colorInfo, newFormat.colorInfo)) {
|
||||
&& !Objects.equals(oldFormat.colorInfo, newFormat.colorInfo)) {
|
||||
// Don't perform detailed checks if both ColorInfos fall within the default SDR assumption.
|
||||
discardReasons |= DISCARD_REASON_VIDEO_COLOR_INFO_CHANGED;
|
||||
}
|
||||
|
@ -39,6 +39,7 @@ import androidx.media3.exoplayer.scheduler.Requirements.RequirementFlags;
|
||||
import androidx.media3.exoplayer.scheduler.Scheduler;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
import org.checkerframework.checker.nullness.qual.MonotonicNonNull;
|
||||
import org.checkerframework.checker.nullness.qual.RequiresNonNull;
|
||||
|
||||
@ -1096,7 +1097,7 @@ public abstract class DownloadService extends Service {
|
||||
// Internal methods.
|
||||
|
||||
private boolean schedulerNeedsUpdate(Requirements requirements) {
|
||||
return !Util.areEqual(scheduledRequirements, requirements);
|
||||
return !Objects.equals(scheduledRequirements, requirements);
|
||||
}
|
||||
|
||||
@RequiresNonNull("scheduler")
|
||||
|
@ -43,6 +43,7 @@ import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
import java.util.concurrent.ExecutionException;
|
||||
import java.util.concurrent.Executor;
|
||||
|
||||
@ -475,7 +476,7 @@ public abstract class SegmentDownloader<M extends FilterableManifest<M>> impleme
|
||||
return dataSpec1.uri.equals(dataSpec2.uri)
|
||||
&& dataSpec1.length != C.LENGTH_UNSET
|
||||
&& (dataSpec1.position + dataSpec1.length == dataSpec2.position)
|
||||
&& Util.areEqual(dataSpec1.key, dataSpec2.key)
|
||||
&& Objects.equals(dataSpec1.key, dataSpec2.key)
|
||||
&& dataSpec1.flags == dataSpec2.flags
|
||||
&& dataSpec1.httpMethod == dataSpec2.httpMethod
|
||||
&& dataSpec1.httpRequestHeaders.equals(dataSpec2.httpRequestHeaders);
|
||||
|
@ -28,6 +28,7 @@ import androidx.media3.exoplayer.drm.DrmSession;
|
||||
import androidx.media3.exoplayer.drm.DrmSessionEventListener;
|
||||
import java.io.IOException;
|
||||
import java.util.HashMap;
|
||||
import java.util.Objects;
|
||||
|
||||
/**
|
||||
* Composite {@link MediaSource} consisting of multiple child sources.
|
||||
@ -365,11 +366,11 @@ public abstract class CompositeMediaSource<T> extends BaseMediaSource {
|
||||
}
|
||||
int windowIndex = getWindowIndexForChildWindowIndex(id, childWindowIndex);
|
||||
if (mediaSourceEventDispatcher.windowIndex != windowIndex
|
||||
|| !Util.areEqual(mediaSourceEventDispatcher.mediaPeriodId, mediaPeriodId)) {
|
||||
|| !Objects.equals(mediaSourceEventDispatcher.mediaPeriodId, mediaPeriodId)) {
|
||||
mediaSourceEventDispatcher = createEventDispatcher(windowIndex, mediaPeriodId);
|
||||
}
|
||||
if (drmEventDispatcher.windowIndex != windowIndex
|
||||
|| !Util.areEqual(drmEventDispatcher.mediaPeriodId, mediaPeriodId)) {
|
||||
|| !Objects.equals(drmEventDispatcher.mediaPeriodId, mediaPeriodId)) {
|
||||
drmEventDispatcher = createDrmEventDispatcher(windowIndex, mediaPeriodId);
|
||||
}
|
||||
return true;
|
||||
|
@ -40,6 +40,7 @@ import com.google.common.collect.ImmutableList;
|
||||
import com.google.errorprone.annotations.CanIgnoreReturnValue;
|
||||
import java.util.HashMap;
|
||||
import java.util.IdentityHashMap;
|
||||
import java.util.Objects;
|
||||
|
||||
/**
|
||||
* Concatenates multiple {@link MediaSource MediaSources}, combining everything in one single {@link
|
||||
@ -432,7 +433,7 @@ public final class ConcatenatingMediaSource2 extends CompositeMediaSource<Intege
|
||||
hasInitialManifest = true;
|
||||
}
|
||||
manifestsAreIdentical =
|
||||
manifestsAreIdentical && Util.areEqual(initialManifest, window.manifest);
|
||||
manifestsAreIdentical && Objects.equals(initialManifest, window.manifest);
|
||||
|
||||
long windowDurationUs = window.durationUs;
|
||||
if (windowDurationUs == C.TIME_UNSET) {
|
||||
|
@ -27,8 +27,8 @@ import androidx.media3.common.Timeline;
|
||||
import androidx.media3.common.Timeline.Window;
|
||||
import androidx.media3.common.util.Assertions;
|
||||
import androidx.media3.common.util.UnstableApi;
|
||||
import androidx.media3.common.util.Util;
|
||||
import androidx.media3.exoplayer.upstream.Allocator;
|
||||
import java.util.Objects;
|
||||
import org.checkerframework.checker.nullness.qual.RequiresNonNull;
|
||||
|
||||
/**
|
||||
@ -317,7 +317,7 @@ public final class MaskingMediaSource extends WrappingMediaSource {
|
||||
@Override
|
||||
public Window getWindow(int windowIndex, Window window, long defaultPositionProjectionUs) {
|
||||
timeline.getWindow(windowIndex, window, defaultPositionProjectionUs);
|
||||
if (Util.areEqual(window.uid, replacedInternalWindowUid)) {
|
||||
if (Objects.equals(window.uid, replacedInternalWindowUid)) {
|
||||
window.uid = Window.SINGLE_WINDOW_UID;
|
||||
}
|
||||
return window;
|
||||
@ -326,7 +326,7 @@ public final class MaskingMediaSource extends WrappingMediaSource {
|
||||
@Override
|
||||
public Period getPeriod(int periodIndex, Period period, boolean setIds) {
|
||||
timeline.getPeriod(periodIndex, period, setIds);
|
||||
if (Util.areEqual(period.uid, replacedInternalPeriodUid) && setIds) {
|
||||
if (Objects.equals(period.uid, replacedInternalPeriodUid) && setIds) {
|
||||
period.uid = MASKING_EXTERNAL_PERIOD_UID;
|
||||
}
|
||||
return period;
|
||||
@ -343,7 +343,7 @@ public final class MaskingMediaSource extends WrappingMediaSource {
|
||||
@Override
|
||||
public Object getUidOfPeriod(int periodIndex) {
|
||||
Object uid = timeline.getUidOfPeriod(periodIndex);
|
||||
return Util.areEqual(uid, replacedInternalPeriodUid) ? MASKING_EXTERNAL_PERIOD_UID : uid;
|
||||
return Objects.equals(uid, replacedInternalPeriodUid) ? MASKING_EXTERNAL_PERIOD_UID : uid;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -46,6 +46,7 @@ import androidx.media3.extractor.SeekMap;
|
||||
import androidx.media3.extractor.TrackOutput;
|
||||
import com.google.common.base.Supplier;
|
||||
import com.google.errorprone.annotations.CanIgnoreReturnValue;
|
||||
import java.util.Objects;
|
||||
import java.util.concurrent.Executor;
|
||||
|
||||
/**
|
||||
@ -363,7 +364,7 @@ public final class ProgressiveMediaSource extends BaseMediaSource
|
||||
return newConfiguration != null
|
||||
&& newConfiguration.uri.equals(existingConfiguration.uri)
|
||||
&& newConfiguration.imageDurationMs == existingConfiguration.imageDurationMs
|
||||
&& Util.areEqual(newConfiguration.customCacheKey, existingConfiguration.customCacheKey);
|
||||
&& Objects.equals(newConfiguration.customCacheKey, existingConfiguration.customCacheKey);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -37,7 +37,6 @@ import androidx.media3.common.util.Log;
|
||||
import androidx.media3.common.util.NullableType;
|
||||
import androidx.media3.common.util.ParsableByteArray;
|
||||
import androidx.media3.common.util.UnstableApi;
|
||||
import androidx.media3.common.util.Util;
|
||||
import androidx.media3.decoder.DecoderInputBuffer;
|
||||
import androidx.media3.decoder.DecoderInputBuffer.InsufficientCapacityException;
|
||||
import androidx.media3.exoplayer.FormatHolder;
|
||||
@ -51,6 +50,7 @@ import androidx.media3.exoplayer.source.SampleStream.ReadFlags;
|
||||
import androidx.media3.exoplayer.upstream.Allocator;
|
||||
import androidx.media3.extractor.TrackOutput;
|
||||
import java.io.IOException;
|
||||
import java.util.Objects;
|
||||
|
||||
/** A queue of media samples. */
|
||||
@UnstableApi
|
||||
@ -740,7 +740,7 @@ public class SampleQueue implements TrackOutput {
|
||||
|
||||
private synchronized boolean setUpstreamFormat(Format format) {
|
||||
upstreamFormatRequired = false;
|
||||
if (Util.areEqual(format, upstreamFormat)) {
|
||||
if (Objects.equals(format, upstreamFormat)) {
|
||||
// The format is unchanged. If format and upstreamFormat are different objects, we keep the
|
||||
// current upstreamFormat so we can detect format changes on the read side using cheap
|
||||
// referential quality.
|
||||
@ -930,7 +930,7 @@ public class SampleQueue implements TrackOutput {
|
||||
// This sample queue is not expected to handle DRM. Nothing to do.
|
||||
return;
|
||||
}
|
||||
if (!isFirstFormat && Util.areEqual(oldDrmInitData, newDrmInitData)) {
|
||||
if (!isFirstFormat && Objects.equals(oldDrmInitData, newDrmInitData)) {
|
||||
// Nothing to do.
|
||||
return;
|
||||
}
|
||||
|
@ -54,6 +54,7 @@ import java.lang.annotation.Target;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
import org.checkerframework.checker.nullness.qual.MonotonicNonNull;
|
||||
import org.checkerframework.checker.nullness.qual.RequiresNonNull;
|
||||
|
||||
@ -243,7 +244,7 @@ public final class AdsMediaSource extends CompositeMediaSource<MediaPeriodId> {
|
||||
|
||||
@Override
|
||||
public boolean canUpdateMediaItem(MediaItem mediaItem) {
|
||||
return Util.areEqual(getAdsConfiguration(getMediaItem()), getAdsConfiguration(mediaItem))
|
||||
return Objects.equals(getAdsConfiguration(getMediaItem()), getAdsConfiguration(mediaItem))
|
||||
&& contentMediaSource.canUpdateMediaItem(mediaItem);
|
||||
}
|
||||
|
||||
|
@ -68,6 +68,7 @@ import java.util.Arrays;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Objects;
|
||||
import org.checkerframework.checker.nullness.qual.MonotonicNonNull;
|
||||
|
||||
/**
|
||||
@ -160,7 +161,7 @@ public final class ServerSideAdInsertionMediaSource extends BaseMediaSource
|
||||
for (Map.Entry<Object, AdPlaybackState> entry : adPlaybackStates.entrySet()) {
|
||||
Object periodUid = entry.getKey();
|
||||
AdPlaybackState adPlaybackState = entry.getValue();
|
||||
checkArgument(Util.areEqual(adsId, adPlaybackState.adsId));
|
||||
checkArgument(Objects.equals(adsId, adPlaybackState.adsId));
|
||||
@Nullable AdPlaybackState oldAdPlaybackState = this.adPlaybackStates.get(periodUid);
|
||||
if (oldAdPlaybackState != null) {
|
||||
for (int adGroupIndex = adPlaybackState.removedAdGroupCount;
|
||||
@ -869,7 +870,7 @@ public final class ServerSideAdInsertionMediaSource extends BaseMediaSource
|
||||
streamResetFlags[i] = !mayRetainStreamFlags[i] || streams[i] == null;
|
||||
if (streamResetFlags[i]) {
|
||||
streams[i] =
|
||||
Util.areEqual(trackSelections[i], selections[i])
|
||||
Objects.equals(trackSelections[i], selections[i])
|
||||
? new SampleStreamImpl(mediaPeriod, /* streamIndex= */ i)
|
||||
: new EmptySampleStream();
|
||||
}
|
||||
|
@ -27,6 +27,7 @@ import androidx.media3.common.util.UnstableApi;
|
||||
import androidx.media3.common.util.Util;
|
||||
import androidx.media3.exoplayer.source.MediaPeriod;
|
||||
import androidx.media3.exoplayer.source.MediaSource.MediaPeriodId;
|
||||
import java.util.Objects;
|
||||
|
||||
/** A static utility class with methods to work with server-side inserted ads. */
|
||||
@UnstableApi
|
||||
@ -98,7 +99,7 @@ public final class ServerSideAdInsertionUtil {
|
||||
}
|
||||
Timeline.Period period =
|
||||
timeline.getPeriod(player.getCurrentPeriodIndex(), new Timeline.Period());
|
||||
if (!Util.areEqual(period.getAdsId(), adPlaybackState.adsId)) {
|
||||
if (!Objects.equals(period.getAdsId(), adPlaybackState.adsId)) {
|
||||
return C.TIME_UNSET;
|
||||
}
|
||||
if (player.isPlayingAd()) {
|
||||
|
@ -67,6 +67,7 @@ import java.nio.IntBuffer;
|
||||
import java.nio.LongBuffer;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
import java.util.regex.Matcher;
|
||||
import java.util.regex.Pattern;
|
||||
|
||||
@ -507,7 +508,7 @@ public final class OutputConsumerAdapterV30 implements MediaParser.OutputConsume
|
||||
.setAccessibilityChannel(mediaFormatAccessibilityChannel);
|
||||
for (int i = 0; i < muxedCaptionFormats.size(); i++) {
|
||||
Format muxedCaptionFormat = muxedCaptionFormats.get(i);
|
||||
if (Util.areEqual(muxedCaptionFormat.sampleMimeType, mediaFormatMimeType)
|
||||
if (Objects.equals(muxedCaptionFormat.sampleMimeType, mediaFormatMimeType)
|
||||
&& muxedCaptionFormat.accessibilityChannel == mediaFormatAccessibilityChannel) {
|
||||
// The track's format matches this muxedCaptionFormat, so we apply the manifest format
|
||||
// information to the track.
|
||||
|
@ -1660,7 +1660,7 @@ public class DefaultTrackSelector extends MappingTrackSelector
|
||||
overrides = new HashMap<>();
|
||||
selectionOverrides.put(rendererIndex, overrides);
|
||||
}
|
||||
if (overrides.containsKey(groups) && Util.areEqual(overrides.get(groups), override)) {
|
||||
if (overrides.containsKey(groups) && Objects.equals(overrides.get(groups), override)) {
|
||||
// The override is unchanged.
|
||||
return this;
|
||||
}
|
||||
@ -2268,7 +2268,7 @@ public class DefaultTrackSelector extends MappingTrackSelector
|
||||
for (Map.Entry<TrackGroupArray, @NullableType SelectionOverride> firstEntry :
|
||||
first.entrySet()) {
|
||||
TrackGroupArray key = firstEntry.getKey();
|
||||
if (!second.containsKey(key) || !Util.areEqual(firstEntry.getValue(), second.get(key))) {
|
||||
if (!second.containsKey(key) || !Objects.equals(firstEntry.getValue(), second.get(key))) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@ -3706,7 +3706,7 @@ public class DefaultTrackSelector extends MappingTrackSelector
|
||||
@Override
|
||||
public boolean isCompatibleForAdaptationWith(VideoTrackInfo otherTrack) {
|
||||
return (allowMixedMimeTypes
|
||||
|| Util.areEqual(format.sampleMimeType, otherTrack.format.sampleMimeType))
|
||||
|| Objects.equals(format.sampleMimeType, otherTrack.format.sampleMimeType))
|
||||
&& (parameters.allowVideoMixedDecoderSupportAdaptiveness
|
||||
|| (this.usesPrimaryDecoder == otherTrack.usesPrimaryDecoder
|
||||
&& this.usesHardwareAcceleration == otherTrack.usesHardwareAcceleration));
|
||||
@ -4013,7 +4013,7 @@ public class DefaultTrackSelector extends MappingTrackSelector
|
||||
.compareFalseFirst(this.isObjectBasedAudio, other.isObjectBasedAudio)
|
||||
.compare(this.channelCount, other.channelCount, qualityOrdering)
|
||||
.compare(this.sampleRate, other.sampleRate, qualityOrdering);
|
||||
if (Util.areEqual(this.language, other.language)) {
|
||||
if (Objects.equals(this.language, other.language)) {
|
||||
// Only compare bit rates of tracks with matching language information.
|
||||
comparisonChain = comparisonChain.compare(this.bitrate, other.bitrate, qualityOrdering);
|
||||
}
|
||||
|
@ -48,6 +48,7 @@ import java.lang.annotation.Retention;
|
||||
import java.lang.annotation.RetentionPolicy;
|
||||
import java.lang.annotation.Target;
|
||||
import java.util.Arrays;
|
||||
import java.util.Objects;
|
||||
|
||||
/**
|
||||
* Base class for {@link TrackSelector}s that first establish a mapping between {@link TrackGroup}s
|
||||
@ -310,7 +311,7 @@ public abstract class MappingTrackSelector extends TrackSelector {
|
||||
if (handledTrackCount++ == 0) {
|
||||
firstSampleMimeType = sampleMimeType;
|
||||
} else {
|
||||
multipleMimeTypes |= !Util.areEqual(firstSampleMimeType, sampleMimeType);
|
||||
multipleMimeTypes |= !Objects.equals(firstSampleMimeType, sampleMimeType);
|
||||
}
|
||||
adaptiveSupport =
|
||||
min(
|
||||
|
@ -22,9 +22,9 @@ import androidx.media3.common.C;
|
||||
import androidx.media3.common.Tracks;
|
||||
import androidx.media3.common.util.NullableType;
|
||||
import androidx.media3.common.util.UnstableApi;
|
||||
import androidx.media3.common.util.Util;
|
||||
import androidx.media3.exoplayer.RendererCapabilities;
|
||||
import androidx.media3.exoplayer.RendererConfiguration;
|
||||
import java.util.Objects;
|
||||
|
||||
/** The result of a {@link TrackSelector} operation. */
|
||||
@UnstableApi
|
||||
@ -133,7 +133,7 @@ public final class TrackSelectorResult {
|
||||
if (other == null) {
|
||||
return false;
|
||||
}
|
||||
return Util.areEqual(rendererConfigurations[index], other.rendererConfigurations[index])
|
||||
&& Util.areEqual(selections[index], other.selections[index]);
|
||||
return Objects.equals(rendererConfigurations[index], other.rendererConfigurations[index])
|
||||
&& Objects.equals(selections[index], other.selections[index]);
|
||||
}
|
||||
}
|
||||
|
@ -97,7 +97,6 @@ import androidx.media3.common.VideoSize;
|
||||
import androidx.media3.common.util.Clock;
|
||||
import androidx.media3.common.util.ConditionVariable;
|
||||
import androidx.media3.common.util.HandlerWrapper;
|
||||
import androidx.media3.common.util.Util;
|
||||
import androidx.media3.exoplayer.DecoderCounters;
|
||||
import androidx.media3.exoplayer.DecoderReuseEvaluation;
|
||||
import androidx.media3.exoplayer.ExoPlaybackException;
|
||||
@ -134,6 +133,7 @@ import java.io.IOException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
import java.util.UUID;
|
||||
import java.util.concurrent.TimeoutException;
|
||||
import java.util.concurrent.atomic.AtomicInteger;
|
||||
@ -2144,7 +2144,7 @@ public final class DefaultAnalyticsCollectorTest {
|
||||
return false;
|
||||
}
|
||||
EventWindowAndPeriodId event = (EventWindowAndPeriodId) other;
|
||||
return windowIndex == event.windowIndex && Util.areEqual(mediaPeriodId, event.mediaPeriodId);
|
||||
return windowIndex == event.windowIndex && Objects.equals(mediaPeriodId, event.mediaPeriodId);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -93,6 +93,7 @@ import java.text.ParseException;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.List;
|
||||
import java.util.Locale;
|
||||
import java.util.Objects;
|
||||
import java.util.TimeZone;
|
||||
import java.util.regex.Matcher;
|
||||
import java.util.regex.Pattern;
|
||||
@ -538,7 +539,7 @@ public final class DashMediaSource extends BaseMediaSource {
|
||||
return newConfiguration != null
|
||||
&& newConfiguration.uri.equals(existingConfiguration.uri)
|
||||
&& newConfiguration.streamKeys.equals(existingConfiguration.streamKeys)
|
||||
&& Util.areEqual(newConfiguration.drmConfiguration, existingConfiguration.drmConfiguration)
|
||||
&& Objects.equals(newConfiguration.drmConfiguration, existingConfiguration.drmConfiguration)
|
||||
&& existingMediaItem.liveConfiguration.equals(mediaItem.liveConfiguration);
|
||||
}
|
||||
|
||||
@ -839,17 +840,17 @@ public final class DashMediaSource extends BaseMediaSource {
|
||||
|
||||
private void resolveUtcTimingElement(UtcTimingElement timingElement) {
|
||||
String scheme = timingElement.schemeIdUri;
|
||||
if (Util.areEqual(scheme, "urn:mpeg:dash:utc:direct:2014")
|
||||
|| Util.areEqual(scheme, "urn:mpeg:dash:utc:direct:2012")) {
|
||||
if (Objects.equals(scheme, "urn:mpeg:dash:utc:direct:2014")
|
||||
|| Objects.equals(scheme, "urn:mpeg:dash:utc:direct:2012")) {
|
||||
resolveUtcTimingElementDirect(timingElement);
|
||||
} else if (Util.areEqual(scheme, "urn:mpeg:dash:utc:http-iso:2014")
|
||||
|| Util.areEqual(scheme, "urn:mpeg:dash:utc:http-iso:2012")) {
|
||||
} else if (Objects.equals(scheme, "urn:mpeg:dash:utc:http-iso:2014")
|
||||
|| Objects.equals(scheme, "urn:mpeg:dash:utc:http-iso:2012")) {
|
||||
resolveUtcTimingElementHttp(timingElement, new Iso8601Parser());
|
||||
} else if (Util.areEqual(scheme, "urn:mpeg:dash:utc:http-xsdate:2014")
|
||||
|| Util.areEqual(scheme, "urn:mpeg:dash:utc:http-xsdate:2012")) {
|
||||
} else if (Objects.equals(scheme, "urn:mpeg:dash:utc:http-xsdate:2014")
|
||||
|| Objects.equals(scheme, "urn:mpeg:dash:utc:http-xsdate:2012")) {
|
||||
resolveUtcTimingElementHttp(timingElement, new XsDateTimeParser());
|
||||
} else if (Util.areEqual(scheme, "urn:mpeg:dash:utc:ntp:2014")
|
||||
|| Util.areEqual(scheme, "urn:mpeg:dash:utc:ntp:2012")) {
|
||||
} else if (Objects.equals(scheme, "urn:mpeg:dash:utc:ntp:2014")
|
||||
|| Objects.equals(scheme, "urn:mpeg:dash:utc:ntp:2012")) {
|
||||
loadNtpTimeOffset();
|
||||
} else {
|
||||
// Unsupported scheme.
|
||||
|
@ -17,7 +17,7 @@ package androidx.media3.exoplayer.dash.manifest;
|
||||
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.media3.common.util.UnstableApi;
|
||||
import com.google.common.base.Objects;
|
||||
import java.util.Objects;
|
||||
|
||||
/** A base URL, as defined by ISO 23009-1, 2nd edition, 5.6. and ETSI TS 103 285 V1.2.1, 10.8.2.1 */
|
||||
@UnstableApi
|
||||
@ -71,12 +71,12 @@ public final class BaseUrl {
|
||||
BaseUrl baseUrl = (BaseUrl) o;
|
||||
return priority == baseUrl.priority
|
||||
&& weight == baseUrl.weight
|
||||
&& Objects.equal(url, baseUrl.url)
|
||||
&& Objects.equal(serviceLocation, baseUrl.serviceLocation);
|
||||
&& Objects.equals(url, baseUrl.url)
|
||||
&& Objects.equals(serviceLocation, baseUrl.serviceLocation);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return Objects.hashCode(url, serviceLocation, priority, weight);
|
||||
return Objects.hash(url, serviceLocation, priority, weight);
|
||||
}
|
||||
}
|
||||
|
@ -17,7 +17,7 @@ package androidx.media3.exoplayer.dash.manifest;
|
||||
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.media3.common.util.UnstableApi;
|
||||
import androidx.media3.common.util.Util;
|
||||
import java.util.Objects;
|
||||
|
||||
/** A descriptor, as defined by ISO 23009-1, 2nd edition, 5.8.2. */
|
||||
@UnstableApi
|
||||
@ -52,9 +52,9 @@ public final class Descriptor {
|
||||
return false;
|
||||
}
|
||||
Descriptor other = (Descriptor) obj;
|
||||
return Util.areEqual(schemeIdUri, other.schemeIdUri)
|
||||
&& Util.areEqual(value, other.value)
|
||||
&& Util.areEqual(id, other.id);
|
||||
return Objects.equals(schemeIdUri, other.schemeIdUri)
|
||||
&& Objects.equals(value, other.value)
|
||||
&& Objects.equals(id, other.id);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -17,7 +17,7 @@ package androidx.media3.exoplayer.dash.manifest;
|
||||
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.media3.common.util.UnstableApi;
|
||||
import androidx.media3.common.util.Util;
|
||||
import java.util.Objects;
|
||||
|
||||
/** A parsed program information element. */
|
||||
@UnstableApi
|
||||
@ -59,11 +59,11 @@ public final class ProgramInformation {
|
||||
return false;
|
||||
}
|
||||
ProgramInformation other = (ProgramInformation) obj;
|
||||
return Util.areEqual(this.title, other.title)
|
||||
&& Util.areEqual(this.source, other.source)
|
||||
&& Util.areEqual(this.copyright, other.copyright)
|
||||
&& Util.areEqual(this.moreInformationURL, other.moreInformationURL)
|
||||
&& Util.areEqual(this.lang, other.lang);
|
||||
return Objects.equals(this.title, other.title)
|
||||
&& Objects.equals(this.source, other.source)
|
||||
&& Objects.equals(this.copyright, other.copyright)
|
||||
&& Objects.equals(this.moreInformationURL, other.moreInformationURL)
|
||||
&& Objects.equals(this.lang, other.lang);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -62,6 +62,7 @@ import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
import org.checkerframework.checker.nullness.qual.MonotonicNonNull;
|
||||
|
||||
/** Source of Hls (possibly adaptive) chunks. */
|
||||
@ -367,7 +368,7 @@ import org.checkerframework.checker.nullness.qual.MonotonicNonNull;
|
||||
return CHUNK_PUBLICATION_STATE_PRELOAD;
|
||||
}
|
||||
Uri newUri = Uri.parse(UriUtil.resolve(mediaPlaylist.baseUri, newPart.url));
|
||||
return Util.areEqual(newUri, mediaChunk.dataSpec.uri)
|
||||
return Objects.equals(newUri, mediaChunk.dataSpec.uri)
|
||||
? CHUNK_PUBLICATION_STATE_PUBLISHED
|
||||
: CHUNK_PUBLICATION_STATE_REMOVED;
|
||||
}
|
||||
|
@ -63,6 +63,7 @@ import java.util.HashSet;
|
||||
import java.util.IdentityHashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Objects;
|
||||
import org.checkerframework.checker.nullness.qual.MonotonicNonNull;
|
||||
|
||||
/** A {@link MediaPeriod} that loads an HLS stream. */
|
||||
@ -750,7 +751,7 @@ import org.checkerframework.checker.nullness.qual.MonotonicNonNull;
|
||||
scratchIndicesList.clear();
|
||||
// Group all renditions with matching name.
|
||||
for (int renditionIndex = 0; renditionIndex < audioRenditions.size(); renditionIndex++) {
|
||||
if (Util.areEqual(name, audioRenditions.get(renditionIndex).name)) {
|
||||
if (Objects.equals(name, audioRenditions.get(renditionIndex).name)) {
|
||||
Rendition rendition = audioRenditions.get(renditionIndex);
|
||||
scratchIndicesList.add(renditionIndex);
|
||||
scratchPlaylistUrls.add(rendition.url);
|
||||
|
@ -65,6 +65,7 @@ import java.lang.annotation.Documented;
|
||||
import java.lang.annotation.Retention;
|
||||
import java.lang.annotation.Target;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
|
||||
/** An HLS {@link MediaSource}. */
|
||||
@UnstableApi
|
||||
@ -497,7 +498,7 @@ public final class HlsMediaSource extends BaseMediaSource
|
||||
return newConfiguration != null
|
||||
&& newConfiguration.uri.equals(existingConfiguration.uri)
|
||||
&& newConfiguration.streamKeys.equals(existingConfiguration.streamKeys)
|
||||
&& Util.areEqual(newConfiguration.drmConfiguration, existingConfiguration.drmConfiguration)
|
||||
&& Objects.equals(newConfiguration.drmConfiguration, existingConfiguration.drmConfiguration)
|
||||
&& existingMediaItem.liveConfiguration.equals(mediaItem.liveConfiguration);
|
||||
}
|
||||
|
||||
|
@ -83,6 +83,7 @@ import java.util.Collections;
|
||||
import java.util.HashSet;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Objects;
|
||||
import java.util.Set;
|
||||
import org.checkerframework.checker.nullness.qual.EnsuresNonNull;
|
||||
import org.checkerframework.checker.nullness.qual.MonotonicNonNull;
|
||||
@ -428,7 +429,7 @@ import org.checkerframework.checker.nullness.qual.RequiresNonNull;
|
||||
}
|
||||
} else {
|
||||
if (!mediaChunks.isEmpty()
|
||||
&& !Util.areEqual(primaryTrackSelection, oldPrimaryTrackSelection)) {
|
||||
&& !Objects.equals(primaryTrackSelection, oldPrimaryTrackSelection)) {
|
||||
// The primary track selection has changed and we have buffered media. The buffered media
|
||||
// may need to be discarded.
|
||||
boolean primarySampleQueueDirty = false;
|
||||
@ -1252,7 +1253,7 @@ import org.checkerframework.checker.nullness.qual.RequiresNonNull;
|
||||
* #overridingDrmInitData}.
|
||||
*/
|
||||
public void setDrmInitData(@Nullable DrmInitData drmInitData) {
|
||||
if (!Util.areEqual(this.drmInitData, drmInitData)) {
|
||||
if (!Objects.equals(this.drmInitData, drmInitData)) {
|
||||
this.drmInitData = drmInitData;
|
||||
for (int i = 0; i < sampleQueues.length; i++) {
|
||||
if (sampleQueueIsAudioVideoFlags[i]) {
|
||||
@ -1652,7 +1653,7 @@ import org.checkerframework.checker.nullness.qual.RequiresNonNull;
|
||||
int manifestFormatTrackType = MimeTypes.getTrackType(manifestFormatMimeType);
|
||||
if (manifestFormatTrackType != C.TRACK_TYPE_TEXT) {
|
||||
return manifestFormatTrackType == MimeTypes.getTrackType(sampleFormatMimeType);
|
||||
} else if (!Util.areEqual(manifestFormatMimeType, sampleFormatMimeType)) {
|
||||
} else if (!Objects.equals(manifestFormatMimeType, sampleFormatMimeType)) {
|
||||
return false;
|
||||
}
|
||||
if (MimeTypes.APPLICATION_CEA608.equals(manifestFormatMimeType)
|
||||
@ -1882,7 +1883,7 @@ import org.checkerframework.checker.nullness.qual.RequiresNonNull;
|
||||
Assertions.checkNotNull(format);
|
||||
ParsableByteArray sample = getSampleAndTrimBuffer(size, offset);
|
||||
ParsableByteArray sampleForDelegate;
|
||||
if (Util.areEqual(format.sampleMimeType, delegateFormat.sampleMimeType)) {
|
||||
if (Objects.equals(format.sampleMimeType, delegateFormat.sampleMimeType)) {
|
||||
// Incoming format matches delegate track's format, so pass straight through.
|
||||
sampleForDelegate = sample;
|
||||
} else if (MimeTypes.APPLICATION_EMSG.equals(format.sampleMimeType)) {
|
||||
@ -1912,7 +1913,7 @@ import org.checkerframework.checker.nullness.qual.RequiresNonNull;
|
||||
private boolean emsgContainsExpectedWrappedFormat(EventMessage emsg) {
|
||||
@Nullable Format wrappedMetadataFormat = emsg.getWrappedMetadataFormat();
|
||||
return wrappedMetadataFormat != null
|
||||
&& Util.areEqual(delegateFormat.sampleMimeType, wrappedMetadataFormat.sampleMimeType);
|
||||
&& Objects.equals(delegateFormat.sampleMimeType, wrappedMetadataFormat.sampleMimeType);
|
||||
}
|
||||
|
||||
private void ensureBufferCapacity(int requiredLength) {
|
||||
|
@ -64,7 +64,6 @@ import com.google.ads.interactivemedia.v3.api.ImaSdkSettings;
|
||||
import com.google.ads.interactivemedia.v3.api.player.AdMediaInfo;
|
||||
import com.google.ads.interactivemedia.v3.api.player.ContentProgressProvider;
|
||||
import com.google.ads.interactivemedia.v3.api.player.VideoAdPlayer;
|
||||
import com.google.ads.interactivemedia.v3.api.player.VideoAdPlayer.VideoAdPlayerCallback;
|
||||
import com.google.ads.interactivemedia.v3.api.player.VideoProgressUpdate;
|
||||
import com.google.common.collect.BiMap;
|
||||
import com.google.common.collect.HashBiMap;
|
||||
@ -76,6 +75,7 @@ import java.lang.annotation.Target;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Objects;
|
||||
|
||||
/** Handles loading and playback of a single ad tag. */
|
||||
/* package */ final class AdTagLoader implements Player.Listener {
|
||||
@ -1365,7 +1365,7 @@ import java.util.Map;
|
||||
@Override
|
||||
public void onAdsManagerLoaded(AdsManagerLoadedEvent adsManagerLoadedEvent) {
|
||||
AdsManager adsManager = adsManagerLoadedEvent.getAdsManager();
|
||||
if (!Util.areEqual(pendingAdRequestContext, adsManagerLoadedEvent.getUserRequestContext())) {
|
||||
if (!Objects.equals(pendingAdRequestContext, adsManagerLoadedEvent.getUserRequestContext())) {
|
||||
adsManager.destroy();
|
||||
return;
|
||||
}
|
||||
|
@ -64,6 +64,7 @@ import java.util.Collection;
|
||||
import java.util.Collections;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
import java.util.Set;
|
||||
|
||||
/**
|
||||
@ -653,7 +654,7 @@ public final class ImaAdsLoader implements AdsLoader {
|
||||
private void maybeUpdateCurrentAdTagLoader() {
|
||||
@Nullable AdTagLoader oldAdTagLoader = currentAdTagLoader;
|
||||
@Nullable AdTagLoader newAdTagLoader = getCurrentAdTagLoader();
|
||||
if (!Util.areEqual(oldAdTagLoader, newAdTagLoader)) {
|
||||
if (!Objects.equals(oldAdTagLoader, newAdTagLoader)) {
|
||||
if (oldAdTagLoader != null) {
|
||||
oldAdTagLoader.deactivate();
|
||||
}
|
||||
|
@ -653,8 +653,8 @@ public final class ImaServerSideAdInsertionMediaSource extends CompositeMediaSou
|
||||
return newConfiguration != null
|
||||
&& newConfiguration.uri.equals(existingConfiguration.uri)
|
||||
&& newConfiguration.streamKeys.equals(existingConfiguration.streamKeys)
|
||||
&& Util.areEqual(newConfiguration.customCacheKey, existingConfiguration.customCacheKey)
|
||||
&& Util.areEqual(newConfiguration.drmConfiguration, existingConfiguration.drmConfiguration)
|
||||
&& Objects.equals(newConfiguration.customCacheKey, existingConfiguration.customCacheKey)
|
||||
&& Objects.equals(newConfiguration.drmConfiguration, existingConfiguration.drmConfiguration)
|
||||
&& existingMediaItem.liveConfiguration.equals(mediaItem.liveConfiguration);
|
||||
}
|
||||
|
||||
|
@ -34,6 +34,7 @@ import java.lang.annotation.Documented;
|
||||
import java.lang.annotation.Retention;
|
||||
import java.lang.annotation.RetentionPolicy;
|
||||
import java.util.HashMap;
|
||||
import java.util.Objects;
|
||||
|
||||
/** Represents one media description section in a SDP message. */
|
||||
/* package */ final class MediaDescription {
|
||||
@ -345,9 +346,9 @@ import java.util.HashMap;
|
||||
&& bitrate == other.bitrate
|
||||
&& attributes.equals(other.attributes)
|
||||
&& rtpMapAttribute.equals(other.rtpMapAttribute)
|
||||
&& Util.areEqual(mediaTitle, other.mediaTitle)
|
||||
&& Util.areEqual(connection, other.connection)
|
||||
&& Util.areEqual(key, other.key);
|
||||
&& Objects.equals(mediaTitle, other.mediaTitle)
|
||||
&& Objects.equals(connection, other.connection)
|
||||
&& Objects.equals(key, other.key);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -21,11 +21,11 @@ import static androidx.media3.common.util.Util.castNonNull;
|
||||
import android.net.Uri;
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.media3.common.Format;
|
||||
import androidx.media3.common.util.Util;
|
||||
import com.google.common.collect.ImmutableList;
|
||||
import com.google.common.collect.ImmutableMap;
|
||||
import com.google.errorprone.annotations.CanIgnoreReturnValue;
|
||||
import java.util.HashMap;
|
||||
import java.util.Objects;
|
||||
|
||||
/**
|
||||
* Records all the information in a SDP message.
|
||||
@ -311,15 +311,15 @@ import java.util.HashMap;
|
||||
return bitrate == that.bitrate
|
||||
&& attributes.equals(that.attributes)
|
||||
&& mediaDescriptionList.equals(that.mediaDescriptionList)
|
||||
&& Util.areEqual(origin, that.origin)
|
||||
&& Util.areEqual(sessionName, that.sessionName)
|
||||
&& Util.areEqual(timing, that.timing)
|
||||
&& Util.areEqual(sessionInfo, that.sessionInfo)
|
||||
&& Util.areEqual(uri, that.uri)
|
||||
&& Util.areEqual(emailAddress, that.emailAddress)
|
||||
&& Util.areEqual(phoneNumber, that.phoneNumber)
|
||||
&& Util.areEqual(connection, that.connection)
|
||||
&& Util.areEqual(key, that.key);
|
||||
&& Objects.equals(origin, that.origin)
|
||||
&& Objects.equals(sessionName, that.sessionName)
|
||||
&& Objects.equals(timing, that.timing)
|
||||
&& Objects.equals(sessionInfo, that.sessionInfo)
|
||||
&& Objects.equals(uri, that.uri)
|
||||
&& Objects.equals(emailAddress, that.emailAddress)
|
||||
&& Objects.equals(phoneNumber, that.phoneNumber)
|
||||
&& Objects.equals(connection, that.connection)
|
||||
&& Objects.equals(key, that.key);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -73,6 +73,7 @@ import com.google.errorprone.annotations.CanIgnoreReturnValue;
|
||||
import java.io.IOException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
|
||||
/** A SmoothStreaming {@link MediaSource}. */
|
||||
@UnstableApi
|
||||
@ -424,7 +425,8 @@ public final class SsMediaSource extends BaseMediaSource
|
||||
return newConfiguration != null
|
||||
&& newConfiguration.uri.equals(existingConfiguration.uri)
|
||||
&& newConfiguration.streamKeys.equals(existingConfiguration.streamKeys)
|
||||
&& Util.areEqual(newConfiguration.drmConfiguration, existingConfiguration.drmConfiguration);
|
||||
&& Objects.equals(
|
||||
newConfiguration.drmConfiguration, existingConfiguration.drmConfiguration);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -21,8 +21,8 @@ import androidx.media3.common.Format;
|
||||
import androidx.media3.common.Metadata;
|
||||
import androidx.media3.common.MimeTypes;
|
||||
import androidx.media3.common.util.UnstableApi;
|
||||
import androidx.media3.common.util.Util;
|
||||
import java.util.Arrays;
|
||||
import java.util.Objects;
|
||||
|
||||
/** An Event Message (emsg) as defined in ISO 23009-1. */
|
||||
@UnstableApi
|
||||
@ -131,8 +131,8 @@ public final class EventMessage implements Metadata.Entry {
|
||||
EventMessage other = (EventMessage) obj;
|
||||
return durationMs == other.durationMs
|
||||
&& id == other.id
|
||||
&& Util.areEqual(schemeIdUri, other.schemeIdUri)
|
||||
&& Util.areEqual(value, other.value)
|
||||
&& Objects.equals(schemeIdUri, other.schemeIdUri)
|
||||
&& Objects.equals(value, other.value)
|
||||
&& Arrays.equals(messageData, other.messageData);
|
||||
}
|
||||
|
||||
|
@ -23,9 +23,9 @@ import androidx.media3.common.Metadata;
|
||||
import androidx.media3.common.util.Assertions;
|
||||
import androidx.media3.common.util.Log;
|
||||
import androidx.media3.common.util.UnstableApi;
|
||||
import androidx.media3.common.util.Util;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Objects;
|
||||
|
||||
/** ICY headers. */
|
||||
@UnstableApi
|
||||
@ -185,9 +185,9 @@ public final class IcyHeaders implements Metadata.Entry {
|
||||
}
|
||||
IcyHeaders other = (IcyHeaders) obj;
|
||||
return bitrate == other.bitrate
|
||||
&& Util.areEqual(genre, other.genre)
|
||||
&& Util.areEqual(name, other.name)
|
||||
&& Util.areEqual(url, other.url)
|
||||
&& Objects.equals(genre, other.genre)
|
||||
&& Objects.equals(name, other.name)
|
||||
&& Objects.equals(url, other.url)
|
||||
&& isPublic == other.isPublic
|
||||
&& metadataInterval == other.metadataInterval;
|
||||
}
|
||||
|
@ -18,8 +18,8 @@ package androidx.media3.extractor.metadata.id3;
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.media3.common.MediaMetadata;
|
||||
import androidx.media3.common.util.UnstableApi;
|
||||
import androidx.media3.common.util.Util;
|
||||
import java.util.Arrays;
|
||||
import java.util.Objects;
|
||||
|
||||
/** APIC (Attached Picture) ID3 frame. */
|
||||
@UnstableApi
|
||||
@ -56,8 +56,8 @@ public final class ApicFrame extends Id3Frame {
|
||||
}
|
||||
ApicFrame other = (ApicFrame) obj;
|
||||
return pictureType == other.pictureType
|
||||
&& Util.areEqual(mimeType, other.mimeType)
|
||||
&& Util.areEqual(description, other.description)
|
||||
&& Objects.equals(mimeType, other.mimeType)
|
||||
&& Objects.equals(description, other.description)
|
||||
&& Arrays.equals(pictureData, other.pictureData);
|
||||
}
|
||||
|
||||
|
@ -18,8 +18,8 @@ package androidx.media3.extractor.metadata.id3;
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.media3.common.C;
|
||||
import androidx.media3.common.util.UnstableApi;
|
||||
import androidx.media3.common.util.Util;
|
||||
import java.util.Arrays;
|
||||
import java.util.Objects;
|
||||
|
||||
/** Chapter information ID3 frame. */
|
||||
@UnstableApi
|
||||
@ -78,7 +78,7 @@ public final class ChapterFrame extends Id3Frame {
|
||||
&& endTimeMs == other.endTimeMs
|
||||
&& startOffset == other.startOffset
|
||||
&& endOffset == other.endOffset
|
||||
&& Util.areEqual(chapterId, other.chapterId)
|
||||
&& Objects.equals(chapterId, other.chapterId)
|
||||
&& Arrays.equals(subFrames, other.subFrames);
|
||||
}
|
||||
|
||||
|
@ -17,8 +17,8 @@ package androidx.media3.extractor.metadata.id3;
|
||||
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.media3.common.util.UnstableApi;
|
||||
import androidx.media3.common.util.Util;
|
||||
import java.util.Arrays;
|
||||
import java.util.Objects;
|
||||
|
||||
/** Chapter table of contents ID3 frame. */
|
||||
@UnstableApi
|
||||
@ -67,7 +67,7 @@ public final class ChapterTocFrame extends Id3Frame {
|
||||
ChapterTocFrame other = (ChapterTocFrame) obj;
|
||||
return isRoot == other.isRoot
|
||||
&& isOrdered == other.isOrdered
|
||||
&& Util.areEqual(elementId, other.elementId)
|
||||
&& Objects.equals(elementId, other.elementId)
|
||||
&& Arrays.equals(children, other.children)
|
||||
&& Arrays.equals(subFrames, other.subFrames);
|
||||
}
|
||||
|
@ -17,7 +17,7 @@ package androidx.media3.extractor.metadata.id3;
|
||||
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.media3.common.util.UnstableApi;
|
||||
import androidx.media3.common.util.Util;
|
||||
import java.util.Objects;
|
||||
|
||||
/** Comment ID3 frame. */
|
||||
@UnstableApi
|
||||
@ -45,9 +45,9 @@ public final class CommentFrame extends Id3Frame {
|
||||
return false;
|
||||
}
|
||||
CommentFrame other = (CommentFrame) obj;
|
||||
return Util.areEqual(description, other.description)
|
||||
&& Util.areEqual(language, other.language)
|
||||
&& Util.areEqual(text, other.text);
|
||||
return Objects.equals(description, other.description)
|
||||
&& Objects.equals(language, other.language)
|
||||
&& Objects.equals(text, other.text);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -17,8 +17,8 @@ package androidx.media3.extractor.metadata.id3;
|
||||
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.media3.common.util.UnstableApi;
|
||||
import androidx.media3.common.util.Util;
|
||||
import java.util.Arrays;
|
||||
import java.util.Objects;
|
||||
|
||||
/** GEOB (General Encapsulated Object) ID3 frame. */
|
||||
@UnstableApi
|
||||
@ -48,9 +48,9 @@ public final class GeobFrame extends Id3Frame {
|
||||
return false;
|
||||
}
|
||||
GeobFrame other = (GeobFrame) obj;
|
||||
return Util.areEqual(mimeType, other.mimeType)
|
||||
&& Util.areEqual(filename, other.filename)
|
||||
&& Util.areEqual(description, other.description)
|
||||
return Objects.equals(mimeType, other.mimeType)
|
||||
&& Objects.equals(filename, other.filename)
|
||||
&& Objects.equals(description, other.description)
|
||||
&& Arrays.equals(data, other.data);
|
||||
}
|
||||
|
||||
|
@ -17,7 +17,7 @@ package androidx.media3.extractor.metadata.id3;
|
||||
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.media3.common.util.UnstableApi;
|
||||
import androidx.media3.common.util.Util;
|
||||
import java.util.Objects;
|
||||
|
||||
/** Internal ID3 frame that is intended for use by the player. */
|
||||
@UnstableApi
|
||||
@ -45,9 +45,9 @@ public final class InternalFrame extends Id3Frame {
|
||||
return false;
|
||||
}
|
||||
InternalFrame other = (InternalFrame) obj;
|
||||
return Util.areEqual(description, other.description)
|
||||
&& Util.areEqual(domain, other.domain)
|
||||
&& Util.areEqual(text, other.text);
|
||||
return Objects.equals(description, other.description)
|
||||
&& Objects.equals(domain, other.domain)
|
||||
&& Objects.equals(text, other.text);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -17,8 +17,8 @@ package androidx.media3.extractor.metadata.id3;
|
||||
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.media3.common.util.UnstableApi;
|
||||
import androidx.media3.common.util.Util;
|
||||
import java.util.Arrays;
|
||||
import java.util.Objects;
|
||||
|
||||
/** PRIV (Private) ID3 frame. */
|
||||
@UnstableApi
|
||||
@ -44,7 +44,7 @@ public final class PrivFrame extends Id3Frame {
|
||||
return false;
|
||||
}
|
||||
PrivFrame other = (PrivFrame) obj;
|
||||
return Util.areEqual(owner, other.owner) && Arrays.equals(privateData, other.privateData);
|
||||
return Objects.equals(owner, other.owner) && Arrays.equals(privateData, other.privateData);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -26,6 +26,7 @@ import com.google.common.primitives.Ints;
|
||||
import com.google.errorprone.annotations.InlineMe;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
|
||||
/** Text information ID3 frame. */
|
||||
@UnstableApi
|
||||
@ -192,8 +193,8 @@ public final class TextInformationFrame extends Id3Frame {
|
||||
return false;
|
||||
}
|
||||
TextInformationFrame other = (TextInformationFrame) obj;
|
||||
return Util.areEqual(id, other.id)
|
||||
&& Util.areEqual(description, other.description)
|
||||
return Objects.equals(id, other.id)
|
||||
&& Objects.equals(description, other.description)
|
||||
&& values.equals(other.values);
|
||||
}
|
||||
|
||||
|
@ -17,7 +17,7 @@ package androidx.media3.extractor.metadata.id3;
|
||||
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.media3.common.util.UnstableApi;
|
||||
import androidx.media3.common.util.Util;
|
||||
import java.util.Objects;
|
||||
|
||||
/** Url link ID3 frame. */
|
||||
@UnstableApi
|
||||
@ -42,8 +42,8 @@ public final class UrlLinkFrame extends Id3Frame {
|
||||
}
|
||||
UrlLinkFrame other = (UrlLinkFrame) obj;
|
||||
return id.equals(other.id)
|
||||
&& Util.areEqual(description, other.description)
|
||||
&& Util.areEqual(url, other.url);
|
||||
&& Objects.equals(description, other.description)
|
||||
&& Objects.equals(url, other.url);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -21,10 +21,10 @@ import androidx.annotation.Nullable;
|
||||
import androidx.media3.common.Metadata;
|
||||
import androidx.media3.common.util.UnstableApi;
|
||||
import androidx.media3.common.util.Util;
|
||||
import com.google.common.base.Objects;
|
||||
import com.google.common.collect.ComparisonChain;
|
||||
import java.util.Comparator;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
|
||||
/** Holds information about the segments of slow motion playback within a track. */
|
||||
@UnstableApi
|
||||
@ -92,7 +92,7 @@ public final class SlowMotionData implements Metadata.Entry {
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return Objects.hashCode(startTimeMs, endTimeMs, speedDivisor);
|
||||
return Objects.hash(startTimeMs, endTimeMs, speedDivisor);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -28,7 +28,6 @@ import androidx.media3.common.util.Assertions;
|
||||
import androidx.media3.common.util.ParsableBitArray;
|
||||
import androidx.media3.common.util.ParsableByteArray;
|
||||
import androidx.media3.common.util.UnstableApi;
|
||||
import androidx.media3.common.util.Util;
|
||||
import androidx.media3.extractor.Ac3Util;
|
||||
import androidx.media3.extractor.Ac3Util.SyncFrameInfo;
|
||||
import androidx.media3.extractor.ExtractorOutput;
|
||||
@ -38,6 +37,7 @@ import java.lang.annotation.Documented;
|
||||
import java.lang.annotation.Retention;
|
||||
import java.lang.annotation.RetentionPolicy;
|
||||
import java.lang.annotation.Target;
|
||||
import java.util.Objects;
|
||||
import org.checkerframework.checker.nullness.qual.MonotonicNonNull;
|
||||
import org.checkerframework.checker.nullness.qual.RequiresNonNull;
|
||||
|
||||
@ -219,7 +219,7 @@ public final class Ac3Reader implements ElementaryStreamReader {
|
||||
if (format == null
|
||||
|| frameInfo.channelCount != format.channelCount
|
||||
|| frameInfo.sampleRate != format.sampleRate
|
||||
|| !Util.areEqual(frameInfo.mimeType, format.sampleMimeType)) {
|
||||
|| !Objects.equals(frameInfo.mimeType, format.sampleMimeType)) {
|
||||
Format.Builder formatBuilder =
|
||||
new Format.Builder()
|
||||
.setId(formatId)
|
||||
|
@ -31,6 +31,7 @@ import androidx.media3.extractor.ExtractorOutput;
|
||||
import androidx.media3.extractor.TrackOutput;
|
||||
import androidx.media3.extractor.ts.TsPayloadReader.TrackIdGenerator;
|
||||
import com.google.common.primitives.Ints;
|
||||
import java.util.Objects;
|
||||
import java.util.concurrent.atomic.AtomicInteger;
|
||||
import org.checkerframework.checker.nullness.qual.MonotonicNonNull;
|
||||
import org.checkerframework.checker.nullness.qual.RequiresNonNull;
|
||||
@ -316,7 +317,7 @@ public final class DtsReader implements ElementaryStreamReader {
|
||||
if (format == null
|
||||
|| dtsHeader.channelCount != format.channelCount
|
||||
|| dtsHeader.sampleRate != format.sampleRate
|
||||
|| !Util.areEqual(dtsHeader.mimeType, format.sampleMimeType)) {
|
||||
|| !Objects.equals(dtsHeader.mimeType, format.sampleMimeType)) {
|
||||
Format.Builder formatBuilder = format == null ? new Format.Builder() : format.buildUpon();
|
||||
format =
|
||||
formatBuilder
|
||||
|
@ -36,7 +36,6 @@ import androidx.media3.common.Player;
|
||||
import androidx.media3.common.util.NullableType;
|
||||
import androidx.media3.common.util.UnstableApi;
|
||||
import androidx.media3.common.util.Util;
|
||||
import com.google.common.base.Objects;
|
||||
import com.google.common.collect.ImmutableList;
|
||||
import com.google.common.primitives.ImmutableIntArray;
|
||||
import com.google.errorprone.annotations.CanIgnoreReturnValue;
|
||||
@ -46,6 +45,7 @@ import java.lang.annotation.Retention;
|
||||
import java.lang.annotation.RetentionPolicy;
|
||||
import java.lang.annotation.Target;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
|
||||
/**
|
||||
* A button for a {@link SessionCommand} or {@link Player.Command} that can be displayed by
|
||||
@ -592,8 +592,8 @@ public final class CommandButton {
|
||||
@CanIgnoreReturnValue
|
||||
public Builder setIconUri(Uri uri) {
|
||||
checkArgument(
|
||||
Objects.equal(uri.getScheme(), ContentResolver.SCHEME_CONTENT)
|
||||
|| Objects.equal(uri.getScheme(), ContentResolver.SCHEME_ANDROID_RESOURCE),
|
||||
Objects.equals(uri.getScheme(), ContentResolver.SCHEME_CONTENT)
|
||||
|| Objects.equals(uri.getScheme(), ContentResolver.SCHEME_ANDROID_RESOURCE),
|
||||
"Only content or resource Uris are supported for CommandButton");
|
||||
this.iconUri = uri;
|
||||
return this;
|
||||
@ -1223,11 +1223,11 @@ public final class CommandButton {
|
||||
return false;
|
||||
}
|
||||
CommandButton button = (CommandButton) obj;
|
||||
return Objects.equal(sessionCommand, button.sessionCommand)
|
||||
return Objects.equals(sessionCommand, button.sessionCommand)
|
||||
&& playerCommand == button.playerCommand
|
||||
&& icon == button.icon
|
||||
&& iconResId == button.iconResId
|
||||
&& Objects.equal(iconUri, button.iconUri)
|
||||
&& Objects.equals(iconUri, button.iconUri)
|
||||
&& TextUtils.equals(displayName, button.displayName)
|
||||
&& isEnabled == button.isEnabled
|
||||
&& slots.equals(button.slots);
|
||||
@ -1235,7 +1235,7 @@ public final class CommandButton {
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return Objects.hashCode(
|
||||
return Objects.hash(
|
||||
sessionCommand, playerCommand, icon, iconResId, displayName, isEnabled, iconUri, slots);
|
||||
}
|
||||
|
||||
@ -1357,8 +1357,8 @@ public final class CommandButton {
|
||||
builder.setPlayerCommand(playerCommand);
|
||||
}
|
||||
if (iconUri != null
|
||||
&& (Objects.equal(iconUri.getScheme(), ContentResolver.SCHEME_CONTENT)
|
||||
|| Objects.equal(iconUri.getScheme(), ContentResolver.SCHEME_ANDROID_RESOURCE))) {
|
||||
&& (Objects.equals(iconUri.getScheme(), ContentResolver.SCHEME_CONTENT)
|
||||
|| Objects.equals(iconUri.getScheme(), ContentResolver.SCHEME_ANDROID_RESOURCE))) {
|
||||
builder.setIconUri(iconUri);
|
||||
}
|
||||
return builder
|
||||
|
@ -2807,7 +2807,7 @@ import org.checkerframework.checker.nullness.qual.NonNull;
|
||||
@Nullable
|
||||
@Player.MediaItemTransitionReason
|
||||
Integer mediaItemTransitionReason =
|
||||
!Util.areEqual(oldPlayerInfo.getCurrentMediaItem(), finalPlayerInfo.getCurrentMediaItem())
|
||||
!Objects.equals(oldPlayerInfo.getCurrentMediaItem(), finalPlayerInfo.getCurrentMediaItem())
|
||||
? finalPlayerInfo.mediaItemTransitionReason
|
||||
: null;
|
||||
|
||||
@ -2840,8 +2840,8 @@ import org.checkerframework.checker.nullness.qual.NonNull;
|
||||
if (!isConnected()) {
|
||||
return;
|
||||
}
|
||||
boolean playerCommandsChanged = !Util.areEqual(playerCommandsFromSession, playerCommands);
|
||||
boolean sessionCommandsChanged = !Util.areEqual(this.sessionCommands, sessionCommands);
|
||||
boolean playerCommandsChanged = !Objects.equals(playerCommandsFromSession, playerCommands);
|
||||
boolean sessionCommandsChanged = !Objects.equals(this.sessionCommands, sessionCommands);
|
||||
if (!playerCommandsChanged && !sessionCommandsChanged) {
|
||||
return;
|
||||
}
|
||||
@ -2854,7 +2854,7 @@ import org.checkerframework.checker.nullness.qual.NonNull;
|
||||
createIntersectedCommandsEnsuringCommandReleaseAvailable(
|
||||
playerCommandsFromSession, playerCommandsFromPlayer);
|
||||
intersectedPlayerCommandsChanged =
|
||||
!Util.areEqual(intersectedPlayerCommands, prevIntersectedPlayerCommands);
|
||||
!Objects.equals(intersectedPlayerCommands, prevIntersectedPlayerCommands);
|
||||
}
|
||||
boolean mediaButtonPreferencesChanged = false;
|
||||
boolean customLayoutChanged = false;
|
||||
@ -2908,7 +2908,7 @@ import org.checkerframework.checker.nullness.qual.NonNull;
|
||||
if (!isConnected()) {
|
||||
return;
|
||||
}
|
||||
if (Util.areEqual(playerCommandsFromPlayer, commandsFromPlayer)) {
|
||||
if (Objects.equals(playerCommandsFromPlayer, commandsFromPlayer)) {
|
||||
return;
|
||||
}
|
||||
playerCommandsFromPlayer = commandsFromPlayer;
|
||||
@ -2917,7 +2917,7 @@ import org.checkerframework.checker.nullness.qual.NonNull;
|
||||
createIntersectedCommandsEnsuringCommandReleaseAvailable(
|
||||
playerCommandsFromSession, playerCommandsFromPlayer);
|
||||
boolean intersectedPlayerCommandsChanged =
|
||||
!Util.areEqual(intersectedPlayerCommands, prevIntersectedPlayerCommands);
|
||||
!Objects.equals(intersectedPlayerCommands, prevIntersectedPlayerCommands);
|
||||
boolean mediaButtonPreferencesChanged = false;
|
||||
boolean customLayoutChanged = false;
|
||||
if (intersectedPlayerCommandsChanged) {
|
||||
|
@ -82,6 +82,7 @@ import com.google.common.util.concurrent.SettableFuture;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
import java.util.concurrent.CancellationException;
|
||||
import java.util.concurrent.ExecutionException;
|
||||
import java.util.concurrent.Future;
|
||||
@ -1672,7 +1673,7 @@ import org.checkerframework.checker.initialization.qual.UnderInitialization;
|
||||
newControllerInfo.playerInfo.timeline,
|
||||
newControllerInfo.playerInfo.timelineChangeReason));
|
||||
}
|
||||
if (!Util.areEqual(oldLegacyPlayerInfo.queueTitle, newLegacyPlayerInfo.queueTitle)) {
|
||||
if (!Objects.equals(oldLegacyPlayerInfo.queueTitle, newLegacyPlayerInfo.queueTitle)) {
|
||||
listeners.queueEvent(
|
||||
Player.EVENT_PLAYLIST_METADATA_CHANGED,
|
||||
(listener) ->
|
||||
|
@ -56,6 +56,7 @@ import com.google.common.util.concurrent.MoreExecutors;
|
||||
import com.google.common.util.concurrent.SettableFuture;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
import java.util.concurrent.CancellationException;
|
||||
import java.util.concurrent.ExecutionException;
|
||||
import java.util.concurrent.Future;
|
||||
@ -625,7 +626,7 @@ import java.util.concurrent.atomic.AtomicReference;
|
||||
synchronized (lock) {
|
||||
for (int i = this.searchRequests.size() - 1; i >= 0; i--) {
|
||||
SearchRequest iter = this.searchRequests.get(i);
|
||||
if (Util.areEqual(remoteUserInfo, iter.remoteUserInfo) && iter.query.equals(query)) {
|
||||
if (Objects.equals(remoteUserInfo, iter.remoteUserInfo) && iter.query.equals(query)) {
|
||||
searchRequests.add(iter);
|
||||
this.searchRequests.remove(i);
|
||||
}
|
||||
@ -695,7 +696,7 @@ import java.util.concurrent.atomic.AtomicReference;
|
||||
return false;
|
||||
}
|
||||
BrowserLegacyCb other = (BrowserLegacyCb) obj;
|
||||
return Util.areEqual(remoteUserInfo, other.remoteUserInfo);
|
||||
return Objects.equals(remoteUserInfo, other.remoteUserInfo);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -62,7 +62,6 @@ import androidx.media3.session.MediaLibraryService.MediaLibrarySession;
|
||||
import androidx.media3.session.legacy.MediaControllerCompat;
|
||||
import androidx.media3.session.legacy.MediaSessionCompat;
|
||||
import androidx.media3.session.legacy.MediaSessionManager.RemoteUserInfo;
|
||||
import com.google.common.base.Objects;
|
||||
import com.google.common.collect.ImmutableList;
|
||||
import com.google.common.primitives.Longs;
|
||||
import com.google.common.util.concurrent.Futures;
|
||||
@ -71,6 +70,7 @@ import com.google.errorprone.annotations.CanIgnoreReturnValue;
|
||||
import com.google.errorprone.annotations.DoNotMock;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
import org.checkerframework.checker.nullness.qual.MonotonicNonNull;
|
||||
|
||||
/**
|
||||
@ -614,7 +614,7 @@ public class MediaSession {
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return Objects.hashCode(controllerCb, remoteUserInfo);
|
||||
return Objects.hash(controllerCb, remoteUserInfo);
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -627,7 +627,7 @@ public class MediaSession {
|
||||
}
|
||||
ControllerInfo other = (ControllerInfo) obj;
|
||||
if (controllerCb != null || other.controllerCb != null) {
|
||||
return Util.areEqual(controllerCb, other.controllerCb);
|
||||
return Objects.equals(controllerCb, other.controllerCb);
|
||||
}
|
||||
return remoteUserInfo.equals(other.remoteUserInfo);
|
||||
}
|
||||
@ -766,7 +766,7 @@ public class MediaSession {
|
||||
/* package */ static MediaSession getSession(Uri sessionUri) {
|
||||
synchronized (STATIC_LOCK) {
|
||||
for (MediaSession session : SESSION_ID_TO_SESSION_MAP.values()) {
|
||||
if (Util.areEqual(session.getUri(), sessionUri)) {
|
||||
if (Objects.equals(session.getUri(), sessionUri)) {
|
||||
return session;
|
||||
}
|
||||
}
|
||||
@ -1814,8 +1814,8 @@ public class MediaSession {
|
||||
MediaItemsWithStartPosition other = (MediaItemsWithStartPosition) obj;
|
||||
|
||||
return mediaItems.equals(other.mediaItems)
|
||||
&& Util.areEqual(startIndex, other.startIndex)
|
||||
&& Util.areEqual(startPositionMs, other.startPositionMs);
|
||||
&& startIndex == other.startIndex
|
||||
&& startPositionMs == other.startPositionMs;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -1029,7 +1029,7 @@ import org.checkerframework.checker.initialization.qual.Initialized;
|
||||
return false;
|
||||
}
|
||||
ControllerLegacyCb other = (ControllerLegacyCb) obj;
|
||||
return Util.areEqual(remoteUserInfo, other.remoteUserInfo);
|
||||
return Objects.equals(remoteUserInfo, other.remoteUserInfo);
|
||||
}
|
||||
}
|
||||
|
||||
@ -1066,18 +1066,18 @@ import org.checkerframework.checker.initialization.qual.Initialized;
|
||||
// can point to the valid current media item in the playlist.
|
||||
Timeline newTimeline = newPlayerWrapper.getCurrentTimelineWithCommandCheck();
|
||||
if (oldPlayerWrapper == null
|
||||
|| !Util.areEqual(oldPlayerWrapper.getCurrentTimelineWithCommandCheck(), newTimeline)) {
|
||||
|| !Objects.equals(oldPlayerWrapper.getCurrentTimelineWithCommandCheck(), newTimeline)) {
|
||||
onTimelineChanged(seq, newTimeline, Player.TIMELINE_CHANGE_REASON_PLAYLIST_CHANGED);
|
||||
}
|
||||
MediaMetadata newPlaylistMetadata = newPlayerWrapper.getPlaylistMetadataWithCommandCheck();
|
||||
if (oldPlayerWrapper == null
|
||||
|| !Util.areEqual(
|
||||
|| !Objects.equals(
|
||||
oldPlayerWrapper.getPlaylistMetadataWithCommandCheck(), newPlaylistMetadata)) {
|
||||
onPlaylistMetadataChanged(seq, newPlaylistMetadata);
|
||||
}
|
||||
MediaMetadata newMediaMetadata = newPlayerWrapper.getMediaMetadataWithCommandCheck();
|
||||
if (oldPlayerWrapper == null
|
||||
|| !Util.areEqual(
|
||||
|| !Objects.equals(
|
||||
oldPlayerWrapper.getMediaMetadataWithCommandCheck(), newMediaMetadata)) {
|
||||
onMediaMetadataChanged(seq, newMediaMetadata);
|
||||
}
|
||||
@ -1101,7 +1101,8 @@ import org.checkerframework.checker.initialization.qual.Initialized;
|
||||
maybeUpdateFlags(newPlayerWrapper);
|
||||
@Nullable MediaItem newMediaItem = newPlayerWrapper.getCurrentMediaItemWithCommandCheck();
|
||||
if (oldPlayerWrapper == null
|
||||
|| !Util.areEqual(oldPlayerWrapper.getCurrentMediaItemWithCommandCheck(), newMediaItem)) {
|
||||
|| !Objects.equals(
|
||||
oldPlayerWrapper.getCurrentMediaItemWithCommandCheck(), newMediaItem)) {
|
||||
// Note: This will update both PlaybackStateCompat and metadata.
|
||||
onMediaItemTransition(
|
||||
seq, newMediaItem, Player.MEDIA_ITEM_TRANSITION_REASON_PLAYLIST_CHANGED);
|
||||
@ -1507,11 +1508,7 @@ import org.checkerframework.checker.initialization.qual.Initialized;
|
||||
|
||||
@Override
|
||||
public void onReceive(Context context, Intent intent) {
|
||||
if (!Util.areEqual(intent.getAction(), Intent.ACTION_MEDIA_BUTTON)) {
|
||||
return;
|
||||
}
|
||||
Uri sessionUri = intent.getData();
|
||||
if (!Util.areEqual(sessionUri, sessionUri)) {
|
||||
if (!Objects.equals(intent.getAction(), Intent.ACTION_MEDIA_BUTTON)) {
|
||||
return;
|
||||
}
|
||||
KeyEvent keyEvent = intent.getParcelableExtra(Intent.EXTRA_KEY_EVENT);
|
||||
|
@ -104,6 +104,7 @@ import java.lang.ref.WeakReference;
|
||||
import java.util.Collections;
|
||||
import java.util.HashSet;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
import java.util.Set;
|
||||
import java.util.concurrent.CancellationException;
|
||||
import java.util.concurrent.ExecutionException;
|
||||
@ -2194,7 +2195,7 @@ import java.util.concurrent.ExecutionException;
|
||||
return false;
|
||||
}
|
||||
Controller2Cb other = (Controller2Cb) obj;
|
||||
return Util.areEqual(getCallbackBinder(), other.getCallbackBinder());
|
||||
return Objects.equals(getCallbackBinder(), other.getCallbackBinder());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -49,8 +49,8 @@ import androidx.media3.common.text.CueGroup;
|
||||
import androidx.media3.common.util.Assertions;
|
||||
import androidx.media3.common.util.UnstableApi;
|
||||
import androidx.media3.common.util.Util;
|
||||
import com.google.common.base.Objects;
|
||||
import com.google.errorprone.annotations.CanIgnoreReturnValue;
|
||||
import java.util.Objects;
|
||||
|
||||
/**
|
||||
* Information about the player that {@link MediaSession} uses to send its state to {@link
|
||||
@ -116,7 +116,7 @@ import com.google.errorprone.annotations.CanIgnoreReturnValue;
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return Objects.hashCode(isTimelineExcluded, areCurrentTracksExcluded);
|
||||
return Objects.hash(isTimelineExcluded, areCurrentTracksExcluded);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -25,10 +25,10 @@ import androidx.media3.common.Timeline;
|
||||
import androidx.media3.common.util.Util;
|
||||
import androidx.media3.session.legacy.MediaMetadataCompat;
|
||||
import androidx.media3.session.legacy.MediaSessionCompat.QueueItem;
|
||||
import com.google.common.base.Objects;
|
||||
import com.google.common.collect.ImmutableList;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
|
||||
/**
|
||||
* An immutable class to represent the current {@link Timeline} backed by {@linkplain QueueItem
|
||||
@ -258,13 +258,13 @@ import java.util.List;
|
||||
return false;
|
||||
}
|
||||
QueueTimeline other = (QueueTimeline) obj;
|
||||
return Objects.equal(queuedMediaItems, other.queuedMediaItems)
|
||||
&& Objects.equal(fakeQueuedMediaItem, other.fakeQueuedMediaItem);
|
||||
return Objects.equals(queuedMediaItems, other.queuedMediaItems)
|
||||
&& Objects.equals(fakeQueuedMediaItem, other.fakeQueuedMediaItem);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return Objects.hashCode(queuedMediaItems, fakeQueuedMediaItem);
|
||||
return Objects.hash(queuedMediaItems, fakeQueuedMediaItem);
|
||||
}
|
||||
|
||||
private QueuedMediaItem getQueuedMediaItem(int index) {
|
||||
|
@ -27,12 +27,12 @@ import androidx.media3.common.Rating;
|
||||
import androidx.media3.common.util.UnstableApi;
|
||||
import androidx.media3.common.util.Util;
|
||||
import androidx.media3.session.MediaLibraryService.LibraryParams;
|
||||
import com.google.common.base.Objects;
|
||||
import com.google.common.collect.ImmutableList;
|
||||
import java.lang.annotation.Documented;
|
||||
import java.lang.annotation.Retention;
|
||||
import java.lang.annotation.RetentionPolicy;
|
||||
import java.lang.annotation.Target;
|
||||
import java.util.Objects;
|
||||
|
||||
/**
|
||||
* A command that a {@link MediaController} can send to a {@link MediaSession}.
|
||||
@ -168,7 +168,7 @@ public final class SessionCommand {
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return Objects.hashCode(customAction, commandCode);
|
||||
return Objects.hash(customAction, commandCode);
|
||||
}
|
||||
|
||||
private static final String FIELD_COMMAND_CODE = Util.intToStringMaxRadix(0);
|
||||
@ -196,5 +196,4 @@ public final class SessionCommand {
|
||||
return new SessionCommand(customAction, customExtras == null ? Bundle.EMPTY : customExtras);
|
||||
}
|
||||
}
|
||||
;
|
||||
}
|
||||
|
@ -24,7 +24,7 @@ import androidx.media3.common.C;
|
||||
import androidx.media3.common.Player;
|
||||
import androidx.media3.common.Player.PositionInfo;
|
||||
import androidx.media3.common.util.Util;
|
||||
import com.google.common.base.Objects;
|
||||
import java.util.Objects;
|
||||
|
||||
/**
|
||||
* Position information to be shared between session and controller.
|
||||
@ -116,7 +116,7 @@ import com.google.common.base.Objects;
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return Objects.hashCode(positionInfo, isPlayingAd);
|
||||
return Objects.hash(positionInfo, isPlayingAd);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -27,7 +27,7 @@ import android.text.TextUtils;
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.core.app.BundleCompat;
|
||||
import androidx.media3.common.util.Util;
|
||||
import com.google.common.base.Objects;
|
||||
import java.util.Objects;
|
||||
|
||||
/* package */ final class SessionTokenImplBase implements SessionToken.SessionTokenImpl {
|
||||
|
||||
@ -112,7 +112,7 @@ import com.google.common.base.Objects;
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return Objects.hashCode(
|
||||
return Objects.hash(
|
||||
uid,
|
||||
type,
|
||||
libraryVersion,
|
||||
@ -136,9 +136,9 @@ import com.google.common.base.Objects;
|
||||
&& interfaceVersion == other.interfaceVersion
|
||||
&& TextUtils.equals(packageName, other.packageName)
|
||||
&& TextUtils.equals(serviceName, other.serviceName)
|
||||
&& Objects.equal(componentName, other.componentName)
|
||||
&& Objects.equal(iSession, other.iSession)
|
||||
&& Objects.equal(platformToken, other.platformToken);
|
||||
&& Objects.equals(componentName, other.componentName)
|
||||
&& Objects.equals(iSession, other.iSession)
|
||||
&& Objects.equals(platformToken, other.platformToken);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -30,7 +30,7 @@ import androidx.annotation.Nullable;
|
||||
import androidx.media3.common.util.Util;
|
||||
import androidx.media3.session.SessionToken.SessionTokenImpl;
|
||||
import androidx.media3.session.legacy.MediaSessionCompat;
|
||||
import com.google.common.base.Objects;
|
||||
import java.util.Objects;
|
||||
|
||||
/* package */ final class SessionTokenImplLegacy implements SessionTokenImpl {
|
||||
|
||||
@ -84,7 +84,7 @@ import com.google.common.base.Objects;
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return Objects.hashCode(type, componentName, legacyToken);
|
||||
return Objects.hash(type, componentName, legacyToken);
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -98,9 +98,9 @@ import com.google.common.base.Objects;
|
||||
}
|
||||
switch (type) {
|
||||
case TYPE_SESSION_LEGACY:
|
||||
return Util.areEqual(legacyToken, other.legacyToken);
|
||||
return Objects.equals(legacyToken, other.legacyToken);
|
||||
case TYPE_BROWSER_SERVICE_LEGACY:
|
||||
return Util.areEqual(componentName, other.componentName);
|
||||
return Objects.equals(componentName, other.componentName);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
@ -35,6 +35,7 @@ import java.io.ByteArrayOutputStream;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.util.Locale;
|
||||
import java.util.Objects;
|
||||
|
||||
/** Provides utility methods for testing purpose. */
|
||||
public class TestUtils {
|
||||
@ -94,7 +95,7 @@ public class TestUtils {
|
||||
return false;
|
||||
}
|
||||
for (String key : b.keySet()) {
|
||||
if (!Util.areEqual(a.get(key), b.get(key))) {
|
||||
if (!Objects.equals(a.get(key), b.get(key))) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
@ -72,6 +72,7 @@ import com.google.common.util.concurrent.ListeningExecutorService;
|
||||
import com.google.common.util.concurrent.MoreExecutors;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
import java.util.concurrent.CountDownLatch;
|
||||
import java.util.concurrent.Executors;
|
||||
import java.util.concurrent.atomic.AtomicReference;
|
||||
@ -153,7 +154,7 @@ public class MediaSessionCallbackWithMediaControllerCompatTest {
|
||||
|
||||
@Override
|
||||
public void onDisconnected(MediaSession session, ControllerInfo controller) {
|
||||
if (Util.areEqual(connectedController, controller)) {
|
||||
if (Objects.equals(connectedController, controller)) {
|
||||
disconnectedLatch.countDown();
|
||||
}
|
||||
}
|
||||
@ -197,7 +198,7 @@ public class MediaSessionCallbackWithMediaControllerCompatTest {
|
||||
|
||||
@Override
|
||||
public void onDisconnected(MediaSession session, ControllerInfo controller) {
|
||||
if (Util.areEqual(connectedController, controller)) {
|
||||
if (Objects.equals(connectedController, controller)) {
|
||||
disconnectedLatch.countDown();
|
||||
}
|
||||
}
|
||||
|
@ -53,6 +53,7 @@ import java.lang.annotation.RetentionPolicy;
|
||||
import java.lang.annotation.Target;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
import java.util.concurrent.TimeoutException;
|
||||
|
||||
/** A mock implementation of {@link Player} for testing. */
|
||||
@ -574,7 +575,7 @@ public class MockPlayer implements Player {
|
||||
}
|
||||
|
||||
public void notifyAvailableCommandsChanged(Commands commands) {
|
||||
if (Util.areEqual(this.commands, commands)) {
|
||||
if (Objects.equals(this.commands, commands)) {
|
||||
return;
|
||||
}
|
||||
this.commands = commands;
|
||||
@ -665,7 +666,7 @@ public class MockPlayer implements Player {
|
||||
}
|
||||
|
||||
public void notifyPlaybackParametersChanged(PlaybackParameters playbackParameters) {
|
||||
if (Util.areEqual(this.playbackParameters, playbackParameters)) {
|
||||
if (Objects.equals(this.playbackParameters, playbackParameters)) {
|
||||
return;
|
||||
}
|
||||
this.playbackParameters = playbackParameters;
|
||||
|
@ -26,6 +26,7 @@ import com.google.common.base.Function;
|
||||
import com.google.errorprone.annotations.CanIgnoreReturnValue;
|
||||
import java.util.Arrays;
|
||||
import java.util.Locale;
|
||||
import java.util.Objects;
|
||||
|
||||
/** Helper utility to dump field values. */
|
||||
@UnstableApi
|
||||
@ -90,7 +91,7 @@ public final class Dumper {
|
||||
@CanIgnoreReturnValue
|
||||
public Dumper addIfNonDefault(
|
||||
String field, @Nullable Object value, @Nullable Object defaultValue) {
|
||||
if (!Util.areEqual(value, defaultValue)) {
|
||||
if (!Objects.equals(value, defaultValue)) {
|
||||
checkNotNull(value);
|
||||
add(field, value);
|
||||
}
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user