Loading include/media/ICrypto.h +1 −1 Original line number Diff line number Diff line Loading @@ -41,7 +41,7 @@ struct ICrypto : public IInterface { virtual bool requiresSecureDecoderComponent( const char *mime) const = 0; virtual status_t decrypt( virtual ssize_t decrypt( bool secure, const uint8_t key[16], const uint8_t iv[16], Loading media/libmedia/ICrypto.cpp +12 −17 Original line number Diff line number Diff line Loading @@ -91,7 +91,7 @@ struct BpCrypto : public BpInterface<ICrypto> { return reply.readInt32() != 0; } virtual status_t decrypt( virtual ssize_t decrypt( bool secure, const uint8_t key[16], const uint8_t iv[16], Loading Loading @@ -136,21 +136,17 @@ struct BpCrypto : public BpInterface<ICrypto> { remote()->transact(DECRYPT, data, &reply); status_t result = reply.readInt32(); ssize_t result = reply.readInt32(); if (result >= ERROR_DRM_VENDOR_MIN && result <= ERROR_DRM_VENDOR_MAX) { errorDetailMsg->setTo(reply.readCString()); } if (result != OK) { return result; } if (!secure) { reply.read(dstPtr, totalSize); if (!secure && result >= 0) { reply.read(dstPtr, result); } return OK; return result; } private: Loading Loading @@ -259,8 +255,7 @@ status_t BnCrypto::onTransact( } AString errorDetailMsg; status_t err = decrypt( ssize_t result = decrypt( secure, key, iv, Loading @@ -270,18 +265,18 @@ status_t BnCrypto::onTransact( dstPtr, &errorDetailMsg); reply->writeInt32(err); reply->writeInt32(result); if (err >= ERROR_DRM_VENDOR_MIN && err <= ERROR_DRM_VENDOR_MAX) { if (result >= ERROR_DRM_VENDOR_MIN && result <= ERROR_DRM_VENDOR_MAX) { reply->writeCString(errorDetailMsg.c_str()); } if (!secure) { if (err == OK) { reply->write(dstPtr, totalSize); if (result >= 0) { CHECK_LE(result, static_cast<ssize_t>(totalSize)); reply->write(dstPtr, result); } free(dstPtr); dstPtr = NULL; } Loading media/libmediaplayerservice/Crypto.cpp +1 −1 Original line number Diff line number Diff line Loading @@ -141,7 +141,7 @@ bool Crypto::requiresSecureDecoderComponent(const char *mime) const { return mPlugin->requiresSecureDecoderComponent(mime); } status_t Crypto::decrypt( ssize_t Crypto::decrypt( bool secure, const uint8_t key[16], const uint8_t iv[16], Loading media/libmediaplayerservice/Crypto.h +1 −1 Original line number Diff line number Diff line Loading @@ -42,7 +42,7 @@ struct Crypto : public BnCrypto { virtual bool requiresSecureDecoderComponent( const char *mime) const; virtual status_t decrypt( virtual ssize_t decrypt( bool secure, const uint8_t key[16], const uint8_t iv[16], Loading media/libstagefright/MediaCodec.cpp +4 −4 Original line number Diff line number Diff line Loading @@ -1346,7 +1346,7 @@ status_t MediaCodec::onQueueInputBuffer(const sp<AMessage> &msg) { AString *errorDetailMsg; CHECK(msg->findPointer("errorDetailMsg", (void **)&errorDetailMsg)); status_t err = mCrypto->decrypt( ssize_t result = mCrypto->decrypt( (mFlags & kFlagIsSecure) != 0, key, iv, Loading @@ -1357,11 +1357,11 @@ status_t MediaCodec::onQueueInputBuffer(const sp<AMessage> &msg) { info->mData->base(), errorDetailMsg); if (err != OK) { return err; if (result < 0) { return result; } info->mData->setRange(0, size); info->mData->setRange(0, result); } reply->setBuffer("buffer", info->mData); Loading Loading
include/media/ICrypto.h +1 −1 Original line number Diff line number Diff line Loading @@ -41,7 +41,7 @@ struct ICrypto : public IInterface { virtual bool requiresSecureDecoderComponent( const char *mime) const = 0; virtual status_t decrypt( virtual ssize_t decrypt( bool secure, const uint8_t key[16], const uint8_t iv[16], Loading
media/libmedia/ICrypto.cpp +12 −17 Original line number Diff line number Diff line Loading @@ -91,7 +91,7 @@ struct BpCrypto : public BpInterface<ICrypto> { return reply.readInt32() != 0; } virtual status_t decrypt( virtual ssize_t decrypt( bool secure, const uint8_t key[16], const uint8_t iv[16], Loading Loading @@ -136,21 +136,17 @@ struct BpCrypto : public BpInterface<ICrypto> { remote()->transact(DECRYPT, data, &reply); status_t result = reply.readInt32(); ssize_t result = reply.readInt32(); if (result >= ERROR_DRM_VENDOR_MIN && result <= ERROR_DRM_VENDOR_MAX) { errorDetailMsg->setTo(reply.readCString()); } if (result != OK) { return result; } if (!secure) { reply.read(dstPtr, totalSize); if (!secure && result >= 0) { reply.read(dstPtr, result); } return OK; return result; } private: Loading Loading @@ -259,8 +255,7 @@ status_t BnCrypto::onTransact( } AString errorDetailMsg; status_t err = decrypt( ssize_t result = decrypt( secure, key, iv, Loading @@ -270,18 +265,18 @@ status_t BnCrypto::onTransact( dstPtr, &errorDetailMsg); reply->writeInt32(err); reply->writeInt32(result); if (err >= ERROR_DRM_VENDOR_MIN && err <= ERROR_DRM_VENDOR_MAX) { if (result >= ERROR_DRM_VENDOR_MIN && result <= ERROR_DRM_VENDOR_MAX) { reply->writeCString(errorDetailMsg.c_str()); } if (!secure) { if (err == OK) { reply->write(dstPtr, totalSize); if (result >= 0) { CHECK_LE(result, static_cast<ssize_t>(totalSize)); reply->write(dstPtr, result); } free(dstPtr); dstPtr = NULL; } Loading
media/libmediaplayerservice/Crypto.cpp +1 −1 Original line number Diff line number Diff line Loading @@ -141,7 +141,7 @@ bool Crypto::requiresSecureDecoderComponent(const char *mime) const { return mPlugin->requiresSecureDecoderComponent(mime); } status_t Crypto::decrypt( ssize_t Crypto::decrypt( bool secure, const uint8_t key[16], const uint8_t iv[16], Loading
media/libmediaplayerservice/Crypto.h +1 −1 Original line number Diff line number Diff line Loading @@ -42,7 +42,7 @@ struct Crypto : public BnCrypto { virtual bool requiresSecureDecoderComponent( const char *mime) const; virtual status_t decrypt( virtual ssize_t decrypt( bool secure, const uint8_t key[16], const uint8_t iv[16], Loading
media/libstagefright/MediaCodec.cpp +4 −4 Original line number Diff line number Diff line Loading @@ -1346,7 +1346,7 @@ status_t MediaCodec::onQueueInputBuffer(const sp<AMessage> &msg) { AString *errorDetailMsg; CHECK(msg->findPointer("errorDetailMsg", (void **)&errorDetailMsg)); status_t err = mCrypto->decrypt( ssize_t result = mCrypto->decrypt( (mFlags & kFlagIsSecure) != 0, key, iv, Loading @@ -1357,11 +1357,11 @@ status_t MediaCodec::onQueueInputBuffer(const sp<AMessage> &msg) { info->mData->base(), errorDetailMsg); if (err != OK) { return err; if (result < 0) { return result; } info->mData->setRange(0, size); info->mData->setRange(0, result); } reply->setBuffer("buffer", info->mData); Loading