本文整理汇总了Java中com.google.android.exoplayer2.util.MimeTypes.VIDEO_MP4属性的典型用法代码示例。如果您正苦于以下问题:Java MimeTypes.VIDEO_MP4属性的具体用法?Java MimeTypes.VIDEO_MP4怎么用?Java MimeTypes.VIDEO_MP4使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类com.google.android.exoplayer2.util.MimeTypes
的用法示例。
在下文中一共展示了MimeTypes.VIDEO_MP4属性的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: build
@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) {
for (int i = 0; i < streamElement.formats.length; i++) {
streamElement.formats[i] = streamElement.formats[i].copyWithDrmInitData(drmInitData);
}
}
}
return new SsManifest(majorVersion, minorVersion, timescale, duration, dvrWindowLength,
lookAheadCount, isLive, protectionElement, streamElementArray);
}
示例2: testParcelable
public void testParcelable() {
DrmInitData.SchemeData DRM_DATA_1 = new DrmInitData.SchemeData(WIDEVINE_UUID, VIDEO_MP4,
TestUtil.buildTestData(128, 1 /* data seed */));
DrmInitData.SchemeData DRM_DATA_2 = new DrmInitData.SchemeData(C.UUID_NIL, VIDEO_WEBM,
TestUtil.buildTestData(128, 1 /* data seed */));
DrmInitData drmInitData = new DrmInitData(DRM_DATA_1, DRM_DATA_2);
byte[] projectionData = new byte[] {1, 2, 3};
Format formatToParcel = new Format("id", MimeTypes.VIDEO_MP4, MimeTypes.VIDEO_H264, null,
1024, 2048, 1920, 1080, 24, 90, 2, projectionData, C.STEREO_MODE_TOP_BOTTOM, 6, 44100,
C.ENCODING_PCM_24BIT, 1001, 1002, 0, "und", Format.OFFSET_SAMPLE_RELATIVE, INIT_DATA,
drmInitData);
Parcel parcel = Parcel.obtain();
formatToParcel.writeToParcel(parcel, 0);
parcel.setDataPosition(0);
Format formatFromParcel = Format.CREATOR.createFromParcel(parcel);
assertEquals(formatToParcel, formatFromParcel);
parcel.recycle();
}
示例3: parseContentProtection
/**
* Parses a ContentProtection element.
*
* @param xpp The parser from which to read.
* @throws XmlPullParserException If an error occurs parsing the element.
* @throws IOException If an error occurs reading the element.
* @return {@link SchemeData} parsed from the ContentProtection element, or null if the element is
* unsupported.
*/
protected SchemeData parseContentProtection(XmlPullParser xpp) throws XmlPullParserException,
IOException {
String schemeIdUri = xpp.getAttributeValue(null, "schemeIdUri");
boolean isPlayReady = "urn:uuid:9a04f079-9840-4286-ab92-e65be0885f95".equals(schemeIdUri);
byte[] data = null;
UUID uuid = null;
boolean requiresSecureDecoder = false;
do {
xpp.next();
if (data == null && XmlPullParserUtil.isStartTag(xpp, "cenc:pssh")
&& xpp.next() == XmlPullParser.TEXT) {
// The cenc:pssh element is defined in 23001-7:2015.
data = Base64.decode(xpp.getText(), Base64.DEFAULT);
uuid = PsshAtomUtil.parseUuid(data);
if (uuid == null) {
Log.w(TAG, "Skipping malformed cenc:pssh data");
data = null;
}
} else if (data == null && isPlayReady && XmlPullParserUtil.isStartTag(xpp, "mspr:pro")
&& xpp.next() == XmlPullParser.TEXT) {
// The mspr:pro element is defined in DASH Content Protection using Microsoft PlayReady.
data = PsshAtomUtil.buildPsshAtom(C.PLAYREADY_UUID,
Base64.decode(xpp.getText(), Base64.DEFAULT));
uuid = C.PLAYREADY_UUID;
} else if (XmlPullParserUtil.isStartTag(xpp, "widevine:license")) {
String robustnessLevel = xpp.getAttributeValue(null, "robustness_level");
requiresSecureDecoder = robustnessLevel != null && robustnessLevel.startsWith("HW");
}
} while (!XmlPullParserUtil.isEndTag(xpp, "ContentProtection"));
return data != null ? new SchemeData(uuid, MimeTypes.VIDEO_MP4, data, requiresSecureDecoder)
: null;
}
示例4: parseContentProtection
/**
* Parses a ContentProtection element.
*
* @param xpp The parser from which to read.
* @throws XmlPullParserException If an error occurs parsing the element.
* @throws IOException If an error occurs reading the element.
* @return {@link SchemeData} parsed from the ContentProtection element, or null if the element is
* unsupported.
*/
protected SchemeData parseContentProtection(XmlPullParser xpp) throws XmlPullParserException,
IOException {
byte[] data = null;
UUID uuid = null;
boolean seenPsshElement = false;
boolean requiresSecureDecoder = false;
do {
xpp.next();
// The cenc:pssh element is defined in 23001-7:2015.
if (XmlPullParserUtil.isStartTag(xpp, "cenc:pssh") && xpp.next() == XmlPullParser.TEXT) {
seenPsshElement = true;
data = Base64.decode(xpp.getText(), Base64.DEFAULT);
uuid = PsshAtomUtil.parseUuid(data);
} else if (XmlPullParserUtil.isStartTag(xpp, "widevine:license")) {
String robustnessLevel = xpp.getAttributeValue(null, "robustness_level");
requiresSecureDecoder = robustnessLevel != null && robustnessLevel.startsWith("HW");
}
} while (!XmlPullParserUtil.isEndTag(xpp, "ContentProtection"));
if (!seenPsshElement) {
return null;
} else if (uuid != null) {
return new SchemeData(uuid, MimeTypes.VIDEO_MP4, data, requiresSecureDecoder);
} else {
Log.w(TAG, "Skipped unsupported ContentProtection element");
return null;
}
}