Files
android/libwvdrmengine/src/WVDrmFactory.cpp
Fred Gylys-Colwell 1a25cbdad6 Update Copyright
Merge from Widevine repo of http://go/wvgerrit/47860

This CL updates the copyright notice to indicate that files
shared with partners are shared under the Widevine Master
License Agreement.

bug: 77926774
test: comment change only
Change-Id: I0423668111578b80fb39a932d763df2827e2dfc3
2018-04-16 16:38:05 -07:00

47 lines
1.1 KiB
C++

//
// Copyright 2018 Google LLC. All Rights Reserved. This file and proprietary
// source code may only be used and distributed under the Widevine Master
// License Agreement.
//
//#define LOG_NDEBUG 0
#define LOG_TAG "WVCdm"
#include <utils/Log.h>
#include "WVDrmFactory.h"
#include "utils/Errors.h"
#include "wv_cdm_constants.h"
#include "WVCDMSingleton.h"
#include "wv_content_decryption_module.h"
#include "WVDrmPlugin.h"
#include "WVUUID.h"
namespace wvdrm {
using namespace android;
WVGenericCryptoInterface WVDrmFactory::sOemCryptoInterface;
bool WVDrmFactory::isCryptoSchemeSupported(const uint8_t uuid[16]) {
return isWidevineUUID(uuid);
}
bool WVDrmFactory::isContentTypeSupported(const String8 &initDataType) {
return wvcdm::WvContentDecryptionModule::IsSupported(initDataType.string());
}
status_t WVDrmFactory::createDrmPlugin(const uint8_t uuid[16],
DrmPlugin** plugin) {
if (!isCryptoSchemeSupported(uuid)) {
*plugin = NULL;
return BAD_VALUE;
}
*plugin = new WVDrmPlugin(getCDM(), &sOemCryptoInterface);
return OK;
}
} // namespace wvdrm