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

Commit ad25a078 authored by Emilian Peev's avatar Emilian Peev
Browse files

Camera: Round off Jpeg/R stream size correctly

Jpeg/R stream sizes are rounded off using the regular
SDR Jpeg stream configuration table. This could be
incorrect in case the device is supporting recent
performance classes.

Bug: 262265296
Test: python tools/run_all_tests.py scenes=4 camera=0
Change-Id: I3b61abce782b926fc1cdddeae5e20777ebbc026c
parent e579d8bb
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -161,8 +161,13 @@ bool roundBufferDimensionNearest(int32_t width, int32_t height,
            getAppropriateModeTag(ANDROID_SCALER_AVAILABLE_STREAM_CONFIGURATIONS, maxResolution);
    const int32_t heicSizesTag =
            getAppropriateModeTag(ANDROID_HEIC_AVAILABLE_HEIC_STREAM_CONFIGURATIONS, maxResolution);
    const int32_t jpegRSizesTag = getAppropriateModeTag(
            ANDROID_JPEGR_AVAILABLE_JPEG_R_STREAM_CONFIGURATIONS, maxResolution);

    bool isJpegRDataSpace = (dataSpace == static_cast<android_dataspace_t>(
                ::aidl::android::hardware::graphics::common::Dataspace::JPEG_R));
    camera_metadata_ro_entry streamConfigs =
            (isJpegRDataSpace) ? info.find(jpegRSizesTag) :
            (dataSpace == HAL_DATASPACE_DEPTH) ? info.find(depthSizesTag) :
            (dataSpace == static_cast<android_dataspace>(HAL_DATASPACE_HEIF)) ?
            info.find(heicSizesTag) :