Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[DASH][ClearKey] Parse ClearKey license URL in MPD. #10260

Merged
merged 2 commits into from Jul 7, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Expand Up @@ -263,7 +263,7 @@ public static final class SchemeData implements Parcelable {
*/
public final UUID uuid;
/** The URL of the server to which license requests should be made. May be null if unknown. */
@Nullable public final String licenseServerUrl;
@Nullable public String licenseServerUrl;
/** The mimeType of {@link #data}. */
public final String mimeType;
/** The initialization data. May be null for scheme support checks only. */
Expand Down
Expand Up @@ -429,6 +429,15 @@ protected AdaptationSet parseAdaptationSet(
drmSchemeType = contentProtection.first;
}
if (contentProtection.second != null) {
// In case of clear key, update the licence server url of
// previously parsed common encryption drmSchemeData.
if (drmSchemeType != null && drmSchemeType == "clearkey") {
for (SchemeData drmSchemeData : drmSchemeDatas) {
if (drmSchemeData.uuid == C.COMMON_PSSH_UUID
&& drmSchemeData.licenseServerUrl == null)
drmSchemeData.licenseServerUrl = contentProtection.second.licenseServerUrl;
}
}
drmSchemeDatas.add(contentProtection.second);
}
} else if (XmlPullParserUtil.isStartTag(xpp, "ContentComponent")) {
Expand Down Expand Up @@ -597,14 +606,21 @@ protected AdaptationSet buildAdaptationSet(
case "urn:uuid:edef8ba9-79d6-4ace-a3c8-27dcd51d21ed":
uuid = C.WIDEVINE_UUID;
break;
case "urn:uuid:e2719d58-a985-b3c9-781a-b030af78d30e":
uuid = C.CLEARKEY_UUID;
schemeType = "clearkey";
break;
default:
break;
}
}

do {
xpp.next();
if (XmlPullParserUtil.isStartTag(xpp, "ms:laurl")) {
if (XmlPullParserUtil.isStartTag(xpp, "clearkey:Laurl")
&& xpp.next() == XmlPullParser.TEXT) {
licenseServerUrl = xpp.getText();
} else if (XmlPullParserUtil.isStartTag(xpp, "ms:laurl")) {
licenseServerUrl = xpp.getAttributeValue(null, "licenseUrl");
} else if (data == null
&& XmlPullParserUtil.isStartTagIgnorePrefix(xpp, "pssh")
Expand Down