Remove Backwards-Compatibility for Classic MediaCodec Mode

(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
This commit is contained in:
John "Juce" Bruce
2015-04-10 15:58:29 -07:00
parent 86fdcc744d
commit 0540770280
3 changed files with 4 additions and 62 deletions

View File

@@ -13,8 +13,8 @@ namespace wvdrm {
class WVCryptoFactory : public android::CryptoFactory {
public:
WVCryptoFactory();
virtual ~WVCryptoFactory();
WVCryptoFactory() {}
virtual ~WVCryptoFactory() {}
virtual bool isCryptoSchemeSupported(const uint8_t uuid[16]) const;
@@ -24,9 +24,6 @@ class WVCryptoFactory : public android::CryptoFactory {
private:
DISALLOW_EVIL_CONSTRUCTORS(WVCryptoFactory);
void* mLegacyLibraryHandle;
android::CryptoFactory* mLegacyFactory;
};
} // namespace wvdrm

View File

@@ -14,8 +14,8 @@ namespace wvdrm {
class WVDrmFactory : public android::DrmFactory {
public:
WVDrmFactory() {};
virtual ~WVDrmFactory() {};
WVDrmFactory() {}
virtual ~WVDrmFactory() {}
virtual bool isCryptoSchemeSupported(const uint8_t uuid[16]);

View File

@@ -19,47 +19,6 @@ namespace wvdrm {
using namespace android;
WVCryptoFactory::WVCryptoFactory()
: mLegacyLibraryHandle(NULL),
mLegacyFactory(NULL) {
mLegacyLibraryHandle = dlopen("libdrmdecrypt.so", RTLD_NOW);
if (mLegacyLibraryHandle == NULL) {
ALOGW("Unable to locate libdrmdecrypt.so");
} else {
typedef CryptoFactory* (*CreateCryptoFactoryFunc)();
CreateCryptoFactoryFunc legacyCreateCryptoFactory =
(CreateCryptoFactoryFunc)dlsym(mLegacyLibraryHandle,
"createCryptoFactory");
if (legacyCreateCryptoFactory == NULL) {
ALOGW("Unable to find legacy symbol 'createCryptoFactory'.");
dlclose(mLegacyLibraryHandle);
mLegacyLibraryHandle = NULL;
} else {
mLegacyFactory = legacyCreateCryptoFactory();
if (mLegacyFactory == NULL) {
ALOGW("Legacy createCryptoFactory() failed.");
dlclose(mLegacyLibraryHandle);
mLegacyLibraryHandle = NULL;
}
}
}
}
WVCryptoFactory::~WVCryptoFactory() {
if (mLegacyFactory != NULL) {
delete mLegacyFactory;
mLegacyFactory = NULL;
}
if (mLegacyLibraryHandle != NULL) {
dlclose(mLegacyLibraryHandle);
mLegacyLibraryHandle = NULL;
}
}
bool WVCryptoFactory::isCryptoSchemeSupported(const uint8_t uuid[16]) const {
return isWidevineUUID(uuid);
}
@@ -71,21 +30,7 @@ status_t WVCryptoFactory::createPlugin(const uint8_t uuid[16], const void* data,
return BAD_VALUE;
}
// 0 size means they want an old-style Widevine plugin
if (size == 0) {
if (mLegacyFactory == NULL) {
ALOGE("Legacy crypto factory loading failed. Cannot create legacy "
"plugin. Look for warnings about this that were logged earlier, "
"during CryptoFactory instantiation.");
return -EINVAL;
}
return mLegacyFactory->createPlugin(uuid, data, size, plugin);
}
// We received a session ID, so create a CENC plugin.
*plugin = new WVCryptoPlugin(data, size, getCDM());
return OK;
}