Add Properties to Query HDCP Status and Usage Reporting Support
This is a merge of http://go/wvgerrit/10846/ from the Widevine repository. Change-Id: I682069073d9ec58c03781de25d9c6fa5ec5864ff
This commit is contained in:
@@ -464,6 +464,39 @@ status_t WVDrmPlugin::getPropertyString(const String8& name,
|
||||
} else {
|
||||
value = kDisable;
|
||||
}
|
||||
} else if (name == "hdcpLevel") {
|
||||
CdmQueryMap status;
|
||||
CdmResponseType res = mCDM->QueryStatus(&status);
|
||||
if (res != wvcdm::NO_ERROR) {
|
||||
ALOGE("Error querying CDM status: %u", res);
|
||||
return mapCdmResponseType(res);
|
||||
} else if (!status.count(QUERY_KEY_CURRENT_HDCP_LEVEL)) {
|
||||
ALOGE("CDM did not report a current HDCP level");
|
||||
return kErrorCDMGeneric;
|
||||
}
|
||||
value = status[QUERY_KEY_CURRENT_HDCP_LEVEL].c_str();
|
||||
} else if (name == "maxHdcpLevel") {
|
||||
CdmQueryMap status;
|
||||
CdmResponseType res = mCDM->QueryStatus(&status);
|
||||
if (res != wvcdm::NO_ERROR) {
|
||||
ALOGE("Error querying CDM status: %u", res);
|
||||
return mapCdmResponseType(res);
|
||||
} else if (!status.count(QUERY_KEY_MAX_HDCP_LEVEL)) {
|
||||
ALOGE("CDM did not report a maximum HDCP level");
|
||||
return kErrorCDMGeneric;
|
||||
}
|
||||
value = status[QUERY_KEY_MAX_HDCP_LEVEL].c_str();
|
||||
} else if (name == "usageReportingSupport") {
|
||||
CdmQueryMap status;
|
||||
CdmResponseType res = mCDM->QueryStatus(&status);
|
||||
if (res != wvcdm::NO_ERROR) {
|
||||
ALOGE("Error querying CDM status: %u", res);
|
||||
return mapCdmResponseType(res);
|
||||
} else if (!status.count(QUERY_KEY_USAGE_SUPPORT)) {
|
||||
ALOGE("CDM did not report whether it supports usage reporting");
|
||||
return kErrorCDMGeneric;
|
||||
}
|
||||
value = status[QUERY_KEY_USAGE_SUPPORT].c_str();
|
||||
} else {
|
||||
ALOGE("App requested unknown string property %s", name.string());
|
||||
return android::ERROR_DRM_CANNOT_HANDLE;
|
||||
|
||||
Reference in New Issue
Block a user