diff options
author | Lajos Molnar <lajos@google.com> | 2013-10-29 18:31:05 -0700 |
---|---|---|
committer | Android Git Automerger <android-git-automerger@android.com> | 2013-10-29 18:31:05 -0700 |
commit | b6b97f6071a3948494b5e9cb1a9c175157bdaf07 (patch) | |
tree | 92637b81065d3948473eeb090d2c95424dbbb7d3 /media | |
parent | ce275b7dd20e3d4781a46126c753e6eb998e6c0f (diff) | |
parent | eb76f318e9daf91dbf195bcb74852b3bd736a32a (diff) | |
download | frameworks_av-b6b97f6071a3948494b5e9cb1a9c175157bdaf07.zip frameworks_av-b6b97f6071a3948494b5e9cb1a9c175157bdaf07.tar.gz frameworks_av-b6b97f6071a3948494b5e9cb1a9c175157bdaf07.tar.bz2 |
am eb76f318: am 96aed4fb: Merge "avcenc: Prepend startcodes to output buffers"
* commit 'eb76f318e9daf91dbf195bcb74852b3bd736a32a':
avcenc: Prepend startcodes to output buffers
Diffstat (limited to 'media')
-rw-r--r-- | media/libstagefright/codecs/avc/enc/SoftAVCEncoder.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/media/libstagefright/codecs/avc/enc/SoftAVCEncoder.cpp b/media/libstagefright/codecs/avc/enc/SoftAVCEncoder.cpp index 1d66120..4a21a3e 100644 --- a/media/libstagefright/codecs/avc/enc/SoftAVCEncoder.cpp +++ b/media/libstagefright/codecs/avc/enc/SoftAVCEncoder.cpp @@ -871,7 +871,13 @@ void SoftAVCEncoder::onQueueFilled(OMX_U32 portIndex) { CHECK(encoderStatus == AVCENC_SUCCESS || encoderStatus == AVCENC_NEW_IDR); dataLength = outHeader->nAllocLen; // Reset the output buffer length 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); + dataLength = outPtr + dataLength - outHeader->pBuffer; if (encoderStatus == AVCENC_SUCCESS) { CHECK(NULL == PVAVCEncGetOverrunBuffer(mHandle)); } else if (encoderStatus == AVCENC_PICTURE_READY) { |