diff options
Diffstat (limited to 'drm/common')
-rw-r--r-- | drm/common/DrmEngineBase.cpp | 6 | ||||
-rw-r--r-- | drm/common/IDrmManagerService.cpp | 32 | ||||
-rw-r--r-- | drm/common/ReadWriteUtils.cpp | 4 |
3 files changed, 19 insertions, 23 deletions
diff --git a/drm/common/DrmEngineBase.cpp b/drm/common/DrmEngineBase.cpp index ac360eb..9b16c36 100644 --- a/drm/common/DrmEngineBase.cpp +++ b/drm/common/DrmEngineBase.cpp @@ -84,7 +84,7 @@ status_t DrmEngineBase::consumeRights( } status_t DrmEngineBase::setPlaybackStatus( - int uniqueId, DecryptHandle* decryptHandle, int playbackStatus, int position) { + int uniqueId, DecryptHandle* decryptHandle, int playbackStatus, int64_t position) { return onSetPlaybackStatus(uniqueId, decryptHandle, playbackStatus, position); } @@ -120,7 +120,7 @@ DrmSupportInfo* DrmEngineBase::getSupportInfo(int uniqueId) { } status_t DrmEngineBase::openDecryptSession( - int uniqueId, DecryptHandle* decryptHandle, int fd, int offset, int length) { + int uniqueId, DecryptHandle* decryptHandle, int fd, off64_t offset, off64_t length) { return onOpenDecryptSession(uniqueId, decryptHandle, fd, offset, length); } @@ -150,7 +150,7 @@ status_t DrmEngineBase::finalizeDecryptUnit( } ssize_t DrmEngineBase::pread( - int uniqueId, DecryptHandle* decryptHandle, void* buffer, ssize_t numBytes, off_t offset) { + int uniqueId, DecryptHandle* decryptHandle, void* buffer, ssize_t numBytes, off64_t offset) { return onPread(uniqueId, decryptHandle, buffer, numBytes, offset); } diff --git a/drm/common/IDrmManagerService.cpp b/drm/common/IDrmManagerService.cpp index 723b50e..ddbd220 100644 --- a/drm/common/IDrmManagerService.cpp +++ b/drm/common/IDrmManagerService.cpp @@ -363,7 +363,7 @@ status_t BpDrmManagerService::consumeRights( } status_t BpDrmManagerService::setPlaybackStatus( - int uniqueId, DecryptHandle* decryptHandle, int playbackStatus, int position) { + int uniqueId, DecryptHandle* decryptHandle, int playbackStatus, int64_t position) { LOGV("setPlaybackStatus"); Parcel data, reply; @@ -382,7 +382,7 @@ status_t BpDrmManagerService::setPlaybackStatus( } data.writeInt32(playbackStatus); - data.writeInt32(position); + data.writeInt64(position); remote()->transact(SET_PLAYBACK_STATUS, data, &reply); return reply.readInt32(); @@ -459,7 +459,7 @@ DrmConvertedStatus* BpDrmManagerService::convertData( if (0 != reply.dataAvail()) { //Filling DRM Converted Status const int statusCode = reply.readInt32(); - const int offset = reply.readInt32(); + const off64_t offset = reply.readInt64(); DrmBuffer* convertedData = NULL; if (0 != reply.dataAvail()) { @@ -491,7 +491,7 @@ DrmConvertedStatus* BpDrmManagerService::closeConvertSession(int uniqueId, int c if (0 != reply.dataAvail()) { //Filling DRM Converted Status const int statusCode = reply.readInt32(); - const int offset = reply.readInt32(); + const off64_t offset = reply.readInt64(); DrmBuffer* convertedData = NULL; if (0 != reply.dataAvail()) { @@ -545,15 +545,15 @@ status_t BpDrmManagerService::getAllSupportInfo( } DecryptHandle* BpDrmManagerService::openDecryptSession( - int uniqueId, int fd, int offset, int length) { + int uniqueId, int fd, off64_t offset, off64_t length) { LOGV("Entering BpDrmManagerService::openDecryptSession"); Parcel data, reply; data.writeInterfaceToken(IDrmManagerService::getInterfaceDescriptor()); data.writeInt32(uniqueId); data.writeFileDescriptor(fd); - data.writeInt32(offset); - data.writeInt32(length); + data.writeInt64(offset); + data.writeInt64(length); remote()->transact(OPEN_DECRYPT_SESSION, data, &reply); @@ -569,8 +569,6 @@ DecryptHandle* BpDrmManagerService::openDecryptSession( handle->decryptInfo = new DecryptInfo(); handle->decryptInfo->decryptBufferLength = reply.readInt32(); } - } else { - LOGE("no decryptHandle is generated in service side"); } return handle; } @@ -729,7 +727,7 @@ status_t BpDrmManagerService::finalizeDecryptUnit( ssize_t BpDrmManagerService::pread( int uniqueId, DecryptHandle* decryptHandle, void* buffer, - ssize_t numBytes, off_t offset) { + ssize_t numBytes, off64_t offset) { LOGV("read"); Parcel data, reply; int result; @@ -749,7 +747,7 @@ ssize_t BpDrmManagerService::pread( } data.writeInt32(numBytes); - data.writeInt32(offset); + data.writeInt64(offset); remote()->transact(PREAD, data, &reply); result = reply.readInt32(); @@ -1113,7 +1111,7 @@ status_t BnDrmManagerService::onTransact( } const status_t status - = setPlaybackStatus(uniqueId, &handle, data.readInt32(), data.readInt32()); + = setPlaybackStatus(uniqueId, &handle, data.readInt32(), data.readInt64()); reply->writeInt32(status); delete handle.decryptInfo; handle.decryptInfo = NULL; @@ -1185,7 +1183,7 @@ status_t BnDrmManagerService::onTransact( if (NULL != drmConvertedStatus) { //Filling Drm Converted Ststus reply->writeInt32(drmConvertedStatus->statusCode); - reply->writeInt32(drmConvertedStatus->offset); + reply->writeInt64(drmConvertedStatus->offset); if (NULL != drmConvertedStatus->convertedData) { const DrmBuffer* convertedData = drmConvertedStatus->convertedData; @@ -1214,7 +1212,7 @@ status_t BnDrmManagerService::onTransact( if (NULL != drmConvertedStatus) { //Filling Drm Converted Ststus reply->writeInt32(drmConvertedStatus->statusCode); - reply->writeInt32(drmConvertedStatus->offset); + reply->writeInt64(drmConvertedStatus->offset); if (NULL != drmConvertedStatus->convertedData) { const DrmBuffer* convertedData = drmConvertedStatus->convertedData; @@ -1274,7 +1272,7 @@ status_t BnDrmManagerService::onTransact( const int fd = data.readFileDescriptor(); DecryptHandle* handle - = openDecryptSession(uniqueId, fd, data.readInt32(), data.readInt32()); + = openDecryptSession(uniqueId, fd, data.readInt64(), data.readInt64()); if (NULL != handle) { reply->writeInt32(handle->decryptId); @@ -1285,8 +1283,6 @@ status_t BnDrmManagerService::onTransact( reply->writeInt32(handle->decryptInfo->decryptBufferLength); delete handle->decryptInfo; handle->decryptInfo = NULL; } - } else { - LOGE("NULL decryptHandle is returned"); } delete handle; handle = NULL; return DRM_NO_ERROR; @@ -1481,7 +1477,7 @@ status_t BnDrmManagerService::onTransact( const int numBytes = data.readInt32(); char* buffer = new char[numBytes]; - const off_t offset = data.readInt32(); + const off64_t offset = data.readInt64(); ssize_t result = pread(uniqueId, &handle, buffer, numBytes, offset); reply->writeInt32(result); diff --git a/drm/common/ReadWriteUtils.cpp b/drm/common/ReadWriteUtils.cpp index 7ec4fa2..c16214e 100644 --- a/drm/common/ReadWriteUtils.cpp +++ b/drm/common/ReadWriteUtils.cpp @@ -42,7 +42,7 @@ String8 ReadWriteUtils::readBytes(const String8& filePath) { struct stat sb; if (fstat(fd, &sb) == 0 && sb.st_size > 0) { - int length = sb.st_size; + off64_t length = sb.st_size; char* bytes = new char[length]; if (length == read(fd, (void*) bytes, length)) { string.append(bytes, length); @@ -57,7 +57,7 @@ String8 ReadWriteUtils::readBytes(const String8& filePath) { int ReadWriteUtils::readBytes(const String8& filePath, char** buffer) { FILE* file = NULL; file = fopen(filePath.string(), "r"); - int length = 0; + off64_t length = 0; if (NULL != file) { int fd = fileno(file); |