(This is a merge of http://go/wvgerrit/14082) Previously, the CryptoFactory had special behavior to defer creation to Widevine Classic if no session ID was provided. This functionality has been deprecated, as MediaCodec Mode is no longer supported. This is necessary as part of supporting the new API for session ID changes because the expectation is that it is now legal to initialize a modular CryptoPlugin without a session ID. Bug: 19570317 Change-Id: Iad0cd01b6a8d2e66c94c5f53a8a60f5787bc02f8
38 lines
775 B
C++
38 lines
775 B
C++
//
|
|
// Copyright 2013 Google Inc. All Rights Reserved.
|
|
//
|
|
|
|
//#define LOG_NDEBUG 0
|
|
#define LOG_TAG "WVCdm"
|
|
#include <utils/Log.h>
|
|
|
|
#include "WVCryptoFactory.h"
|
|
|
|
#include <dlfcn.h>
|
|
|
|
#include "utils/Errors.h"
|
|
#include "WVCDMSingleton.h"
|
|
#include "WVCryptoPlugin.h"
|
|
#include "WVUUID.h"
|
|
|
|
namespace wvdrm {
|
|
|
|
using namespace android;
|
|
|
|
bool WVCryptoFactory::isCryptoSchemeSupported(const uint8_t uuid[16]) const {
|
|
return isWidevineUUID(uuid);
|
|
}
|
|
|
|
status_t WVCryptoFactory::createPlugin(const uint8_t uuid[16], const void* data,
|
|
size_t size, CryptoPlugin** plugin) {
|
|
if (!isCryptoSchemeSupported(uuid)) {
|
|
*plugin = NULL;
|
|
return BAD_VALUE;
|
|
}
|
|
|
|
*plugin = new WVCryptoPlugin(data, size, getCDM());
|
|
return OK;
|
|
}
|
|
|
|
} // namespace wvdrm
|