Java Code Examples for com.google.android.exoplayer2.Format#copyWithDrmInitData()

The following examples show how to use com.google.android.exoplayer2.Format#copyWithDrmInitData() . 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: DashManifestParser.java    From TelePlus-Android with GNU General Public License v2.0 6 votes vote down vote up
protected Representation buildRepresentation(RepresentationInfo representationInfo,
    String contentId, String extraDrmSchemeType, ArrayList<SchemeData> extraDrmSchemeDatas,
    ArrayList<Descriptor> extraInbandEventStreams) {
  Format format = representationInfo.format;
  String drmSchemeType = representationInfo.drmSchemeType != null
      ? representationInfo.drmSchemeType : extraDrmSchemeType;
  ArrayList<SchemeData> drmSchemeDatas = representationInfo.drmSchemeDatas;
  drmSchemeDatas.addAll(extraDrmSchemeDatas);
  if (!drmSchemeDatas.isEmpty()) {
    filterRedundantIncompleteSchemeDatas(drmSchemeDatas);
    DrmInitData drmInitData = new DrmInitData(drmSchemeType, drmSchemeDatas);
    format = format.copyWithDrmInitData(drmInitData);
  }
  ArrayList<Descriptor> inbandEventStreams = representationInfo.inbandEventStreams;
  inbandEventStreams.addAll(extraInbandEventStreams);
  return Representation.newInstance(contentId, representationInfo.revisionId, format,
      representationInfo.baseUrl, representationInfo.segmentBase, inbandEventStreams);
}
 
Example 2
Source File: DashManifestParser.java    From TelePlus-Android with GNU General Public License v2.0 6 votes vote down vote up
protected Representation buildRepresentation(RepresentationInfo representationInfo,
    String contentId, String extraDrmSchemeType, ArrayList<SchemeData> extraDrmSchemeDatas,
    ArrayList<Descriptor> extraInbandEventStreams) {
  Format format = representationInfo.format;
  String drmSchemeType = representationInfo.drmSchemeType != null
      ? representationInfo.drmSchemeType : extraDrmSchemeType;
  ArrayList<SchemeData> drmSchemeDatas = representationInfo.drmSchemeDatas;
  drmSchemeDatas.addAll(extraDrmSchemeDatas);
  if (!drmSchemeDatas.isEmpty()) {
    filterRedundantIncompleteSchemeDatas(drmSchemeDatas);
    DrmInitData drmInitData = new DrmInitData(drmSchemeType, drmSchemeDatas);
    format = format.copyWithDrmInitData(drmInitData);
  }
  ArrayList<Descriptor> inbandEventStreams = representationInfo.inbandEventStreams;
  inbandEventStreams.addAll(extraInbandEventStreams);
  return Representation.newInstance(contentId, representationInfo.revisionId, format,
      representationInfo.baseUrl, representationInfo.segmentBase, inbandEventStreams);
}
 
Example 3
Source File: DashManifestParser.java    From MediaSDK with Apache License 2.0 5 votes vote down vote up
protected Representation buildRepresentation(
    RepresentationInfo representationInfo,
    @Nullable String label,
    @Nullable String extraDrmSchemeType,
    ArrayList<SchemeData> extraDrmSchemeDatas,
    ArrayList<Descriptor> extraInbandEventStreams) {
  Format format = representationInfo.format;
  if (label != null) {
    format = format.copyWithLabel(label);
  }
  String drmSchemeType = representationInfo.drmSchemeType != null
      ? representationInfo.drmSchemeType : extraDrmSchemeType;
  ArrayList<SchemeData> drmSchemeDatas = representationInfo.drmSchemeDatas;
  drmSchemeDatas.addAll(extraDrmSchemeDatas);
  if (!drmSchemeDatas.isEmpty()) {
    filterRedundantIncompleteSchemeDatas(drmSchemeDatas);
    DrmInitData drmInitData = new DrmInitData(drmSchemeType, drmSchemeDatas);
    format = format.copyWithDrmInitData(drmInitData);
  }
  ArrayList<Descriptor> inbandEventStreams = representationInfo.inbandEventStreams;
  inbandEventStreams.addAll(extraInbandEventStreams);
  return Representation.newInstance(
      representationInfo.revisionId,
      format,
      representationInfo.baseUrl,
      representationInfo.segmentBase,
      inbandEventStreams);
}
 
Example 4
Source File: DashManifestParser.java    From K-Sonic with MIT License 5 votes vote down vote up
protected Representation buildRepresentation(RepresentationInfo representationInfo,
    String contentId, ArrayList<SchemeData> extraDrmSchemeDatas,
    ArrayList<SchemeValuePair> extraInbandEventStreams) {
  Format format = representationInfo.format;
  ArrayList<SchemeData> drmSchemeDatas = representationInfo.drmSchemeDatas;
  drmSchemeDatas.addAll(extraDrmSchemeDatas);
  if (!drmSchemeDatas.isEmpty()) {
    format = format.copyWithDrmInitData(new DrmInitData(drmSchemeDatas));
  }
  ArrayList<SchemeValuePair> inbandEventStremas = representationInfo.inbandEventStreams;
  inbandEventStremas.addAll(extraInbandEventStreams);
  return Representation.newInstance(contentId, Representation.REVISION_ID_DEFAULT, format,
      representationInfo.baseUrl, representationInfo.segmentBase, inbandEventStremas);
}
 
Example 5
Source File: DashManifestParser.java    From Telegram-FOSS with GNU General Public License v2.0 5 votes vote down vote up
protected Representation buildRepresentation(
    RepresentationInfo representationInfo,
    String label,
    String extraDrmSchemeType,
    ArrayList<SchemeData> extraDrmSchemeDatas,
    ArrayList<Descriptor> extraInbandEventStreams) {
  Format format = representationInfo.format;
  if (label != null) {
    format = format.copyWithLabel(label);
  }
  String drmSchemeType = representationInfo.drmSchemeType != null
      ? representationInfo.drmSchemeType : extraDrmSchemeType;
  ArrayList<SchemeData> drmSchemeDatas = representationInfo.drmSchemeDatas;
  drmSchemeDatas.addAll(extraDrmSchemeDatas);
  if (!drmSchemeDatas.isEmpty()) {
    filterRedundantIncompleteSchemeDatas(drmSchemeDatas);
    DrmInitData drmInitData = new DrmInitData(drmSchemeType, drmSchemeDatas);
    format = format.copyWithDrmInitData(drmInitData);
  }
  ArrayList<Descriptor> inbandEventStreams = representationInfo.inbandEventStreams;
  inbandEventStreams.addAll(extraInbandEventStreams);
  return Representation.newInstance(
      representationInfo.revisionId,
      format,
      representationInfo.baseUrl,
      representationInfo.segmentBase,
      inbandEventStreams);
}
 
Example 6
Source File: DashManifestParser.java    From Telegram with GNU General Public License v2.0 5 votes vote down vote up
protected Representation buildRepresentation(
    RepresentationInfo representationInfo,
    String label,
    String extraDrmSchemeType,
    ArrayList<SchemeData> extraDrmSchemeDatas,
    ArrayList<Descriptor> extraInbandEventStreams) {
  Format format = representationInfo.format;
  if (label != null) {
    format = format.copyWithLabel(label);
  }
  String drmSchemeType = representationInfo.drmSchemeType != null
      ? representationInfo.drmSchemeType : extraDrmSchemeType;
  ArrayList<SchemeData> drmSchemeDatas = representationInfo.drmSchemeDatas;
  drmSchemeDatas.addAll(extraDrmSchemeDatas);
  if (!drmSchemeDatas.isEmpty()) {
    filterRedundantIncompleteSchemeDatas(drmSchemeDatas);
    DrmInitData drmInitData = new DrmInitData(drmSchemeType, drmSchemeDatas);
    format = format.copyWithDrmInitData(drmInitData);
  }
  ArrayList<Descriptor> inbandEventStreams = representationInfo.inbandEventStreams;
  inbandEventStreams.addAll(extraInbandEventStreams);
  return Representation.newInstance(
      representationInfo.revisionId,
      format,
      representationInfo.baseUrl,
      representationInfo.segmentBase,
      inbandEventStreams);
}