Relax string comparison in DASH parseContentProtection

... by making it case insensitive and null-tolerant for schemeId (as was before
adding playlist drm data merging).

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=174472123
This commit is contained in:
aquilescanta 2017-11-03 09:36:43 -07:00 committed by Oliver Woodman
parent 1cfea62545
commit ecaaed9674

View File

@ -345,30 +345,32 @@ public class DashManifestParser extends DefaultHandler
*/
protected Pair<String, SchemeData> parseContentProtection(XmlPullParser xpp)
throws XmlPullParserException, IOException {
String schemeIdUri = xpp.getAttributeValue(null, "schemeIdUri");
String schemeType = null;
byte[] data = null;
UUID uuid = null;
boolean requiresSecureDecoder = false;
switch (schemeIdUri) {
case "urn:mpeg:dash:mp4protection:2011":
schemeType = xpp.getAttributeValue(null, "value");
String defaultKid = xpp.getAttributeValue(null, "cenc:default_KID");
if (defaultKid != null && !"00000000-0000-0000-0000-000000000000".equals(defaultKid)) {
UUID keyId = UUID.fromString(defaultKid);
data = PsshAtomUtil.buildPsshAtom(C.COMMON_PSSH_UUID, new UUID[] {keyId}, null);
uuid = C.COMMON_PSSH_UUID;
}
break;
case "urn:uuid:9a04f079-9840-4286-ab92-e65be0885f95":
uuid = C.PLAYREADY_UUID;
break;
case "urn:uuid:edef8ba9-79d6-4ace-a3c8-27dcd51d21ed":
uuid = C.WIDEVINE_UUID;
break;
default:
break;
String schemeIdUri = xpp.getAttributeValue(null, "schemeIdUri");
if (schemeIdUri != null) {
switch (schemeIdUri.toLowerCase()) {
case "urn:mpeg:dash:mp4protection:2011":
schemeType = xpp.getAttributeValue(null, "value");
String defaultKid = xpp.getAttributeValue(null, "cenc:default_KID");
if (defaultKid != null && !"00000000-0000-0000-0000-000000000000".equals(defaultKid)) {
UUID keyId = UUID.fromString(defaultKid);
data = PsshAtomUtil.buildPsshAtom(C.COMMON_PSSH_UUID, new UUID[] {keyId}, null);
uuid = C.COMMON_PSSH_UUID;
}
break;
case "urn:uuid:9a04f079-9840-4286-ab92-e65be0885f95":
uuid = C.PLAYREADY_UUID;
break;
case "urn:uuid:edef8ba9-79d6-4ace-a3c8-27dcd51d21ed":
uuid = C.WIDEVINE_UUID;
break;
default:
break;
}
}
do {