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

Commit e4fa13d0 authored by Android Build Coastguard Worker's avatar Android Build Coastguard Worker
Browse files

Snap for 7767938 from cbf8ae96 to sc-v2-release

Change-Id: I2571ff5b57fec73c74053cea404d47f420eea624
parents 6d89e6ce cbf8ae96
Loading
Loading
Loading
Loading
+9 −1
Original line number Diff line number Diff line
@@ -796,8 +796,16 @@ sp<AMessage> MediaImageDecoder::onGetFormatAndSeekOptions(
    if (overrideMeta == NULL) {
        // check if we're dealing with a tiled heif
        int32_t tileWidth, tileHeight, gridRows, gridCols;
        int32_t widthColsProduct = 0;
        int32_t heightRowsProduct = 0;
        if (findGridInfo(trackMeta(), &tileWidth, &tileHeight, &gridRows, &gridCols)) {
            if (mWidth <= tileWidth * gridCols && mHeight <= tileHeight * gridRows) {
            if (__builtin_mul_overflow(tileWidth, gridCols, &widthColsProduct) ||
                    __builtin_mul_overflow(tileHeight, gridRows, &heightRowsProduct)) {
                ALOGE("Multiplication overflowed Grid size: %dx%d, Picture size: %dx%d",
                        gridCols, gridRows, tileWidth, tileHeight);
                return nullptr;
            }
            if (mWidth <= widthColsProduct && mHeight <= heightRowsProduct) {
                ALOGV("grid: %dx%d, tile size: %dx%d, picture size: %dx%d",
                        gridCols, gridRows, tileWidth, tileHeight, mWidth, mHeight);

+32 −0
Original line number Diff line number Diff line
@@ -4783,6 +4783,26 @@ bool Camera3Device::RequestThread::threadLoop() {
    return submitRequestSuccess;
}

status_t Camera3Device::removeFwkOnlyRegionKeys(CameraMetadata *request) {
    static const std::array<uint32_t, 4> kFwkOnlyRegionKeys = {ANDROID_CONTROL_AF_REGIONS_SET,
        ANDROID_CONTROL_AE_REGIONS_SET, ANDROID_CONTROL_AWB_REGIONS_SET,
        ANDROID_SCALER_CROP_REGION_SET};
    if (request == nullptr) {
        ALOGE("%s request metadata nullptr", __FUNCTION__);
        return BAD_VALUE;
    }
    status_t res = OK;
    for (const auto &key : kFwkOnlyRegionKeys) {
        if (request->exists(key)) {
            res = request->erase(key);
            if (res != OK) {
                return res;
            }
        }
    }
    return OK;
}

status_t Camera3Device::RequestThread::prepareHalRequests() {
    ATRACE_CALL();

@@ -4842,6 +4862,12 @@ status_t Camera3Device::RequestThread::prepareHalRequests() {
                            it != captureRequest->mSettingsList.end(); it++) {
                        if (parent->mUHRCropAndMeteringRegionMappers.find(it->cameraId) ==
                                parent->mUHRCropAndMeteringRegionMappers.end()) {
                            if (removeFwkOnlyRegionKeys(&(it->metadata)) != OK) {
                                SET_ERR("RequestThread: Unable to remove fwk-only keys from request"
                                        "%d: %s (%d)", halRequest->frame_number, strerror(-res),
                                        res);
                                return INVALID_OPERATION;
                            }
                            continue;
                        }

@@ -4856,6 +4882,12 @@ status_t Camera3Device::RequestThread::prepareHalRequests() {
                                return INVALID_OPERATION;
                            }
                            captureRequest->mUHRCropAndMeteringRegionsUpdated = true;
                            if (removeFwkOnlyRegionKeys(&(it->metadata)) != OK) {
                                SET_ERR("RequestThread: Unable to remove fwk-only keys from request"
                                        "%d: %s (%d)", halRequest->frame_number, strerror(-res),
                                        res);
                                return INVALID_OPERATION;
                            }
                        }
                    }

+1 −0
Original line number Diff line number Diff line
@@ -297,6 +297,7 @@ class Camera3Device :

  private:
    status_t disconnectImpl();
    static status_t removeFwkOnlyRegionKeys(CameraMetadata *request);

    // internal typedefs
    using RequestMetadataQueue = hardware::MessageQueue<uint8_t, hardware::kSynchronizedReadWrite>;