[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::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