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

Commit b618eab6 authored by Wonsik Kim's avatar Wonsik Kim
Browse files

FrameDecoder: fix 180 rotation for HDR thumbnails

HDR thumbnails go through rendering pipeline, from which rotations are
already applied. Thus the frame should have the rotation degree
cleared to zero.

Bug: 237497501
Test: manual
Change-Id: I6dd0d8bdd06fecb4808c789ae99a678c7ebfa8e8
parent 1f74d704
Loading
Loading
Loading
Loading
+8 −5
Original line number Diff line number Diff line
@@ -86,11 +86,14 @@ sp<IMemory> allocVideoFrame(const sp<MetaData>& trackMeta,
        displayHeight = height;
    }

    if (allocRotated && (rotationAngle == 90 || rotationAngle == 270)) {
        int32_t tmp;
        tmp = width; width = height; height = tmp;
        tmp = displayWidth; displayWidth = displayHeight; displayHeight = tmp;
        tmp = tileWidth; tileWidth = tileHeight; tileHeight = tmp;
    if (allocRotated) {
        if (rotationAngle == 90 || rotationAngle == 270) {
            // swap width and height for 90 & 270 degrees rotation
            std::swap(width, height);
            std::swap(displayWidth, displayHeight);
            std::swap(tileWidth, tileHeight);
        }
        // Rotation is already applied.
        rotationAngle = 0;
    }