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

Commit 7de1920b authored by Chong Zhang's avatar Chong Zhang Committed by android-build-merger
Browse files

Merge "stagefright: convert heif rotation angle to clockwise" into oc-mr1-dev am: 94cb791a

am: c993cdcd

Change-Id: I010a4c26b191335af7a1442d7c11f216a74d2927
parents e156e8ff c993cdcd
Loading
Loading
Loading
Loading
+8 −1
Original line number Original line Diff line number Diff line
@@ -1409,7 +1409,14 @@ sp<MetaData> ItemTable::getImageMeta() {
    meta->setInt32(kKeyWidth, image->width);
    meta->setInt32(kKeyWidth, image->width);
    meta->setInt32(kKeyHeight, image->height);
    meta->setInt32(kKeyHeight, image->height);
    if (image->rotation != 0) {
    if (image->rotation != 0) {
        meta->setInt32(kKeyRotation, image->rotation);
        // Rotation angle in HEIF is CCW, convert to CW here to be
        // consistent with the other media formats.
        switch(image->rotation) {
            case 90: meta->setInt32(kKeyRotation, 270); break;
            case 180: meta->setInt32(kKeyRotation, 180); break;
            case 270: meta->setInt32(kKeyRotation, 90); break;
            default: break; // don't set if invalid
        }
    }
    }
    meta->setInt32(kKeyMaxInputSize, image->width * image->height * 1.5);
    meta->setInt32(kKeyMaxInputSize, image->width * image->height * 1.5);