android: Remove CameraWorker
The CameraWorker class purpose was to handle acquire fences for incoming capture requests directed to libcamera. Now that fences are handled by the core library, it is not required to handle them in the HAL and the CameraWorker and CaptureRequest classes can be dropped. Update the core in CameraDevice class accordingly to queue Requests directly to the libcamera::Camera and set the release_fence to the value of the FrameBuffer::fence() for streams of type ::Direct. While at it make CameraRequest::StreamBuffer::fence a UniqueFD to ease the management of the fences file descriptor values. Signed-off-by: Jacopo Mondi <jacopo@jmondi.org> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
This commit is contained in:
@@ -170,16 +170,16 @@ int CameraStream::process(Camera3RequestDescriptor::StreamBuffer *streamBuffer)
|
||||
ASSERT(type_ != Type::Direct);
|
||||
|
||||
/* Handle waiting on fences on the destination buffer. */
|
||||
if (streamBuffer->fence != -1) {
|
||||
int ret = waitFence(streamBuffer->fence);
|
||||
if (streamBuffer->fence.isValid()) {
|
||||
int ret = waitFence(streamBuffer->fence.get());
|
||||
if (ret < 0) {
|
||||
LOG(HAL, Error) << "Failed waiting for fence: "
|
||||
<< streamBuffer->fence << ": " << strerror(-ret);
|
||||
<< streamBuffer->fence.get() << ": "
|
||||
<< strerror(-ret);
|
||||
return ret;
|
||||
}
|
||||
|
||||
::close(streamBuffer->fence);
|
||||
streamBuffer->fence = -1;
|
||||
streamBuffer->fence.reset();
|
||||
}
|
||||
|
||||
const StreamConfiguration &output = configuration();
|
||||
|
||||
Reference in New Issue
Block a user