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

The following examples show how to use com.google.android.exoplayer2.util.Util#getRendererCapabilities() . 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: DownloadHelper.java    From MediaSDK with Apache License 2.0 6 votes vote down vote up
/**
 * Creates a {@link DownloadHelper} for DASH streams.
 *
 * @param uri A manifest {@link Uri}.
 * @param dataSourceFactory A {@link DataSource.Factory} used to load the manifest.
 * @param renderersFactory A {@link RenderersFactory} creating the renderers for which tracks are
 *     selected.
 * @param drmSessionManager An optional {@link DrmSessionManager} used by the renderers created by
 *     {@code renderersFactory}.
 * @param trackSelectorParameters {@link DefaultTrackSelector.Parameters} for selecting tracks for
 *     downloading.
 * @return A {@link DownloadHelper} for DASH streams.
 * @throws IllegalStateException If the DASH module is missing.
 */
public static DownloadHelper forDash(
    Uri uri,
    DataSource.Factory dataSourceFactory,
    RenderersFactory renderersFactory,
    @Nullable DrmSessionManager<FrameworkMediaCrypto> drmSessionManager,
    DefaultTrackSelector.Parameters trackSelectorParameters) {
  return new DownloadHelper(
      DownloadRequest.TYPE_DASH,
      uri,
      /* cacheKey= */ null,
      createMediaSourceInternal(
          DASH_FACTORY_CONSTRUCTOR, uri, dataSourceFactory, /* streamKeys= */ null),
      trackSelectorParameters,
      Util.getRendererCapabilities(renderersFactory, drmSessionManager));
}
 
Example 2
Source File: DownloadHelper.java    From MediaSDK with Apache License 2.0 6 votes vote down vote up
/**
 * Creates a {@link DownloadHelper} for HLS streams.
 *
 * @param uri A playlist {@link Uri}.
 * @param dataSourceFactory A {@link DataSource.Factory} used to load the playlist.
 * @param renderersFactory A {@link RenderersFactory} creating the renderers for which tracks are
 *     selected.
 * @param drmSessionManager An optional {@link DrmSessionManager} used by the renderers created by
 *     {@code renderersFactory}.
 * @param trackSelectorParameters {@link DefaultTrackSelector.Parameters} for selecting tracks for
 *     downloading.
 * @return A {@link DownloadHelper} for HLS streams.
 * @throws IllegalStateException If the HLS module is missing.
 */
public static DownloadHelper forHls(
    Uri uri,
    DataSource.Factory dataSourceFactory,
    RenderersFactory renderersFactory,
    @Nullable DrmSessionManager<FrameworkMediaCrypto> drmSessionManager,
    DefaultTrackSelector.Parameters trackSelectorParameters) {
  return new DownloadHelper(
      DownloadRequest.TYPE_HLS,
      uri,
      /* cacheKey= */ null,
      createMediaSourceInternal(
          HLS_FACTORY_CONSTRUCTOR, uri, dataSourceFactory, /* streamKeys= */ null),
      trackSelectorParameters,
      Util.getRendererCapabilities(renderersFactory, drmSessionManager));
}
 
Example 3
Source File: DownloadHelper.java    From MediaSDK with Apache License 2.0 6 votes vote down vote up
/**
 * Creates a {@link DownloadHelper} for SmoothStreaming streams.
 *
 * @param uri A manifest {@link Uri}.
 * @param dataSourceFactory A {@link DataSource.Factory} used to load the manifest.
 * @param renderersFactory A {@link RenderersFactory} creating the renderers for which tracks are
 *     selected.
 * @param drmSessionManager An optional {@link DrmSessionManager} used by the renderers created by
 *     {@code renderersFactory}.
 * @param trackSelectorParameters {@link DefaultTrackSelector.Parameters} for selecting tracks for
 *     downloading.
 * @return A {@link DownloadHelper} for SmoothStreaming streams.
 * @throws IllegalStateException If the SmoothStreaming module is missing.
 */
public static DownloadHelper forSmoothStreaming(
    Uri uri,
    DataSource.Factory dataSourceFactory,
    RenderersFactory renderersFactory,
    @Nullable DrmSessionManager<FrameworkMediaCrypto> drmSessionManager,
    DefaultTrackSelector.Parameters trackSelectorParameters) {
  return new DownloadHelper(
      DownloadRequest.TYPE_SS,
      uri,
      /* cacheKey= */ null,
      createMediaSourceInternal(
          SS_FACTORY_CONSTRUCTOR, uri, dataSourceFactory, /* streamKeys= */ null),
      trackSelectorParameters,
      Util.getRendererCapabilities(renderersFactory, drmSessionManager));
}
 
Example 4
Source File: DownloadHelper.java    From Telegram-FOSS with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Creates a {@link DownloadHelper} for DASH streams.
 *
 * @param uri A manifest {@link Uri}.
 * @param dataSourceFactory A {@link DataSource.Factory} used to load the manifest.
 * @param renderersFactory A {@link RenderersFactory} creating the renderers for which tracks are
 *     selected.
 * @param drmSessionManager An optional {@link DrmSessionManager} used by the renderers created by
 *     {@code renderersFactory}.
 * @param trackSelectorParameters {@link DefaultTrackSelector.Parameters} for selecting tracks for
 *     downloading.
 * @return A {@link DownloadHelper} for DASH streams.
 * @throws IllegalStateException If the DASH module is missing.
 */
public static DownloadHelper forDash(
    Uri uri,
    DataSource.Factory dataSourceFactory,
    RenderersFactory renderersFactory,
    @Nullable DrmSessionManager<FrameworkMediaCrypto> drmSessionManager,
    DefaultTrackSelector.Parameters trackSelectorParameters) {
  return new DownloadHelper(
      DownloadRequest.TYPE_DASH,
      uri,
      /* cacheKey= */ null,
      DASH_FACTORY.createMediaSource(uri, dataSourceFactory, /* streamKeys= */ null),
      trackSelectorParameters,
      Util.getRendererCapabilities(renderersFactory, drmSessionManager));
}
 
Example 5
Source File: DownloadHelper.java    From Telegram-FOSS with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Creates a {@link DownloadHelper} for HLS streams.
 *
 * @param uri A playlist {@link Uri}.
 * @param dataSourceFactory A {@link DataSource.Factory} used to load the playlist.
 * @param renderersFactory A {@link RenderersFactory} creating the renderers for which tracks are
 *     selected.
 * @param drmSessionManager An optional {@link DrmSessionManager} used by the renderers created by
 *     {@code renderersFactory}.
 * @param trackSelectorParameters {@link DefaultTrackSelector.Parameters} for selecting tracks for
 *     downloading.
 * @return A {@link DownloadHelper} for HLS streams.
 * @throws IllegalStateException If the HLS module is missing.
 */
public static DownloadHelper forHls(
    Uri uri,
    DataSource.Factory dataSourceFactory,
    RenderersFactory renderersFactory,
    @Nullable DrmSessionManager<FrameworkMediaCrypto> drmSessionManager,
    DefaultTrackSelector.Parameters trackSelectorParameters) {
  return new DownloadHelper(
      DownloadRequest.TYPE_HLS,
      uri,
      /* cacheKey= */ null,
      HLS_FACTORY.createMediaSource(uri, dataSourceFactory, /* streamKeys= */ null),
      trackSelectorParameters,
      Util.getRendererCapabilities(renderersFactory, drmSessionManager));
}
 
Example 6
Source File: DownloadHelper.java    From Telegram-FOSS with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Creates a {@link DownloadHelper} for SmoothStreaming streams.
 *
 * @param uri A manifest {@link Uri}.
 * @param dataSourceFactory A {@link DataSource.Factory} used to load the manifest.
 * @param renderersFactory A {@link RenderersFactory} creating the renderers for which tracks are
 *     selected.
 * @param drmSessionManager An optional {@link DrmSessionManager} used by the renderers created by
 *     {@code renderersFactory}.
 * @param trackSelectorParameters {@link DefaultTrackSelector.Parameters} for selecting tracks for
 *     downloading.
 * @return A {@link DownloadHelper} for SmoothStreaming streams.
 * @throws IllegalStateException If the SmoothStreaming module is missing.
 */
public static DownloadHelper forSmoothStreaming(
    Uri uri,
    DataSource.Factory dataSourceFactory,
    RenderersFactory renderersFactory,
    @Nullable DrmSessionManager<FrameworkMediaCrypto> drmSessionManager,
    DefaultTrackSelector.Parameters trackSelectorParameters) {
  return new DownloadHelper(
      DownloadRequest.TYPE_SS,
      uri,
      /* cacheKey= */ null,
      SS_FACTORY.createMediaSource(uri, dataSourceFactory, /* streamKeys= */ null),
      trackSelectorParameters,
      Util.getRendererCapabilities(renderersFactory, drmSessionManager));
}
 
Example 7
Source File: DownloadHelper.java    From Telegram with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Creates a {@link DownloadHelper} for DASH streams.
 *
 * @param uri A manifest {@link Uri}.
 * @param dataSourceFactory A {@link DataSource.Factory} used to load the manifest.
 * @param renderersFactory A {@link RenderersFactory} creating the renderers for which tracks are
 *     selected.
 * @param drmSessionManager An optional {@link DrmSessionManager} used by the renderers created by
 *     {@code renderersFactory}.
 * @param trackSelectorParameters {@link DefaultTrackSelector.Parameters} for selecting tracks for
 *     downloading.
 * @return A {@link DownloadHelper} for DASH streams.
 * @throws IllegalStateException If the DASH module is missing.
 */
public static DownloadHelper forDash(
    Uri uri,
    DataSource.Factory dataSourceFactory,
    RenderersFactory renderersFactory,
    @Nullable DrmSessionManager<FrameworkMediaCrypto> drmSessionManager,
    DefaultTrackSelector.Parameters trackSelectorParameters) {
  return new DownloadHelper(
      DownloadRequest.TYPE_DASH,
      uri,
      /* cacheKey= */ null,
      DASH_FACTORY.createMediaSource(uri, dataSourceFactory, /* streamKeys= */ null),
      trackSelectorParameters,
      Util.getRendererCapabilities(renderersFactory, drmSessionManager));
}
 
Example 8
Source File: DownloadHelper.java    From Telegram with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Creates a {@link DownloadHelper} for HLS streams.
 *
 * @param uri A playlist {@link Uri}.
 * @param dataSourceFactory A {@link DataSource.Factory} used to load the playlist.
 * @param renderersFactory A {@link RenderersFactory} creating the renderers for which tracks are
 *     selected.
 * @param drmSessionManager An optional {@link DrmSessionManager} used by the renderers created by
 *     {@code renderersFactory}.
 * @param trackSelectorParameters {@link DefaultTrackSelector.Parameters} for selecting tracks for
 *     downloading.
 * @return A {@link DownloadHelper} for HLS streams.
 * @throws IllegalStateException If the HLS module is missing.
 */
public static DownloadHelper forHls(
    Uri uri,
    DataSource.Factory dataSourceFactory,
    RenderersFactory renderersFactory,
    @Nullable DrmSessionManager<FrameworkMediaCrypto> drmSessionManager,
    DefaultTrackSelector.Parameters trackSelectorParameters) {
  return new DownloadHelper(
      DownloadRequest.TYPE_HLS,
      uri,
      /* cacheKey= */ null,
      HLS_FACTORY.createMediaSource(uri, dataSourceFactory, /* streamKeys= */ null),
      trackSelectorParameters,
      Util.getRendererCapabilities(renderersFactory, drmSessionManager));
}
 
Example 9
Source File: DownloadHelper.java    From Telegram with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Creates a {@link DownloadHelper} for SmoothStreaming streams.
 *
 * @param uri A manifest {@link Uri}.
 * @param dataSourceFactory A {@link DataSource.Factory} used to load the manifest.
 * @param renderersFactory A {@link RenderersFactory} creating the renderers for which tracks are
 *     selected.
 * @param drmSessionManager An optional {@link DrmSessionManager} used by the renderers created by
 *     {@code renderersFactory}.
 * @param trackSelectorParameters {@link DefaultTrackSelector.Parameters} for selecting tracks for
 *     downloading.
 * @return A {@link DownloadHelper} for SmoothStreaming streams.
 * @throws IllegalStateException If the SmoothStreaming module is missing.
 */
public static DownloadHelper forSmoothStreaming(
    Uri uri,
    DataSource.Factory dataSourceFactory,
    RenderersFactory renderersFactory,
    @Nullable DrmSessionManager<FrameworkMediaCrypto> drmSessionManager,
    DefaultTrackSelector.Parameters trackSelectorParameters) {
  return new DownloadHelper(
      DownloadRequest.TYPE_SS,
      uri,
      /* cacheKey= */ null,
      SS_FACTORY.createMediaSource(uri, dataSourceFactory, /* streamKeys= */ null),
      trackSelectorParameters,
      Util.getRendererCapabilities(renderersFactory, drmSessionManager));
}