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

Commit ef5fc71f authored by Vinay Kalia's avatar Vinay Kalia
Browse files

CCodecBuffers: Update KEY_WIDTH and KEY_HEIGHT to correct values



Update the KEY_WIDTH and KEY_HEIGHT according to the MediaImage.
Applications KEY_WIDTH and KEY_HEIGHT to interpret the MediaImage
so they must be aligned.

bug: 197699850
bug: 198104271

Signed-off-by: default avatarVinay Kalia <vinaykalia@google.com>
Change-Id: I05c9d15ff20caefd5a2784849e23b9b0464b5f2e
parent e63e1471
Loading
Loading
Loading
Loading
+4 −1
Original line number Diff line number Diff line
@@ -96,7 +96,10 @@ void CCodecBuffers::handleImageData(const sp<Codec2Buffer> &buffer) {
        if (img->mNumPlanes > 0 && img->mType != img->MEDIA_IMAGE_TYPE_UNKNOWN) {
            int32_t stride = img->mPlane[0].mRowInc;
            mFormatWithImageData->setInt32(KEY_STRIDE, stride);
            ALOGD("[%s] updating stride = %d", mName, stride);
            mFormatWithImageData->setInt32(KEY_WIDTH, img->mWidth);
            mFormatWithImageData->setInt32(KEY_HEIGHT, img->mHeight);
            ALOGD("[%s] updating stride = %d, width: %d, height: %d",
                  mName, stride, img->mWidth, img->mHeight);
            if (img->mNumPlanes > 1 && stride > 0) {
                int64_t offsetDelta =
                    (int64_t)img->mPlane[1].mOffset - (int64_t)img->mPlane[0].mOffset;