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

项目:miku    文件:DashChunkSource.java   
private static DrmInitData getDrmInitData(MediaPresentationDescription manifest,
    int adaptationSetIndex) {
  AdaptationSet adaptationSet = manifest.periods.get(0).adaptationSets.get(adaptationSetIndex);
  String drmInitMimeType = mimeTypeIsWebm(adaptationSet.representations.get(0).format.mimeType)
      ? MimeTypes.VIDEO_WEBM : MimeTypes.VIDEO_MP4;
  if (adaptationSet.contentProtections.isEmpty()) {
    return null;
  } else {
    DrmInitData.Mapped drmInitData = null;
    for (ContentProtection contentProtection : adaptationSet.contentProtections) {
      if (contentProtection.uuid != null && contentProtection.data != null) {
        if (drmInitData == null) {
          drmInitData = new DrmInitData.Mapped(drmInitMimeType);
        }
        drmInitData.put(contentProtection.uuid, contentProtection.data);
      }
    }
    return drmInitData;
  }
}
项目:ExoPlayer-Demo    文件:DashChunkSource.java   
private static DrmInitData getDrmInitData(AdaptationSet adaptationSet) {
  if (adaptationSet.contentProtections.isEmpty()) {
    return null;
  } else {
    DrmInitData.Mapped drmInitData = null;
    for (int i = 0; i < adaptationSet.contentProtections.size(); i++) {
      ContentProtection contentProtection = adaptationSet.contentProtections.get(i);
      if (contentProtection.uuid != null && contentProtection.data != null) {
        if (drmInitData == null) {
          drmInitData = new DrmInitData.Mapped();
        }
        drmInitData.put(contentProtection.uuid, contentProtection.data);
      }
    }
    return drmInitData;
  }
}
项目:ExoPlayer    文件:DashChunkSource.java   
private static DrmInitData getDrmInitData(MediaPresentationDescription manifest,
    int adaptationSetIndex) {
  AdaptationSet adaptationSet = manifest.periods.get(0).adaptationSets.get(adaptationSetIndex);
  String drmInitMimeType = mimeTypeIsWebm(adaptationSet.representations.get(0).format.mimeType)
      ? MimeTypes.VIDEO_WEBM : MimeTypes.VIDEO_MP4;
  if (adaptationSet.contentProtections.isEmpty()) {
    return null;
  } else {
    DrmInitData.Mapped drmInitData = null;
    for (ContentProtection contentProtection : adaptationSet.contentProtections) {
      if (contentProtection.uuid != null && contentProtection.data != null) {
        if (drmInitData == null) {
          drmInitData = new DrmInitData.Mapped(drmInitMimeType);
        }
        drmInitData.put(contentProtection.uuid, contentProtection.data);
      }
    }
    return drmInitData;
  }
}
项目:android-exoplayer    文件:DashChunkSource.java   
private static Map<UUID, byte[]> getPsshInfo(MediaPresentationDescription manifest,
    int adaptationSetIndex) {
  AdaptationSet adaptationSet = manifest.periods.get(0).adaptationSets.get(adaptationSetIndex);
  if (adaptationSet.contentProtections.isEmpty()) {
    return null;
  } else {
    Map<UUID, byte[]> psshInfo = new HashMap<UUID, byte[]>();
    for (ContentProtection contentProtection : adaptationSet.contentProtections) {
      if (contentProtection.uuid != null && contentProtection.data != null) {
        psshInfo.put(contentProtection.uuid, contentProtection.data);
      }
    }
    return psshInfo.isEmpty() ? null : psshInfo;
  }
}
项目:Exoplayer_VLC    文件:DashChunkSource.java   
private static Map<UUID, byte[]> getPsshInfo(MediaPresentationDescription manifest,
    int adaptationSetIndex) {
  AdaptationSet adaptationSet = manifest.periods.get(0).adaptationSets.get(adaptationSetIndex);
  if (adaptationSet.contentProtections.isEmpty()) {
    return null;
  } else {
    Map<UUID, byte[]> psshInfo = new HashMap<UUID, byte[]>();
    for (ContentProtection contentProtection : adaptationSet.contentProtections) {
      if (contentProtection.uuid != null && contentProtection.data != null) {
        psshInfo.put(contentProtection.uuid, contentProtection.data);
      }
    }
    return psshInfo.isEmpty() ? null : psshInfo;
  }
}