Implement isCryptoSchemeSupported in the Widevine drm plugin
Support overloaded isCryptoSchemeSupported method that accepts a security level parameter bug:110701831 test: cts media test cases, widevine integration tests, gts media tests Change-Id: Ia84e40ff8d4f13fc06478e338e3238061e283dac
This commit is contained in:
@@ -24,6 +24,7 @@ class InitializationData {
|
||||
bool is_cenc() const { return is_cenc_; }
|
||||
bool is_hls() const { return is_hls_; }
|
||||
bool is_webm() const { return is_webm_; }
|
||||
bool is_audio() const { return is_audio_; }
|
||||
|
||||
bool IsEmpty() const { return data_.empty(); }
|
||||
|
||||
@@ -84,6 +85,7 @@ class InitializationData {
|
||||
bool is_cenc_;
|
||||
bool is_hls_;
|
||||
bool is_webm_;
|
||||
bool is_audio_;
|
||||
|
||||
std::vector<uint8_t> hls_iv_;
|
||||
CdmHlsMethod hls_method_;
|
||||
|
||||
@@ -55,6 +55,7 @@ InitializationData::InitializationData(const std::string& type,
|
||||
is_cenc_(false),
|
||||
is_hls_(false),
|
||||
is_webm_(false),
|
||||
is_audio_(false),
|
||||
hls_method_(kHlsMethodNone) {
|
||||
if (type == ISO_BMFF_VIDEO_MIME_TYPE || type == ISO_BMFF_AUDIO_MIME_TYPE ||
|
||||
type == CENC_INIT_DATA_FORMAT) {
|
||||
@@ -65,6 +66,9 @@ InitializationData::InitializationData(const std::string& type,
|
||||
} else if (type == HLS_INIT_DATA_FORMAT) {
|
||||
is_hls_ = true;
|
||||
}
|
||||
if (type == ISO_BMFF_AUDIO_MIME_TYPE || type == WEBM_AUDIO_MIME_TYPE) {
|
||||
is_audio_ = true;
|
||||
}
|
||||
|
||||
if (data.size() && is_supported()) {
|
||||
if (is_cenc()) {
|
||||
|
||||
@@ -34,6 +34,7 @@ class WvContentDecryptionModule : public android::RefBase, public TimerHandler {
|
||||
static bool IsCenc(const std::string& init_data_type);
|
||||
static bool IsWebm(const std::string& init_data_type);
|
||||
static bool IsHls(const std::string& init_data_type);
|
||||
static bool IsAudio(const std::string& init_data_type);
|
||||
|
||||
// Session related methods
|
||||
virtual CdmResponseType OpenSession(const CdmKeySystem& key_system,
|
||||
|
||||
@@ -47,6 +47,10 @@ bool WvContentDecryptionModule::IsHls(const std::string& init_data_type) {
|
||||
return InitializationData(init_data_type).is_hls();
|
||||
}
|
||||
|
||||
bool WvContentDecryptionModule::IsAudio(const std::string& init_data_type) {
|
||||
return InitializationData(init_data_type).is_audio();
|
||||
}
|
||||
|
||||
CdmResponseType WvContentDecryptionModule::OpenSession(
|
||||
const CdmKeySystem& key_system, CdmClientPropertySet* property_set,
|
||||
const CdmIdentifier& identifier, WvCdmEventListener* event_listener,
|
||||
|
||||
@@ -35,9 +35,22 @@ Return<bool> WVDrmFactory::isCryptoSchemeSupported_1_2(
|
||||
const hidl_array<uint8_t, 16>& uuid,
|
||||
const hidl_string& initDataType,
|
||||
SecurityLevel level) {
|
||||
return isWidevineUUID(uuid.data()) &&
|
||||
isContentTypeSupported(initDataType)
|
||||
/* TODO: jtinker@ b/117104043 && wvcdm::IsSecurityLevelSupported(level)*/;
|
||||
|
||||
if (!isWidevineUUID(uuid.data()) || !isContentTypeSupported(initDataType)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (wvcdm::WvContentDecryptionModule::IsSecurityLevelSupported(
|
||||
wvcdm::kSecurityLevelL1)) {
|
||||
if (wvcdm::WvContentDecryptionModule::IsAudio(initDataType)) {
|
||||
if (level < SecurityLevel::HW_SECURE_ALL) {
|
||||
return true;
|
||||
}
|
||||
} else {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return level <= SecurityLevel::SW_SECURE_DECODE;
|
||||
}
|
||||
|
||||
Return<bool> WVDrmFactory::isContentTypeSupported(
|
||||
|
||||
Reference in New Issue
Block a user