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

Commit 655a642b authored by Treehugger Robot's avatar Treehugger Robot Committed by Automerger Merge Worker
Browse files

Merge "Camera: Heic: Allow grids settings override in onFormatChanged" into...

Merge "Camera: Heic: Allow grids settings override in onFormatChanged" into main am: f41d09bd am: c0ff7da0

Original change: https://android-review.googlesource.com/c/platform/frameworks/av/+/2684430



Change-Id: I3e26645f189ab2d52e09b56caf201bbc109fc607
Signed-off-by: default avatarAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
parents 13457d68 c0ff7da0
Loading
Loading
Loading
Loading
+17 −5
Original line number Diff line number Diff line
@@ -451,17 +451,29 @@ void HeicCompositeStream::onHeicFormatChanged(sp<AMessage>& newFormat) {
        newFormat->setString(KEY_MIME, mimeHeic);
        newFormat->setInt32(KEY_WIDTH, mOutputWidth);
        newFormat->setInt32(KEY_HEIGHT, mOutputHeight);
        if (mUseGrid) {
    }

    if (mUseGrid || mUseHeic) {
        int32_t gridRows, gridCols, tileWidth, tileHeight;
        if (newFormat->findInt32(KEY_GRID_ROWS, &gridRows) &&
                newFormat->findInt32(KEY_GRID_COLUMNS, &gridCols) &&
                newFormat->findInt32(KEY_TILE_WIDTH, &tileWidth) &&
                newFormat->findInt32(KEY_TILE_HEIGHT, &tileHeight)) {
            mGridWidth = tileWidth;
            mGridHeight = tileHeight;
            mGridRows = gridRows;
            mGridCols = gridCols;
        } else {
            newFormat->setInt32(KEY_TILE_WIDTH, mGridWidth);
            newFormat->setInt32(KEY_TILE_HEIGHT, mGridHeight);
            newFormat->setInt32(KEY_GRID_ROWS, mGridRows);
            newFormat->setInt32(KEY_GRID_COLUMNS, mGridCols);
        }
        int32_t left, top, right, bottom;
        if (newFormat->findRect("crop", &left, &top, &right, &bottom)) {
            newFormat->setRect("crop", 0, 0, mOutputWidth - 1, mOutputHeight - 1);
        }
    }
    }
    newFormat->setInt32(KEY_IS_DEFAULT, 1 /*isPrimary*/);

    int32_t gridRows, gridCols;