[libcamera-devel] [PATCH v2 8/9] android: camera_device: Remove single buffer restriction.
Laurent Pinchart
laurent.pinchart at ideasonboard.com
Fri Jul 3 13:08:31 CEST 2020
Hi Kieran,
On Fri, Jul 03, 2020 at 12:07:57PM +0100, Kieran Bingham wrote:
> On 03/07/2020 01:41, Laurent Pinchart wrote:
> > On Thu, Jul 02, 2020 at 10:36:53PM +0100, Kieran Bingham wrote:
> >> A capture request is no longer limited to a single output buffer.
> >> Remove the limitation, but (for now) keep the check to ensure that
> >> at least one buffer is always provided.
> >>
> >> This 'should never happen' so could be a LOG(Fatal) or removed.
> >>
> >> Signed-off-by: Kieran Bingham <kieran.bingham at ideasonboard.com>
> >> ---
> >> src/android/camera_device.cpp | 2 +-
> >> 1 file changed, 1 insertion(+), 1 deletion(-)
> >>
> >> diff --git a/src/android/camera_device.cpp b/src/android/camera_device.cpp
> >> index eea8c8c50352..4681fd8af90b 100644
> >> --- a/src/android/camera_device.cpp
> >> +++ b/src/android/camera_device.cpp
> >> @@ -1046,7 +1046,7 @@ static FrameBuffer *newFrameBuffer(const buffer_handle_t camera3buffer)
> >>
> >> int CameraDevice::processCaptureRequest(camera3_capture_request_t *camera3Request)
> >> {
> >> - if (camera3Request->num_output_buffers != 1) {
> >> + if (camera3Request->num_output_buffers < 1) {
> >> LOG(HAL, Error) << "Invalid number of output buffers: "
> >> << camera3Request->num_output_buffers;
> >
> > As num_output_buffers is unsigned, it can only be 0 here. I'd write
> >
> > LOG(HAL, Error) << "No output buffers provided";
>
>
> Good point, would you also change the conditional to:
>
> if (!camera3Request->num_output_buffers) {
Yes, I think this is best.
>
> or
> if (camera3Request->num_output_buffers == 0) {
>
> in that case?
>
> > Reviewed-by: Laurent Pinchart <laurent.pinchart at ideasonboard.com>
> >
> >> return -EINVAL;
--
Regards,
Laurent Pinchart
More information about the libcamera-devel
mailing list