diff options
author | Laurent Pinchart <laurent.pinchart@ideasonboard.com> | 2021-10-19 17:17:58 +0530 |
---|---|---|
committer | Umang Jain <umang.jain@ideasonboard.com> | 2021-10-19 19:15:43 +0530 |
commit | b393edb181a9ec5d0544a453029627fb3e81075c (patch) | |
tree | eb8fbb13fe971b01cd18ce966c6f6d10c346b9d3 /src | |
parent | a769684815bc8a47d5df9504700a6420bd15f430 (diff) |
android: camera_device: Use abortRequest() instead of open-coding it
Call abortRequest() in CameraDevice::requestComplete() instead of
open-coding it.
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Jacopo Mondi <jacopo@jmondi.org>
Reviewed-by: Umang Jain <umang.jain@ideasonboard.com>
Signed-off-by: Umang Jain <umang.jain@ideasonboard.com>
Diffstat (limited to 'src')
-rw-r--r-- | src/android/camera_device.cpp | 21 |
1 files changed, 6 insertions, 15 deletions
diff --git a/src/android/camera_device.cpp b/src/android/camera_device.cpp index 80e11d4b..0bb547ae 100644 --- a/src/android/camera_device.cpp +++ b/src/android/camera_device.cpp @@ -802,6 +802,11 @@ void CameraDevice::abortRequest(Camera3RequestDescriptor *descriptor) const notifyError(descriptor->frameNumber_, nullptr, CAMERA3_MSG_ERROR_REQUEST); for (auto &buffer : descriptor->buffers_) { + /* + * Signal to the framework it has to handle fences that have not + * been waited on by setting the release fence to the acquire + * fence value. + */ buffer.buffer.release_fence = buffer.buffer.acquire_fence; buffer.buffer.acquire_fence = -1; buffer.buffer.status = CAMERA3_BUFFER_STATUS_ERROR; @@ -1083,21 +1088,7 @@ void CameraDevice::requestComplete(Request *request) << " not successfully completed: " << request->status(); - notifyError(descriptor->frameNumber_, nullptr, - CAMERA3_MSG_ERROR_REQUEST); - - for (auto &buffer : descriptor->buffers_) { - /* - * Signal to the framework it has to handle fences that - * have not been waited on by setting the release fence - * to the acquire fence value. - */ - buffer.buffer.release_fence = buffer.buffer.acquire_fence; - buffer.buffer.acquire_fence = -1; - buffer.buffer.status = CAMERA3_BUFFER_STATUS_ERROR; - } - - descriptor->status_ = Camera3RequestDescriptor::Status::Error; + abortRequest(descriptor); sendCaptureResults(); return; |