Improve query performance

[ Merge of http://go/wvgerrit/15780 ]

Android mediaDrm allows callers to serially query status information through a
property API. CDM however retrieves all status information in a map and
filters out all but the relevent one. This leads to delays in Netflix app
startup. Rewriting the CDM interface to return only the queried value.

b/24181894

Change-Id: Ie9ed6288524e3a7e03b83aa55ef3531dd52a0dfb
This commit is contained in:
Rahul Frias
2015-10-05 15:22:20 -07:00
parent dfe644da56
commit e5dfb83e03
7 changed files with 270 additions and 217 deletions

View File

@@ -880,18 +880,13 @@ status_t WVDrmPlugin::queryProperty(const std::string& property,
status_t WVDrmPlugin::queryProperty(SecurityLevel securityLevel,
const std::string& property,
std::string& stringValue) const {
CdmQueryMap status;
CdmResponseType res = mCDM->QueryStatus(securityLevel, &status);
CdmResponseType res =
mCDM->QueryStatus(securityLevel, property, &stringValue);
if (res != wvcdm::NO_ERROR) {
ALOGE("Error querying CDM status: %u", res);
return mapCdmResponseType(res);
} else if (!status.count(property)) {
ALOGE("CDM did not report %s", property.c_str());
return kErrorCDMGeneric;
}
stringValue = status[property];
return android::OK;
return mapCdmResponseType(res);
}
status_t WVDrmPlugin::queryProperty(const std::string& property,