summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--media/libstagefright/omx/OMXNodeInstance.cpp8
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)