Java Code Examples for com.google.android.exoplayer2.util.Util#compareLong()

The following examples show how to use com.google.android.exoplayer2.util.Util#compareLong() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: ExoPlayerImplInternal.java    From MediaSDK with Apache License 2.0 6 votes vote down vote up
@Override
public int compareTo(PendingMessageInfo other) {
  if ((resolvedPeriodUid == null) != (other.resolvedPeriodUid == null)) {
    // PendingMessageInfos with a resolved period position are always smaller.
    return resolvedPeriodUid != null ? -1 : 1;
  }
  if (resolvedPeriodUid == null) {
    // Don't sort message with unresolved positions.
    return 0;
  }
  // Sort resolved media times by period index and then by period position.
  int comparePeriodIndex = resolvedPeriodIndex - other.resolvedPeriodIndex;
  if (comparePeriodIndex != 0) {
    return comparePeriodIndex;
  }
  return Util.compareLong(resolvedPeriodTimeUs, other.resolvedPeriodTimeUs);
}
 
Example 2
Source File: ExoPlayerImplInternal.java    From TelePlus-Android with GNU General Public License v2.0 6 votes vote down vote up
@Override
public int compareTo(@NonNull PendingMessageInfo other) {
  if ((resolvedPeriodUid == null) != (other.resolvedPeriodUid == null)) {
    // PendingMessageInfos with a resolved period position are always smaller.
    return resolvedPeriodUid != null ? -1 : 1;
  }
  if (resolvedPeriodUid == null) {
    // Don't sort message with unresolved positions.
    return 0;
  }
  // Sort resolved media times by period index and then by period position.
  int comparePeriodIndex = resolvedPeriodIndex - other.resolvedPeriodIndex;
  if (comparePeriodIndex != 0) {
    return comparePeriodIndex;
  }
  return Util.compareLong(resolvedPeriodTimeUs, other.resolvedPeriodTimeUs);
}
 
Example 3
Source File: ExoPlayerImplInternal.java    From TelePlus-Android with GNU General Public License v2.0 6 votes vote down vote up
@Override
public int compareTo(@NonNull PendingMessageInfo other) {
  if ((resolvedPeriodUid == null) != (other.resolvedPeriodUid == null)) {
    // PendingMessageInfos with a resolved period position are always smaller.
    return resolvedPeriodUid != null ? -1 : 1;
  }
  if (resolvedPeriodUid == null) {
    // Don't sort message with unresolved positions.
    return 0;
  }
  // Sort resolved media times by period index and then by period position.
  int comparePeriodIndex = resolvedPeriodIndex - other.resolvedPeriodIndex;
  if (comparePeriodIndex != 0) {
    return comparePeriodIndex;
  }
  return Util.compareLong(resolvedPeriodTimeUs, other.resolvedPeriodTimeUs);
}
 
Example 4
Source File: ExoPlayerImplInternal.java    From Telegram-FOSS with GNU General Public License v2.0 6 votes vote down vote up
@Override
public int compareTo(@NonNull PendingMessageInfo other) {
  if ((resolvedPeriodUid == null) != (other.resolvedPeriodUid == null)) {
    // PendingMessageInfos with a resolved period position are always smaller.
    return resolvedPeriodUid != null ? -1 : 1;
  }
  if (resolvedPeriodUid == null) {
    // Don't sort message with unresolved positions.
    return 0;
  }
  // Sort resolved media times by period index and then by period position.
  int comparePeriodIndex = resolvedPeriodIndex - other.resolvedPeriodIndex;
  if (comparePeriodIndex != 0) {
    return comparePeriodIndex;
  }
  return Util.compareLong(resolvedPeriodTimeUs, other.resolvedPeriodTimeUs);
}
 
Example 5
Source File: ExoPlayerImplInternal.java    From Telegram with GNU General Public License v2.0 6 votes vote down vote up
@Override
public int compareTo(@NonNull PendingMessageInfo other) {
  if ((resolvedPeriodUid == null) != (other.resolvedPeriodUid == null)) {
    // PendingMessageInfos with a resolved period position are always smaller.
    return resolvedPeriodUid != null ? -1 : 1;
  }
  if (resolvedPeriodUid == null) {
    // Don't sort message with unresolved positions.
    return 0;
  }
  // Sort resolved media times by period index and then by period position.
  int comparePeriodIndex = resolvedPeriodIndex - other.resolvedPeriodIndex;
  if (comparePeriodIndex != 0) {
    return comparePeriodIndex;
  }
  return Util.compareLong(resolvedPeriodTimeUs, other.resolvedPeriodTimeUs);
}
 
Example 6
Source File: SegmentDownloader.java    From MediaSDK with Apache License 2.0 4 votes vote down vote up
@Override
public int compareTo(Segment other) {
  return Util.compareLong(startTimeUs, other.startTimeUs);
}
 
Example 7
Source File: DownloadManager.java    From MediaSDK with Apache License 2.0 4 votes vote down vote up
private static int compareStartTimes(Download first, Download second) {
  return Util.compareLong(first.startTimeMs, second.startTimeMs);
}
 
Example 8
Source File: CachedRegionTracker.java    From MediaSDK with Apache License 2.0 4 votes vote down vote up
@Override
public int compareTo(@NonNull Region another) {
  return Util.compareLong(startOffset, another.startOffset);
}
 
Example 9
Source File: SegmentDownloader.java    From Telegram-FOSS with GNU General Public License v2.0 4 votes vote down vote up
@Override
public int compareTo(@NonNull Segment other) {
  return Util.compareLong(startTimeUs, other.startTimeUs);
}
 
Example 10
Source File: DownloadManager.java    From Telegram-FOSS with GNU General Public License v2.0 4 votes vote down vote up
private static int compareStartTimes(Download first, Download second) {
  return Util.compareLong(first.startTimeMs, second.startTimeMs);
}
 
Example 11
Source File: CachedRegionTracker.java    From Telegram-FOSS with GNU General Public License v2.0 4 votes vote down vote up
@Override
public int compareTo(@NonNull Region another) {
  return Util.compareLong(startOffset, another.startOffset);
}
 
Example 12
Source File: SegmentDownloader.java    From Telegram with GNU General Public License v2.0 4 votes vote down vote up
@Override
public int compareTo(@NonNull Segment other) {
  return Util.compareLong(startTimeUs, other.startTimeUs);
}
 
Example 13
Source File: DownloadManager.java    From Telegram with GNU General Public License v2.0 4 votes vote down vote up
private static int compareStartTimes(Download first, Download second) {
  return Util.compareLong(first.startTimeMs, second.startTimeMs);
}
 
Example 14
Source File: CachedRegionTracker.java    From Telegram with GNU General Public License v2.0 4 votes vote down vote up
@Override
public int compareTo(@NonNull Region another) {
  return Util.compareLong(startOffset, another.startOffset);
}