Message ID | 20211019114802.665980-9-umang.jain@ideasonboard.com |
---|---|
State | Accepted |
Delegated to: | Umang Jain |
Headers | show |
Series |
|
Related | show |
Hi Umang, thank you for the patch. On Tue, Oct 19, 2021 at 8:48 PM Umang Jain <umang.jain@ideasonboard.com> wrote: > > From: Laurent Pinchart <laurent.pinchart@ideasonboard.com> > > 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> Reviewed-by: Hirokazu Honda <hiroh@chromium.org> > --- > src/android/camera_device.cpp | 21 ++++++--------------- > 1 file 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; > -- > 2.31.0 >
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;