{"id":644,"url":"https://patchwork.libcamera.org/api/1.1/patches/644/?format=json","web_url":"https://patchwork.libcamera.org/patch/644/","project":{"id":1,"url":"https://patchwork.libcamera.org/api/1.1/projects/1/?format=json","name":"libcamera","link_name":"libcamera","list_id":"libcamera_core","list_email":"libcamera-devel@lists.libcamera.org","web_url":"","scm_url":"","webscm_url":""},"msgid":"<20190227173837.6902-6-jacopo@jmondi.org>","date":"2019-02-27T17:38:34","name":"[libcamera-devel,v4,5/8] libcamera: v4l2_subdevice: Update crop/compose rectangle","commit_ref":null,"pull_url":null,"state":"superseded","archived":false,"hash":"8c5426a8ff40c76f83cb72a8e6f08b14df7b5647","submitter":{"id":3,"url":"https://patchwork.libcamera.org/api/1.1/people/3/?format=json","name":"Jacopo Mondi","email":"jacopo@jmondi.org"},"delegate":null,"mbox":"https://patchwork.libcamera.org/patch/644/mbox/","series":[{"id":194,"url":"https://patchwork.libcamera.org/api/1.1/series/194/?format=json","web_url":"https://patchwork.libcamera.org/project/libcamera/list/?series=194","date":"2019-02-27T17:38:29","name":"v4l2_(sub)dev: improvements and tests","version":4,"mbox":"https://patchwork.libcamera.org/series/194/mbox/"}],"comments":"https://patchwork.libcamera.org/api/patches/644/comments/","check":"pending","checks":"https://patchwork.libcamera.org/api/patches/644/checks/","tags":{},"headers":{"Return-Path":"<jacopo@jmondi.org>","Received":["from relay11.mail.gandi.net (relay11.mail.gandi.net\n\t[217.70.178.231])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id DE8C2610BB\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tWed, 27 Feb 2019 18:38:16 +0100 (CET)","from uno.lan (2-224-242-101.ip172.fastwebnet.it [2.224.242.101])\n\t(Authenticated sender: jacopo@jmondi.org)\n\tby relay11.mail.gandi.net (Postfix) with ESMTPSA id 74A08100003;\n\tWed, 27 Feb 2019 17:38:16 +0000 (UTC)"],"From":"Jacopo Mondi <jacopo@jmondi.org>","To":"libcamera-devel@lists.libcamera.org","Date":"Wed, 27 Feb 2019 18:38:34 +0100","Message-Id":"<20190227173837.6902-6-jacopo@jmondi.org>","X-Mailer":"git-send-email 2.20.1","In-Reply-To":"<20190227173837.6902-1-jacopo@jmondi.org>","References":"<20190227173837.6902-1-jacopo@jmondi.org>","MIME-Version":"1.0","Content-Transfer-Encoding":"8bit","Subject":"[libcamera-devel] [PATCH v4 5/8] libcamera: v4l2_subdevice: Update\n\tcrop/compose rectangle","X-BeenThere":"libcamera-devel@lists.libcamera.org","X-Mailman-Version":"2.1.23","Precedence":"list","List-Id":"<libcamera-devel.lists.libcamera.org>","List-Unsubscribe":"<https://lists.libcamera.org/options/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=unsubscribe>","List-Archive":"<https://lists.libcamera.org/pipermail/libcamera-devel/>","List-Post":"<mailto:libcamera-devel@lists.libcamera.org>","List-Help":"<mailto:libcamera-devel-request@lists.libcamera.org?subject=help>","List-Subscribe":"<https://lists.libcamera.org/listinfo/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=subscribe>","X-List-Received-Date":"Wed, 27 Feb 2019 17:38:17 -0000"},"content":"Update the crop/compose rectangle provided to setCrop()/setCompose()\nmethods with the rectangle sizes set by the device driver after a\nS_SELECTION ioctl operation.\n\nWhile at there, fix the use of 'top' and 'left' field of the selection\nrectangle, which where wrongly used.\n\nFixes: 468176fa07d9 (\"libcamera: Add V4L2Subdevice\")\nSigned-off-by: Jacopo Mondi <jacopo@jmondi.org>\n---\n src/libcamera/v4l2_subdevice.cpp | 9 +++++++--\n 1 file changed, 7 insertions(+), 2 deletions(-)","diff":"diff --git a/src/libcamera/v4l2_subdevice.cpp b/src/libcamera/v4l2_subdevice.cpp\nindex b3a5d7a37413..0cd531b64634 100644\n--- a/src/libcamera/v4l2_subdevice.cpp\n+++ b/src/libcamera/v4l2_subdevice.cpp\n@@ -375,8 +375,8 @@ int V4L2Subdevice::setSelection(unsigned int pad, unsigned int target,\n \tsel.target = target;\n \tsel.flags = 0;\n \n-\tsel.r.left = rect->y;\n-\tsel.r.top = rect->x;\n+\tsel.r.left = rect->x;\n+\tsel.r.top = rect->y;\n \tsel.r.width = rect->w;\n \tsel.r.height = rect->h;\n \n@@ -389,6 +389,11 @@ int V4L2Subdevice::setSelection(unsigned int pad, unsigned int target,\n \t\treturn ret;\n \t}\n \n+\trect->x = sel.r.left;\n+\trect->y = sel.r.top;\n+\trect->w = sel.r.width;\n+\trect->h = sel.r.height;\n+\n \treturn 0;\n }\n \n","prefixes":["libcamera-devel","v4","5/8"]}