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

Commit 16642231 authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Camera: Allow addSurface due to mismatched dataSpace for PRIVATE format"

parents 2a5b32fa 75d66023
Loading
Loading
Loading
Loading
+7 −3
Original line number Diff line number Diff line
@@ -373,13 +373,17 @@ public final class OutputConfiguration implements Parcelable {
                    ", the pre-configured size will be used.");
        }

        if (mConfiguredDataspace != SurfaceUtils.getSurfaceDataspace(surface)) {
            throw new IllegalArgumentException("The dataspace of added surface doesn't match");
        }
        if (mConfiguredFormat != SurfaceUtils.getSurfaceFormat(surface)) {
            throw new IllegalArgumentException("The format of added surface format doesn't match");
        }

        // If the surface format is PRIVATE, do not enforce dataSpace because camera device may
        // override it.
        if (mConfiguredFormat != ImageFormat.PRIVATE &&
                mConfiguredDataspace != SurfaceUtils.getSurfaceDataspace(surface)) {
            throw new IllegalArgumentException("The dataspace of added surface doesn't match");
        }

        mSurfaces.add(surface);
    }