- Change level of some LOGs from LOGE to LOGV because those logs
are not error logs from non-DRMed content's point of view. - Add more mutex lock to avoid crash by multi-thread calls. - Fix for bug 4050039 Change-Id: I52fed22069f0cda6c4ac6a5363469168c797a33b
This commit is contained in:
@@ -596,7 +596,7 @@ DecryptHandle* BpDrmManagerService::openDecryptSession(int uniqueId, const char*
|
|||||||
handle->decryptInfo->decryptBufferLength = reply.readInt32();
|
handle->decryptInfo->decryptBufferLength = reply.readInt32();
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
LOGE("no decryptHandle is generated in service side");
|
LOGV("no decryptHandle is generated in service side");
|
||||||
}
|
}
|
||||||
return handle;
|
return handle;
|
||||||
}
|
}
|
||||||
@@ -1308,7 +1308,7 @@ status_t BnDrmManagerService::onTransact(
|
|||||||
delete handle->decryptInfo; handle->decryptInfo = NULL;
|
delete handle->decryptInfo; handle->decryptInfo = NULL;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
LOGE("NULL decryptHandle is returned");
|
LOGV("NULL decryptHandle is returned");
|
||||||
}
|
}
|
||||||
delete handle; handle = NULL;
|
delete handle; handle = NULL;
|
||||||
return DRM_NO_ERROR;
|
return DRM_NO_ERROR;
|
||||||
|
|||||||
@@ -51,6 +51,7 @@ DrmManager::~DrmManager() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
int DrmManager::addUniqueId(int uniqueId) {
|
int DrmManager::addUniqueId(int uniqueId) {
|
||||||
|
Mutex::Autolock _l(mLock);
|
||||||
if (0 == uniqueId) {
|
if (0 == uniqueId) {
|
||||||
int temp = 0;
|
int temp = 0;
|
||||||
bool foundUniqueId = false;
|
bool foundUniqueId = false;
|
||||||
@@ -78,6 +79,7 @@ int DrmManager::addUniqueId(int uniqueId) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void DrmManager::removeUniqueId(int uniqueId) {
|
void DrmManager::removeUniqueId(int uniqueId) {
|
||||||
|
Mutex::Autolock _l(mLock);
|
||||||
for (unsigned int i = 0; i < mUniqueIdVector.size(); i++) {
|
for (unsigned int i = 0; i < mUniqueIdVector.size(); i++) {
|
||||||
if (uniqueId == mUniqueIdVector.itemAt(i)) {
|
if (uniqueId == mUniqueIdVector.itemAt(i)) {
|
||||||
mUniqueIdVector.removeAt(i);
|
mUniqueIdVector.removeAt(i);
|
||||||
@@ -107,6 +109,7 @@ status_t DrmManager::loadPlugIns(const String8& plugInDirPath) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
status_t DrmManager::unloadPlugIns() {
|
status_t DrmManager::unloadPlugIns() {
|
||||||
|
Mutex::Autolock _l(mLock);
|
||||||
mConvertSessionMap.clear();
|
mConvertSessionMap.clear();
|
||||||
mDecryptSessionMap.clear();
|
mDecryptSessionMap.clear();
|
||||||
mPlugInManager.unloadPlugIns();
|
mPlugInManager.unloadPlugIns();
|
||||||
@@ -126,6 +129,7 @@ status_t DrmManager::setDrmServiceListener(
|
|||||||
}
|
}
|
||||||
|
|
||||||
void DrmManager::addClient(int uniqueId) {
|
void DrmManager::addClient(int uniqueId) {
|
||||||
|
Mutex::Autolock _l(mLock);
|
||||||
if (!mSupportInfoToPlugInIdMap.isEmpty()) {
|
if (!mSupportInfoToPlugInIdMap.isEmpty()) {
|
||||||
Vector<String8> plugInIdList = mPlugInManager.getPlugInIdList();
|
Vector<String8> plugInIdList = mPlugInManager.getPlugInIdList();
|
||||||
for (unsigned int index = 0; index < plugInIdList.size(); index++) {
|
for (unsigned int index = 0; index < plugInIdList.size(); index++) {
|
||||||
@@ -137,6 +141,7 @@ void DrmManager::addClient(int uniqueId) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void DrmManager::removeClient(int uniqueId) {
|
void DrmManager::removeClient(int uniqueId) {
|
||||||
|
Mutex::Autolock _l(mLock);
|
||||||
Vector<String8> plugInIdList = mPlugInManager.getPlugInIdList();
|
Vector<String8> plugInIdList = mPlugInManager.getPlugInIdList();
|
||||||
for (unsigned int index = 0; index < plugInIdList.size(); index++) {
|
for (unsigned int index = 0; index < plugInIdList.size(); index++) {
|
||||||
IDrmEngine& rDrmEngine = mPlugInManager.getPlugIn(plugInIdList.itemAt(index));
|
IDrmEngine& rDrmEngine = mPlugInManager.getPlugIn(plugInIdList.itemAt(index));
|
||||||
@@ -145,6 +150,7 @@ void DrmManager::removeClient(int uniqueId) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
DrmConstraints* DrmManager::getConstraints(int uniqueId, const String8* path, const int action) {
|
DrmConstraints* DrmManager::getConstraints(int uniqueId, const String8* path, const int action) {
|
||||||
|
Mutex::Autolock _l(mLock);
|
||||||
const String8 plugInId = getSupportedPlugInIdFromPath(uniqueId, *path);
|
const String8 plugInId = getSupportedPlugInIdFromPath(uniqueId, *path);
|
||||||
if (EMPTY_STRING != plugInId) {
|
if (EMPTY_STRING != plugInId) {
|
||||||
IDrmEngine& rDrmEngine = mPlugInManager.getPlugIn(plugInId);
|
IDrmEngine& rDrmEngine = mPlugInManager.getPlugIn(plugInId);
|
||||||
@@ -154,6 +160,7 @@ DrmConstraints* DrmManager::getConstraints(int uniqueId, const String8* path, co
|
|||||||
}
|
}
|
||||||
|
|
||||||
DrmMetadata* DrmManager::getMetadata(int uniqueId, const String8* path) {
|
DrmMetadata* DrmManager::getMetadata(int uniqueId, const String8* path) {
|
||||||
|
Mutex::Autolock _l(mLock);
|
||||||
const String8 plugInId = getSupportedPlugInIdFromPath(uniqueId, *path);
|
const String8 plugInId = getSupportedPlugInIdFromPath(uniqueId, *path);
|
||||||
if (EMPTY_STRING != plugInId) {
|
if (EMPTY_STRING != plugInId) {
|
||||||
IDrmEngine& rDrmEngine = mPlugInManager.getPlugIn(plugInId);
|
IDrmEngine& rDrmEngine = mPlugInManager.getPlugIn(plugInId);
|
||||||
@@ -163,6 +170,7 @@ DrmMetadata* DrmManager::getMetadata(int uniqueId, const String8* path) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
status_t DrmManager::installDrmEngine(int uniqueId, const String8& absolutePath) {
|
status_t DrmManager::installDrmEngine(int uniqueId, const String8& absolutePath) {
|
||||||
|
Mutex::Autolock _l(mLock);
|
||||||
mPlugInManager.loadPlugIn(absolutePath);
|
mPlugInManager.loadPlugIn(absolutePath);
|
||||||
|
|
||||||
IDrmEngine& rDrmEngine = mPlugInManager.getPlugIn(absolutePath);
|
IDrmEngine& rDrmEngine = mPlugInManager.getPlugIn(absolutePath);
|
||||||
@@ -176,6 +184,7 @@ status_t DrmManager::installDrmEngine(int uniqueId, const String8& absolutePath)
|
|||||||
}
|
}
|
||||||
|
|
||||||
bool DrmManager::canHandle(int uniqueId, const String8& path, const String8& mimeType) {
|
bool DrmManager::canHandle(int uniqueId, const String8& path, const String8& mimeType) {
|
||||||
|
Mutex::Autolock _l(mLock);
|
||||||
const String8 plugInId = getSupportedPlugInId(mimeType);
|
const String8 plugInId = getSupportedPlugInId(mimeType);
|
||||||
bool result = (EMPTY_STRING != plugInId) ? true : false;
|
bool result = (EMPTY_STRING != plugInId) ? true : false;
|
||||||
|
|
||||||
@@ -194,6 +203,7 @@ bool DrmManager::canHandle(int uniqueId, const String8& path, const String8& mim
|
|||||||
}
|
}
|
||||||
|
|
||||||
DrmInfoStatus* DrmManager::processDrmInfo(int uniqueId, const DrmInfo* drmInfo) {
|
DrmInfoStatus* DrmManager::processDrmInfo(int uniqueId, const DrmInfo* drmInfo) {
|
||||||
|
Mutex::Autolock _l(mLock);
|
||||||
const String8 plugInId = getSupportedPlugInId(drmInfo->getMimeType());
|
const String8 plugInId = getSupportedPlugInId(drmInfo->getMimeType());
|
||||||
if (EMPTY_STRING != plugInId) {
|
if (EMPTY_STRING != plugInId) {
|
||||||
IDrmEngine& rDrmEngine = mPlugInManager.getPlugIn(plugInId);
|
IDrmEngine& rDrmEngine = mPlugInManager.getPlugIn(plugInId);
|
||||||
@@ -218,6 +228,7 @@ bool DrmManager::canHandle(int uniqueId, const String8& path) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
DrmInfo* DrmManager::acquireDrmInfo(int uniqueId, const DrmInfoRequest* drmInfoRequest) {
|
DrmInfo* DrmManager::acquireDrmInfo(int uniqueId, const DrmInfoRequest* drmInfoRequest) {
|
||||||
|
Mutex::Autolock _l(mLock);
|
||||||
const String8 plugInId = getSupportedPlugInId(drmInfoRequest->getMimeType());
|
const String8 plugInId = getSupportedPlugInId(drmInfoRequest->getMimeType());
|
||||||
if (EMPTY_STRING != plugInId) {
|
if (EMPTY_STRING != plugInId) {
|
||||||
IDrmEngine& rDrmEngine = mPlugInManager.getPlugIn(plugInId);
|
IDrmEngine& rDrmEngine = mPlugInManager.getPlugIn(plugInId);
|
||||||
@@ -228,6 +239,7 @@ DrmInfo* DrmManager::acquireDrmInfo(int uniqueId, const DrmInfoRequest* drmInfoR
|
|||||||
|
|
||||||
status_t DrmManager::saveRights(int uniqueId, const DrmRights& drmRights,
|
status_t DrmManager::saveRights(int uniqueId, const DrmRights& drmRights,
|
||||||
const String8& rightsPath, const String8& contentPath) {
|
const String8& rightsPath, const String8& contentPath) {
|
||||||
|
Mutex::Autolock _l(mLock);
|
||||||
const String8 plugInId = getSupportedPlugInId(drmRights.getMimeType());
|
const String8 plugInId = getSupportedPlugInId(drmRights.getMimeType());
|
||||||
status_t result = DRM_ERROR_UNKNOWN;
|
status_t result = DRM_ERROR_UNKNOWN;
|
||||||
if (EMPTY_STRING != plugInId) {
|
if (EMPTY_STRING != plugInId) {
|
||||||
@@ -238,6 +250,7 @@ status_t DrmManager::saveRights(int uniqueId, const DrmRights& drmRights,
|
|||||||
}
|
}
|
||||||
|
|
||||||
String8 DrmManager::getOriginalMimeType(int uniqueId, const String8& path) {
|
String8 DrmManager::getOriginalMimeType(int uniqueId, const String8& path) {
|
||||||
|
Mutex::Autolock _l(mLock);
|
||||||
const String8 plugInId = getSupportedPlugInIdFromPath(uniqueId, path);
|
const String8 plugInId = getSupportedPlugInIdFromPath(uniqueId, path);
|
||||||
if (EMPTY_STRING != plugInId) {
|
if (EMPTY_STRING != plugInId) {
|
||||||
IDrmEngine& rDrmEngine = mPlugInManager.getPlugIn(plugInId);
|
IDrmEngine& rDrmEngine = mPlugInManager.getPlugIn(plugInId);
|
||||||
@@ -247,6 +260,7 @@ String8 DrmManager::getOriginalMimeType(int uniqueId, const String8& path) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
int DrmManager::getDrmObjectType(int uniqueId, const String8& path, const String8& mimeType) {
|
int DrmManager::getDrmObjectType(int uniqueId, const String8& path, const String8& mimeType) {
|
||||||
|
Mutex::Autolock _l(mLock);
|
||||||
const String8 plugInId = getSupportedPlugInId(uniqueId, path, mimeType);
|
const String8 plugInId = getSupportedPlugInId(uniqueId, path, mimeType);
|
||||||
if (EMPTY_STRING != plugInId) {
|
if (EMPTY_STRING != plugInId) {
|
||||||
IDrmEngine& rDrmEngine = mPlugInManager.getPlugIn(plugInId);
|
IDrmEngine& rDrmEngine = mPlugInManager.getPlugIn(plugInId);
|
||||||
@@ -256,6 +270,7 @@ int DrmManager::getDrmObjectType(int uniqueId, const String8& path, const String
|
|||||||
}
|
}
|
||||||
|
|
||||||
int DrmManager::checkRightsStatus(int uniqueId, const String8& path, int action) {
|
int DrmManager::checkRightsStatus(int uniqueId, const String8& path, int action) {
|
||||||
|
Mutex::Autolock _l(mLock);
|
||||||
const String8 plugInId = getSupportedPlugInIdFromPath(uniqueId, path);
|
const String8 plugInId = getSupportedPlugInIdFromPath(uniqueId, path);
|
||||||
if (EMPTY_STRING != plugInId) {
|
if (EMPTY_STRING != plugInId) {
|
||||||
IDrmEngine& rDrmEngine = mPlugInManager.getPlugIn(plugInId);
|
IDrmEngine& rDrmEngine = mPlugInManager.getPlugIn(plugInId);
|
||||||
@@ -267,6 +282,7 @@ int DrmManager::checkRightsStatus(int uniqueId, const String8& path, int action)
|
|||||||
status_t DrmManager::consumeRights(
|
status_t DrmManager::consumeRights(
|
||||||
int uniqueId, DecryptHandle* decryptHandle, int action, bool reserve) {
|
int uniqueId, DecryptHandle* decryptHandle, int action, bool reserve) {
|
||||||
status_t result = DRM_ERROR_UNKNOWN;
|
status_t result = DRM_ERROR_UNKNOWN;
|
||||||
|
Mutex::Autolock _l(mDecryptLock);
|
||||||
if (mDecryptSessionMap.indexOfKey(decryptHandle->decryptId) != NAME_NOT_FOUND) {
|
if (mDecryptSessionMap.indexOfKey(decryptHandle->decryptId) != NAME_NOT_FOUND) {
|
||||||
IDrmEngine* drmEngine = mDecryptSessionMap.valueFor(decryptHandle->decryptId);
|
IDrmEngine* drmEngine = mDecryptSessionMap.valueFor(decryptHandle->decryptId);
|
||||||
result = drmEngine->consumeRights(uniqueId, decryptHandle, action, reserve);
|
result = drmEngine->consumeRights(uniqueId, decryptHandle, action, reserve);
|
||||||
@@ -277,6 +293,7 @@ status_t DrmManager::consumeRights(
|
|||||||
status_t DrmManager::setPlaybackStatus(
|
status_t DrmManager::setPlaybackStatus(
|
||||||
int uniqueId, DecryptHandle* decryptHandle, int playbackStatus, int64_t position) {
|
int uniqueId, DecryptHandle* decryptHandle, int playbackStatus, int64_t position) {
|
||||||
status_t result = DRM_ERROR_UNKNOWN;
|
status_t result = DRM_ERROR_UNKNOWN;
|
||||||
|
Mutex::Autolock _l(mDecryptLock);
|
||||||
if (mDecryptSessionMap.indexOfKey(decryptHandle->decryptId) != NAME_NOT_FOUND) {
|
if (mDecryptSessionMap.indexOfKey(decryptHandle->decryptId) != NAME_NOT_FOUND) {
|
||||||
IDrmEngine* drmEngine = mDecryptSessionMap.valueFor(decryptHandle->decryptId);
|
IDrmEngine* drmEngine = mDecryptSessionMap.valueFor(decryptHandle->decryptId);
|
||||||
result = drmEngine->setPlaybackStatus(uniqueId, decryptHandle, playbackStatus, position);
|
result = drmEngine->setPlaybackStatus(uniqueId, decryptHandle, playbackStatus, position);
|
||||||
@@ -286,6 +303,7 @@ status_t DrmManager::setPlaybackStatus(
|
|||||||
|
|
||||||
bool DrmManager::validateAction(
|
bool DrmManager::validateAction(
|
||||||
int uniqueId, const String8& path, int action, const ActionDescription& description) {
|
int uniqueId, const String8& path, int action, const ActionDescription& description) {
|
||||||
|
Mutex::Autolock _l(mLock);
|
||||||
const String8 plugInId = getSupportedPlugInIdFromPath(uniqueId, path);
|
const String8 plugInId = getSupportedPlugInIdFromPath(uniqueId, path);
|
||||||
if (EMPTY_STRING != plugInId) {
|
if (EMPTY_STRING != plugInId) {
|
||||||
IDrmEngine& rDrmEngine = mPlugInManager.getPlugIn(plugInId);
|
IDrmEngine& rDrmEngine = mPlugInManager.getPlugIn(plugInId);
|
||||||
@@ -295,6 +313,7 @@ bool DrmManager::validateAction(
|
|||||||
}
|
}
|
||||||
|
|
||||||
status_t DrmManager::removeRights(int uniqueId, const String8& path) {
|
status_t DrmManager::removeRights(int uniqueId, const String8& path) {
|
||||||
|
Mutex::Autolock _l(mLock);
|
||||||
const String8 plugInId = getSupportedPlugInIdFromPath(uniqueId, path);
|
const String8 plugInId = getSupportedPlugInIdFromPath(uniqueId, path);
|
||||||
status_t result = DRM_ERROR_UNKNOWN;
|
status_t result = DRM_ERROR_UNKNOWN;
|
||||||
if (EMPTY_STRING != plugInId) {
|
if (EMPTY_STRING != plugInId) {
|
||||||
@@ -318,6 +337,7 @@ status_t DrmManager::removeAllRights(int uniqueId) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
int DrmManager::openConvertSession(int uniqueId, const String8& mimeType) {
|
int DrmManager::openConvertSession(int uniqueId, const String8& mimeType) {
|
||||||
|
Mutex::Autolock _l(mConvertLock);
|
||||||
int convertId = -1;
|
int convertId = -1;
|
||||||
|
|
||||||
const String8 plugInId = getSupportedPlugInId(mimeType);
|
const String8 plugInId = getSupportedPlugInId(mimeType);
|
||||||
@@ -325,7 +345,6 @@ int DrmManager::openConvertSession(int uniqueId, const String8& mimeType) {
|
|||||||
IDrmEngine& rDrmEngine = mPlugInManager.getPlugIn(plugInId);
|
IDrmEngine& rDrmEngine = mPlugInManager.getPlugIn(plugInId);
|
||||||
|
|
||||||
if (DRM_NO_ERROR == rDrmEngine.openConvertSession(uniqueId, mConvertId + 1)) {
|
if (DRM_NO_ERROR == rDrmEngine.openConvertSession(uniqueId, mConvertId + 1)) {
|
||||||
Mutex::Autolock _l(mConvertLock);
|
|
||||||
++mConvertId;
|
++mConvertId;
|
||||||
convertId = mConvertId;
|
convertId = mConvertId;
|
||||||
mConvertSessionMap.add(convertId, &rDrmEngine);
|
mConvertSessionMap.add(convertId, &rDrmEngine);
|
||||||
@@ -338,6 +357,7 @@ DrmConvertedStatus* DrmManager::convertData(
|
|||||||
int uniqueId, int convertId, const DrmBuffer* inputData) {
|
int uniqueId, int convertId, const DrmBuffer* inputData) {
|
||||||
DrmConvertedStatus *drmConvertedStatus = NULL;
|
DrmConvertedStatus *drmConvertedStatus = NULL;
|
||||||
|
|
||||||
|
Mutex::Autolock _l(mConvertLock);
|
||||||
if (mConvertSessionMap.indexOfKey(convertId) != NAME_NOT_FOUND) {
|
if (mConvertSessionMap.indexOfKey(convertId) != NAME_NOT_FOUND) {
|
||||||
IDrmEngine* drmEngine = mConvertSessionMap.valueFor(convertId);
|
IDrmEngine* drmEngine = mConvertSessionMap.valueFor(convertId);
|
||||||
drmConvertedStatus = drmEngine->convertData(uniqueId, convertId, inputData);
|
drmConvertedStatus = drmEngine->convertData(uniqueId, convertId, inputData);
|
||||||
@@ -346,6 +366,7 @@ DrmConvertedStatus* DrmManager::convertData(
|
|||||||
}
|
}
|
||||||
|
|
||||||
DrmConvertedStatus* DrmManager::closeConvertSession(int uniqueId, int convertId) {
|
DrmConvertedStatus* DrmManager::closeConvertSession(int uniqueId, int convertId) {
|
||||||
|
Mutex::Autolock _l(mConvertLock);
|
||||||
DrmConvertedStatus *drmConvertedStatus = NULL;
|
DrmConvertedStatus *drmConvertedStatus = NULL;
|
||||||
|
|
||||||
if (mConvertSessionMap.indexOfKey(convertId) != NAME_NOT_FOUND) {
|
if (mConvertSessionMap.indexOfKey(convertId) != NAME_NOT_FOUND) {
|
||||||
@@ -358,6 +379,7 @@ DrmConvertedStatus* DrmManager::closeConvertSession(int uniqueId, int convertId)
|
|||||||
|
|
||||||
status_t DrmManager::getAllSupportInfo(
|
status_t DrmManager::getAllSupportInfo(
|
||||||
int uniqueId, int* length, DrmSupportInfo** drmSupportInfoArray) {
|
int uniqueId, int* length, DrmSupportInfo** drmSupportInfoArray) {
|
||||||
|
Mutex::Autolock _l(mLock);
|
||||||
Vector<String8> plugInPathList = mPlugInManager.getPlugInIdList();
|
Vector<String8> plugInPathList = mPlugInManager.getPlugInIdList();
|
||||||
int size = plugInPathList.size();
|
int size = plugInPathList.size();
|
||||||
int validPlugins = 0;
|
int validPlugins = 0;
|
||||||
@@ -437,7 +459,7 @@ DecryptHandle* DrmManager::openDecryptSession(int uniqueId, const char* uri) {
|
|||||||
}
|
}
|
||||||
if (DRM_NO_ERROR != result) {
|
if (DRM_NO_ERROR != result) {
|
||||||
delete handle; handle = NULL;
|
delete handle; handle = NULL;
|
||||||
LOGE("DrmManager::openDecryptSession: no capable plug-in found");
|
LOGV("DrmManager::openDecryptSession: no capable plug-in found");
|
||||||
}
|
}
|
||||||
return handle;
|
return handle;
|
||||||
}
|
}
|
||||||
@@ -458,6 +480,7 @@ status_t DrmManager::closeDecryptSession(int uniqueId, DecryptHandle* decryptHan
|
|||||||
status_t DrmManager::initializeDecryptUnit(
|
status_t DrmManager::initializeDecryptUnit(
|
||||||
int uniqueId, DecryptHandle* decryptHandle, int decryptUnitId, const DrmBuffer* headerInfo) {
|
int uniqueId, DecryptHandle* decryptHandle, int decryptUnitId, const DrmBuffer* headerInfo) {
|
||||||
status_t result = DRM_ERROR_UNKNOWN;
|
status_t result = DRM_ERROR_UNKNOWN;
|
||||||
|
Mutex::Autolock _l(mDecryptLock);
|
||||||
if (mDecryptSessionMap.indexOfKey(decryptHandle->decryptId) != NAME_NOT_FOUND) {
|
if (mDecryptSessionMap.indexOfKey(decryptHandle->decryptId) != NAME_NOT_FOUND) {
|
||||||
IDrmEngine* drmEngine = mDecryptSessionMap.valueFor(decryptHandle->decryptId);
|
IDrmEngine* drmEngine = mDecryptSessionMap.valueFor(decryptHandle->decryptId);
|
||||||
result = drmEngine->initializeDecryptUnit(uniqueId, decryptHandle, decryptUnitId, headerInfo);
|
result = drmEngine->initializeDecryptUnit(uniqueId, decryptHandle, decryptUnitId, headerInfo);
|
||||||
@@ -468,6 +491,8 @@ status_t DrmManager::initializeDecryptUnit(
|
|||||||
status_t DrmManager::decrypt(int uniqueId, DecryptHandle* decryptHandle, int decryptUnitId,
|
status_t DrmManager::decrypt(int uniqueId, DecryptHandle* decryptHandle, int decryptUnitId,
|
||||||
const DrmBuffer* encBuffer, DrmBuffer** decBuffer, DrmBuffer* IV) {
|
const DrmBuffer* encBuffer, DrmBuffer** decBuffer, DrmBuffer* IV) {
|
||||||
status_t result = DRM_ERROR_UNKNOWN;
|
status_t result = DRM_ERROR_UNKNOWN;
|
||||||
|
|
||||||
|
Mutex::Autolock _l(mDecryptLock);
|
||||||
if (mDecryptSessionMap.indexOfKey(decryptHandle->decryptId) != NAME_NOT_FOUND) {
|
if (mDecryptSessionMap.indexOfKey(decryptHandle->decryptId) != NAME_NOT_FOUND) {
|
||||||
IDrmEngine* drmEngine = mDecryptSessionMap.valueFor(decryptHandle->decryptId);
|
IDrmEngine* drmEngine = mDecryptSessionMap.valueFor(decryptHandle->decryptId);
|
||||||
result = drmEngine->decrypt(
|
result = drmEngine->decrypt(
|
||||||
@@ -479,6 +504,7 @@ status_t DrmManager::decrypt(int uniqueId, DecryptHandle* decryptHandle, int dec
|
|||||||
status_t DrmManager::finalizeDecryptUnit(
|
status_t DrmManager::finalizeDecryptUnit(
|
||||||
int uniqueId, DecryptHandle* decryptHandle, int decryptUnitId) {
|
int uniqueId, DecryptHandle* decryptHandle, int decryptUnitId) {
|
||||||
status_t result = DRM_ERROR_UNKNOWN;
|
status_t result = DRM_ERROR_UNKNOWN;
|
||||||
|
Mutex::Autolock _l(mDecryptLock);
|
||||||
if (mDecryptSessionMap.indexOfKey(decryptHandle->decryptId) != NAME_NOT_FOUND) {
|
if (mDecryptSessionMap.indexOfKey(decryptHandle->decryptId) != NAME_NOT_FOUND) {
|
||||||
IDrmEngine* drmEngine = mDecryptSessionMap.valueFor(decryptHandle->decryptId);
|
IDrmEngine* drmEngine = mDecryptSessionMap.valueFor(decryptHandle->decryptId);
|
||||||
result = drmEngine->finalizeDecryptUnit(uniqueId, decryptHandle, decryptUnitId);
|
result = drmEngine->finalizeDecryptUnit(uniqueId, decryptHandle, decryptUnitId);
|
||||||
@@ -490,6 +516,7 @@ ssize_t DrmManager::pread(int uniqueId, DecryptHandle* decryptHandle,
|
|||||||
void* buffer, ssize_t numBytes, off64_t offset) {
|
void* buffer, ssize_t numBytes, off64_t offset) {
|
||||||
ssize_t result = DECRYPT_FILE_ERROR;
|
ssize_t result = DECRYPT_FILE_ERROR;
|
||||||
|
|
||||||
|
Mutex::Autolock _l(mDecryptLock);
|
||||||
if (mDecryptSessionMap.indexOfKey(decryptHandle->decryptId) != NAME_NOT_FOUND) {
|
if (mDecryptSessionMap.indexOfKey(decryptHandle->decryptId) != NAME_NOT_FOUND) {
|
||||||
IDrmEngine* drmEngine = mDecryptSessionMap.valueFor(decryptHandle->decryptId);
|
IDrmEngine* drmEngine = mDecryptSessionMap.valueFor(decryptHandle->decryptId);
|
||||||
result = drmEngine->pread(uniqueId, decryptHandle, buffer, numBytes, offset);
|
result = drmEngine->pread(uniqueId, decryptHandle, buffer, numBytes, offset);
|
||||||
|
|||||||
Reference in New Issue
Block a user