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

Commit 182ebdc6 authored by Emilian Peev's avatar Emilian Peev
Browse files

Camera: Set the Jpeg/R output usage flags

Configure the Jpeg/R composite output surface usage flags
with respect to the stream functionality.

Bug: 281549972
Test: atest -c -d
cts/tests/camera/src/android/hardware/camera2/cts/ImageReaderTest.java#testJpegR
atest -c -d
cts/tests/camera/src/android/hardware/camera2/cts/PerformanceTest.java#testSingleCapture

Change-Id: Ia6b41b2e5e880fab8469894fb0374451e4a07008
parent 5ea3a6d1
Loading
Loading
Loading
Loading
+7 −0
Original line number Diff line number Diff line
@@ -658,6 +658,13 @@ status_t JpegRCompositeStream::configureStream() {
        return res;
    }

    if ((res = native_window_set_usage(mOutputSurface.get(),
            GRALLOC_USAGE_SW_READ_OFTEN | GRALLOC_USAGE_SW_WRITE_OFTEN)) != OK) {
        ALOGE("%s: Unable to configure stream buffer usage for stream %d", __FUNCTION__,
                mP010StreamId);
        return res;
    }

    int maxProducerBuffers;
    ANativeWindow *anw = mP010Surface.get();
    if ((res = anw->query(anw, NATIVE_WINDOW_MIN_UNDEQUEUED_BUFFERS, &maxProducerBuffers)) != OK) {