Lines Matching refs:mObj

49     AMediaDrm *mObj;  member
55 DrmListener(AMediaDrm *obj, AMediaDrmEventListener listener) : mObj(obj), in DrmListener()
58 DrmListener(AMediaDrm *obj, AMediaDrmExpirationUpdateListener listener) : mObj(obj), in DrmListener()
61 DrmListener(AMediaDrm *obj, AMediaDrmKeysChangeListener listener) : mObj(obj), in DrmListener()
120 (*mExpirationUpdateListener)(mObj, &asid, expiryTimeInMS); in sendExpirationUpdate()
146 (*mKeysChangeListener)(mObj, &asid, keysStatus.array(), numKeys, hasNewUsableKey); in sendKeysChange()
187 (*mEventListener)(mObj, &asid, ndkEventType, 0, dataPtr, dataSize); in sendEvent()
302 AMediaDrm *mObj = new AMediaDrm(); in AMediaDrm_createByUUID() local
303 mObj->mDrm = CreateDrmFromUUID(uuid); in AMediaDrm_createByUUID()
305 mObj->mListener.clear(); in AMediaDrm_createByUUID()
306 return mObj; in AMediaDrm_createByUUID()
310 void AMediaDrm_release(AMediaDrm *mObj) { in AMediaDrm_release() argument
311 if (mObj->mDrm != NULL) { in AMediaDrm_release()
312 mObj->mDrm->setListener(NULL); in AMediaDrm_release()
313 mObj->mDrm->destroyPlugin(); in AMediaDrm_release()
314 mObj->mDrm.clear(); in AMediaDrm_release()
316 delete mObj; in AMediaDrm_release()
320 media_status_t AMediaDrm_setOnEventListener(AMediaDrm *mObj, AMediaDrmEventListener listener) { in AMediaDrm_setOnEventListener() argument
321 if (!mObj || mObj->mDrm == NULL) { in AMediaDrm_setOnEventListener()
325 if (mObj->mListener.get()) { in AMediaDrm_setOnEventListener()
326 mObj->mListener->setEventListener(listener); in AMediaDrm_setOnEventListener()
328 mObj->mListener = new DrmListener(mObj, listener); in AMediaDrm_setOnEventListener()
330 mObj->mDrm->setListener(mObj->mListener); in AMediaDrm_setOnEventListener()
335 media_status_t AMediaDrm_setOnExpirationUpdateListener(AMediaDrm *mObj, in AMediaDrm_setOnExpirationUpdateListener() argument
337 if (!mObj || mObj->mDrm == NULL) { in AMediaDrm_setOnExpirationUpdateListener()
341 if (mObj->mListener.get()) { in AMediaDrm_setOnExpirationUpdateListener()
342 mObj->mListener->setExpirationUpdateListener(listener); in AMediaDrm_setOnExpirationUpdateListener()
344 mObj->mListener = new DrmListener(mObj, listener); in AMediaDrm_setOnExpirationUpdateListener()
346 mObj->mDrm->setListener(mObj->mListener); in AMediaDrm_setOnExpirationUpdateListener()
351 media_status_t AMediaDrm_setOnKeysChangeListener(AMediaDrm *mObj, in AMediaDrm_setOnKeysChangeListener() argument
353 if (!mObj || mObj->mDrm == NULL) { in AMediaDrm_setOnKeysChangeListener()
357 if (mObj->mListener.get()) { in AMediaDrm_setOnKeysChangeListener()
358 mObj->mListener->setKeysChangeListener(listener); in AMediaDrm_setOnKeysChangeListener()
360 mObj->mListener = new DrmListener(mObj, listener); in AMediaDrm_setOnKeysChangeListener()
362 mObj->mDrm->setListener(mObj->mListener); in AMediaDrm_setOnKeysChangeListener()
366 static bool findId(AMediaDrm *mObj, const AMediaDrmByteArray &id, List<idvec_t>::iterator &iter) { in findId() argument
367 for (iter = mObj->mIds.begin(); iter != mObj->mIds.end(); ++iter) { in findId()
376 media_status_t AMediaDrm_openSession(AMediaDrm *mObj, AMediaDrmSessionId *sessionId) { in AMediaDrm_openSession() argument
377 if (!mObj || mObj->mDrm == NULL) { in AMediaDrm_openSession()
384 status_t status = mObj->mDrm->openSession(DrmPlugin::kSecurityLevelMax, session); in AMediaDrm_openSession()
390 mObj->mIds.push_front(session); in AMediaDrm_openSession()
391 List<idvec_t>::iterator iter = mObj->mIds.begin(); in AMediaDrm_openSession()
398 media_status_t AMediaDrm_closeSession(AMediaDrm *mObj, const AMediaDrmSessionId *sessionId) { in AMediaDrm_closeSession() argument
399 if (!mObj || mObj->mDrm == NULL) { in AMediaDrm_closeSession()
407 if (!findId(mObj, *sessionId, iter)) { in AMediaDrm_closeSession()
410 mObj->mDrm->closeSession(*iter); in AMediaDrm_closeSession()
411 mObj->mIds.erase(iter); in AMediaDrm_closeSession()
416 media_status_t AMediaDrm_getKeyRequest(AMediaDrm *mObj, const AMediaDrmScope *scope, in AMediaDrm_getKeyRequest() argument
421 return AMediaDrm_getKeyRequestWithDefaultUrlAndType(mObj, in AMediaDrm_getKeyRequest()
428 media_status_t AMediaDrm_getKeyRequestWithDefaultUrlAndType(AMediaDrm *mObj, in AMediaDrm_getKeyRequestWithDefaultUrlAndType() argument
436 if (!mObj || mObj->mDrm == NULL) { in AMediaDrm_getKeyRequestWithDefaultUrlAndType()
444 if (!findId(mObj, *scope, iter)) { in AMediaDrm_getKeyRequestWithDefaultUrlAndType()
471 mObj->mKeyRequest.clear(); in AMediaDrm_getKeyRequestWithDefaultUrlAndType()
472 status_t status = mObj->mDrm->getKeyRequest(*iter, mdInit, String8(mimeType), in AMediaDrm_getKeyRequestWithDefaultUrlAndType()
473 mdKeyType, mdOptionalParameters, mObj->mKeyRequest, mObj->mDefaultUrl, in AMediaDrm_getKeyRequestWithDefaultUrlAndType()
478 *keyRequest = mObj->mKeyRequest.array(); in AMediaDrm_getKeyRequestWithDefaultUrlAndType()
479 *keyRequestSize = mObj->mKeyRequest.size(); in AMediaDrm_getKeyRequestWithDefaultUrlAndType()
481 *defaultUrl = mObj->mDefaultUrl.c_str(); in AMediaDrm_getKeyRequestWithDefaultUrlAndType()
484 mObj->mkeyRequestType = KEY_REQUEST_TYPE_INITIAL; in AMediaDrm_getKeyRequestWithDefaultUrlAndType()
487 mObj->mkeyRequestType = KEY_REQUEST_TYPE_RENEWAL; in AMediaDrm_getKeyRequestWithDefaultUrlAndType()
490 mObj->mkeyRequestType = KEY_REQUEST_TYPE_RELEASE; in AMediaDrm_getKeyRequestWithDefaultUrlAndType()
493 mObj->mkeyRequestType = KEY_REQUEST_TYPE_NONE; in AMediaDrm_getKeyRequestWithDefaultUrlAndType()
496 mObj->mkeyRequestType = KEY_REQUEST_TYPE_UPDATE; in AMediaDrm_getKeyRequestWithDefaultUrlAndType()
503 *keyRequestType = mObj->mkeyRequestType; in AMediaDrm_getKeyRequestWithDefaultUrlAndType()
510 media_status_t AMediaDrm_provideKeyResponse(AMediaDrm *mObj, const AMediaDrmScope *scope, in AMediaDrm_provideKeyResponse() argument
513 if (!mObj || mObj->mDrm == NULL) { in AMediaDrm_provideKeyResponse()
521 if (!findId(mObj, *scope, iter)) { in AMediaDrm_provideKeyResponse()
528 status_t status = mObj->mDrm->provideKeyResponse(*iter, mdResponse, mdKeySetId); in AMediaDrm_provideKeyResponse()
530 mObj->mIds.push_front(mdKeySetId); in AMediaDrm_provideKeyResponse()
531 List<idvec_t>::iterator iter = mObj->mIds.begin(); in AMediaDrm_provideKeyResponse()
543 media_status_t AMediaDrm_restoreKeys(AMediaDrm *mObj, const AMediaDrmSessionId *sessionId, in AMediaDrm_restoreKeys() argument
546 if (!mObj || mObj->mDrm == NULL) { in AMediaDrm_restoreKeys()
553 if (!findId(mObj, *sessionId, iter)) { in AMediaDrm_restoreKeys()
558 return translateStatus(mObj->mDrm->restoreKeys(*iter, keySet)); in AMediaDrm_restoreKeys()
562 media_status_t AMediaDrm_removeKeys(AMediaDrm *mObj, const AMediaDrmSessionId *keySetId) { in AMediaDrm_removeKeys() argument
563 if (!mObj || mObj->mDrm == NULL) { in AMediaDrm_removeKeys()
571 if (!findId(mObj, *keySetId, iter)) { in AMediaDrm_removeKeys()
574 status = mObj->mDrm->removeKeys(keySet); in AMediaDrm_removeKeys()
576 status = mObj->mDrm->removeKeys(*iter); in AMediaDrm_removeKeys()
577 mObj->mIds.erase(iter); in AMediaDrm_removeKeys()
583 media_status_t AMediaDrm_queryKeyStatus(AMediaDrm *mObj, const AMediaDrmSessionId *sessionId, in AMediaDrm_queryKeyStatus() argument
586 if (!mObj || mObj->mDrm == NULL) { in AMediaDrm_queryKeyStatus()
593 if (!findId(mObj, *sessionId, iter)) { in AMediaDrm_queryKeyStatus()
597 status_t status = mObj->mDrm->queryKeyStatus(*iter, mObj->mQueryResults); in AMediaDrm_queryKeyStatus()
603 if (mObj->mQueryResults.size() > *numPairs) { in AMediaDrm_queryKeyStatus()
604 *numPairs = mObj->mQueryResults.size(); in AMediaDrm_queryKeyStatus()
608 for (size_t i = 0; i < mObj->mQueryResults.size(); i++) { in AMediaDrm_queryKeyStatus()
609 keyValuePairs[i].mKey = mObj->mQueryResults.keyAt(i).c_str(); in AMediaDrm_queryKeyStatus()
610 keyValuePairs[i].mValue = mObj->mQueryResults.valueAt(i).c_str(); in AMediaDrm_queryKeyStatus()
612 *numPairs = mObj->mQueryResults.size(); in AMediaDrm_queryKeyStatus()
617 media_status_t AMediaDrm_getProvisionRequest(AMediaDrm *mObj, const uint8_t **provisionRequest, in AMediaDrm_getProvisionRequest() argument
619 if (!mObj || mObj->mDrm == NULL) { in AMediaDrm_getProvisionRequest()
626 status_t status = mObj->mDrm->getProvisionRequest(String8(""), String8(""), in AMediaDrm_getProvisionRequest()
627 mObj->mProvisionRequest, mObj->mProvisionUrl); in AMediaDrm_getProvisionRequest()
631 *provisionRequest = mObj->mProvisionRequest.array(); in AMediaDrm_getProvisionRequest()
632 *provisionRequestSize = mObj->mProvisionRequest.size(); in AMediaDrm_getProvisionRequest()
633 *serverUrl = mObj->mProvisionUrl.c_str(); in AMediaDrm_getProvisionRequest()
639 media_status_t AMediaDrm_provideProvisionResponse(AMediaDrm *mObj, in AMediaDrm_provideProvisionResponse() argument
641 if (!mObj || mObj->mDrm == NULL) { in AMediaDrm_provideProvisionResponse()
652 return translateStatus(mObj->mDrm->provideProvisionResponse(mdResponse, unused, unused)); in AMediaDrm_provideProvisionResponse()
656 media_status_t AMediaDrm_getSecureStops(AMediaDrm *mObj, in AMediaDrm_getSecureStops() argument
659 if (!mObj || mObj->mDrm == NULL) { in AMediaDrm_getSecureStops()
665 status_t status = mObj->mDrm->getSecureStops(mObj->mSecureStops); in AMediaDrm_getSecureStops()
670 if (*numSecureStops < mObj->mSecureStops.size()) { in AMediaDrm_getSecureStops()
673 List<Vector<uint8_t> >::iterator iter = mObj->mSecureStops.begin(); in AMediaDrm_getSecureStops()
675 while (iter != mObj->mSecureStops.end()) { in AMediaDrm_getSecureStops()
681 *numSecureStops = mObj->mSecureStops.size(); in AMediaDrm_getSecureStops()
686 media_status_t AMediaDrm_releaseSecureStops(AMediaDrm *mObj, in AMediaDrm_releaseSecureStops() argument
689 if (!mObj || mObj->mDrm == NULL) { in AMediaDrm_releaseSecureStops()
698 return translateStatus(mObj->mDrm->releaseSecureStops(release)); in AMediaDrm_releaseSecureStops()
703 media_status_t AMediaDrm_getPropertyString(AMediaDrm *mObj, const char *propertyName, in AMediaDrm_getPropertyString() argument
706 if (!mObj || mObj->mDrm == NULL) { in AMediaDrm_getPropertyString()
713 status_t status = mObj->mDrm->getPropertyString(String8(propertyName), in AMediaDrm_getPropertyString()
714 mObj->mPropertyString); in AMediaDrm_getPropertyString()
717 *propertyValue = mObj->mPropertyString.c_str(); in AMediaDrm_getPropertyString()
725 media_status_t AMediaDrm_getPropertyByteArray(AMediaDrm *mObj, in AMediaDrm_getPropertyByteArray() argument
727 if (!mObj || mObj->mDrm == NULL) { in AMediaDrm_getPropertyByteArray()
734 status_t status = mObj->mDrm->getPropertyByteArray(String8(propertyName), in AMediaDrm_getPropertyByteArray()
735 mObj->mPropertyByteArray); in AMediaDrm_getPropertyByteArray()
738 propertyValue->ptr = mObj->mPropertyByteArray.array(); in AMediaDrm_getPropertyByteArray()
739 propertyValue->length = mObj->mPropertyByteArray.size(); in AMediaDrm_getPropertyByteArray()
748 media_status_t AMediaDrm_setPropertyString(AMediaDrm *mObj, in AMediaDrm_setPropertyString() argument
750 if (!mObj || mObj->mDrm == NULL) { in AMediaDrm_setPropertyString()
754 return translateStatus(mObj->mDrm->setPropertyString(String8(propertyName), in AMediaDrm_setPropertyString()
759 media_status_t AMediaDrm_setPropertyByteArray(AMediaDrm *mObj, in AMediaDrm_setPropertyByteArray() argument
761 if (!mObj || mObj->mDrm == NULL) { in AMediaDrm_setPropertyByteArray()
768 return translateStatus(mObj->mDrm->setPropertyByteArray(String8(propertyName), in AMediaDrm_setPropertyByteArray()
773 static media_status_t encrypt_decrypt_common(AMediaDrm *mObj, in encrypt_decrypt_common() argument
778 if (!mObj || mObj->mDrm == NULL) { in encrypt_decrypt_common()
782 if (!findId(mObj, sessionId, iter)) { in encrypt_decrypt_common()
786 status_t status = mObj->mDrm->setCipherAlgorithm(*iter, String8(cipherAlgorithm)); in encrypt_decrypt_common()
804 status = mObj->mDrm->encrypt(*iter, keyIdVec, inputVec, ivVec, outputVec); in encrypt_decrypt_common()
806 status = mObj->mDrm->decrypt(*iter, keyIdVec, inputVec, ivVec, outputVec); in encrypt_decrypt_common()
815 media_status_t AMediaDrm_encrypt(AMediaDrm *mObj, const AMediaDrmSessionId *sessionId, in AMediaDrm_encrypt() argument
821 return encrypt_decrypt_common(mObj, *sessionId, cipherAlgorithm, keyId, iv, in AMediaDrm_encrypt()
826 media_status_t AMediaDrm_decrypt(AMediaDrm *mObj, const AMediaDrmSessionId *sessionId, in AMediaDrm_decrypt() argument
832 return encrypt_decrypt_common(mObj, *sessionId, cipherAlgorithm, keyId, iv, in AMediaDrm_decrypt()
837 media_status_t AMediaDrm_sign(AMediaDrm *mObj, const AMediaDrmSessionId *sessionId, in AMediaDrm_sign() argument
841 if (!mObj || mObj->mDrm == NULL) { in AMediaDrm_sign()
848 if (!findId(mObj, *sessionId, iter)) { in AMediaDrm_sign()
852 status_t status = mObj->mDrm->setMacAlgorithm(*iter, String8(macAlgorithm)); in AMediaDrm_sign()
865 status = mObj->mDrm->sign(*iter, keyIdVec, messageVec, signatureVec); in AMediaDrm_sign()
876 media_status_t AMediaDrm_verify(AMediaDrm *mObj, const AMediaDrmSessionId *sessionId, in AMediaDrm_verify() argument
880 if (!mObj || mObj->mDrm == NULL) { in AMediaDrm_verify()
887 if (!findId(mObj, *sessionId, iter)) { in AMediaDrm_verify()
891 status_t status = mObj->mDrm->setMacAlgorithm(*iter, String8(macAlgorithm)); in AMediaDrm_verify()
907 status = mObj->mDrm->verify(*iter, keyIdVec, messageVec, signatureVec, match); in AMediaDrm_verify()