[{"id":2456,"web_url":"https://patchwork.libcamera.org/comment/2456/","msgid":"<20190817155804.GE22846@wyvern>","date":"2019-08-17T15:58:04","subject":"Re: [libcamera-devel] [PATCH 4/5] libcamera: v4l2_subdevice: Add\n\tG_SELECTION ioctl support","submitter":{"id":5,"url":"https://patchwork.libcamera.org/api/people/5/","name":"Niklas Söderlund","email":"niklas.soderlund@ragnatech.se"},"content":"Hi Jacopo,\n\nThanks for your work.\n\nOn 2019-08-17 12:59:36 +0200, Jacopo Mondi wrote:\n> Add a private operation to perform G_SELECTION ioctl on the v4l2\n> subdevice and create two public methods to retrieve the crop bound\n> rectangle and the subdevice native area size.\n> \n> Signed-off-by: Jacopo Mondi <jacopo@jmondi.org>\n\nReviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>\n\n> ---\n>  src/libcamera/include/v4l2_subdevice.h |  4 +++\n>  src/libcamera/v4l2_subdevice.cpp       | 48 ++++++++++++++++++++++++++\n>  2 files changed, 52 insertions(+)\n> \n> diff --git a/src/libcamera/include/v4l2_subdevice.h b/src/libcamera/include/v4l2_subdevice.h\n> index 9c077674f997..5316617c6873 100644\n> --- a/src/libcamera/include/v4l2_subdevice.h\n> +++ b/src/libcamera/include/v4l2_subdevice.h\n> @@ -43,6 +43,8 @@ public:\n>  \n>  \tint setCrop(unsigned int pad, Rectangle *rect);\n>  \tint setCompose(unsigned int pad, Rectangle *rect);\n> +\tint getCropBounds(unsigned int pad, Rectangle *rect);\n> +\tint getNativeSize(unsigned int pad, Rectangle *rect);\n>  \n>  \tImageFormats formats(unsigned int pad);\n>  \n> @@ -62,6 +64,8 @@ private:\n>  \n>  \tint setSelection(unsigned int pad, unsigned int target,\n>  \t\t\t Rectangle *rect);\n> +\tint getSelection(unsigned int pad, unsigned int target,\n> +\t\t\t Rectangle *rect);\n>  \n>  \tconst MediaEntity *entity_;\n>  };\n> diff --git a/src/libcamera/v4l2_subdevice.cpp b/src/libcamera/v4l2_subdevice.cpp\n> index a188298de34c..5e661e2ef1fc 100644\n> --- a/src/libcamera/v4l2_subdevice.cpp\n> +++ b/src/libcamera/v4l2_subdevice.cpp\n> @@ -148,6 +148,28 @@ int V4L2Subdevice::setCompose(unsigned int pad, Rectangle *rect)\n>  \treturn setSelection(pad, V4L2_SEL_TGT_COMPOSE, rect);\n>  }\n>  \n> +/**\n> + * \\brief Get the crop bounds rectangle on one of the V4L2 subdevice pads\n> + * \\param[in] pad The 0-indexed pad number the rectangle is retrived from\n> + * \\param[out] rect The rectangle describing the crop bounds area\n> + * \\return 0 on success or a negative error code otherwise\n> + */\n> +int V4L2Subdevice::getCropBounds(unsigned int pad, Rectangle *rect)\n> +{\n> +\treturn getSelection(pad, V4L2_SEL_TGT_CROP_BOUNDS, rect);\n> +}\n> +\n> +/**\n> + * \\brief Get the native area size on one of the V4L2 subdevice pads\n> + * \\param[in] pad The 0-indexed pad number the native area is retrieved from\n> + * \\param[out] rect The rectangle describing the native size area\n> + * \\return 0 on success or a negative error code otherwise\n> + */\n> +int V4L2Subdevice::getNativeSize(unsigned int pad, Rectangle *rect)\n> +{\n> +\treturn getSelection(pad, V4L2_SEL_TGT_NATIVE_SIZE, rect);\n> +}\n> +\n>  /**\n>   * \\brief Enumerate all media bus codes and frame sizes on a \\a pad\n>   * \\param[in] pad The 0-indexed pad number to enumerate formats on\n> @@ -360,4 +382,30 @@ int V4L2Subdevice::setSelection(unsigned int pad, unsigned int target,\n>  \treturn 0;\n>  }\n>  \n> +int V4L2Subdevice::getSelection(unsigned int pad, unsigned int target,\n> +\t\t\t\tRectangle *rect)\n> +{\n> +\tstruct v4l2_subdev_selection sel = {};\n> +\n> +\tsel.which = V4L2_SUBDEV_FORMAT_ACTIVE;\n> +\tsel.pad = pad;\n> +\tsel.target = target;\n> +\tsel.flags = 0;\n> +\n> +\tint ret = ioctl(VIDIOC_SUBDEV_G_SELECTION, &sel);\n> +\tif (ret < 0) {\n> +\t\tLOG(V4L2, Error)\n> +\t\t\t<< \"Unable to get rectangle \" << target << \" on pad \"\n> +\t\t\t<< pad << \": \" << strerror(-ret);\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>  } /* namespace libcamera */\n> -- \n> 2.22.0\n> \n> _______________________________________________\n> libcamera-devel mailing list\n> libcamera-devel@lists.libcamera.org\n> https://lists.libcamera.org/listinfo/libcamera-devel","headers":{"Return-Path":"<niklas.soderlund@ragnatech.se>","Received":["from mail-ed1-x541.google.com (mail-ed1-x541.google.com\n\t[IPv6:2a00:1450:4864:20::541])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id DF685600F9\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tSat, 17 Aug 2019 17:58:06 +0200 (CEST)","by mail-ed1-x541.google.com with SMTP id a21so7591354edt.11\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tSat, 17 Aug 2019 08:58:06 -0700 (PDT)","from localhost ([185.224.57.161]) by smtp.gmail.com with ESMTPSA id\n\tu14sm1699260edy.55.2019.08.17.08.58.05\n\t(version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n\tSat, 17 Aug 2019 08:58:06 -0700 (PDT)"],"DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=ragnatech-se.20150623.gappssmtp.com; s=20150623;\n\th=date:from:to:cc:subject:message-id:references:mime-version\n\t:content-disposition:content-transfer-encoding:in-reply-to\n\t:user-agent; bh=Ipcu/hY4pHP6WLNn9iKGwGun8WngdLbLyk5nLULxGJM=;\n\tb=oOXc2Rc6uA1ILlzO/zBhnI/dqSyFJvzxXOY5raUAoxM3uGN1MNNs4ycGl02/xpPogB\n\tBtnYNqGa98g3A8C/6kTR6GEuy00iQhEHlmfuGHaQKZBxvT6MI+BZUsGhO+BJmatvul8V\n\tjoePcSNrTtIYKTko2Mh+8jT5el2cPAIPbIs7R4pQM1SX/C2bXzvhPEbVIKJlRfTmHGEE\n\t3WEwAzdKL3rOhLwYLRKpz551tjNilfy+j8sKDZ25OmK60MkGe7mg/EMHbkXvhsQK8wWY\n\tJQrp6Tf6/wXOuGIvUVYGibij4utjG+bsJlDO2vCFSFtIIerRp/M9FXulb/mZ6OKuLlUd\n\t3gsA==","X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20161025;\n\th=x-gm-message-state:date:from:to:cc:subject:message-id:references\n\t:mime-version:content-disposition:content-transfer-encoding\n\t:in-reply-to:user-agent;\n\tbh=Ipcu/hY4pHP6WLNn9iKGwGun8WngdLbLyk5nLULxGJM=;\n\tb=P1bG1iju8P26QnMJph4UA9bpIPPKrE4rfLxOcejJi3uqkHGdtwN1IJrJFz8GmiJQG5\n\t/28+3u3iWBbCYQZl66off0xq/f4JiGC3ceOlyAv6A2aJFVx+pzWkKIrDOOA1Y0Z381Ka\n\tusgEGW3S4684sa/KnFvq322ot9WNEwgCPPPYEcTQF8+KMzB1GOJY1HwS7/hn3q8BI1Ac\n\t4SzKtnYUIEjQxWmYaZpwcnAbtyQJR49bZayuaTXoHn1JZX7hY5uW0/QfWjKiSG6kuaQv\n\tS4dMB9p7gLfQB2mEDm7/u7WaBkXB1CLeJUNj41soKZXZ95VUuZBhieoRSPDCC+suxPCH\n\tcB2Q==","X-Gm-Message-State":"APjAAAXTDOoC6VML0/r0C+LiblkyAcvhEr6nSyTzQDsnOZFk7V2zGlnh\n\teAbl6NZOA5F3f2O37pSoPT4zYrDfaxs=","X-Google-Smtp-Source":"APXvYqxTLhfVZBsdUQ6UvBtOyn0bSbUL63mFeih/IQ6IGQvfQ4KVYHkZeAPlaY+9bhTwUA+PTN9TBQ==","X-Received":"by 2002:a17:906:f2d0:: with SMTP id\n\tgz16mr13635741ejb.21.1566057486577; \n\tSat, 17 Aug 2019 08:58:06 -0700 (PDT)","Date":"Sat, 17 Aug 2019 17:58:04 +0200","From":"Niklas =?iso-8859-1?q?S=F6derlund?= <niklas.soderlund@ragnatech.se>","To":"Jacopo Mondi <jacopo@jmondi.org>","Cc":"libcamera-devel@lists.libcamera.org","Message-ID":"<20190817155804.GE22846@wyvern>","References":"<20190817105937.29353-1-jacopo@jmondi.org>\n\t<20190817105937.29353-5-jacopo@jmondi.org>","MIME-Version":"1.0","Content-Type":"text/plain; charset=iso-8859-1","Content-Disposition":"inline","Content-Transfer-Encoding":"8bit","In-Reply-To":"<20190817105937.29353-5-jacopo@jmondi.org>","User-Agent":"Mutt/1.12.1 (2019-06-15)","Subject":"Re: [libcamera-devel] [PATCH 4/5] libcamera: v4l2_subdevice: Add\n\tG_SELECTION ioctl support","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":"Sat, 17 Aug 2019 15:58:07 -0000"}},{"id":2458,"web_url":"https://patchwork.libcamera.org/comment/2458/","msgid":"<20190817161943.GF15630@pendragon.ideasonboard.com>","date":"2019-08-17T16:19:43","subject":"Re: [libcamera-devel] [PATCH 4/5] libcamera: v4l2_subdevice: Add\n\tG_SELECTION ioctl support","submitter":{"id":2,"url":"https://patchwork.libcamera.org/api/people/2/","name":"Laurent Pinchart","email":"laurent.pinchart@ideasonboard.com"},"content":"Hi Jacopo,\n\nThank you for the patch.\n\nOn Sat, Aug 17, 2019 at 12:59:36PM +0200, Jacopo Mondi wrote:\n> Add a private operation to perform G_SELECTION ioctl on the v4l2\n> subdevice and create two public methods to retrieve the crop bound\n> rectangle and the subdevice native area size.\n> \n> Signed-off-by: Jacopo Mondi <jacopo@jmondi.org>\n> ---\n>  src/libcamera/include/v4l2_subdevice.h |  4 +++\n>  src/libcamera/v4l2_subdevice.cpp       | 48 ++++++++++++++++++++++++++\n>  2 files changed, 52 insertions(+)\n> \n> diff --git a/src/libcamera/include/v4l2_subdevice.h b/src/libcamera/include/v4l2_subdevice.h\n> index 9c077674f997..5316617c6873 100644\n> --- a/src/libcamera/include/v4l2_subdevice.h\n> +++ b/src/libcamera/include/v4l2_subdevice.h\n> @@ -43,6 +43,8 @@ public:\n>  \n>  \tint setCrop(unsigned int pad, Rectangle *rect);\n>  \tint setCompose(unsigned int pad, Rectangle *rect);\n> +\tint getCropBounds(unsigned int pad, Rectangle *rect);\n> +\tint getNativeSize(unsigned int pad, Rectangle *rect);\n\nShould these two methods be named cropBounds() and nativeSize() ?\nThey don't map directly to a VIDIOC_SUBDEV_G_... ioctl. And should they\nreturn a Rectangle instance instead of taking it through an argument ?\nFinally, should we remove the pad argument ? The native size is the\nnative size of the sensor, not the size of a pad.\n\n>  \n>  \tImageFormats formats(unsigned int pad);\n>  \n> @@ -62,6 +64,8 @@ private:\n>  \n>  \tint setSelection(unsigned int pad, unsigned int target,\n>  \t\t\t Rectangle *rect);\n> +\tint getSelection(unsigned int pad, unsigned int target,\n> +\t\t\t Rectangle *rect);\n\nI would move getSelection() above setSelection().\n\n>  \n>  \tconst MediaEntity *entity_;\n>  };\n> diff --git a/src/libcamera/v4l2_subdevice.cpp b/src/libcamera/v4l2_subdevice.cpp\n> index a188298de34c..5e661e2ef1fc 100644\n> --- a/src/libcamera/v4l2_subdevice.cpp\n> +++ b/src/libcamera/v4l2_subdevice.cpp\n> @@ -148,6 +148,28 @@ int V4L2Subdevice::setCompose(unsigned int pad, Rectangle *rect)\n>  \treturn setSelection(pad, V4L2_SEL_TGT_COMPOSE, rect);\n>  }\n>  \n> +/**\n> + * \\brief Get the crop bounds rectangle on one of the V4L2 subdevice pads\n\nI think this method shouldn't use V4L2 terminology, but explain in\nclearer terms what it retrieves. It should thus likely be renamed.\n\n> + * \\param[in] pad The 0-indexed pad number the rectangle is retrived from\n> + * \\param[out] rect The rectangle describing the crop bounds area\n> + * \\return 0 on success or a negative error code otherwise\n> + */\n> +int V4L2Subdevice::getCropBounds(unsigned int pad, Rectangle *rect)\n> +{\n> +\treturn getSelection(pad, V4L2_SEL_TGT_CROP_BOUNDS, rect);\n> +}\n> +\n> +/**\n> + * \\brief Get the native area size on one of the V4L2 subdevice pads\n\nIf you rename the method to nativeSize(), I would write the brief as\n\"Retrieve the ...\" as we usually do.\n\n> + * \\param[in] pad The 0-indexed pad number the native area is retrieved from\n> + * \\param[out] rect The rectangle describing the native size area\n> + * \\return 0 on success or a negative error code otherwise\n> + */\n> +int V4L2Subdevice::getNativeSize(unsigned int pad, Rectangle *rect)\n\nShould this be renamted to pixelArraySize() and return a Size ?\n\n> +{\n> +\treturn getSelection(pad, V4L2_SEL_TGT_NATIVE_SIZE, rect);\n> +}\n> +\n>  /**\n>   * \\brief Enumerate all media bus codes and frame sizes on a \\a pad\n>   * \\param[in] pad The 0-indexed pad number to enumerate formats on\n> @@ -360,4 +382,30 @@ int V4L2Subdevice::setSelection(unsigned int pad, unsigned int target,\n>  \treturn 0;\n>  }\n>  \n> +int V4L2Subdevice::getSelection(unsigned int pad, unsigned int target,\n> +\t\t\t\tRectangle *rect)\n> +{\n> +\tstruct v4l2_subdev_selection sel = {};\n> +\n> +\tsel.which = V4L2_SUBDEV_FORMAT_ACTIVE;\n> +\tsel.pad = pad;\n> +\tsel.target = target;\n> +\tsel.flags = 0;\n\nYou can drop this as you initialise sel to 0.\n\n> +\n> +\tint ret = ioctl(VIDIOC_SUBDEV_G_SELECTION, &sel);\n> +\tif (ret < 0) {\n> +\t\tLOG(V4L2, Error)\n> +\t\t\t<< \"Unable to get rectangle \" << target << \" on pad \"\n> +\t\t\t<< pad << \": \" << strerror(-ret);\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>  } /* namespace libcamera */","headers":{"Return-Path":"<laurent.pinchart@ideasonboard.com>","Received":["from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 7B93B60E2B\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tSat, 17 Aug 2019 18:19:49 +0200 (CEST)","from pendragon.ideasonboard.com\n\t(dfj612yhrgyx302h3jwwy-3.rev.dnainternet.fi\n\t[IPv6:2001:14ba:21f5:5b00:ce28:277f:58d7:3ca4])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id E790F556;\n\tSat, 17 Aug 2019 18:19:48 +0200 (CEST)"],"DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1566058789;\n\tbh=sFMMM4H2j8rQS0wlxoT/38mLbo267wbd2YNCgGhcTY8=;\n\th=Date:From:To:Cc:Subject:References:In-Reply-To:From;\n\tb=YIsXu09iezL4SaJQgAXelDhsDKPndNO2qB4rqJ5ChAdmBRAb6HtZzV46STKW7NLfy\n\tKAZ50sNLPHxN+Go8DaAyH4ibjhgt1ON1UCc9fG9ieiDRilMH/Yy9EHrr3ZK+5HsOJZ\n\tzpveDa7cUsC2bqGvJ6U2Ca5Wxw93V+tTAzdHHL0s=","Date":"Sat, 17 Aug 2019 19:19:43 +0300","From":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>","To":"Jacopo Mondi <jacopo@jmondi.org>","Cc":"libcamera-devel@lists.libcamera.org","Message-ID":"<20190817161943.GF15630@pendragon.ideasonboard.com>","References":"<20190817105937.29353-1-jacopo@jmondi.org>\n\t<20190817105937.29353-5-jacopo@jmondi.org>","MIME-Version":"1.0","Content-Type":"text/plain; charset=utf-8","Content-Disposition":"inline","In-Reply-To":"<20190817105937.29353-5-jacopo@jmondi.org>","User-Agent":"Mutt/1.10.1 (2018-07-13)","Subject":"Re: [libcamera-devel] [PATCH 4/5] libcamera: v4l2_subdevice: Add\n\tG_SELECTION ioctl support","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":"Sat, 17 Aug 2019 16:19:49 -0000"}},{"id":2460,"web_url":"https://patchwork.libcamera.org/comment/2460/","msgid":"<20190817162547.GH15630@pendragon.ideasonboard.com>","date":"2019-08-17T16:25:47","subject":"Re: [libcamera-devel] [PATCH 4/5] libcamera: v4l2_subdevice: Add\n\tG_SELECTION ioctl support","submitter":{"id":2,"url":"https://patchwork.libcamera.org/api/people/2/","name":"Laurent Pinchart","email":"laurent.pinchart@ideasonboard.com"},"content":"Hi Jacopo,\n\nOn Sat, Aug 17, 2019 at 07:19:43PM +0300, Laurent Pinchart wrote:\n> On Sat, Aug 17, 2019 at 12:59:36PM +0200, Jacopo Mondi wrote:\n> > Add a private operation to perform G_SELECTION ioctl on the v4l2\n> > subdevice and create two public methods to retrieve the crop bound\n> > rectangle and the subdevice native area size.\n> > \n> > Signed-off-by: Jacopo Mondi <jacopo@jmondi.org>\n> > ---\n> >  src/libcamera/include/v4l2_subdevice.h |  4 +++\n> >  src/libcamera/v4l2_subdevice.cpp       | 48 ++++++++++++++++++++++++++\n> >  2 files changed, 52 insertions(+)\n> > \n> > diff --git a/src/libcamera/include/v4l2_subdevice.h b/src/libcamera/include/v4l2_subdevice.h\n> > index 9c077674f997..5316617c6873 100644\n> > --- a/src/libcamera/include/v4l2_subdevice.h\n> > +++ b/src/libcamera/include/v4l2_subdevice.h\n> > @@ -43,6 +43,8 @@ public:\n> >  \n> >  \tint setCrop(unsigned int pad, Rectangle *rect);\n> >  \tint setCompose(unsigned int pad, Rectangle *rect);\n> > +\tint getCropBounds(unsigned int pad, Rectangle *rect);\n> > +\tint getNativeSize(unsigned int pad, Rectangle *rect);\n> \n> Should these two methods be named cropBounds() and nativeSize() ?\n> They don't map directly to a VIDIOC_SUBDEV_G_... ioctl. And should they\n> return a Rectangle instance instead of taking it through an argument ?\n> Finally, should we remove the pad argument ? The native size is the\n> native size of the sensor, not the size of a pad.\n\nMy bad, for some reason I though I was reviewing the CameraSensor class.\nPlease ignore all comments about the getCropBounds and getNativeSize\nmethods. I wonder, however, if we shouldn't make the get/set selection\nmethods public (and remove setCrop() and setCompose()), otherwise we'll\nkeep adding accessors for all targets, and I'm not sure it's worth it.\nIf you really think dedicated accessors are best I would at least make\nthem inline and move the get methods before the set methods.\n\n> >  \n> >  \tImageFormats formats(unsigned int pad);\n> >  \n> > @@ -62,6 +64,8 @@ private:\n> >  \n> >  \tint setSelection(unsigned int pad, unsigned int target,\n> >  \t\t\t Rectangle *rect);\n> > +\tint getSelection(unsigned int pad, unsigned int target,\n> > +\t\t\t Rectangle *rect);\n> \n> I would move getSelection() above setSelection().\n> \n> >  \n> >  \tconst MediaEntity *entity_;\n> >  };\n> > diff --git a/src/libcamera/v4l2_subdevice.cpp b/src/libcamera/v4l2_subdevice.cpp\n> > index a188298de34c..5e661e2ef1fc 100644\n> > --- a/src/libcamera/v4l2_subdevice.cpp\n> > +++ b/src/libcamera/v4l2_subdevice.cpp\n> > @@ -148,6 +148,28 @@ int V4L2Subdevice::setCompose(unsigned int pad, Rectangle *rect)\n> >  \treturn setSelection(pad, V4L2_SEL_TGT_COMPOSE, rect);\n> >  }\n> >  \n> > +/**\n> > + * \\brief Get the crop bounds rectangle on one of the V4L2 subdevice pads\n> \n> I think this method shouldn't use V4L2 terminology, but explain in\n> clearer terms what it retrieves. It should thus likely be renamed.\n> \n> > + * \\param[in] pad The 0-indexed pad number the rectangle is retrived from\n> > + * \\param[out] rect The rectangle describing the crop bounds area\n> > + * \\return 0 on success or a negative error code otherwise\n> > + */\n> > +int V4L2Subdevice::getCropBounds(unsigned int pad, Rectangle *rect)\n> > +{\n> > +\treturn getSelection(pad, V4L2_SEL_TGT_CROP_BOUNDS, rect);\n> > +}\n> > +\n> > +/**\n> > + * \\brief Get the native area size on one of the V4L2 subdevice pads\n> \n> If you rename the method to nativeSize(), I would write the brief as\n> \"Retrieve the ...\" as we usually do.\n> \n> > + * \\param[in] pad The 0-indexed pad number the native area is retrieved from\n> > + * \\param[out] rect The rectangle describing the native size area\n> > + * \\return 0 on success or a negative error code otherwise\n> > + */\n> > +int V4L2Subdevice::getNativeSize(unsigned int pad, Rectangle *rect)\n> \n> Should this be renamted to pixelArraySize() and return a Size ?\n> \n> > +{\n> > +\treturn getSelection(pad, V4L2_SEL_TGT_NATIVE_SIZE, rect);\n> > +}\n> > +\n> >  /**\n> >   * \\brief Enumerate all media bus codes and frame sizes on a \\a pad\n> >   * \\param[in] pad The 0-indexed pad number to enumerate formats on\n> > @@ -360,4 +382,30 @@ int V4L2Subdevice::setSelection(unsigned int pad, unsigned int target,\n> >  \treturn 0;\n> >  }\n> >  \n> > +int V4L2Subdevice::getSelection(unsigned int pad, unsigned int target,\n> > +\t\t\t\tRectangle *rect)\n> > +{\n> > +\tstruct v4l2_subdev_selection sel = {};\n> > +\n> > +\tsel.which = V4L2_SUBDEV_FORMAT_ACTIVE;\n> > +\tsel.pad = pad;\n> > +\tsel.target = target;\n> > +\tsel.flags = 0;\n> \n> You can drop this as you initialise sel to 0.\n> \n> > +\n> > +\tint ret = ioctl(VIDIOC_SUBDEV_G_SELECTION, &sel);\n> > +\tif (ret < 0) {\n> > +\t\tLOG(V4L2, Error)\n> > +\t\t\t<< \"Unable to get rectangle \" << target << \" on pad \"\n> > +\t\t\t<< pad << \": \" << strerror(-ret);\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> >  } /* namespace libcamera */","headers":{"Return-Path":"<laurent.pinchart@ideasonboard.com>","Received":["from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[IPv6:2001:4b98:dc2:55:216:3eff:fef7:d647])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 0652360E2B\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tSat, 17 Aug 2019 18:25:53 +0200 (CEST)","from pendragon.ideasonboard.com\n\t(dfj612yhrgyx302h3jwwy-3.rev.dnainternet.fi\n\t[IPv6:2001:14ba:21f5:5b00:ce28:277f:58d7:3ca4])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 70BD2556;\n\tSat, 17 Aug 2019 18:25:52 +0200 (CEST)"],"DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1566059152;\n\tbh=HsLj2lL7Dt2SemcDyCy1x9/Eh1a7M6p7/Umvqd/NOqQ=;\n\th=Date:From:To:Cc:Subject:References:In-Reply-To:From;\n\tb=LRqQKo9tu4wDS87EVcyArskJ3Lo4YGLbXGb6oScW9UEZXAPvJumDdwOZJWJGcHb4y\n\tQragtwZuaInGj4V7eFZXPx/X4Kzq6cB06jPGV/4fhSHjPKxpeoGsiFfUN2vQH//Yab\n\t/5h7SLFY0fR7aOzX+vabDfE5+dNBHDd/OBKrMp+4=","Date":"Sat, 17 Aug 2019 19:25:47 +0300","From":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>","To":"Jacopo Mondi <jacopo@jmondi.org>","Cc":"libcamera-devel@lists.libcamera.org","Message-ID":"<20190817162547.GH15630@pendragon.ideasonboard.com>","References":"<20190817105937.29353-1-jacopo@jmondi.org>\n\t<20190817105937.29353-5-jacopo@jmondi.org>\n\t<20190817161943.GF15630@pendragon.ideasonboard.com>","MIME-Version":"1.0","Content-Type":"text/plain; charset=utf-8","Content-Disposition":"inline","In-Reply-To":"<20190817161943.GF15630@pendragon.ideasonboard.com>","User-Agent":"Mutt/1.10.1 (2018-07-13)","Subject":"Re: [libcamera-devel] [PATCH 4/5] libcamera: v4l2_subdevice: Add\n\tG_SELECTION ioctl support","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":"Sat, 17 Aug 2019 16:25:53 -0000"}},{"id":2467,"web_url":"https://patchwork.libcamera.org/comment/2467/","msgid":"<20190819073726.q6qoouk7kbeywlaj@uno.localdomain>","date":"2019-08-19T07:37:26","subject":"Re: [libcamera-devel] [PATCH 4/5] libcamera: v4l2_subdevice: Add\n\tG_SELECTION ioctl support","submitter":{"id":3,"url":"https://patchwork.libcamera.org/api/people/3/","name":"Jacopo Mondi","email":"jacopo@jmondi.org"},"content":"Hi Laurent,\n\nOn Sat, Aug 17, 2019 at 07:25:47PM +0300, Laurent Pinchart wrote:\n> Hi Jacopo,\n>\n> On Sat, Aug 17, 2019 at 07:19:43PM +0300, Laurent Pinchart wrote:\n> > On Sat, Aug 17, 2019 at 12:59:36PM +0200, Jacopo Mondi wrote:\n> > > Add a private operation to perform G_SELECTION ioctl on the v4l2\n> > > subdevice and create two public methods to retrieve the crop bound\n> > > rectangle and the subdevice native area size.\n> > >\n> > > Signed-off-by: Jacopo Mondi <jacopo@jmondi.org>\n> > > ---\n> > >  src/libcamera/include/v4l2_subdevice.h |  4 +++\n> > >  src/libcamera/v4l2_subdevice.cpp       | 48 ++++++++++++++++++++++++++\n> > >  2 files changed, 52 insertions(+)\n> > >\n> > > diff --git a/src/libcamera/include/v4l2_subdevice.h b/src/libcamera/include/v4l2_subdevice.h\n> > > index 9c077674f997..5316617c6873 100644\n> > > --- a/src/libcamera/include/v4l2_subdevice.h\n> > > +++ b/src/libcamera/include/v4l2_subdevice.h\n> > > @@ -43,6 +43,8 @@ public:\n> > >\n> > >  \tint setCrop(unsigned int pad, Rectangle *rect);\n> > >  \tint setCompose(unsigned int pad, Rectangle *rect);\n> > > +\tint getCropBounds(unsigned int pad, Rectangle *rect);\n> > > +\tint getNativeSize(unsigned int pad, Rectangle *rect);\n> >\n> > Should these two methods be named cropBounds() and nativeSize() ?\n> > They don't map directly to a VIDIOC_SUBDEV_G_... ioctl. And should they\n> > return a Rectangle instance instead of taking it through an argument ?\n> > Finally, should we remove the pad argument ? The native size is the\n> > native size of the sensor, not the size of a pad.\n>\n> My bad, for some reason I though I was reviewing the CameraSensor class.\n> Please ignore all comments about the getCropBounds and getNativeSize\n> methods. I wonder, however, if we shouldn't make the get/set selection\n> methods public (and remove setCrop() and setCompose()), otherwise we'll\n> keep adding accessors for all targets, and I'm not sure it's worth it.\n> If you really think dedicated accessors are best I would at least make\n> them inline and move the get methods before the set methods.\n>\n\nI had the same concern.. We'll keep adding wrappers and wrappers.\nHowever this is not too bad, the other way around would be what you\nsaid, but this will then require user of the subdev API to use V4L2\ndefined flags (which is not a big issue, as they're already using a\n-v4l2-_subdevice instance after all)\n\n> > >\n> > >  \tImageFormats formats(unsigned int pad);\n> > >\n> > > @@ -62,6 +64,8 @@ private:\n> > >\n> > >  \tint setSelection(unsigned int pad, unsigned int target,\n> > >  \t\t\t Rectangle *rect);\n> > > +\tint getSelection(unsigned int pad, unsigned int target,\n> > > +\t\t\t Rectangle *rect);\n> >\n> > I would move getSelection() above setSelection().\n> >\n\nOK\n\n> > >\n> > >  \tconst MediaEntity *entity_;\n> > >  };\n> > > diff --git a/src/libcamera/v4l2_subdevice.cpp b/src/libcamera/v4l2_subdevice.cpp\n> > > index a188298de34c..5e661e2ef1fc 100644\n> > > --- a/src/libcamera/v4l2_subdevice.cpp\n> > > +++ b/src/libcamera/v4l2_subdevice.cpp\n> > > @@ -148,6 +148,28 @@ int V4L2Subdevice::setCompose(unsigned int pad, Rectangle *rect)\n> > >  \treturn setSelection(pad, V4L2_SEL_TGT_COMPOSE, rect);\n> > >  }\n> > >\n> > > +/**\n> > > + * \\brief Get the crop bounds rectangle on one of the V4L2 subdevice pads\n> >\n> > I think this method shouldn't use V4L2 terminology, but explain in\n> > clearer terms what it retrieves. It should thus likely be renamed.\n> >\n> > > + * \\param[in] pad The 0-indexed pad number the rectangle is retrived from\n> > > + * \\param[out] rect The rectangle describing the crop bounds area\n> > > + * \\return 0 on success or a negative error code otherwise\n> > > + */\n> > > +int V4L2Subdevice::getCropBounds(unsigned int pad, Rectangle *rect)\n> > > +{\n> > > +\treturn getSelection(pad, V4L2_SEL_TGT_CROP_BOUNDS, rect);\n> > > +}\n> > > +\n> > > +/**\n> > > + * \\brief Get the native area size on one of the V4L2 subdevice pads\n> >\n> > If you rename the method to nativeSize(), I would write the brief as\n> > \"Retrieve the ...\" as we usually do.\n> >\n\nIgnoring the renaming part, but I should probably use the usual\n\"Retrieve\" here.\n\n> > > + * \\param[in] pad The 0-indexed pad number the native area is retrieved from\n> > > + * \\param[out] rect The rectangle describing the native size area\n> > > + * \\return 0 on success or a negative error code otherwise\n> > > + */\n> > > +int V4L2Subdevice::getNativeSize(unsigned int pad, Rectangle *rect)\n> >\n> > Should this be renamted to pixelArraySize() and return a Size ?\n> >\n> > > +{\n> > > +\treturn getSelection(pad, V4L2_SEL_TGT_NATIVE_SIZE, rect);\n> > > +}\n> > > +\n> > >  /**\n> > >   * \\brief Enumerate all media bus codes and frame sizes on a \\a pad\n> > >   * \\param[in] pad The 0-indexed pad number to enumerate formats on\n> > > @@ -360,4 +382,30 @@ int V4L2Subdevice::setSelection(unsigned int pad, unsigned int target,\n> > >  \treturn 0;\n> > >  }\n> > >\n> > > +int V4L2Subdevice::getSelection(unsigned int pad, unsigned int target,\n> > > +\t\t\t\tRectangle *rect)\n> > > +{\n> > > +\tstruct v4l2_subdev_selection sel = {};\n> > > +\n> > > +\tsel.which = V4L2_SUBDEV_FORMAT_ACTIVE;\n> > > +\tsel.pad = pad;\n> > > +\tsel.target = target;\n> > > +\tsel.flags = 0;\n> >\n> > You can drop this as you initialise sel to 0.\n> >\n> > > +\n> > > +\tint ret = ioctl(VIDIOC_SUBDEV_G_SELECTION, &sel);\n> > > +\tif (ret < 0) {\n> > > +\t\tLOG(V4L2, Error)\n> > > +\t\t\t<< \"Unable to get rectangle \" << target << \" on pad \"\n> > > +\t\t\t<< pad << \": \" << strerror(-ret);\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> > >  } /* namespace libcamera */\n>\n> --\n> Regards,\n>\n> Laurent Pinchart","headers":{"Return-Path":"<jacopo@jmondi.org>","Received":["from relay9-d.mail.gandi.net (relay9-d.mail.gandi.net\n\t[217.70.183.199])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 2E00660E38\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tMon, 19 Aug 2019 09:35:58 +0200 (CEST)","from uno.localdomain (unknown [87.18.63.98])\n\t(Authenticated sender: jacopo@jmondi.org)\n\tby relay9-d.mail.gandi.net (Postfix) with ESMTPSA id 5C40AFF806;\n\tMon, 19 Aug 2019 07:35:57 +0000 (UTC)"],"X-Originating-IP":"87.18.63.98","Date":"Mon, 19 Aug 2019 09:37:26 +0200","From":"Jacopo Mondi <jacopo@jmondi.org>","To":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>","Cc":"libcamera-devel@lists.libcamera.org","Message-ID":"<20190819073726.q6qoouk7kbeywlaj@uno.localdomain>","References":"<20190817105937.29353-1-jacopo@jmondi.org>\n\t<20190817105937.29353-5-jacopo@jmondi.org>\n\t<20190817161943.GF15630@pendragon.ideasonboard.com>\n\t<20190817162547.GH15630@pendragon.ideasonboard.com>","MIME-Version":"1.0","Content-Type":"multipart/signed; micalg=pgp-sha256;\n\tprotocol=\"application/pgp-signature\"; boundary=\"edtea4dnjzckrvub\"","Content-Disposition":"inline","In-Reply-To":"<20190817162547.GH15630@pendragon.ideasonboard.com>","User-Agent":"NeoMutt/20180716","Subject":"Re: [libcamera-devel] [PATCH 4/5] libcamera: v4l2_subdevice: Add\n\tG_SELECTION ioctl support","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":"Mon, 19 Aug 2019 07:35:58 -0000"}},{"id":2484,"web_url":"https://patchwork.libcamera.org/comment/2484/","msgid":"<20190819132830.GE5011@pendragon.ideasonboard.com>","date":"2019-08-19T13:28:30","subject":"Re: [libcamera-devel] [PATCH 4/5] libcamera: v4l2_subdevice: Add\n\tG_SELECTION ioctl support","submitter":{"id":2,"url":"https://patchwork.libcamera.org/api/people/2/","name":"Laurent Pinchart","email":"laurent.pinchart@ideasonboard.com"},"content":"Hi Jacopo,\n\nOn Mon, Aug 19, 2019 at 09:37:26AM +0200, Jacopo Mondi wrote:\n> On Sat, Aug 17, 2019 at 07:25:47PM +0300, Laurent Pinchart wrote:\n> > On Sat, Aug 17, 2019 at 07:19:43PM +0300, Laurent Pinchart wrote:\n> >> On Sat, Aug 17, 2019 at 12:59:36PM +0200, Jacopo Mondi wrote:\n> >>> Add a private operation to perform G_SELECTION ioctl on the v4l2\n> >>> subdevice and create two public methods to retrieve the crop bound\n> >>> rectangle and the subdevice native area size.\n> >>>\n> >>> Signed-off-by: Jacopo Mondi <jacopo@jmondi.org>\n> >>> ---\n> >>>  src/libcamera/include/v4l2_subdevice.h |  4 +++\n> >>>  src/libcamera/v4l2_subdevice.cpp       | 48 ++++++++++++++++++++++++++\n> >>>  2 files changed, 52 insertions(+)\n> >>>\n> >>> diff --git a/src/libcamera/include/v4l2_subdevice.h b/src/libcamera/include/v4l2_subdevice.h\n> >>> index 9c077674f997..5316617c6873 100644\n> >>> --- a/src/libcamera/include/v4l2_subdevice.h\n> >>> +++ b/src/libcamera/include/v4l2_subdevice.h\n> >>> @@ -43,6 +43,8 @@ public:\n> >>>\n> >>>  \tint setCrop(unsigned int pad, Rectangle *rect);\n> >>>  \tint setCompose(unsigned int pad, Rectangle *rect);\n> >>> +\tint getCropBounds(unsigned int pad, Rectangle *rect);\n> >>> +\tint getNativeSize(unsigned int pad, Rectangle *rect);\n> >>\n> >> Should these two methods be named cropBounds() and nativeSize() ?\n> >> They don't map directly to a VIDIOC_SUBDEV_G_... ioctl. And should they\n> >> return a Rectangle instance instead of taking it through an argument ?\n> >> Finally, should we remove the pad argument ? The native size is the\n> >> native size of the sensor, not the size of a pad.\n> >\n> > My bad, for some reason I though I was reviewing the CameraSensor class.\n> > Please ignore all comments about the getCropBounds and getNativeSize\n> > methods. I wonder, however, if we shouldn't make the get/set selection\n> > methods public (and remove setCrop() and setCompose()), otherwise we'll\n> > keep adding accessors for all targets, and I'm not sure it's worth it.\n> > If you really think dedicated accessors are best I would at least make\n> > them inline and move the get methods before the set methods.\n> \n> I had the same concern.. We'll keep adding wrappers and wrappers.\n> However this is not too bad, the other way around would be what you\n> said, but this will then require user of the subdev API to use V4L2\n> defined flags (which is not a big issue, as they're already using a\n> -v4l2-_subdevice instance after all)\n\nExactly, this class is specific to V4L2 subdevs, so I think we can use\nthe V4L2 API :-)\n\n> >>>\n> >>>  \tImageFormats formats(unsigned int pad);\n> >>>\n> >>> @@ -62,6 +64,8 @@ private:\n> >>>\n> >>>  \tint setSelection(unsigned int pad, unsigned int target,\n> >>>  \t\t\t Rectangle *rect);\n> >>> +\tint getSelection(unsigned int pad, unsigned int target,\n> >>> +\t\t\t Rectangle *rect);\n> >>\n> >> I would move getSelection() above setSelection().\n> \n> OK\n> \n> >>>\n> >>>  \tconst MediaEntity *entity_;\n> >>>  };\n> >>> diff --git a/src/libcamera/v4l2_subdevice.cpp b/src/libcamera/v4l2_subdevice.cpp\n> >>> index a188298de34c..5e661e2ef1fc 100644\n> >>> --- a/src/libcamera/v4l2_subdevice.cpp\n> >>> +++ b/src/libcamera/v4l2_subdevice.cpp\n> >>> @@ -148,6 +148,28 @@ int V4L2Subdevice::setCompose(unsigned int pad, Rectangle *rect)\n> >>>  \treturn setSelection(pad, V4L2_SEL_TGT_COMPOSE, rect);\n> >>>  }\n> >>>\n> >>> +/**\n> >>> + * \\brief Get the crop bounds rectangle on one of the V4L2 subdevice pads\n> >>\n> >> I think this method shouldn't use V4L2 terminology, but explain in\n> >> clearer terms what it retrieves. It should thus likely be renamed.\n> >>\n> >>> + * \\param[in] pad The 0-indexed pad number the rectangle is retrived from\n> >>> + * \\param[out] rect The rectangle describing the crop bounds area\n> >>> + * \\return 0 on success or a negative error code otherwise\n> >>> + */\n> >>> +int V4L2Subdevice::getCropBounds(unsigned int pad, Rectangle *rect)\n> >>> +{\n> >>> +\treturn getSelection(pad, V4L2_SEL_TGT_CROP_BOUNDS, rect);\n> >>> +}\n> >>> +\n> >>> +/**\n> >>> + * \\brief Get the native area size on one of the V4L2 subdevice pads\n> >>\n> >> If you rename the method to nativeSize(), I would write the brief as\n> >> \"Retrieve the ...\" as we usually do.\n> \n> Ignoring the renaming part, but I should probably use the usual\n> \"Retrieve\" here.\n\nIf you turn these functions into getSelection and setSelection, I think\n\"get\" and \"set\" are good for the documentation.\n\n> >>> + * \\param[in] pad The 0-indexed pad number the native area is retrieved from\n> >>> + * \\param[out] rect The rectangle describing the native size area\n> >>> + * \\return 0 on success or a negative error code otherwise\n> >>> + */\n> >>> +int V4L2Subdevice::getNativeSize(unsigned int pad, Rectangle *rect)\n> >>\n> >> Should this be renamted to pixelArraySize() and return a Size ?\n> >>\n> >>> +{\n> >>> +\treturn getSelection(pad, V4L2_SEL_TGT_NATIVE_SIZE, rect);\n> >>> +}\n> >>> +\n> >>>  /**\n> >>>   * \\brief Enumerate all media bus codes and frame sizes on a \\a pad\n> >>>   * \\param[in] pad The 0-indexed pad number to enumerate formats on\n> >>> @@ -360,4 +382,30 @@ int V4L2Subdevice::setSelection(unsigned int pad, unsigned int target,\n> >>>  \treturn 0;\n> >>>  }\n> >>>\n> >>> +int V4L2Subdevice::getSelection(unsigned int pad, unsigned int target,\n> >>> +\t\t\t\tRectangle *rect)\n> >>> +{\n> >>> +\tstruct v4l2_subdev_selection sel = {};\n> >>> +\n> >>> +\tsel.which = V4L2_SUBDEV_FORMAT_ACTIVE;\n> >>> +\tsel.pad = pad;\n> >>> +\tsel.target = target;\n> >>> +\tsel.flags = 0;\n> >>\n> >> You can drop this as you initialise sel to 0.\n> >>\n> >>> +\n> >>> +\tint ret = ioctl(VIDIOC_SUBDEV_G_SELECTION, &sel);\n> >>> +\tif (ret < 0) {\n> >>> +\t\tLOG(V4L2, Error)\n> >>> +\t\t\t<< \"Unable to get rectangle \" << target << \" on pad \"\n> >>> +\t\t\t<< pad << \": \" << strerror(-ret);\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> >>>  } /* namespace libcamera */","headers":{"Return-Path":"<laurent.pinchart@ideasonboard.com>","Received":["from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id EE98D60C1E\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tMon, 19 Aug 2019 15:28:35 +0200 (CEST)","from pendragon.ideasonboard.com\n\t(dfj612yhrgyx302h3jwwy-3.rev.dnainternet.fi\n\t[IPv6:2001:14ba:21f5:5b00:ce28:277f:58d7:3ca4])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 8A152510;\n\tMon, 19 Aug 2019 15:28:35 +0200 (CEST)"],"DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1566221315;\n\tbh=zNVGOGFsja7M3X7oDmWYj1JeoG46ntbGZ/rlHKYfiOw=;\n\th=Date:From:To:Cc:Subject:References:In-Reply-To:From;\n\tb=JDw5pXryh2ybaz9eRjUVIQnQfWeoKfLBOxYJoGpn76VofoN9Pev9VnE257jGgAIJB\n\t1nqtOeyMBduxOxRfyntss7ieuMZT5QdxivDtimKmlIe7WrCParYK11gB6MdFGC2FSj\n\tK0P2XvsK9iZMsMf1AtqZ/Mc3GN71WE8KiUUSkrjg=","Date":"Mon, 19 Aug 2019 16:28:30 +0300","From":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>","To":"Jacopo Mondi <jacopo@jmondi.org>","Cc":"libcamera-devel@lists.libcamera.org","Message-ID":"<20190819132830.GE5011@pendragon.ideasonboard.com>","References":"<20190817105937.29353-1-jacopo@jmondi.org>\n\t<20190817105937.29353-5-jacopo@jmondi.org>\n\t<20190817161943.GF15630@pendragon.ideasonboard.com>\n\t<20190817162547.GH15630@pendragon.ideasonboard.com>\n\t<20190819073726.q6qoouk7kbeywlaj@uno.localdomain>","MIME-Version":"1.0","Content-Type":"text/plain; charset=utf-8","Content-Disposition":"inline","In-Reply-To":"<20190819073726.q6qoouk7kbeywlaj@uno.localdomain>","User-Agent":"Mutt/1.10.1 (2018-07-13)","Subject":"Re: [libcamera-devel] [PATCH 4/5] libcamera: v4l2_subdevice: Add\n\tG_SELECTION ioctl support","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":"Mon, 19 Aug 2019 13:28:36 -0000"}}]