本文整理了Java中com.google.android.exoplayer2.Format.copyWithDrmInitData()
方法的一些代码示例,展示了Format.copyWithDrmInitData()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Format.copyWithDrmInitData()
方法的具体详情如下:
包路径:com.google.android.exoplayer2.Format
类名称:Format
方法名:copyWithDrmInitData
暂无
代码示例来源:origin: google/ExoPlayer
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);
}
代码示例来源:origin: google/ExoPlayer
public void updateDrmInitData(DrmInitData drmInitData) {
TrackEncryptionBox encryptionBox =
track.getSampleDescriptionEncryptionBox(fragment.header.sampleDescriptionIndex);
String schemeType = encryptionBox != null ? encryptionBox.schemeType : null;
output.format(track.format.copyWithDrmInitData(drmInitData.copyWithSchemeType(schemeType)));
}
代码示例来源:origin: google/ExoPlayer
@Override
public Object build() {
StreamElement[] streamElementArray = new StreamElement[streamElements.size()];
streamElements.toArray(streamElementArray);
if (protectionElement != null) {
DrmInitData drmInitData = new DrmInitData(new SchemeData(protectionElement.uuid,
MimeTypes.VIDEO_MP4, protectionElement.data));
for (StreamElement streamElement : streamElementArray) {
int type = streamElement.type;
if (type == C.TRACK_TYPE_VIDEO || type == C.TRACK_TYPE_AUDIO) {
Format[] formats = streamElement.formats;
for (int i = 0; i < formats.length; i++) {
formats[i] = formats[i].copyWithDrmInitData(drmInitData);
}
}
}
}
return new SsManifest(majorVersion, minorVersion, timescale, duration, dvrWindowLength,
lookAheadCount, isLive, protectionElement, streamElementArray);
}
代码示例来源:origin: google/ExoPlayer
private static Representation newRepresentations(DrmInitData drmInitData) {
Format format =
Format.createVideoContainerFormat(
"id",
"label",
MimeTypes.VIDEO_MP4,
MimeTypes.VIDEO_H264,
/* codecs= */ "",
Format.NO_VALUE,
/* width= */ 1024,
/* height= */ 768,
Format.NO_VALUE,
/* initializationData= */ null,
/* selectionFlags= */ 0);
if (drmInitData != null) {
format = format.copyWithDrmInitData(drmInitData);
}
return Representation.newInstance("", 0, format, "", new SingleSegmentBase());
}
内容来源于网络,如有侵权,请联系作者删除!