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

Commit 96aed4fb authored by Lajos Molnar's avatar Lajos Molnar Committed by Gerrit Code Review
Browse files

Merge "avcenc: Prepend startcodes to output buffers"

parents d5255d1d 67606c31
Loading
Loading
Loading
Loading
+6 −0
Original line number Original line Diff line number Diff line
@@ -871,7 +871,13 @@ void SoftAVCEncoder::onQueueFilled(OMX_U32 portIndex) {
        CHECK(encoderStatus == AVCENC_SUCCESS || encoderStatus == AVCENC_NEW_IDR);
        CHECK(encoderStatus == AVCENC_SUCCESS || encoderStatus == AVCENC_NEW_IDR);
        dataLength = outHeader->nAllocLen;  // Reset the output buffer length
        dataLength = outHeader->nAllocLen;  // Reset the output buffer length
        if (inHeader->nFilledLen > 0) {
        if (inHeader->nFilledLen > 0) {
            if (outHeader->nAllocLen >= 4) {
                memcpy(outPtr, "\x00\x00\x00\x01", 4);
                outPtr += 4;
                dataLength -= 4;
            }
            encoderStatus = PVAVCEncodeNAL(mHandle, outPtr, &dataLength, &type);
            encoderStatus = PVAVCEncodeNAL(mHandle, outPtr, &dataLength, &type);
            dataLength = outPtr + dataLength - outHeader->pBuffer;
            if (encoderStatus == AVCENC_SUCCESS) {
            if (encoderStatus == AVCENC_SUCCESS) {
                CHECK(NULL == PVAVCEncGetOverrunBuffer(mHandle));
                CHECK(NULL == PVAVCEncGetOverrunBuffer(mHandle));
            } else if (encoderStatus == AVCENC_PICTURE_READY) {
            } else if (encoderStatus == AVCENC_PICTURE_READY) {