Merge "Query analog output capabilities."
This commit is contained in:
@@ -48,7 +48,14 @@ static const char KEY_SET_ID_PREFIX[] = "ksid";
|
||||
static const char KEY_SYSTEM[] = "com.widevine";
|
||||
static const char ATSC_APP_PACKAGE_NAME[] = "org.atsc";
|
||||
|
||||
// define query keys, values here
|
||||
// Define query keys, values here.
|
||||
// To expose these query items to Android update:
|
||||
// android/mediadrm/src/WVDrmPlugin.cpp
|
||||
// android/mediadrm/src_hidl/WVDrmPlugin.cpp
|
||||
// Update test QueryStatus and QueryStatusL3 test for all possible outputs:
|
||||
// android/cdm/test/request_license_test.cpp
|
||||
// Update HIDL debug output:
|
||||
// android/src_hidl/WVDrmFactory.cpp
|
||||
static const std::string QUERY_KEY_LICENSE_TYPE =
|
||||
"LicenseType"; // "Streaming", "Offline"
|
||||
static const std::string QUERY_KEY_PLAY_ALLOWED =
|
||||
@@ -96,10 +103,16 @@ static const std::string QUERY_KEY_MAX_USAGE_TABLE_ENTRIES =
|
||||
"MaxNumberOfUsageTableEntries";
|
||||
static const std::string QUERY_KEY_OEMCRYPTO_API_MINOR_VERSION =
|
||||
"OemCryptoApiMinorVersion";
|
||||
static const std::string QUERY_KEY_ANALOG_OUTPUT_CAPABILITIES =
|
||||
"AnalogOutputCapabilities";
|
||||
static const std::string QUERY_KEY_CAN_DISABLE_ANALOG_OUTPUT =
|
||||
"CanDisableAnalogOutput";
|
||||
|
||||
static const std::string QUERY_VALUE_TRUE = "True";
|
||||
static const std::string QUERY_VALUE_FALSE = "False";
|
||||
static const std::string QUERY_VALUE_NONE = "None";
|
||||
static const std::string QUERY_VALUE_SUPPORTED = "Supported";
|
||||
static const std::string QUERY_VALUE_UNKNOWN = "Unknown";
|
||||
static const std::string QUERY_VALUE_STREAMING = "Streaming";
|
||||
static const std::string QUERY_VALUE_OFFLINE = "Offline";
|
||||
static const std::string QUERY_VALUE_SECURITY_LEVEL_L1 = "L1";
|
||||
@@ -118,6 +131,7 @@ static const std::string QUERY_VALUE_HDCP_LEVEL_UNKNOWN = "HDCP-LevelUnknown";
|
||||
static const std::string QUERY_VALUE_DRM_CERTIFICATE = "DrmCertificate";
|
||||
static const std::string QUERY_VALUE_KEYBOX = "Keybox";
|
||||
static const std::string QUERY_VALUE_OEM_CERTIFICATE = "OEMCertificate";
|
||||
static const std::string QUERY_VALUE_CGMS_A = "CGMS-A";
|
||||
|
||||
static const std::string ISO_BMFF_VIDEO_MIME_TYPE = "video/mp4";
|
||||
static const std::string ISO_BMFF_AUDIO_MIME_TYPE = "audio/mp4";
|
||||
|
||||
@@ -720,6 +720,32 @@ CdmResponseType CdmEngine::QueryStatus(SecurityLevel security_level,
|
||||
|
||||
*query_response = std::to_string(api_minor_version);
|
||||
return NO_ERROR;
|
||||
} else if (query_token == QUERY_KEY_ANALOG_OUTPUT_CAPABILITIES) {
|
||||
bool supported = false, can_disable = false, cgms_a = false;
|
||||
if (crypto_session->GetAnalogOutputCapabilities(&supported, &can_disable,
|
||||
&cgms_a)) {
|
||||
if (supported) {
|
||||
if (cgms_a) {
|
||||
*query_response = QUERY_VALUE_CGMS_A;
|
||||
} else {
|
||||
*query_response = QUERY_VALUE_SUPPORTED;
|
||||
}
|
||||
} else {
|
||||
*query_response = QUERY_VALUE_NONE;
|
||||
}
|
||||
} else {
|
||||
*query_response = QUERY_VALUE_UNKNOWN;
|
||||
}
|
||||
return NO_ERROR;
|
||||
} else if (query_token == QUERY_KEY_CAN_DISABLE_ANALOG_OUTPUT) {
|
||||
bool supported = false, can_disable = false, cgms_a = false;
|
||||
if (crypto_session->GetAnalogOutputCapabilities(&supported, &can_disable,
|
||||
&cgms_a)) {
|
||||
*query_response = can_disable ? QUERY_VALUE_TRUE : QUERY_VALUE_FALSE;
|
||||
} else {
|
||||
*query_response = QUERY_VALUE_UNKNOWN;
|
||||
}
|
||||
return NO_ERROR;
|
||||
}
|
||||
|
||||
M_TIME(status = crypto_session->Open(security_level),
|
||||
|
||||
@@ -2648,9 +2648,9 @@ bool CryptoSession::GetAnalogOutputCapabilities(bool* can_support_output,
|
||||
bool* can_disable_output,
|
||||
bool* can_support_cgms_a) {
|
||||
LOGV("Getting analog output capabilities: id = %u", oec_session_id_);
|
||||
uint32_t flags;
|
||||
WithOecReadLock("GetAnalogOutputCapabilities", [&] {
|
||||
flags = OEMCrypto_GetAnalogOutputFlags(requested_security_level_);
|
||||
RETURN_IF_UNINITIALIZED(false);
|
||||
const uint32_t flags = WithOecReadLock("GetAnalogOutputCapabilities", [&] {
|
||||
return OEMCrypto_GetAnalogOutputFlags(requested_security_level_);
|
||||
});
|
||||
|
||||
if ((flags & OEMCrypto_Unknown_Analog_Output) != 0) return false;
|
||||
|
||||
Reference in New Issue
Block a user