Initial import of Widevine Common Encryption DRM engine
Builds libwvmdrmengine.so, which is loaded by the new MediaDrm APIs to support playback of Widevine/CENC protected content. Change-Id: I6f57dd37083dfd96c402cb9dd137c7d74edc8f1c
This commit is contained in:
32
libwvdrmengine/src/WVCDMSingleton.cpp
Normal file
32
libwvdrmengine/src/WVCDMSingleton.cpp
Normal file
@@ -0,0 +1,32 @@
|
||||
//
|
||||
// Copyright 2013 Google Inc. All Rights Reserved.
|
||||
//
|
||||
|
||||
//#define LOG_NDEBUG 0
|
||||
#define LOG_TAG "WVCdm"
|
||||
#include <utils/Log.h>
|
||||
|
||||
#include "WVCDMSingleton.h"
|
||||
|
||||
#include "utils/Mutex.h"
|
||||
|
||||
namespace wvdrm {
|
||||
|
||||
using wvcdm::WvContentDecryptionModule;
|
||||
using android::Mutex;
|
||||
|
||||
Mutex cdmLock;
|
||||
WvContentDecryptionModule* cdm = NULL;
|
||||
|
||||
WvContentDecryptionModule* getCDM() {
|
||||
Mutex::Autolock lock(cdmLock);
|
||||
|
||||
if (cdm == NULL) {
|
||||
ALOGD("Instantiating CDM.");
|
||||
cdm = new WvContentDecryptionModule();
|
||||
}
|
||||
|
||||
return cdm;
|
||||
}
|
||||
|
||||
} // namespace wvdrm
|
||||
Reference in New Issue
Block a user