Java 类com.google.android.exoplayer.dash.mpd.MediaPresentationDescriptionParser 实例源码

项目:ExoPlayer-Demo    文件:DashTest.java   
private void testDashPlayback(HostActivity activity, String streamName,
    ActionSchedule actionSchedule, boolean fullPlaybackNoSeeking, String manifestFileName,
    String audioFormat, boolean canIncludeAdditionalVideoFormats, String... videoFormats)
    throws IOException {
  MediaPresentationDescription mpd = TestUtil.loadManifest(activity, TAG,
      MANIFEST_URL_PREFIX + manifestFileName, new MediaPresentationDescriptionParser());
  MetricsLogger metricsLogger = MetricsLogger.Factory.createDefault(getInstrumentation(), TAG,
      REPORT_NAME, streamName);
  DashHostedTest test = new DashHostedTest(streamName, mpd, metricsLogger, fullPlaybackNoSeeking,
      audioFormat, canIncludeAdditionalVideoFormats, false, actionSchedule, videoFormats);
  activity.runTest(test, mpd.duration + MAX_ADDITIONAL_TIME_MS);
  // Retry test exactly once if adaptive test fails due to excessive dropped buffers when playing
  // non-CDD required formats (b/28220076).
  if (test.needsCddLimitedRetry) {
    metricsLogger = MetricsLogger.Factory.createDefault(getInstrumentation(), TAG, REPORT_NAME,
        streamName + "_cdd_limited_retry");
    test = new DashHostedTest(streamName, mpd, metricsLogger, fullPlaybackNoSeeking, audioFormat,
        false, true, actionSchedule, videoFormats);
    activity.runTest(test, mpd.duration + MAX_ADDITIONAL_TIME_MS);
  }
}
项目:androidtv-sample    文件:DashRendererBuilder.java   
public AsyncRendererBuilder(Context context, String userAgent, String url,
                            MediaDrmCallback drmCallback, DemoPlayer player) {
    this.context = context;
    this.userAgent = userAgent;
    this.drmCallback = drmCallback;
    this.player = player;
    MediaPresentationDescriptionParser parser = new MediaPresentationDescriptionParser();
    manifestDataSource = new DefaultUriDataSource(context, userAgent);
    manifestFetcher = new ManifestFetcher<>(url, manifestDataSource, parser);
}
项目:androidtv-sample    文件:DashRendererBuilder.java   
public AsyncRendererBuilder(Context context, String userAgent, String url,
                            MediaDrmCallback drmCallback, VideoPlayer player) {
    this.context = context;
    this.userAgent = userAgent;
    this.drmCallback = drmCallback;
    this.player = player;
    MediaPresentationDescriptionParser parser = new MediaPresentationDescriptionParser();
    manifestDataSource = new DefaultUriDataSource(context, userAgent);
    manifestFetcher = new ManifestFetcher<>(url, manifestDataSource, parser);
}
项目:AndroidTvDemo    文件:DashRendererBuilder.java   
public AsyncRendererBuilder(Context context, String userAgent, String url,
    MediaDrmCallback drmCallback, DemoPlayer player) {
  this.context = context;
  this.userAgent = userAgent;
  this.drmCallback = drmCallback;
  this.player = player;
  MediaPresentationDescriptionParser parser = new MediaPresentationDescriptionParser();
  manifestDataSource = new DefaultUriDataSource(context, userAgent);
  manifestFetcher = new ManifestFetcher<>(url, manifestDataSource, parser);
}
项目:ShaddockVideoPlayer    文件:DashRendererBuilder.java   
public AsyncRendererBuilder(Context context, String userAgent, String url,
    MediaDrmCallback drmCallback, DemoPlayer player) {
  this.context = context;
  this.userAgent = userAgent;
  this.drmCallback = drmCallback;
  this.player = player;
  MediaPresentationDescriptionParser parser = new MediaPresentationDescriptionParser();
  manifestDataSource = new DefaultUriDataSource(context, userAgent);
  manifestFetcher = new ManifestFetcher<>(url, manifestDataSource, parser);
}
项目:ExoPlayerController    文件:DashRendererBuilder.java   
public AsyncRendererBuilder(Context context, String userAgent, String url,
    MediaDrmCallback drmCallback, DemoPlayer player) {
  this.context = context;
  this.userAgent = userAgent;
  this.drmCallback = drmCallback;
  this.player = player;
  MediaPresentationDescriptionParser parser = new MediaPresentationDescriptionParser();
  manifestDataSource = new DefaultUriDataSource(context, userAgent);
  manifestFetcher = new ManifestFetcher<>(url, manifestDataSource, parser);
}
项目:FriendsCameraSDK-android    文件:DashRendererBuilder.java   
public AsyncRendererBuilder(Context context, String userAgent, String url,
                            MediaDrmCallback drmCallback, DemoPlayer player) {
  this.context = context;
  this.userAgent = userAgent;
  this.drmCallback = drmCallback;
  this.player = player;
  MediaPresentationDescriptionParser parser = new MediaPresentationDescriptionParser();
  manifestDataSource = new DefaultUriDataSource(context, userAgent);
  manifestFetcher = new ManifestFetcher<>(url, manifestDataSource, parser);
}
项目:talk-android    文件:DashRendererBuilder.java   
public AsyncRendererBuilder(Context context, String userAgent, String url,
    MediaDrmCallback drmCallback, DemoPlayer player) {
  this.context = context;
  this.userAgent = userAgent;
  this.drmCallback = drmCallback;
  this.player = player;
  MediaPresentationDescriptionParser parser = new MediaPresentationDescriptionParser();
  manifestDataSource = new DefaultUriDataSource(context, userAgent);
  manifestFetcher = new ManifestFetcher<>(url, manifestDataSource, parser);
}
项目:OKPlayer    文件:DashRendererBuilder.java   
public AsyncRendererBuilder(Context context, String userAgent, String url,
    MediaDrmCallback drmCallback, DemoPlayer player) {
  this.context = context;
  this.userAgent = userAgent;
  this.drmCallback = drmCallback;
  this.player = player;
  MediaPresentationDescriptionParser parser = new MediaPresentationDescriptionParser();
  manifestDataSource = new DefaultUriDataSource(context, userAgent);
  manifestFetcher = new ManifestFetcher<>(url, manifestDataSource, parser);
}
项目:miku    文件:DashRendererBuilder.java   
public AsyncRendererBuilder(Context context, String userAgent, String url,
                            MediaDrmCallback drmCallback, AudioCapabilities audioCapabilities, MediaPlayer player) {
  this.context = context;
  this.userAgent = userAgent;
  this.drmCallback = drmCallback;
  this.audioCapabilities = audioCapabilities;
  this.player = player;
  MediaPresentationDescriptionParser parser = new MediaPresentationDescriptionParser();
  manifestDataSource = new DefaultUriDataSource(context, userAgent);
  manifestFetcher = new ManifestFetcher<>(url, manifestDataSource, parser);
}
项目:Mediathek    文件:DashRendererBuilder.java   
public AsyncRendererBuilder(Context context, String userAgent, String url,
    MediaDrmCallback drmCallback, Player player) {
  this.context = context;
  this.userAgent = userAgent;
  this.drmCallback = drmCallback;
  this.player = player;
  MediaPresentationDescriptionParser parser = new MediaPresentationDescriptionParser();
  manifestDataSource = new DefaultUriDataSource(context, userAgent);
  manifestFetcher = new ManifestFetcher<>(url, manifestDataSource, parser);
}
项目:droidkaigi2016    文件:DashRendererBuilder.java   
public AsyncRendererBuilder(Context context, String userAgent, String url, DemoPlayer player) {
  this.context = context;
  this.userAgent = userAgent;
    this.player = player;
  MediaPresentationDescriptionParser parser = new MediaPresentationDescriptionParser();
  manifestDataSource = new DefaultUriDataSource(context, userAgent);
  manifestFetcher = new ManifestFetcher<>(url, manifestDataSource, parser);
}
项目:WliveTV    文件:DashRendererBuilder.java   
public AsyncRendererBuilder(Context context, String userAgent, String url,
    MediaDrmCallback drmCallback, DemoPlayer player) {
  this.context = context;
  this.userAgent = userAgent;
  this.drmCallback = drmCallback;
  this.player = player;
  MediaPresentationDescriptionParser parser = new MediaPresentationDescriptionParser();
  manifestDataSource = new DefaultUriDataSource(context, userAgent);
  manifestFetcher = new ManifestFetcher<>(url, manifestDataSource, parser);
}
项目:luxunPro    文件:DashRenderBuilder.java   
public AsyncRendererBuilder(Context context, OkHttpClient okHttpClient, String userAgent, String url, EMExoPlayer player, int streamType) {
    this.context = context;
    this.userAgent = userAgent;
    this.streamType = streamType;
    this.player = player;
    this.okHttpClient = okHttpClient;

    MediaPresentationDescriptionParser parser = new MediaPresentationDescriptionParser();
    manifestDataSource = createManifestDataSource(context, userAgent);
    manifestFetcher = new ManifestFetcher<>(url, manifestDataSource, parser);
}
项目:ExoPlayerWrapper    文件:DashRendererBuilder.java   
public AsyncRendererBuilder(Context context, String userAgent, String url,
                            MediaDrmCallback drmCallback, ExoPlayerWrapper player) {
    this.context = context;
    this.userAgent = userAgent;
    this.drmCallback = drmCallback;
    this.player = player;
    MediaPresentationDescriptionParser parser = new MediaPresentationDescriptionParser();
    manifestDataSource = new DefaultUriDataSource(context, userAgent);
    manifestFetcher = new ManifestFetcher<>(url, manifestDataSource, parser);
}
项目:android-exoplayer    文件:DashRendererBuilder.java   
@Override
public void buildRenderers(DemoPlayer player, RendererBuilderCallback callback) {
  this.player = player;
  this.callback = callback;
  MediaPresentationDescriptionParser parser = new MediaPresentationDescriptionParser();
  manifestFetcher = new ManifestFetcher<MediaPresentationDescription>(parser, contentId, url,
      userAgent);
  manifestFetcher.singleLoad(player.getMainHandler().getLooper(), this);
}
项目:android-exoplayer    文件:DashRendererBuilder.java   
@Override
public void buildRenderers(RendererBuilderCallback callback) {
  this.callback = callback;
  MediaPresentationDescriptionParser parser = new MediaPresentationDescriptionParser();
  manifestFetcher = new ManifestFetcher<MediaPresentationDescription>(parser, contentId, url,
      userAgent);
  manifestFetcher.singleLoad(playerActivity.getMainLooper(), this);
}
项目:Android-Birdcopy-Application    文件:DashRendererBuilder.java   
public AsyncRendererBuilder(Context context, String userAgent, String url,
    MediaDrmCallback drmCallback, FlyingPlayer player) {
  this.context = context;
  this.userAgent = userAgent;
  this.drmCallback = drmCallback;
  this.player = player;
  MediaPresentationDescriptionParser parser = new MediaPresentationDescriptionParser();
  manifestDataSource = new DefaultUriDataSource(context, userAgent);
  manifestFetcher = new ManifestFetcher<>(url, manifestDataSource, parser);
}
项目:Exoplayer_VLC    文件:DashRendererBuilder.java   
@Override
public void buildRenderers(DemoPlayer player, RendererBuilderCallback callback) {
  this.player = player;
  this.callback = callback;
  MediaPresentationDescriptionParser parser = new MediaPresentationDescriptionParser();
  manifestFetcher = new ManifestFetcher<MediaPresentationDescription>(parser, contentId, url,
      userAgent);
  manifestFetcher.singleLoad(player.getMainHandler().getLooper(), this);
}
项目:droidkaigi2016    文件:DashRendererBuilder.java   
public AsyncRendererBuilder(Context context, String userAgent, String url, DemoPlayer player) {
  this.context = context;
  this.userAgent = userAgent;
    this.player = player;
  MediaPresentationDescriptionParser parser = new MediaPresentationDescriptionParser();
  manifestDataSource = new DefaultUriDataSource(context, userAgent);
  manifestFetcher = new ManifestFetcher<>(url, manifestDataSource, parser);
}
项目:ExoPlayer    文件:DashRendererBuilder.java   
public AsyncRendererBuilder(Context context, String userAgent, String url,
    MediaDrmCallback drmCallback, AudioCapabilities audioCapabilities, DemoPlayer player) {
  this.context = context;
  this.userAgent = userAgent;
  this.drmCallback = drmCallback;
  this.audioCapabilities = audioCapabilities;
  this.player = player;
  MediaPresentationDescriptionParser parser = new MediaPresentationDescriptionParser();
  manifestDataSource = new DefaultUriDataSource(context, userAgent);
  manifestFetcher = new ManifestFetcher<>(url, manifestDataSource, parser);
}
项目:androidtv-sample-inputs    文件:DashRendererBuilder.java   
public AsyncRendererBuilder(Context context, String userAgent, String url,
                            MediaDrmCallback drmCallback, DemoPlayer player) {
    this.context = context;
    this.userAgent = userAgent;
    this.drmCallback = drmCallback;
    this.player = player;
    MediaPresentationDescriptionParser parser = new MediaPresentationDescriptionParser();
    manifestDataSource = new DefaultUriDataSource(context, userAgent);
    manifestFetcher = new ManifestFetcher<>(url, manifestDataSource, parser);
}
项目:google-media-framework-android    文件:DashRendererBuilder.java   
public AsyncRendererBuilder(Context context, String userAgent, String url,
                            MediaDrmCallback drmCallback, ExoplayerWrapper player) {
  this.context = context;
  this.userAgent = userAgent;
  this.drmCallback = drmCallback;
  this.player = player;
  MediaPresentationDescriptionParser parser = new MediaPresentationDescriptionParser();
  manifestDataSource = new DefaultUriDataSource(context, userAgent);
  manifestFetcher = new ManifestFetcher<>(url, manifestDataSource, parser);
}
项目:player-sdk-native-android    文件:SimpleDashParser.java   
SimpleDashParser parse(String localPath) throws IOException {

        InputStream inputStream = new BufferedInputStream(new FileInputStream(localPath));

        MediaPresentationDescriptionParser mpdParser = new MediaPresentationDescriptionParser();
        MediaPresentationDescription mpd = mpdParser.parse(localPath, inputStream);

        if (mpd.getPeriodCount() < 1) {
            throw new IOException("At least one period is required");
        }

        Period period = mpd.getPeriod(0);
        List<AdaptationSet> adaptationSets = period.adaptationSets;
        AdaptationSet videoAdaptation = adaptationSets.get(period.getAdaptationSetIndex(AdaptationSet.TYPE_VIDEO));

        List<Representation> representations = videoAdaptation.representations;

        if (representations == null || representations.isEmpty()) {
            throw new IOException("At least one video representation is required");
        }
        Representation representation = representations.get(0);

        format = representation.format;

        hasContentProtection = videoAdaptation.hasContentProtection();
        if (hasContentProtection) {
            loadDrmInitData(representation);
        }

        return this;
    }
项目:player-sdk-native-android    文件:DashRendererBuilder.java   
public AsyncRendererBuilder(Context context, String userAgent, String url,
                            MediaDrmCallback drmCallback, ExoplayerWrapper player) {
  this.context = context;
  this.userAgent = userAgent;
  this.drmCallback = drmCallback;
  this.player = player;
  MediaPresentationDescriptionParser parser = new MediaPresentationDescriptionParser();
  manifestDataSource = new DefaultUriDataSource(context, userAgent);
  manifestFetcher = new ManifestFetcher<>(url, manifestDataSource, parser);
}
项目:ExoPlayer-Demo    文件:DashRendererBuilder.java   
public void build() {
  MediaPresentationDescriptionParser parser = new MediaPresentationDescriptionParser();
  ManifestFetcher<MediaPresentationDescription> manifestFetcher =
      new ManifestFetcher<>(manifestUrl, new DefaultHttpDataSource(userAgent, null), parser);
  manifestFetcher.singleLoad(player.getMainHandler().getLooper(), this);
}
项目:ExoPlayer    文件:DashRendererBuilder.java   
public void build() {
  MediaPresentationDescriptionParser parser = new MediaPresentationDescriptionParser();
  ManifestFetcher<MediaPresentationDescription> manifestFetcher =
      new ManifestFetcher<>(manifestUrl, new DefaultHttpDataSource(userAgent, null), parser);
  manifestFetcher.singleLoad(player.getMainHandler().getLooper(), this);
}