diff options
author | Lajos Molnar <lajos@google.com> | 2016-09-12 14:40:47 -0700 |
---|---|---|
committer | gitbuildkicker <android-build@google.com> | 2016-09-30 12:03:12 -0700 |
commit | b1463a7e50d22414c62cb9872ef9078f5a962923 (patch) | |
tree | bc75fd6836a99579dcc06b732a91a34bf7469d13 | |
parent | b5203aba00dc60bee526d78e5851f0a34c4b5bd7 (diff) | |
download | frameworks_av-b1463a7e50d22414c62cb9872ef9078f5a962923.zip frameworks_av-b1463a7e50d22414c62cb9872ef9078f5a962923.tar.gz frameworks_av-b1463a7e50d22414c62cb9872ef9078f5a962923.tar.bz2 |
IOMX: restrict conversion of ANWB to gralloc source in emptyBuffer
This is only allowed in-process (if backup and codec buffers are
connected.)
Bug: 29422020
Bug: 31412859
Change-Id: If48e3e0b6f1af99a459fdc3f6f03744bbf0dc375
(cherry picked from commit 087ff38490016f4a0b6a1e717ae8af781d9b750c)
-rw-r--r-- | media/libstagefright/omx/OMXNodeInstance.cpp | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/media/libstagefright/omx/OMXNodeInstance.cpp b/media/libstagefright/omx/OMXNodeInstance.cpp index a0dc2ec..13b7cbb 100644 --- a/media/libstagefright/omx/OMXNodeInstance.cpp +++ b/media/libstagefright/omx/OMXNodeInstance.cpp @@ -167,6 +167,10 @@ struct BufferMeta { return buf; } + bool copyToOmx() const { + return mCopyToOmx; + } + void setGraphicBuffer(const sp<GraphicBuffer> &graphicBuffer) { mGraphicBuffer = graphicBuffer; } @@ -788,7 +792,7 @@ status_t OMXNodeInstance::useBuffer( params, portIndex, false /* copyToOmx */, false /* copyFromOmx */, data); } else { buffer_meta = new BufferMeta( - params, portIndex, false /* copyFromOmx */, false /* copyToOmx */, NULL); + params, portIndex, false /* copyToOmx */, false /* copyFromOmx */, NULL); } OMX_BUFFERHEADERTYPE *header; @@ -1277,7 +1281,8 @@ status_t OMXNodeInstance::emptyBuffer( // convert incoming ANW meta buffers if component is configured for gralloc metadata mode // ignore rangeOffset in this case - if (mMetadataType[kPortIndexInput] == kMetadataBufferTypeGrallocSource + if (buffer_meta->copyToOmx() + && mMetadataType[kPortIndexInput] == kMetadataBufferTypeGrallocSource && backup->capacity() >= sizeof(VideoNativeMetadata) && codec->capacity() >= sizeof(VideoGrallocMetadata) && ((VideoNativeMetadata *)backup->base())->eType |