本文整理匯總了Java中com.google.android.exoplayer2.source.TrackGroupArray.indexOf方法的典型用法代碼示例。如果您正苦於以下問題:Java TrackGroupArray.indexOf方法的具體用法?Java TrackGroupArray.indexOf怎麽用?Java TrackGroupArray.indexOf使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類com.google.android.exoplayer2.source.TrackGroupArray
的用法示例。
在下文中一共展示了TrackGroupArray.indexOf方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: rendererSupportsTunneling
import com.google.android.exoplayer2.source.TrackGroupArray; //導入方法依賴的package包/類
/**
* Returns whether a renderer supports tunneling for a {@link TrackSelection}.
*
* @param formatSupport The result of {@link RendererCapabilities#supportsFormat} for each
* track, indexed by group index and track index (in that order).
* @param trackGroups The {@link TrackGroupArray}s for the renderer.
* @param selection The track selection.
* @return Whether the renderer supports tunneling for the {@link TrackSelection}.
*/
private static boolean rendererSupportsTunneling(int[][] formatSupport,
TrackGroupArray trackGroups, TrackSelection selection) {
if (selection == null) {
return false;
}
int trackGroupIndex = trackGroups.indexOf(selection.getTrackGroup());
for (int i = 0; i < selection.length(); i++) {
int trackFormatSupport = formatSupport[trackGroupIndex][selection.getIndexInTrackGroup(i)];
if ((trackFormatSupport & RendererCapabilities.TUNNELING_SUPPORT_MASK)
!= RendererCapabilities.TUNNELING_SUPPORTED) {
return false;
}
}
return true;
}