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

Commit ba0fac31 authored by Emilian Peev's avatar Emilian Peev
Browse files

Camera: Try to remove inflight requests during error notifications

Make it possible for clients to clear the internal inflight queue
as part of error result notifications. For this to work all pending
buffers must be returned previously with the exception of the
result metadata.

Bug: 35652756
Test: Complete Camera/Camera2 CTS without any regressions.
Change-Id: I9d8a6b63364fd254311cda2f8c836b99ee05cacb
parent 32a81b60
Loading
Loading
Loading
Loading
+7 −0
Original line number Diff line number Diff line
@@ -2934,6 +2934,13 @@ void Camera3Device::notifyError(const camera3_error_msg_t &msg,
                    InFlightRequest &r = mInFlightMap.editValueAt(idx);
                    r.requestStatus = msg.error_code;
                    resultExtras = r.resultExtras;
                    if (hardware::camera2::ICameraDeviceCallbacks::ERROR_CAMERA_RESULT ==
                            errorCode) {
                        // In case of missing result check whether the buffers
                        // returned. If they returned, then remove inflight
                        // request.
                        removeInFlightRequestIfReadyLocked(idx);
                    }
                } else {
                    resultExtras.frameNumber = msg.frame_number;
                    ALOGE("Camera %s: %s: cannot find in-flight request on "