Merge "aidl drm: independent min/max SecurityLevel for each supported mime" into tm-dev
This commit is contained in:
@@ -35,6 +35,7 @@ using std::vector;
|
|||||||
using ::aidl::android::hardware::drm::CryptoSchemes;
|
using ::aidl::android::hardware::drm::CryptoSchemes;
|
||||||
using ::aidl::android::hardware::drm::SecurityLevel;
|
using ::aidl::android::hardware::drm::SecurityLevel;
|
||||||
using ::aidl::android::hardware::drm::Status;
|
using ::aidl::android::hardware::drm::Status;
|
||||||
|
using ::aidl::android::hardware::drm::SupportedContentType;
|
||||||
using ::aidl::android::hardware::drm::Uuid;
|
using ::aidl::android::hardware::drm::Uuid;
|
||||||
|
|
||||||
WVGenericCryptoInterface WVDrmFactory::sOemCryptoInterface;
|
WVGenericCryptoInterface WVDrmFactory::sOemCryptoInterface;
|
||||||
@@ -130,17 +131,19 @@ int32_t WVDrmFactory::firstApiLevel() {
|
|||||||
for (const auto& uuid : wvdrm::getSupportedCryptoSchemes()) {
|
for (const auto& uuid : wvdrm::getSupportedCryptoSchemes()) {
|
||||||
schemes.uuids.push_back({uuid});
|
schemes.uuids.push_back({uuid});
|
||||||
}
|
}
|
||||||
schemes.minLevel = schemes.maxLevel = SecurityLevel::SW_SECURE_CRYPTO;
|
|
||||||
if (wvcdm::WvContentDecryptionModule::IsSecurityLevelSupported(
|
|
||||||
wvcdm::kSecurityLevelL1)) {
|
|
||||||
schemes.maxLevel = SecurityLevel::HW_SECURE_ALL;
|
|
||||||
}
|
|
||||||
|
|
||||||
schemes.mimeTypes = {
|
bool isL1 = wvcdm::WvContentDecryptionModule::IsSecurityLevelSupported(wvcdm::kSecurityLevelL1);
|
||||||
wvcdm::ISO_BMFF_VIDEO_MIME_TYPE, wvcdm::ISO_BMFF_AUDIO_MIME_TYPE,
|
for (auto mime : {wvcdm::ISO_BMFF_VIDEO_MIME_TYPE, wvcdm::ISO_BMFF_AUDIO_MIME_TYPE,
|
||||||
wvcdm::WEBM_VIDEO_MIME_TYPE, wvcdm::WEBM_AUDIO_MIME_TYPE,
|
wvcdm::WEBM_VIDEO_MIME_TYPE, wvcdm::WEBM_AUDIO_MIME_TYPE,
|
||||||
wvcdm::CENC_INIT_DATA_FORMAT, wvcdm::HLS_INIT_DATA_FORMAT,
|
wvcdm::CENC_INIT_DATA_FORMAT, wvcdm::HLS_INIT_DATA_FORMAT,
|
||||||
wvcdm::WEBM_INIT_DATA_FORMAT};
|
wvcdm::WEBM_INIT_DATA_FORMAT}) {
|
||||||
|
bool isAudio = wvcdm::WvContentDecryptionModule::IsAudio(mime);
|
||||||
|
SupportedContentType ct{mime, SecurityLevel::SW_SECURE_CRYPTO, SecurityLevel::SW_SECURE_DECODE};
|
||||||
|
if (isL1) {
|
||||||
|
ct.maxLevel = isAudio ? SecurityLevel::HW_SECURE_DECODE : SecurityLevel::HW_SECURE_ALL;
|
||||||
|
}
|
||||||
|
schemes.mimeTypes.push_back(ct);
|
||||||
|
}
|
||||||
*_aidl_return = schemes;
|
*_aidl_return = schemes;
|
||||||
return ::ndk::ScopedAStatus::ok();
|
return ::ndk::ScopedAStatus::ok();
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user