[libcamera-devel] [PATCH v3 4/8] libcamera: v4l2_subdevice: Update crop/compose rectangle

Jacopo Mondi jacopo at jmondi.org
Wed Feb 27 09:26:18 CET 2019


Hi Kieran,

On Tue, Feb 26, 2019 at 11:35:16PM +0000, Kieran Bingham wrote:
> Hi Jacopo,
>
> On 26/02/2019 16:26, Jacopo Mondi wrote:
> > Update the crop/compose rectangle provided to setCrop()/setCompose()
> > methods with the rectangle sizes set by the device driver after a
> > S_SELECTION ioctl operation.
> >
> > Signed-off-by: Jacopo Mondi <jacopo at jmondi.org>
> > ---
> >  src/libcamera/v4l2_subdevice.cpp | 5 +++++
> >  1 file changed, 5 insertions(+)
> >
> > diff --git a/src/libcamera/v4l2_subdevice.cpp b/src/libcamera/v4l2_subdevice.cpp
> > index f81a521f9e2a..a043a07ff156 100644
> > --- a/src/libcamera/v4l2_subdevice.cpp
> > +++ b/src/libcamera/v4l2_subdevice.cpp
> > @@ -385,6 +385,11 @@ int V4L2Subdevice::setSelection(unsigned int pad, unsigned int target,
> >  		return ret;
> >  	}
> >
> > +	rect->y = sel.r.left;
> > +	rect->x = sel.r.top;
>
> Hrm... am I crazy? or are the x/y coordinates swapped there.
> X is horizontal, so it's the left value, right? (pun-intended).

You're absolutely not, maybe I am, as I've gone through this sequence
quite some time and never noticed :(

>
>
> Same comment applies to the sel being set earlier in the function?

Good spot, thanks for the comment!

>
>
>
> > +	rect->w = sel.r.width;
> > +	rect->h = sel.r.height;
> > +
> >  	return 0;
> >  }
> >
> >
>
> --
> Regards
> --
> Kieran
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <https://lists.libcamera.org/pipermail/libcamera-devel/attachments/20190227/36182287/attachment-0001.sig>


More information about the libcamera-devel mailing list