diff options
author | Lajos Molnar <lajos@google.com> | 2016-11-02 14:59:03 -0700 |
---|---|---|
committer | Christopher R. Palmer <crpalmer@gmail.com> | 2017-02-03 20:26:53 -0500 |
commit | ad990eb12c7aff3c4bcdd50cae90b2b7c20041e6 (patch) | |
tree | 055c2565ae66798d7c7028458960de0956130854 | |
parent | ffa026e98f239bbb17b7978cf8f10b7977ab563e (diff) | |
download | frameworks_av-ad990eb12c7aff3c4bcdd50cae90b2b7c20041e6.zip frameworks_av-ad990eb12c7aff3c4bcdd50cae90b2b7c20041e6.tar.gz frameworks_av-ad990eb12c7aff3c4bcdd50cae90b2b7c20041e6.tar.bz2 |
IOMX: convert ANWB to Gralloc meta if using useBuffer in the same process
This was disabled by a previous commit.
Bug: 32436178
Change-Id: I9f9c6a372a039226d61f3651be3af207fed63e60
(cherry picked from commit 4fb1e42a16e77d7abf1d84bedbc20f901af26524)
-rw-r--r-- | media/libstagefright/omx/OMXNodeInstance.cpp | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/media/libstagefright/omx/OMXNodeInstance.cpp b/media/libstagefright/omx/OMXNodeInstance.cpp index afb7382..0c30e44 100644 --- a/media/libstagefright/omx/OMXNodeInstance.cpp +++ b/media/libstagefright/omx/OMXNodeInstance.cpp @@ -170,8 +170,10 @@ struct BufferMeta { return buf; } - bool copyToOmx() const { - return mCopyToOmx; + bool copyingOrSharingToOmx(const OMX_BUFFERHEADERTYPE *header) const { + return mCopyToOmx + // sharing buffer with client + || (mMem != NULL && mMem->pointer() == header->pBuffer); } void setGraphicBuffer(const sp<GraphicBuffer> &graphicBuffer) { @@ -1276,7 +1278,7 @@ status_t OMXNodeInstance::emptyBuffer( // convert incoming ANW meta buffers if component is configured for gralloc metadata mode // ignore rangeOffset in this case - if (buffer_meta->copyToOmx() + if (buffer_meta->copyingOrSharingToOmx(header) && mMetadataType[kPortIndexInput] == kMetadataBufferTypeGrallocSource && backup->capacity() >= sizeof(VideoNativeMetadata) && codec->capacity() >= sizeof(VideoGrallocMetadata) |