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

Commit 4a920030 authored by Marco Nelissen's avatar Marco Nelissen Committed by android-build-merger
Browse files

Merge "Don't allow using or allocating a buffer after the first state...

Merge "Don't allow using or allocating a buffer after the first state transition" into klp-dev am: 922ad618 am: 0893c50b am: 59bc7f77 am: 82ffcbd6 am: 9edaa79f am: 56c520c4 am: 12c17606
am: 8671302d

Change-Id: I8cda69d1fdf55fe8be6d904813eb0e87db043c8a
parents d0221706 8671302d
Loading
Loading
Loading
Loading
+18 −0
Original line number Diff line number Diff line
@@ -769,6 +769,12 @@ status_t OMXNodeInstance::useBuffer(
        return BAD_VALUE;
    }

    if (!mSailed) {
        ALOGE("b/35467458");
        android_errorWriteLog(0x534e4554, "35467458");
        return BAD_VALUE;
    }

    // metadata buffers are not connected cross process
    BufferMeta *buffer_meta;
    bool isMeta = mMetadataType[portIndex] != kMetadataBufferTypeInvalid;
@@ -1112,6 +1118,12 @@ status_t OMXNodeInstance::allocateBuffer(
        void **buffer_data) {
    Mutex::Autolock autoLock(mLock);

    if (!mSailed) {
        ALOGE("b/35467458");
        android_errorWriteLog(0x534e4554, "35467458");
        return BAD_VALUE;
    }

    BufferMeta *buffer_meta = new BufferMeta(size, portIndex);

    OMX_BUFFERHEADERTYPE *header;
@@ -1153,6 +1165,12 @@ status_t OMXNodeInstance::allocateBufferWithBackup(
        return BAD_VALUE;
    }

    if (!mSailed) {
        ALOGE("b/35467458");
        android_errorWriteLog(0x534e4554, "35467458");
        return BAD_VALUE;
    }

    // metadata buffers are not connected cross process
    bool isMeta = mMetadataType[portIndex] != kMetadataBufferTypeInvalid;
    bool copy = !(crossProcess && isMeta);