// // Copyright 2017 Google Inc. All Rights Reserved. // //#define LOG_NDEBUG 0 #define LOG_TAG "WVCdm" #include #include "WVDrmFactory.h" #include "wv_cdm_constants.h" #include "WVCDMSingleton.h" #include "wv_content_decryption_module.h" #include "WVDrmPlugin.h" #include "WVUUID.h" namespace wvdrm { namespace hardware { namespace drm { namespace V1_0 { namespace widevine { using ::android::hardware::drm::V1_0::Status; using ::android::hardware::Void; WVGenericCryptoInterface WVDrmFactory::sOemCryptoInterface; Return WVDrmFactory::isCryptoSchemeSupported( const hidl_array& uuid) { return isWidevineUUID(uuid.data()); } Return WVDrmFactory::isContentTypeSupported( const hidl_string& initDataType) { return wvcdm::WvContentDecryptionModule::IsSupported(initDataType.c_str()); } Return WVDrmFactory::createPlugin( const hidl_array& uuid, const hidl_string& appPackageName, createPlugin_cb _hidl_cb) { WVDrmPlugin *plugin = NULL; if (!isCryptoSchemeSupported(uuid.data())) { ALOGE("Widevine Drm HAL: failed to create drm plugin, " \ "invalid crypto scheme"); _hidl_cb(Status::BAD_VALUE, plugin); return Void(); } plugin = new WVDrmPlugin(getCDM(), appPackageName.c_str(), &sOemCryptoInterface); _hidl_cb(Status::OK, plugin); return Void(); } } // namespace widevine } // namespace V1_0 } // namespace drm } // namespace hardware } // namespace wvdrm