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

Commit d1733607 authored by Chien-Yu Chen's avatar Chien-Yu Chen Committed by Android (Google) Code Review
Browse files

Merge "Camera2: Fix getInternalFormatSizes for depth" into nyc-dev

parents e5bfd2da 4a67724d
Loading
Loading
Loading
Loading
+11 −3
Original line number Diff line number Diff line
@@ -1269,6 +1269,11 @@ public final class StreamConfigurationMap {

    private Size[] getInternalFormatSizes(int format, int dataspace,
            boolean output, boolean highRes) {
        // All depth formats are non-high-res.
        if (dataspace == HAL_DATASPACE_DEPTH && highRes) {
            return new Size[0];
        }

        SparseIntArray formatsMap =
                !output ? mInputFormats :
                dataspace == HAL_DATASPACE_DEPTH ? mDepthOutputFormats :
@@ -1287,6 +1292,8 @@ public final class StreamConfigurationMap {

        StreamConfiguration[] configurations =
                (dataspace == HAL_DATASPACE_DEPTH) ? mDepthConfigurations : mConfigurations;
        StreamConfigurationDuration[] minFrameDurations =
                (dataspace == HAL_DATASPACE_DEPTH) ? mDepthMinFrameDurations : mMinFrameDurations;

        for (StreamConfiguration config : configurations) {
            int fmt = config.getFormat();
@@ -1295,8 +1302,8 @@ public final class StreamConfigurationMap {
                    // Filter slow high-res output formats; include for
                    // highRes, remove for !highRes
                    long duration = 0;
                    for (int i = 0; i < mMinFrameDurations.length; i++) {
                        StreamConfigurationDuration d = mMinFrameDurations[i];
                    for (int i = 0; i < minFrameDurations.length; i++) {
                        StreamConfigurationDuration d = minFrameDurations[i];
                        if (d.getFormat() == fmt &&
                                d.getWidth() == config.getSize().getWidth() &&
                                d.getHeight() == config.getSize().getHeight()) {
@@ -1304,7 +1311,8 @@ public final class StreamConfigurationMap {
                            break;
                        }
                    }
                    if (highRes != (duration > DURATION_20FPS_NS)) {
                    if (dataspace != HAL_DATASPACE_DEPTH &&
                            highRes != (duration > DURATION_20FPS_NS)) {
                        continue;
                    }
                }