libcamera: v4l2_subdevice: Update crop/compose rectangle
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.
While at there, fix the use of 'top' and 'left' field of the selection
rectangle, which where wrongly used.
Fixes: 468176fa07 ("libcamera: Add V4L2Subdevice")
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Jacopo Mondi <jacopo@jmondi.org>
This commit is contained in:
@@ -258,8 +258,8 @@ int V4L2Subdevice::setSelection(unsigned int pad, unsigned int target,
|
||||
sel.target = target;
|
||||
sel.flags = 0;
|
||||
|
||||
sel.r.left = rect->y;
|
||||
sel.r.top = rect->x;
|
||||
sel.r.left = rect->x;
|
||||
sel.r.top = rect->y;
|
||||
sel.r.width = rect->w;
|
||||
sel.r.height = rect->h;
|
||||
|
||||
@@ -272,6 +272,11 @@ int V4L2Subdevice::setSelection(unsigned int pad, unsigned int target,
|
||||
return ret;
|
||||
}
|
||||
|
||||
rect->x = sel.r.left;
|
||||
rect->y = sel.r.top;
|
||||
rect->w = sel.r.width;
|
||||
rect->h = sel.r.height;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user