diff options
author | Wolfgang Wiedmeyer <wolfgit@wiedmeyer.de> | 2017-02-11 22:43:10 +0100 |
---|---|---|
committer | Wolfgang Wiedmeyer <wolfgit@wiedmeyer.de> | 2017-02-11 22:43:10 +0100 |
commit | 26718276fd99ef60d9646d79467d2bb3f2db5549 (patch) | |
tree | fa47c708c4a931e0506f6ea5a212aa2a433c8b38 /media/libstagefright/omx/OMXNodeInstance.cpp | |
parent | e9c0ba1859c0f5890fed280e03d0328311234cce (diff) | |
parent | ad990eb12c7aff3c4bcdd50cae90b2b7c20041e6 (diff) | |
download | frameworks_av-26718276fd99ef60d9646d79467d2bb3f2db5549.zip frameworks_av-26718276fd99ef60d9646d79467d2bb3f2db5549.tar.gz frameworks_av-26718276fd99ef60d9646d79467d2bb3f2db5549.tar.bz2 |
Merge branch 'cm-13.0' of https://github.com/LineageOS/android_frameworks_av into replicant-6.0
Diffstat (limited to 'media/libstagefright/omx/OMXNodeInstance.cpp')
-rw-r--r-- | media/libstagefright/omx/OMXNodeInstance.cpp | 15 |
1 files changed, 5 insertions, 10 deletions
diff --git a/media/libstagefright/omx/OMXNodeInstance.cpp b/media/libstagefright/omx/OMXNodeInstance.cpp index c09064f..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) { @@ -784,13 +786,6 @@ status_t OMXNodeInstance::useBuffer( } memset(data, 0, allottedSize); - // if we are not connecting the buffers, the sizes must match - if (allottedSize != params->size()) { - CLOG_ERROR(useBuffer, BAD_VALUE, SIMPLE_BUFFER(portIndex, (size_t)allottedSize, data)); - delete[] data; - return BAD_VALUE; - } - buffer_meta = new BufferMeta( params, portIndex, false /* copyToOmx */, false /* copyFromOmx */, data); } else { @@ -1283,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) |