Java Code Examples for com.google.android.exoplayer2.RendererCapabilities#FORMAT_HANDLED

The following examples show how to use com.google.android.exoplayer2.RendererCapabilities#FORMAT_HANDLED . 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: EventLogger.java    From GSYVideoPlayer with Apache License 2.0 6 votes vote down vote up
private static String getFormatSupportString(int formatSupport) {
    switch (formatSupport) {
        case RendererCapabilities.FORMAT_HANDLED:
            return "YES";
        case RendererCapabilities.FORMAT_EXCEEDS_CAPABILITIES:
            return "NO_EXCEEDS_CAPABILITIES";
        case RendererCapabilities.FORMAT_UNSUPPORTED_DRM:
            return "NO_UNSUPPORTED_DRM";
        case RendererCapabilities.FORMAT_UNSUPPORTED_SUBTYPE:
            return "NO_UNSUPPORTED_TYPE";
        case RendererCapabilities.FORMAT_UNSUPPORTED_TYPE:
            return "NO";
        default:
            return "?";
    }
}
 
Example 2
Source File: EventLogger.java    From TelePlus-Android with GNU General Public License v2.0 6 votes vote down vote up
private static String getFormatSupportString(int formatSupport) {
  switch (formatSupport) {
    case RendererCapabilities.FORMAT_HANDLED:
      return "YES";
    case RendererCapabilities.FORMAT_EXCEEDS_CAPABILITIES:
      return "NO_EXCEEDS_CAPABILITIES";
    case RendererCapabilities.FORMAT_UNSUPPORTED_DRM:
      return "NO_UNSUPPORTED_DRM";
    case RendererCapabilities.FORMAT_UNSUPPORTED_SUBTYPE:
      return "NO_UNSUPPORTED_TYPE";
    case RendererCapabilities.FORMAT_UNSUPPORTED_TYPE:
      return "NO";
    default:
      return "?";
  }
}
 
Example 3
Source File: MappingTrackSelector.java    From Telegram with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Returns the extent to which a renderer can play the tracks that are mapped to it.
 *
 * @param rendererIndex The renderer index.
 * @return One of {@link #RENDERER_SUPPORT_PLAYABLE_TRACKS}, {@link
 *     #RENDERER_SUPPORT_EXCEEDS_CAPABILITIES_TRACKS}, {@link
 *     #RENDERER_SUPPORT_UNSUPPORTED_TRACKS} and {@link #RENDERER_SUPPORT_NO_TRACKS}.
 */
public @RendererSupport int getRendererSupport(int rendererIndex) {
  int bestRendererSupport = RENDERER_SUPPORT_NO_TRACKS;
  int[][] rendererFormatSupport = rendererFormatSupports[rendererIndex];
  for (int i = 0; i < rendererFormatSupport.length; i++) {
    for (int j = 0; j < rendererFormatSupport[i].length; j++) {
      int trackRendererSupport;
      switch (rendererFormatSupport[i][j] & RendererCapabilities.FORMAT_SUPPORT_MASK) {
        case RendererCapabilities.FORMAT_HANDLED:
          return RENDERER_SUPPORT_PLAYABLE_TRACKS;
        case RendererCapabilities.FORMAT_EXCEEDS_CAPABILITIES:
          trackRendererSupport = RENDERER_SUPPORT_EXCEEDS_CAPABILITIES_TRACKS;
          break;
        default:
          trackRendererSupport = RENDERER_SUPPORT_UNSUPPORTED_TRACKS;
          break;
      }
      bestRendererSupport = Math.max(bestRendererSupport, trackRendererSupport);
    }
  }
  return bestRendererSupport;
}
 
Example 4
Source File: MappingTrackSelector.java    From Telegram-FOSS with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Returns the extent to which a renderer can play the tracks that are mapped to it.
 *
 * @param rendererIndex The renderer index.
 * @return One of {@link #RENDERER_SUPPORT_PLAYABLE_TRACKS}, {@link
 *     #RENDERER_SUPPORT_EXCEEDS_CAPABILITIES_TRACKS}, {@link
 *     #RENDERER_SUPPORT_UNSUPPORTED_TRACKS} and {@link #RENDERER_SUPPORT_NO_TRACKS}.
 */
public @RendererSupport int getRendererSupport(int rendererIndex) {
  int bestRendererSupport = RENDERER_SUPPORT_NO_TRACKS;
  int[][] rendererFormatSupport = rendererFormatSupports[rendererIndex];
  for (int i = 0; i < rendererFormatSupport.length; i++) {
    for (int j = 0; j < rendererFormatSupport[i].length; j++) {
      int trackRendererSupport;
      switch (rendererFormatSupport[i][j] & RendererCapabilities.FORMAT_SUPPORT_MASK) {
        case RendererCapabilities.FORMAT_HANDLED:
          return RENDERER_SUPPORT_PLAYABLE_TRACKS;
        case RendererCapabilities.FORMAT_EXCEEDS_CAPABILITIES:
          trackRendererSupport = RENDERER_SUPPORT_EXCEEDS_CAPABILITIES_TRACKS;
          break;
        default:
          trackRendererSupport = RENDERER_SUPPORT_UNSUPPORTED_TRACKS;
          break;
      }
      bestRendererSupport = Math.max(bestRendererSupport, trackRendererSupport);
    }
  }
  return bestRendererSupport;
}
 
Example 5
Source File: MappingTrackSelector.java    From TelePlus-Android with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Returns the extent to which a renderer can play the tracks that are mapped to it.
 *
 * @param rendererIndex The renderer index.
 * @return One of {@link #RENDERER_SUPPORT_PLAYABLE_TRACKS}, {@link
 *     #RENDERER_SUPPORT_EXCEEDS_CAPABILITIES_TRACKS}, {@link
 *     #RENDERER_SUPPORT_UNSUPPORTED_TRACKS} and {@link #RENDERER_SUPPORT_NO_TRACKS}.
 */
public @RendererSupport int getRendererSupport(int rendererIndex) {
  int bestRendererSupport = RENDERER_SUPPORT_NO_TRACKS;
  int[][] rendererFormatSupport = rendererFormatSupports[rendererIndex];
  for (int i = 0; i < rendererFormatSupport.length; i++) {
    for (int j = 0; j < rendererFormatSupport[i].length; j++) {
      int trackRendererSupport;
      switch (rendererFormatSupport[i][j] & RendererCapabilities.FORMAT_SUPPORT_MASK) {
        case RendererCapabilities.FORMAT_HANDLED:
          return RENDERER_SUPPORT_PLAYABLE_TRACKS;
        case RendererCapabilities.FORMAT_EXCEEDS_CAPABILITIES:
          trackRendererSupport = RENDERER_SUPPORT_EXCEEDS_CAPABILITIES_TRACKS;
          break;
        default:
          trackRendererSupport = RENDERER_SUPPORT_UNSUPPORTED_TRACKS;
          break;
      }
      bestRendererSupport = Math.max(bestRendererSupport, trackRendererSupport);
    }
  }
  return bestRendererSupport;
}
 
Example 6
Source File: EventLogger.java    From Telegram-FOSS with GNU General Public License v2.0 6 votes vote down vote up
private static String getFormatSupportString(int formatSupport) {
  switch (formatSupport) {
    case RendererCapabilities.FORMAT_HANDLED:
      return "YES";
    case RendererCapabilities.FORMAT_EXCEEDS_CAPABILITIES:
      return "NO_EXCEEDS_CAPABILITIES";
    case RendererCapabilities.FORMAT_UNSUPPORTED_DRM:
      return "NO_UNSUPPORTED_DRM";
    case RendererCapabilities.FORMAT_UNSUPPORTED_SUBTYPE:
      return "NO_UNSUPPORTED_TYPE";
    case RendererCapabilities.FORMAT_UNSUPPORTED_TYPE:
      return "NO";
    default:
      return "?";
  }
}
 
Example 7
Source File: MappingTrackSelector.java    From TelePlus-Android with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Finds the renderer to which the provided {@link TrackGroup} should be mapped.
 * <p>
 * A {@link TrackGroup} is mapped to the renderer that reports the highest of (listed in
 * decreasing order of support) {@link RendererCapabilities#FORMAT_HANDLED},
 * {@link RendererCapabilities#FORMAT_EXCEEDS_CAPABILITIES},
 * {@link RendererCapabilities#FORMAT_UNSUPPORTED_DRM} and
 * {@link RendererCapabilities#FORMAT_UNSUPPORTED_SUBTYPE}. In the case that two or more renderers
 * report the same level of support, the renderer with the lowest index is associated.
 * <p>
 * If all renderers report {@link RendererCapabilities#FORMAT_UNSUPPORTED_TYPE} for all of the
 * tracks in the group, then {@code renderers.length} is returned to indicate that the group was
 * not mapped to any renderer.
 *
 * @param rendererCapabilities The {@link RendererCapabilities} of the renderers.
 * @param group The track group to map to a renderer.
 * @return The index of the renderer to which the track group was mapped, or
 *     {@code renderers.length} if it was not mapped to any renderer.
 * @throws ExoPlaybackException If an error occurs finding a renderer.
 */
private static int findRenderer(RendererCapabilities[] rendererCapabilities, TrackGroup group)
    throws ExoPlaybackException {
  int bestRendererIndex = rendererCapabilities.length;
  int bestFormatSupportLevel = RendererCapabilities.FORMAT_UNSUPPORTED_TYPE;
  for (int rendererIndex = 0; rendererIndex < rendererCapabilities.length; rendererIndex++) {
    RendererCapabilities rendererCapability = rendererCapabilities[rendererIndex];
    for (int trackIndex = 0; trackIndex < group.length; trackIndex++) {
      int formatSupportLevel = rendererCapability.supportsFormat(group.getFormat(trackIndex))
          & RendererCapabilities.FORMAT_SUPPORT_MASK;
      if (formatSupportLevel > bestFormatSupportLevel) {
        bestRendererIndex = rendererIndex;
        bestFormatSupportLevel = formatSupportLevel;
        if (bestFormatSupportLevel == RendererCapabilities.FORMAT_HANDLED) {
          // We can't do better.
          return bestRendererIndex;
        }
      }
    }
  }
  return bestRendererIndex;
}
 
Example 8
Source File: MappingTrackSelector.java    From K-Sonic with MIT License 6 votes vote down vote up
/**
 * Returns the extent to which a renderer can support playback of the tracks associated to it.
 *
 * @param rendererIndex The renderer index.
 * @return One of {@link #RENDERER_SUPPORT_PLAYABLE_TRACKS},
 *     {@link #RENDERER_SUPPORT_EXCEEDS_CAPABILITIES_TRACKS},
 *     {@link #RENDERER_SUPPORT_UNSUPPORTED_TRACKS} and {@link #RENDERER_SUPPORT_NO_TRACKS}.
 */
public int getRendererSupport(int rendererIndex) {
  int bestRendererSupport = RENDERER_SUPPORT_NO_TRACKS;
  int[][] rendererFormatSupport = formatSupport[rendererIndex];
  for (int i = 0; i < rendererFormatSupport.length; i++) {
    for (int j = 0; j < rendererFormatSupport[i].length; j++) {
      int trackRendererSupport;
      switch (rendererFormatSupport[i][j] & RendererCapabilities.FORMAT_SUPPORT_MASK) {
        case RendererCapabilities.FORMAT_HANDLED:
          return RENDERER_SUPPORT_PLAYABLE_TRACKS;
        case RendererCapabilities.FORMAT_EXCEEDS_CAPABILITIES:
          trackRendererSupport = RENDERER_SUPPORT_EXCEEDS_CAPABILITIES_TRACKS;
          break;
        default:
          trackRendererSupport = RENDERER_SUPPORT_UNSUPPORTED_TRACKS;
          break;
      }
      bestRendererSupport = Math.max(bestRendererSupport, trackRendererSupport);
    }
  }
  return bestRendererSupport;
}
 
Example 9
Source File: EventLogger.java    From PowerFileExplorer with GNU General Public License v3.0 5 votes vote down vote up
private static String getFormatSupportString(int formatSupport) {
  switch (formatSupport) {
    case RendererCapabilities.FORMAT_HANDLED:
      return "YES";
    case RendererCapabilities.FORMAT_EXCEEDS_CAPABILITIES:
      return "NO_EXCEEDS_CAPABILITIES";
    case RendererCapabilities.FORMAT_UNSUPPORTED_SUBTYPE:
      return "NO_UNSUPPORTED_TYPE";
    case RendererCapabilities.FORMAT_UNSUPPORTED_TYPE:
      return "NO";
    default:
      return "?";
  }
}
 
Example 10
Source File: EventLogger.java    From mimi-reader with Apache License 2.0 5 votes vote down vote up
private static String getFormatSupportString(int formatSupport) {
    switch (formatSupport) {
        case RendererCapabilities.FORMAT_HANDLED:
            return "YES";
        case RendererCapabilities.FORMAT_EXCEEDS_CAPABILITIES:
            return "NO_EXCEEDS_CAPABILITIES";
        case RendererCapabilities.FORMAT_UNSUPPORTED_SUBTYPE:
            return "NO_UNSUPPORTED_TYPE";
        case RendererCapabilities.FORMAT_UNSUPPORTED_TYPE:
            return "NO";
        default:
            return "?";
    }
}
 
Example 11
Source File: TrackSelectionHelper.java    From leafpicrevived with GNU General Public License v3.0 5 votes vote down vote up
@SuppressLint("InflateParams")
private View buildView(LayoutInflater inflater) {
    View view = inflater.inflate(R.layout.track_selection_dialog, null);
    ViewGroup root = view.findViewById(R.id.root);

    trackViews = new CheckedTextView[trackGroups.length][];
    for (int groupIndex = 0; groupIndex < trackGroups.length; groupIndex++) {
        TrackGroup group = trackGroups.get(groupIndex);
        boolean groupIsAdaptive = trackGroupsAdaptive[groupIndex];
        trackViews[groupIndex] = new CheckedTextView[group.length];
        for (int trackIndex = 0; trackIndex < group.length; trackIndex++) {
            if (trackIndex == 0) {
                root.addView(inflater.inflate(R.layout.list_divider, root, false));
            }
            int trackViewLayoutId = groupIsAdaptive ? android.R.layout.simple_list_item_multiple_choice
                    : android.R.layout.simple_list_item_single_choice;
            CheckedTextView trackView = (CheckedTextView) inflater.inflate(
                    trackViewLayoutId, root, false);
            trackView.setText(buildTrackName(group.getFormat(trackIndex)));
            if (trackInfo.getTrackFormatSupport(rendererIndex, groupIndex, trackIndex)
                    == RendererCapabilities.FORMAT_HANDLED) {
                trackView.setFocusable(true);
                trackView.setTag(Pair.create(groupIndex, trackIndex));
                trackView.setOnClickListener(this);
            } else {
                trackView.setFocusable(false);
                trackView.setEnabled(false);
            }
            trackViews[groupIndex][trackIndex] = trackView;
            root.addView(trackView);
        }
    }

    updateViews();
    return view;
}
 
Example 12
Source File: EventLogger.java    From LiveVideoBroadcaster with Apache License 2.0 5 votes vote down vote up
private static String getFormatSupportString(int formatSupport) {
  switch (formatSupport) {
    case RendererCapabilities.FORMAT_HANDLED:
      return "YES";
    case RendererCapabilities.FORMAT_EXCEEDS_CAPABILITIES:
      return "NO_EXCEEDS_CAPABILITIES";
    case RendererCapabilities.FORMAT_UNSUPPORTED_SUBTYPE:
      return "NO_UNSUPPORTED_TYPE";
    case RendererCapabilities.FORMAT_UNSUPPORTED_TYPE:
      return "NO";
    default:
      return "?";
  }
}
 
Example 13
Source File: MappingTrackSelector.java    From MediaSDK with Apache License 2.0 5 votes vote down vote up
/**
 * Returns the extent to which a renderer can play the tracks that are mapped to it.
 *
 * @param rendererIndex The renderer index.
 * @return The {@link RendererSupport}.
 */
@RendererSupport
public int getRendererSupport(int rendererIndex) {
  @RendererSupport int bestRendererSupport = RENDERER_SUPPORT_NO_TRACKS;
  @Capabilities int[][] rendererFormatSupport = rendererFormatSupports[rendererIndex];
  for (@Capabilities int[] trackGroupFormatSupport : rendererFormatSupport) {
    for (@Capabilities int trackFormatSupport : trackGroupFormatSupport) {
      int trackRendererSupport;
      switch (RendererCapabilities.getFormatSupport(trackFormatSupport)) {
        case RendererCapabilities.FORMAT_HANDLED:
          return RENDERER_SUPPORT_PLAYABLE_TRACKS;
        case RendererCapabilities.FORMAT_EXCEEDS_CAPABILITIES:
          trackRendererSupport = RENDERER_SUPPORT_EXCEEDS_CAPABILITIES_TRACKS;
          break;
        case RendererCapabilities.FORMAT_UNSUPPORTED_TYPE:
        case RendererCapabilities.FORMAT_UNSUPPORTED_SUBTYPE:
        case RendererCapabilities.FORMAT_UNSUPPORTED_DRM:
          trackRendererSupport = RENDERER_SUPPORT_UNSUPPORTED_TRACKS;
          break;
        default:
          throw new IllegalStateException();
      }
      bestRendererSupport = Math.max(bestRendererSupport, trackRendererSupport);
    }
  }
  return bestRendererSupport;
}
 
Example 14
Source File: DashTest.java    From ExoPlayer-Offline with Apache License 2.0 4 votes vote down vote up
private static boolean isFormatHandled(int formatSupport) {
  return (formatSupport & RendererCapabilities.FORMAT_SUPPORT_MASK)
      == RendererCapabilities.FORMAT_HANDLED;
}
 
Example 15
Source File: MappingTrackSelector.java    From TelePlus-Android with GNU General Public License v2.0 4 votes vote down vote up
/**
 * Returns the extent to which a renderer supports adaptation between supported tracks in a
 * specified {@link TrackGroup}.
 *
 * <p>Tracks for which {@link #getTrackSupport(int, int, int)} returns {@link
 * RendererCapabilities#FORMAT_HANDLED} are always considered. Tracks for which {@link
 * #getTrackSupport(int, int, int)} returns {@link
 * RendererCapabilities#FORMAT_EXCEEDS_CAPABILITIES} are also considered if {@code
 * includeCapabilitiesExceededTracks} is set to {@code true}. Tracks for which {@link
 * #getTrackSupport(int, int, int)} returns {@link RendererCapabilities#FORMAT_UNSUPPORTED_DRM},
 * {@link RendererCapabilities#FORMAT_UNSUPPORTED_TYPE} or {@link
 * RendererCapabilities#FORMAT_UNSUPPORTED_SUBTYPE} are never considered.
 *
 * @param rendererIndex The renderer index.
 * @param groupIndex The index of the track group.
 * @param includeCapabilitiesExceededTracks Whether tracks that exceed the capabilities of the
 *     renderer are included when determining support.
 * @return One of {@link RendererCapabilities#ADAPTIVE_SEAMLESS}, {@link
 *     RendererCapabilities#ADAPTIVE_NOT_SEAMLESS} and {@link
 *     RendererCapabilities#ADAPTIVE_NOT_SUPPORTED}.
 */
public int getAdaptiveSupport(
    int rendererIndex, int groupIndex, boolean includeCapabilitiesExceededTracks) {
  int trackCount = rendererTrackGroups[rendererIndex].get(groupIndex).length;
  // Iterate over the tracks in the group, recording the indices of those to consider.
  int[] trackIndices = new int[trackCount];
  int trackIndexCount = 0;
  for (int i = 0; i < trackCount; i++) {
    int fixedSupport = getTrackSupport(rendererIndex, groupIndex, i);
    if (fixedSupport == RendererCapabilities.FORMAT_HANDLED
        || (includeCapabilitiesExceededTracks
        && fixedSupport == RendererCapabilities.FORMAT_EXCEEDS_CAPABILITIES)) {
      trackIndices[trackIndexCount++] = i;
    }
  }
  trackIndices = Arrays.copyOf(trackIndices, trackIndexCount);
  return getAdaptiveSupport(rendererIndex, groupIndex, trackIndices);
}
 
Example 16
Source File: MappingTrackSelector.java    From Telegram-FOSS with GNU General Public License v2.0 4 votes vote down vote up
/**
 * Returns the extent to which a renderer supports adaptation between supported tracks in a
 * specified {@link TrackGroup}.
 *
 * <p>Tracks for which {@link #getTrackSupport(int, int, int)} returns {@link
 * RendererCapabilities#FORMAT_HANDLED} are always considered. Tracks for which {@link
 * #getTrackSupport(int, int, int)} returns {@link
 * RendererCapabilities#FORMAT_EXCEEDS_CAPABILITIES} are also considered if {@code
 * includeCapabilitiesExceededTracks} is set to {@code true}. Tracks for which {@link
 * #getTrackSupport(int, int, int)} returns {@link RendererCapabilities#FORMAT_UNSUPPORTED_DRM},
 * {@link RendererCapabilities#FORMAT_UNSUPPORTED_TYPE} or {@link
 * RendererCapabilities#FORMAT_UNSUPPORTED_SUBTYPE} are never considered.
 *
 * @param rendererIndex The renderer index.
 * @param groupIndex The index of the track group.
 * @param includeCapabilitiesExceededTracks Whether tracks that exceed the capabilities of the
 *     renderer are included when determining support.
 * @return One of {@link RendererCapabilities#ADAPTIVE_SEAMLESS}, {@link
 *     RendererCapabilities#ADAPTIVE_NOT_SEAMLESS} and {@link
 *     RendererCapabilities#ADAPTIVE_NOT_SUPPORTED}.
 */
public int getAdaptiveSupport(
    int rendererIndex, int groupIndex, boolean includeCapabilitiesExceededTracks) {
  int trackCount = rendererTrackGroups[rendererIndex].get(groupIndex).length;
  // Iterate over the tracks in the group, recording the indices of those to consider.
  int[] trackIndices = new int[trackCount];
  int trackIndexCount = 0;
  for (int i = 0; i < trackCount; i++) {
    int fixedSupport = getTrackSupport(rendererIndex, groupIndex, i);
    if (fixedSupport == RendererCapabilities.FORMAT_HANDLED
        || (includeCapabilitiesExceededTracks
        && fixedSupport == RendererCapabilities.FORMAT_EXCEEDS_CAPABILITIES)) {
      trackIndices[trackIndexCount++] = i;
    }
  }
  trackIndices = Arrays.copyOf(trackIndices, trackIndexCount);
  return getAdaptiveSupport(rendererIndex, groupIndex, trackIndices);
}
 
Example 17
Source File: MappingTrackSelector.java    From TelePlus-Android with GNU General Public License v2.0 4 votes vote down vote up
/**
 * Returns the extent to which a renderer supports adaptation between supported tracks in a
 * specified {@link TrackGroup}.
 *
 * <p>Tracks for which {@link #getTrackSupport(int, int, int)} returns {@link
 * RendererCapabilities#FORMAT_HANDLED} are always considered. Tracks for which {@link
 * #getTrackSupport(int, int, int)} returns {@link
 * RendererCapabilities#FORMAT_EXCEEDS_CAPABILITIES} are also considered if {@code
 * includeCapabilitiesExceededTracks} is set to {@code true}. Tracks for which {@link
 * #getTrackSupport(int, int, int)} returns {@link RendererCapabilities#FORMAT_UNSUPPORTED_DRM},
 * {@link RendererCapabilities#FORMAT_UNSUPPORTED_TYPE} or {@link
 * RendererCapabilities#FORMAT_UNSUPPORTED_SUBTYPE} are never considered.
 *
 * @param rendererIndex The renderer index.
 * @param groupIndex The index of the track group.
 * @param includeCapabilitiesExceededTracks Whether tracks that exceed the capabilities of the
 *     renderer are included when determining support.
 * @return One of {@link RendererCapabilities#ADAPTIVE_SEAMLESS}, {@link
 *     RendererCapabilities#ADAPTIVE_NOT_SEAMLESS} and {@link
 *     RendererCapabilities#ADAPTIVE_NOT_SUPPORTED}.
 */
public int getAdaptiveSupport(
    int rendererIndex, int groupIndex, boolean includeCapabilitiesExceededTracks) {
  int trackCount = rendererTrackGroups[rendererIndex].get(groupIndex).length;
  // Iterate over the tracks in the group, recording the indices of those to consider.
  int[] trackIndices = new int[trackCount];
  int trackIndexCount = 0;
  for (int i = 0; i < trackCount; i++) {
    int fixedSupport = getTrackSupport(rendererIndex, groupIndex, i);
    if (fixedSupport == RendererCapabilities.FORMAT_HANDLED
        || (includeCapabilitiesExceededTracks
        && fixedSupport == RendererCapabilities.FORMAT_EXCEEDS_CAPABILITIES)) {
      trackIndices[trackIndexCount++] = i;
    }
  }
  trackIndices = Arrays.copyOf(trackIndices, trackIndexCount);
  return getAdaptiveSupport(rendererIndex, groupIndex, trackIndices);
}
 
Example 18
Source File: DefaultTrackSelector.java    From K-Sonic with MIT License 4 votes vote down vote up
protected static boolean isSupported(int formatSupport, boolean allowExceedsCapabilities) {
  int maskedSupport = formatSupport & RendererCapabilities.FORMAT_SUPPORT_MASK;
  return maskedSupport == RendererCapabilities.FORMAT_HANDLED || (allowExceedsCapabilities
      && maskedSupport == RendererCapabilities.FORMAT_EXCEEDS_CAPABILITIES);
}
 
Example 19
Source File: DefaultTrackSelector.java    From Telegram-FOSS with GNU General Public License v2.0 2 votes vote down vote up
/**
 * Applies the {@link RendererCapabilities#FORMAT_SUPPORT_MASK} to a value obtained from
 * {@link RendererCapabilities#supportsFormat(Format)}, returning true if the result is
 * {@link RendererCapabilities#FORMAT_HANDLED} or if {@code allowExceedsCapabilities} is set
 * and the result is {@link RendererCapabilities#FORMAT_EXCEEDS_CAPABILITIES}.
 *
 * @param formatSupport A value obtained from {@link RendererCapabilities#supportsFormat(Format)}.
 * @param allowExceedsCapabilities Whether to return true if the format support component of the
 *     value is {@link RendererCapabilities#FORMAT_EXCEEDS_CAPABILITIES}.
 * @return True if the format support component is {@link RendererCapabilities#FORMAT_HANDLED}, or
 *     if {@code allowExceedsCapabilities} is set and the format support component is
 *     {@link RendererCapabilities#FORMAT_EXCEEDS_CAPABILITIES}.
 */
protected static boolean isSupported(int formatSupport, boolean allowExceedsCapabilities) {
  int maskedSupport = formatSupport & RendererCapabilities.FORMAT_SUPPORT_MASK;
  return maskedSupport == RendererCapabilities.FORMAT_HANDLED || (allowExceedsCapabilities
      && maskedSupport == RendererCapabilities.FORMAT_EXCEEDS_CAPABILITIES);
}
 
Example 20
Source File: DefaultTrackSelector.java    From Telegram with GNU General Public License v2.0 2 votes vote down vote up
/**
 * Applies the {@link RendererCapabilities#FORMAT_SUPPORT_MASK} to a value obtained from
 * {@link RendererCapabilities#supportsFormat(Format)}, returning true if the result is
 * {@link RendererCapabilities#FORMAT_HANDLED} or if {@code allowExceedsCapabilities} is set
 * and the result is {@link RendererCapabilities#FORMAT_EXCEEDS_CAPABILITIES}.
 *
 * @param formatSupport A value obtained from {@link RendererCapabilities#supportsFormat(Format)}.
 * @param allowExceedsCapabilities Whether to return true if the format support component of the
 *     value is {@link RendererCapabilities#FORMAT_EXCEEDS_CAPABILITIES}.
 * @return True if the format support component is {@link RendererCapabilities#FORMAT_HANDLED}, or
 *     if {@code allowExceedsCapabilities} is set and the format support component is
 *     {@link RendererCapabilities#FORMAT_EXCEEDS_CAPABILITIES}.
 */
protected static boolean isSupported(int formatSupport, boolean allowExceedsCapabilities) {
  int maskedSupport = formatSupport & RendererCapabilities.FORMAT_SUPPORT_MASK;
  return maskedSupport == RendererCapabilities.FORMAT_HANDLED || (allowExceedsCapabilities
      && maskedSupport == RendererCapabilities.FORMAT_EXCEEDS_CAPABILITIES);
}