diff options
author | Andreas Huber <andih@google.com> | 2010-09-23 14:25:28 -0700 |
---|---|---|
committer | Android Git Automerger <android-git-automerger@android.com> | 2010-09-23 14:25:28 -0700 |
commit | 0597872f3ff7cc3c8549c26483158c22c3d09126 (patch) | |
tree | 5b1f7cedc60bee2919329406cdc83c3446149c3f /media/libstagefright | |
parent | 45adaf601ea69f8bd060c8a219e1ccf7045bbfa4 (diff) | |
parent | 7504187b46abb91df54539c569840b4c3f0ae1ce (diff) | |
download | frameworks_av-0597872f3ff7cc3c8549c26483158c22c3d09126.zip frameworks_av-0597872f3ff7cc3c8549c26483158c22c3d09126.tar.gz frameworks_av-0597872f3ff7cc3c8549c26483158c22c3d09126.tar.bz2 |
am 13770dcc: am 7b2ed5d7: Merge "Depending on our preference to write 2-byte or 4-byte NALs, patch the codec specific data \'avcC\' accordingly." into gingerbread
Merge commit '13770dcce2cc1b4268ba092b59bc5a4c049f3a33'
* commit '13770dcce2cc1b4268ba092b59bc5a4c049f3a33':
Depending on our preference to write 2-byte or 4-byte NALs, patch the codec specific data 'avcC' accordingly.
Diffstat (limited to 'media/libstagefright')
-rw-r--r-- | media/libstagefright/MPEG4Writer.cpp | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/media/libstagefright/MPEG4Writer.cpp b/media/libstagefright/MPEG4Writer.cpp index f0d8943..ba1e218 100644 --- a/media/libstagefright/MPEG4Writer.cpp +++ b/media/libstagefright/MPEG4Writer.cpp @@ -2111,7 +2111,15 @@ void MPEG4Writer::Track::writeTrackHeader( mOwner->endBox(); // d263 } else if (!strcasecmp(MEDIA_MIMETYPE_VIDEO_AVC, mime)) { CHECK(mCodecSpecificData); - CHECK(mCodecSpecificDataSize > 0); + CHECK(mCodecSpecificDataSize >= 5); + + // Patch avcc's lengthSize field to match the number + // of bytes we use to indicate the size of a nal unit. + uint8_t *ptr = (uint8_t *)mCodecSpecificData; + ptr[4] = + (ptr[4] & 0xfc) + | (mOwner->useNalLengthFour() ? 3 : 1); + mOwner->beginBox("avcC"); mOwner->write(mCodecSpecificData, mCodecSpecificDataSize); mOwner->endBox(); // avcC |