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

Commit 13770dcc authored by Andreas Huber's avatar Andreas Huber Committed by Android Git Automerger
Browse files

am 7b2ed5d7: Merge "Depending on our preference to write 2-byte or 4-byte...

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 '7b2ed5d7' into gingerbread-plus-aosp

* commit '7b2ed5d7':
  Depending on our preference to write 2-byte or 4-byte NALs, patch the codec specific data 'avcC' accordingly.
parents 2983e038 7b2ed5d7
Loading
Loading
Loading
Loading
+9 −1
Original line number Diff line number Diff line
@@ -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