Files
android/libclearkeydrmengine/include/WVDrmPluginFactory.h
John "Juce" Bruce 04bfbb0198 Initial Clear Key DRM Engine
Adds the initial pieces of a sample DRM Engine that accepts keys in the clear
through the decrypt call instead of using the DrmClientPlugin and its key
ladder.  This is to help unblock teams writing code that consumes DRM Engines
while Widevine continues working their real DRM engine.  This is based on the
in-progress Widevine DRM Engine.

This change contains the DRM Engine glue pieces (.so entry point,
DrmPluginFactory, etc.) and a CryptoPlugin implementation.  However, said
CryptoPlugin will not work until an implementation of OEMCrypto is provided
in a future checkin and the CryptoPlugin is hooked up to it.

For ease of loading, this library also implements the old CryptoFactory
interface and entry point.

If asked to create a CryptoPlugin with no data, it will defer to the old
Widevine Crypto Plugin.

Change-Id: I0bfbec7e32439a50a2956488dd970284f0075e61
2012-12-21 12:40:06 -08:00

49 lines
1.3 KiB
C++

/*
* Copyright 2012 Google Inc. All Rights Reserved.
*/
#ifndef WV_DRM_PLUGIN_FACTORY_H_
#define WV_DRM_PLUGIN_FACTORY_H_
#include "media/stagefright/foundation/ABase.h"
#include "media/drm/DrmEngineAPI.h"
#include "media/hardware/CryptoAPI.h"
namespace wvclearkey {
using android::status_t;
class WVDrmPluginFactory : public android::DrmPluginFactory, public android::CryptoFactory {
public:
WVDrmPluginFactory();
virtual ~WVDrmPluginFactory();
// Implement DrmPluginFactory
virtual bool isCryptoSchemeSupported(const uint8_t uuid[16]) const;
virtual status_t createCryptoPlugin(
const uint8_t uuid[16], const void *data, size_t size,
android::CryptoPlugin **plugin);
virtual status_t createDrmClientPlugin(
const uint8_t uuid[16], const void *data, size_t size,
android::DrmClientPlugin **plugin);
// Implement CryptoFactory
virtual status_t createPlugin(
const uint8_t uuid[16], const void *data, size_t size,
android::CryptoPlugin **plugin) {
return createCryptoPlugin(uuid, data, size, plugin);
}
private:
DISALLOW_EVIL_CONSTRUCTORS(WVDrmPluginFactory);
void *mLegacyLibraryHandle;
android::CryptoFactory *mLegacyFactory;
};
} // namespace wvclearkey
#endif // WV_DRM_PLUGIN_FACTORY_H_