[libcamera-devel] [PATCH v4 5/8] libcamera: v4l2_subdevice: Update crop/compose rectangle
Jacopo Mondi
jacopo at jmondi.org
Wed Feb 27 18:38:34 CET 2019
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: 468176fa07d9 ("libcamera: Add V4L2Subdevice")
Signed-off-by: Jacopo Mondi <jacopo at jmondi.org>
---
src/libcamera/v4l2_subdevice.cpp | 9 +++++++--
1 file changed, 7 insertions(+), 2 deletions(-)
diff --git a/src/libcamera/v4l2_subdevice.cpp b/src/libcamera/v4l2_subdevice.cpp
index b3a5d7a37413..0cd531b64634 100644
--- a/src/libcamera/v4l2_subdevice.cpp
+++ b/src/libcamera/v4l2_subdevice.cpp
@@ -375,8 +375,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;
@@ -389,6 +389,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;
}
--
2.20.1
More information about the libcamera-devel
mailing list