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

Commit b7ab1e47 authored by Shuzhen Wang's avatar Shuzhen Wang
Browse files

Camera: Initialize bufferSize for JPEG app segments stream

Set bufferSize in @3.4::Stream::bufferSize for JPEG_APP_SEGMENTS stream.

Bug: 124999074
Test: Build
Change-Id: I6f24f4273b0d3d18b1bdbf263fc12ed48e857004
parent ea69bfb0
Loading
Loading
Loading
Loading
+11 −4
Original line number Diff line number Diff line
@@ -2847,12 +2847,19 @@ status_t Camera3Device::configureStreamsLocked(int operatingMode,
        }
        streams.add(outputStream);

        if (outputStream->format == HAL_PIXEL_FORMAT_BLOB &&
                outputStream->data_space == HAL_DATASPACE_V0_JFIF) {
        if (outputStream->format == HAL_PIXEL_FORMAT_BLOB) {
            size_t k = i + ((mInputStream != nullptr) ? 1 : 0); // Input stream if present should
                                                                // always occupy the initial entry.
            if (outputStream->data_space == HAL_DATASPACE_V0_JFIF) {
                bufferSizes[k] = static_cast<uint32_t>(
                        getJpegBufferSize(outputStream->width, outputStream->height));
            } else if (outputStream->data_space ==
                    static_cast<android_dataspace>(HAL_DATASPACE_JPEG_APP_SEGMENTS)) {
                bufferSizes[k] = outputStream->width * outputStream->height;
            } else {
                ALOGW("%s: Blob dataSpace %d not supported",
                        __FUNCTION__, outputStream->data_space);
            }
        }
    }