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

Commit a93b86c6 authored by Wei Lee's avatar Wei Lee Committed by Android (Google) Code Review
Browse files

Merge "Camera: Set focal length for external camera if the information is provided"

parents 60e7d69f cfae241e
Loading
Loading
Loading
Loading
+5 −4
Original line number Diff line number Diff line
@@ -2454,12 +2454,9 @@ status_t Parameters::getDefaultFocalLength(CameraDeviceBase *device) {

    camera_metadata_ro_entry_t availableFocalLengths =
        staticInfo(ANDROID_LENS_INFO_AVAILABLE_FOCAL_LENGTHS, 0, 0, /*required*/false);
    if (!availableFocalLengths.count && !fastInfo.isExternalCamera) return NO_INIT;

    // Find focal length in PREVIEW template to use as default focal length.
    if (fastInfo.isExternalCamera) {
        fastInfo.defaultFocalLength = -1.0;
    } else {
    if (availableFocalLengths.count) {
        // Find smallest (widest-angle) focal length to use as basis of still
        // picture FOV reporting.
        fastInfo.defaultFocalLength = availableFocalLengths.data.f[0];
@@ -2481,6 +2478,10 @@ status_t Parameters::getDefaultFocalLength(CameraDeviceBase *device) {
        if (entry.count != 0) {
            fastInfo.defaultFocalLength = entry.data.f[0];
        }
    } else if (fastInfo.isExternalCamera) {
        fastInfo.defaultFocalLength = -1.0;
    } else {
        return NO_INIT;
    }
    return OK;
}