Message ID | 20190226162641.12116-5-jacopo@jmondi.org |
---|---|
State | Superseded |
Headers | show |
Series |
|
Related | show |
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@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). Same comment applies to the sel being set earlier in the function? > + rect->w = sel.r.width; > + rect->h = sel.r.height; > + > return 0; > } > >
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@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
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; + rect->w = sel.r.width; + rect->h = sel.r.height; + return 0; }
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@jmondi.org> --- src/libcamera/v4l2_subdevice.cpp | 5 +++++ 1 file changed, 5 insertions(+)