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

Commit a02eae5e authored by Lajos Molnar's avatar Lajos Molnar
Browse files

stagefright: SoftVP8: Handle EOS flag on frames with content.



SoftVP8 decoder ignored frame content if EOS flag was set on
input frame.  Now, decode the frame first, unless it is empty.

Change-Id: Id105a9eb86103a61390af3de60cae2507028e2d1
Signed-off-by: default avatarLajos Molnar <lajos@google.com>
Bug: 9091495
parent c7722457
Loading
Loading
Loading
Loading
+16 −12
Original line number Diff line number Diff line
@@ -226,6 +226,7 @@ void SoftVPX::onQueueFilled(OMX_U32 portIndex) {

    List<BufferInfo *> &inQueue = getPortQueue(0);
    List<BufferInfo *> &outQueue = getPortQueue(1);
    bool EOSseen = false;

    while (!inQueue.empty() && !outQueue.empty()) {
        BufferInfo *inInfo = *inQueue.begin();
@@ -235,6 +236,8 @@ void SoftVPX::onQueueFilled(OMX_U32 portIndex) {
        OMX_BUFFERHEADERTYPE *outHeader = outInfo->mHeader;

        if (inHeader->nFlags & OMX_BUFFERFLAG_EOS) {
            EOSseen = true;
            if (inHeader->nFilledLen == 0) {
                inQueue.erase(inQueue.begin());
                inInfo->mOwnedByUs = false;
                notifyEmptyBufferDone(inHeader);
@@ -247,6 +250,7 @@ void SoftVPX::onQueueFilled(OMX_U32 portIndex) {
                notifyFillBufferDone(outHeader);
                return;
            }
        }

        if (vpx_codec_decode(
                    (vpx_codec_ctx_t *)mCtx,
@@ -282,7 +286,7 @@ void SoftVPX::onQueueFilled(OMX_U32 portIndex) {

            outHeader->nOffset = 0;
            outHeader->nFilledLen = (width * height * 3) / 2;
            outHeader->nFlags = 0;
            outHeader->nFlags = EOSseen ? OMX_BUFFERFLAG_EOS : 0;
            outHeader->nTimeStamp = inHeader->nTimeStamp;

            const uint8_t *srcLine = (const uint8_t *)img->planes[PLANE_Y];