[automerge] aidl drm: independent min/max SecurityLevel for each supported mime 2p: f2d89aaf77
Original change: https://googleplex-android-review.googlesource.com/c/platform/vendor/widevine/+/16952668 Bug: 219528925 Change-Id: Iaaef182b8774feb612a129305c316fb92d3086b2 Merged-In: I5c0d511358c394aff6885135de851395f199dac0
This commit is contained in:
@@ -35,6 +35,7 @@ using std::vector;
|
||||
using ::aidl::android::hardware::drm::CryptoSchemes;
|
||||
using ::aidl::android::hardware::drm::SecurityLevel;
|
||||
using ::aidl::android::hardware::drm::Status;
|
||||
using ::aidl::android::hardware::drm::SupportedContentType;
|
||||
using ::aidl::android::hardware::drm::Uuid;
|
||||
|
||||
WVGenericCryptoInterface WVDrmFactory::sOemCryptoInterface;
|
||||
@@ -130,17 +131,19 @@ int32_t WVDrmFactory::firstApiLevel() {
|
||||
for (const auto& uuid : wvdrm::getSupportedCryptoSchemes()) {
|
||||
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 = {
|
||||
wvcdm::ISO_BMFF_VIDEO_MIME_TYPE, wvcdm::ISO_BMFF_AUDIO_MIME_TYPE,
|
||||
wvcdm::WEBM_VIDEO_MIME_TYPE, wvcdm::WEBM_AUDIO_MIME_TYPE,
|
||||
wvcdm::CENC_INIT_DATA_FORMAT, wvcdm::HLS_INIT_DATA_FORMAT,
|
||||
wvcdm::WEBM_INIT_DATA_FORMAT};
|
||||
bool isL1 = wvcdm::WvContentDecryptionModule::IsSecurityLevelSupported(wvcdm::kSecurityLevelL1);
|
||||
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::CENC_INIT_DATA_FORMAT, wvcdm::HLS_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;
|
||||
return ::ndk::ScopedAStatus::ok();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user