Loading include/media/IOMX.h +2 −1 Original line number Diff line number Diff line Loading @@ -37,6 +37,7 @@ namespace android { class IMemory; class IOMXObserver; class IOMXRenderer; class NativeHandle; class Surface; class IOMX : public IInterface { Loading Loading @@ -149,7 +150,7 @@ public: // pointer is just that, a pointer into local address space. virtual status_t allocateSecureBuffer( node_id node, OMX_U32 port_index, size_t size, buffer_id *buffer, void **buffer_data, native_handle_t **native_handle) = 0; buffer_id *buffer, void **buffer_data, sp<NativeHandle> *native_handle) = 0; // Allocate an OMX buffer of size |allotedSize|. Use |params| as the backup buffer, which // may be larger. Loading media/libmedia/IOMX.cpp +5 −4 Original line number Diff line number Diff line Loading @@ -487,7 +487,7 @@ public: virtual status_t allocateSecureBuffer( node_id node, OMX_U32 port_index, size_t size, buffer_id *buffer, void **buffer_data, native_handle_t **native_handle) { buffer_id *buffer, void **buffer_data, sp<NativeHandle> *native_handle) { Parcel data, reply; data.writeInterfaceToken(IOMX::getInterfaceDescriptor()); data.writeInt32((int32_t)node); Loading @@ -506,7 +506,8 @@ public: *buffer = (buffer_id)reply.readInt32(); *buffer_data = (void *)reply.readInt64(); if (*buffer_data == NULL) { *native_handle = reply.readNativeHandle(); *native_handle = NativeHandle::create( reply.readNativeHandle(), true /* ownsHandle */); } else { *native_handle = NULL; } Loading Loading @@ -1104,7 +1105,7 @@ status_t BnOMX::onTransact( buffer_id buffer; void *buffer_data = NULL; native_handle_t *native_handle = NULL; sp<NativeHandle> native_handle; status_t err = allocateSecureBuffer( node, port_index, size, &buffer, &buffer_data, &native_handle); reply->writeInt32(err); Loading @@ -1113,7 +1114,7 @@ status_t BnOMX::onTransact( reply->writeInt32((int32_t)buffer); reply->writeInt64((uintptr_t)buffer_data); if (buffer_data == NULL) { reply->writeNativeHandle(native_handle); reply->writeNativeHandle(native_handle == NULL ? NULL : native_handle->handle()); } } Loading media/libstagefright/ACodec.cpp +6 −3 Original line number Diff line number Diff line Loading @@ -867,7 +867,7 @@ status_t ACodec::allocateBuffersOnPort(OMX_U32 portIndex) { mem.clear(); void *ptr = NULL; native_handle_t *native_handle = NULL; sp<NativeHandle> native_handle; err = mOMX->allocateSecureBuffer( mNode, portIndex, bufSize, &info.mBufferID, &ptr, &native_handle); Loading @@ -880,8 +880,11 @@ status_t ACodec::allocateBuffersOnPort(OMX_U32 portIndex) { // TRICKY2: use native handle as the base of the ABuffer if received one, // because Widevine source only receives these base addresses. info.mData = new ABuffer(ptr != NULL ? ptr : (void *)native_handle, bufSize); info.mNativeHandle = NativeHandle::create(native_handle, true /* ownsHandle */); const native_handle_t *native_handle_ptr = native_handle == NULL ? NULL : native_handle->handle(); info.mData = new ABuffer( ptr != NULL ? ptr : (void *)native_handle_ptr, bufSize); info.mNativeHandle = native_handle; info.mCodecData = info.mData; } else if (mQuirks & requiresAllocateBufferBit) { err = mOMX->allocateBufferWithBackup( Loading media/libstagefright/OMXClient.cpp +2 −2 Original line number Diff line number Diff line Loading @@ -131,7 +131,7 @@ struct MuxOMX : public IOMX { virtual status_t allocateSecureBuffer( node_id node, OMX_U32 port_index, size_t size, buffer_id *buffer, void **buffer_data, native_handle_t **native_handle); buffer_id *buffer, void **buffer_data, sp<NativeHandle> *native_handle); virtual status_t allocateBufferWithBackup( node_id node, OMX_U32 port_index, const sp<IMemory> ¶ms, Loading Loading @@ -426,7 +426,7 @@ status_t MuxOMX::signalEndOfInputStream(node_id node) { status_t MuxOMX::allocateSecureBuffer( node_id node, OMX_U32 port_index, size_t size, buffer_id *buffer, void **buffer_data, native_handle_t **native_handle) { buffer_id *buffer, void **buffer_data, sp<NativeHandle> *native_handle) { return getOMX(node)->allocateSecureBuffer( node, port_index, size, buffer, buffer_data, native_handle); } Loading media/libstagefright/include/OMX.h +1 −1 Original line number Diff line number Diff line Loading @@ -115,7 +115,7 @@ public: virtual status_t allocateSecureBuffer( node_id node, OMX_U32 port_index, size_t size, buffer_id *buffer, void **buffer_data, native_handle_t **native_handle); buffer_id *buffer, void **buffer_data, sp<NativeHandle> *native_handle); virtual status_t allocateBufferWithBackup( node_id node, OMX_U32 port_index, const sp<IMemory> ¶ms, Loading Loading
include/media/IOMX.h +2 −1 Original line number Diff line number Diff line Loading @@ -37,6 +37,7 @@ namespace android { class IMemory; class IOMXObserver; class IOMXRenderer; class NativeHandle; class Surface; class IOMX : public IInterface { Loading Loading @@ -149,7 +150,7 @@ public: // pointer is just that, a pointer into local address space. virtual status_t allocateSecureBuffer( node_id node, OMX_U32 port_index, size_t size, buffer_id *buffer, void **buffer_data, native_handle_t **native_handle) = 0; buffer_id *buffer, void **buffer_data, sp<NativeHandle> *native_handle) = 0; // Allocate an OMX buffer of size |allotedSize|. Use |params| as the backup buffer, which // may be larger. Loading
media/libmedia/IOMX.cpp +5 −4 Original line number Diff line number Diff line Loading @@ -487,7 +487,7 @@ public: virtual status_t allocateSecureBuffer( node_id node, OMX_U32 port_index, size_t size, buffer_id *buffer, void **buffer_data, native_handle_t **native_handle) { buffer_id *buffer, void **buffer_data, sp<NativeHandle> *native_handle) { Parcel data, reply; data.writeInterfaceToken(IOMX::getInterfaceDescriptor()); data.writeInt32((int32_t)node); Loading @@ -506,7 +506,8 @@ public: *buffer = (buffer_id)reply.readInt32(); *buffer_data = (void *)reply.readInt64(); if (*buffer_data == NULL) { *native_handle = reply.readNativeHandle(); *native_handle = NativeHandle::create( reply.readNativeHandle(), true /* ownsHandle */); } else { *native_handle = NULL; } Loading Loading @@ -1104,7 +1105,7 @@ status_t BnOMX::onTransact( buffer_id buffer; void *buffer_data = NULL; native_handle_t *native_handle = NULL; sp<NativeHandle> native_handle; status_t err = allocateSecureBuffer( node, port_index, size, &buffer, &buffer_data, &native_handle); reply->writeInt32(err); Loading @@ -1113,7 +1114,7 @@ status_t BnOMX::onTransact( reply->writeInt32((int32_t)buffer); reply->writeInt64((uintptr_t)buffer_data); if (buffer_data == NULL) { reply->writeNativeHandle(native_handle); reply->writeNativeHandle(native_handle == NULL ? NULL : native_handle->handle()); } } Loading
media/libstagefright/ACodec.cpp +6 −3 Original line number Diff line number Diff line Loading @@ -867,7 +867,7 @@ status_t ACodec::allocateBuffersOnPort(OMX_U32 portIndex) { mem.clear(); void *ptr = NULL; native_handle_t *native_handle = NULL; sp<NativeHandle> native_handle; err = mOMX->allocateSecureBuffer( mNode, portIndex, bufSize, &info.mBufferID, &ptr, &native_handle); Loading @@ -880,8 +880,11 @@ status_t ACodec::allocateBuffersOnPort(OMX_U32 portIndex) { // TRICKY2: use native handle as the base of the ABuffer if received one, // because Widevine source only receives these base addresses. info.mData = new ABuffer(ptr != NULL ? ptr : (void *)native_handle, bufSize); info.mNativeHandle = NativeHandle::create(native_handle, true /* ownsHandle */); const native_handle_t *native_handle_ptr = native_handle == NULL ? NULL : native_handle->handle(); info.mData = new ABuffer( ptr != NULL ? ptr : (void *)native_handle_ptr, bufSize); info.mNativeHandle = native_handle; info.mCodecData = info.mData; } else if (mQuirks & requiresAllocateBufferBit) { err = mOMX->allocateBufferWithBackup( Loading
media/libstagefright/OMXClient.cpp +2 −2 Original line number Diff line number Diff line Loading @@ -131,7 +131,7 @@ struct MuxOMX : public IOMX { virtual status_t allocateSecureBuffer( node_id node, OMX_U32 port_index, size_t size, buffer_id *buffer, void **buffer_data, native_handle_t **native_handle); buffer_id *buffer, void **buffer_data, sp<NativeHandle> *native_handle); virtual status_t allocateBufferWithBackup( node_id node, OMX_U32 port_index, const sp<IMemory> ¶ms, Loading Loading @@ -426,7 +426,7 @@ status_t MuxOMX::signalEndOfInputStream(node_id node) { status_t MuxOMX::allocateSecureBuffer( node_id node, OMX_U32 port_index, size_t size, buffer_id *buffer, void **buffer_data, native_handle_t **native_handle) { buffer_id *buffer, void **buffer_data, sp<NativeHandle> *native_handle) { return getOMX(node)->allocateSecureBuffer( node, port_index, size, buffer, buffer_data, native_handle); } Loading
media/libstagefright/include/OMX.h +1 −1 Original line number Diff line number Diff line Loading @@ -115,7 +115,7 @@ public: virtual status_t allocateSecureBuffer( node_id node, OMX_U32 port_index, size_t size, buffer_id *buffer, void **buffer_data, native_handle_t **native_handle); buffer_id *buffer, void **buffer_data, sp<NativeHandle> *native_handle); virtual status_t allocateBufferWithBackup( node_id node, OMX_U32 port_index, const sp<IMemory> ¶ms, Loading