Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 4fb1e42a authored by Lajos Molnar's avatar Lajos Molnar
Browse files

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
parent 58388aa7
Loading
Loading
Loading
Loading
+5 −3
Original line number Diff line number Diff line
@@ -167,8 +167,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) {
@@ -1272,7 +1274,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)