[{"id":4592,"web_url":"https://patchwork.libcamera.org/comment/4592/","msgid":"<20200427232507.GE1165729@oden.dyn.berto.se>","date":"2020-04-27T23:25:07","subject":"Re: [libcamera-devel] [PATCH v4 1/7] libcamera: v4l2_subdevice:\n\tExpose setSelection()","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 patch.\n\nOn 2020-04-27 23:32:30 +0200, Jacopo Mondi wrote:\n> Expose V4L2Subdevice::setSelection() method and drop\n> V4L2Subdevice::setCrop() and V4L2Subdevice::setComopse() as wrapping\n> each target with a single function does not provide any benefit.\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 |  7 +--\n>  src/libcamera/pipeline/ipu3/ipu3.cpp   |  4 +-\n>  src/libcamera/v4l2_subdevice.cpp       | 76 ++++++++++----------------\n>  3 files changed, 34 insertions(+), 53 deletions(-)\n> \n> diff --git a/src/libcamera/include/v4l2_subdevice.h b/src/libcamera/include/v4l2_subdevice.h\n> index 4a04eadfb1f9..9a5c812db9b6 100644\n> --- a/src/libcamera/include/v4l2_subdevice.h\n> +++ b/src/libcamera/include/v4l2_subdevice.h\n> @@ -46,8 +46,8 @@ public:\n>  \n>  \tconst MediaEntity *entity() const { return entity_; }\n>  \n> -\tint setCrop(unsigned int pad, Rectangle *rect);\n> -\tint setCompose(unsigned int pad, Rectangle *rect);\n> +\tint setSelection(unsigned int pad, unsigned int target,\n> +\t\t\t Rectangle *rect);\n>  \n>  \tImageFormats formats(unsigned int pad);\n>  \n> @@ -67,9 +67,6 @@ private:\n>  \tstd::vector<SizeRange> enumPadSizes(unsigned int pad,\n>  \t\t\t\t\t    unsigned int code);\n>  \n> -\tint setSelection(unsigned int pad, unsigned int target,\n> -\t\t\t Rectangle *rect);\n> -\n>  \tconst MediaEntity *entity_;\n>  };\n>  \n> diff --git a/src/libcamera/pipeline/ipu3/ipu3.cpp b/src/libcamera/pipeline/ipu3/ipu3.cpp\n> index b45900159d06..ff33f15f9eac 100644\n> --- a/src/libcamera/pipeline/ipu3/ipu3.cpp\n> +++ b/src/libcamera/pipeline/ipu3/ipu3.cpp\n> @@ -1135,11 +1135,11 @@ int ImgUDevice::configureInput(const Size &size,\n>  \t\t.width = inputFormat->size.width,\n>  \t\t.height = inputFormat->size.height,\n>  \t};\n> -\tret = imgu_->setCrop(PAD_INPUT, &rect);\n> +\tret = imgu_->setSelection(PAD_INPUT, V4L2_SEL_TGT_CROP, &rect);\n>  \tif (ret)\n>  \t\treturn ret;\n>  \n> -\tret = imgu_->setCompose(PAD_INPUT, &rect);\n> +\tret = imgu_->setSelection(PAD_INPUT, V4L2_SEL_TGT_COMPOSE, &rect);\n>  \tif (ret)\n>  \t\treturn ret;\n>  \n> diff --git a/src/libcamera/v4l2_subdevice.cpp b/src/libcamera/v4l2_subdevice.cpp\n> index 5a479a96b795..432e89eacbd3 100644\n> --- a/src/libcamera/v4l2_subdevice.cpp\n> +++ b/src/libcamera/v4l2_subdevice.cpp\n> @@ -134,27 +134,42 @@ int V4L2Subdevice::open()\n>   */\n>  \n>  /**\n> - * \\brief Set a crop rectangle on one of the V4L2 subdevice pads\n> + * \\brief Set selection rectangle \\a rect for \\a target\n>   * \\param[in] pad The 0-indexed pad number the rectangle is to be applied to\n> - * \\param[inout] rect The rectangle describing crop target area\n> + * \\param[in] target The selection target defined by the V4L2_SEL_TGT_* flags\n> + * \\param[inout] rect The selection rectangle to be applied\n>   * \\return 0 on success or a negative error code otherwise\n>   */\n> -int V4L2Subdevice::setCrop(unsigned int pad, Rectangle *rect)\n> +int V4L2Subdevice::setSelection(unsigned int pad, unsigned int target,\n> +\t\t\t\tRectangle *rect)\n>  {\n> -\treturn setSelection(pad, V4L2_SEL_TGT_CROP, rect);\n> -}\n> +\tstruct v4l2_subdev_selection sel = {};\n>  \n> -/**\n> - * \\brief Set a compose rectangle on one of the V4L2 subdevice pads\n> - * \\param[in] pad The 0-indexed pad number the rectangle is to be applied to\n> - * \\param[inout] rect The rectangle describing the compose target area\n> - * \\return 0 on success or a negative error code otherwise\n> - */\n> -int V4L2Subdevice::setCompose(unsigned int pad, Rectangle *rect)\n> -{\n> -\treturn setSelection(pad, V4L2_SEL_TGT_COMPOSE, rect);\n> -}\n> +\tsel.which = V4L2_SUBDEV_FORMAT_ACTIVE;\n> +\tsel.pad = pad;\n> +\tsel.target = target;\n> +\tsel.flags = 0;\n>  \n> +\tsel.r.left = rect->x;\n> +\tsel.r.top = rect->y;\n> +\tsel.r.width = rect->width;\n> +\tsel.r.height = rect->height;\n> +\n> +\tint ret = ioctl(VIDIOC_SUBDEV_S_SELECTION, &sel);\n> +\tif (ret < 0) {\n> +\t\tLOG(V4L2, Error)\n> +\t\t\t<< \"Unable to set 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->width = sel.r.width;\n> +\trect->height = sel.r.height;\n> +\n> +\treturn 0;\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> @@ -343,35 +358,4 @@ std::vector<SizeRange> V4L2Subdevice::enumPadSizes(unsigned int pad,\n>  \treturn sizes;\n>  }\n>  \n> -int V4L2Subdevice::setSelection(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> -\tsel.r.left = rect->x;\n> -\tsel.r.top = rect->y;\n> -\tsel.r.width = rect->width;\n> -\tsel.r.height = rect->height;\n> -\n> -\tint ret = ioctl(VIDIOC_SUBDEV_S_SELECTION, &sel);\n> -\tif (ret < 0) {\n> -\t\tLOG(V4L2, Error)\n> -\t\t\t<< \"Unable to set 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->width = sel.r.width;\n> -\trect->height = sel.r.height;\n> -\n> -\treturn 0;\n> -}\n> -\n>  } /* namespace libcamera */\n> -- \n> 2.26.1\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-lj1-x241.google.com (mail-lj1-x241.google.com\n\t[IPv6:2a00:1450:4864:20::241])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id ED6B4603FB\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue, 28 Apr 2020 01:25:09 +0200 (CEST)","by mail-lj1-x241.google.com with SMTP id u6so19462233ljl.6\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tMon, 27 Apr 2020 16:25:09 -0700 (PDT)","from localhost (h-209-203.A463.priv.bahnhof.se. [155.4.209.203])\n\tby smtp.gmail.com with ESMTPSA id\n\tm5sm12390087lfb.56.2020.04.27.16.25.08\n\t(version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n\tMon, 27 Apr 2020 16:25:08 -0700 (PDT)"],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (2048-bit key; \n\tunprotected)\n\theader.d=ragnatech-se.20150623.gappssmtp.com\n\theader.i=@ragnatech-se.20150623.gappssmtp.com header.b=\"N++P7Kgt\"; \n\tdkim-atps=neutral","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\tbh=R1MIULKMeg2SZqU9gETynrPt1dykMTTHdGnq6ZFv05A=;\n\tb=N++P7KgtHyK5bzNEHRhXBI27h15RUFBCMoEJXm95F2bqQfyVSMvzQkRlEAXYcy13hG\n\tFU/UkRna/Tjt7PiyIzM1RuPfAQ/wncKKVmIWDNqDCIz5aUqR6xSfdlxTDSsFlTH3xEZC\n\tkRNboPkokMbPL7NgoB7viBN4c63VjTZxfKNDUWtZOU7XqKcyAn0JgXcB57Yr532d5d+b\n\tnVKiSJV3GXkmmLKWd1tVflMIydOAfHACsVJ3Fdk3q2FlnamJD1NtYkB6KWr0EBzO70FA\n\tqJ6z8/u3j8R/y4OrgcSfBmd86cQi1AAugpYXQnDMmMvmht37NfcscVrhRpPFUdG2NbXc\n\tOXmA==","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;\n\tbh=R1MIULKMeg2SZqU9gETynrPt1dykMTTHdGnq6ZFv05A=;\n\tb=Uu8uFznlREyj8ILDdm14EXcvgt4IP+zFTLx9py/4/hrttiT8SNWblYrHLgZVhcg/UI\n\tcgZIf6cFXBMQt+p4wvz6+dnQ+rZyQG3swPybgM3ApxWxdl6fRc50T8/DAEIHGG7jDMUy\n\t4jQEhneGPLRmokT/TZ9zv7Oc8gEoGsQiN8qaeuQ/XSNkU+SweBkXR7SnXYyU71bjbFm9\n\tlSd5pTSZCe4NBoF3571zvIUmbOBtiMYw4FcGodUcRMifJY4CTTo24ZtNyLkDmSoaSwzF\n\tc4PewSIRGmQGCD5USGnNJAUJkbZw0nSuPqhU7sboaQ1G0sD1UgDTd4+aPkJGqKSYVvDC\n\tQj4g==","X-Gm-Message-State":"AGi0PuZURuaX2wxNw8BF+pnGlBs9gXWUBtrMPJfbbunxCGW2RBuBBxg3\n\t7YKWOKwwYX1eS7+MDwLuLLGvsc/vvG8=","X-Google-Smtp-Source":"APiQypLkI4lrq5zMkaYEOVQLmBTmd16ORGU+YlNqbf+ee1fbPkGhZ9TQDlyzdteVD41HEEl+xq+SMQ==","X-Received":"by 2002:a2e:8719:: with SMTP id\n\tm25mr12966308lji.268.1588029909214; \n\tMon, 27 Apr 2020 16:25:09 -0700 (PDT)","Date":"Tue, 28 Apr 2020 01:25:07 +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":"<20200427232507.GE1165729@oden.dyn.berto.se>","References":"<20200427213236.333777-1-jacopo@jmondi.org>\n\t<20200427213236.333777-2-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":"<20200427213236.333777-2-jacopo@jmondi.org>","Subject":"Re: [libcamera-devel] [PATCH v4 1/7] libcamera: v4l2_subdevice:\n\tExpose setSelection()","X-BeenThere":"libcamera-devel@lists.libcamera.org","X-Mailman-Version":"2.1.29","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, 27 Apr 2020 23:25:10 -0000"}},{"id":4598,"web_url":"https://patchwork.libcamera.org/comment/4598/","msgid":"<20200428013643.GA3579@pendragon.ideasonboard.com>","date":"2020-04-28T01:36:43","subject":"Re: [libcamera-devel] [PATCH v4 1/7] libcamera: v4l2_subdevice:\n\tExpose setSelection()","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 Mon, Apr 27, 2020 at 11:32:30PM +0200, Jacopo Mondi wrote:\n> Expose V4L2Subdevice::setSelection() method and drop\n> V4L2Subdevice::setCrop() and V4L2Subdevice::setComopse() as wrapping\n> each target with a single function does not provide any benefit.\n> \n> Signed-off-by: Jacopo Mondi <jacopo@jmondi.org>\n> ---\n>  src/libcamera/include/v4l2_subdevice.h |  7 +--\n>  src/libcamera/pipeline/ipu3/ipu3.cpp   |  4 +-\n>  src/libcamera/v4l2_subdevice.cpp       | 76 ++++++++++----------------\n>  3 files changed, 34 insertions(+), 53 deletions(-)\n> \n> diff --git a/src/libcamera/include/v4l2_subdevice.h b/src/libcamera/include/v4l2_subdevice.h\n> index 4a04eadfb1f9..9a5c812db9b6 100644\n> --- a/src/libcamera/include/v4l2_subdevice.h\n> +++ b/src/libcamera/include/v4l2_subdevice.h\n> @@ -46,8 +46,8 @@ public:\n>  \n>  \tconst MediaEntity *entity() const { return entity_; }\n>  \n> -\tint setCrop(unsigned int pad, Rectangle *rect);\n> -\tint setCompose(unsigned int pad, Rectangle *rect);\n> +\tint setSelection(unsigned int pad, unsigned int target,\n> +\t\t\t Rectangle *rect);\n\nA note on API design, not intended to be applied to this patch: with two\ninteger parameters for pad and target, there's a risk that the caller\nwould use them in the wrong order. If we defined\n\n\tenum V4L2SelectionTarget {\n\t\tV4L2SelectionTargetCrop = V4L2_SEL_TGT_CROP,\n\t\t...\n\t};\n\nand turned the function into\n\n\tint setSelection(unsigned int pad, V4L2SelectionTarget target,\n\t\t\t Rectangle *rect);\n\nthen the compiler would tell us if we called\n\n\tsubdev->setSelection(V4L2SelectionTargetCrop, 0, &rect);\n\n>  \n>  \tImageFormats formats(unsigned int pad);\n>  \n> @@ -67,9 +67,6 @@ private:\n>  \tstd::vector<SizeRange> enumPadSizes(unsigned int pad,\n>  \t\t\t\t\t    unsigned int code);\n>  \n> -\tint setSelection(unsigned int pad, unsigned int target,\n> -\t\t\t Rectangle *rect);\n> -\n>  \tconst MediaEntity *entity_;\n>  };\n>  \n> diff --git a/src/libcamera/pipeline/ipu3/ipu3.cpp b/src/libcamera/pipeline/ipu3/ipu3.cpp\n> index b45900159d06..ff33f15f9eac 100644\n> --- a/src/libcamera/pipeline/ipu3/ipu3.cpp\n> +++ b/src/libcamera/pipeline/ipu3/ipu3.cpp\n> @@ -1135,11 +1135,11 @@ int ImgUDevice::configureInput(const Size &size,\n>  \t\t.width = inputFormat->size.width,\n>  \t\t.height = inputFormat->size.height,\n>  \t};\n> -\tret = imgu_->setCrop(PAD_INPUT, &rect);\n> +\tret = imgu_->setSelection(PAD_INPUT, V4L2_SEL_TGT_CROP, &rect);\n>  \tif (ret)\n>  \t\treturn ret;\n>  \n> -\tret = imgu_->setCompose(PAD_INPUT, &rect);\n> +\tret = imgu_->setSelection(PAD_INPUT, V4L2_SEL_TGT_COMPOSE, &rect);\n>  \tif (ret)\n>  \t\treturn ret;\n>  \n> diff --git a/src/libcamera/v4l2_subdevice.cpp b/src/libcamera/v4l2_subdevice.cpp\n> index 5a479a96b795..432e89eacbd3 100644\n> --- a/src/libcamera/v4l2_subdevice.cpp\n> +++ b/src/libcamera/v4l2_subdevice.cpp\n> @@ -134,27 +134,42 @@ int V4L2Subdevice::open()\n>   */\n>  \n>  /**\n> - * \\brief Set a crop rectangle on one of the V4L2 subdevice pads\n> + * \\brief Set selection rectangle \\a rect for \\a target\n>   * \\param[in] pad The 0-indexed pad number the rectangle is to be applied to\n> - * \\param[inout] rect The rectangle describing crop target area\n> + * \\param[in] target The selection target defined by the V4L2_SEL_TGT_* flags\n> + * \\param[inout] rect The selection rectangle to be applied\n\nMaybe you could add\n\n  * \\todo Define a V4L2SelectionTarget enum for the selection target\n\nhere to remember the comment above.\n\nReviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n\n(and no need to submit a new version just for this, you can fix when\npushing if you agree with the comment.\n\n>   * \\return 0 on success or a negative error code otherwise\n>   */\n> -int V4L2Subdevice::setCrop(unsigned int pad, Rectangle *rect)\n> +int V4L2Subdevice::setSelection(unsigned int pad, unsigned int target,\n> +\t\t\t\tRectangle *rect)\n>  {\n> -\treturn setSelection(pad, V4L2_SEL_TGT_CROP, rect);\n> -}\n> +\tstruct v4l2_subdev_selection sel = {};\n>  \n> -/**\n> - * \\brief Set a compose rectangle on one of the V4L2 subdevice pads\n> - * \\param[in] pad The 0-indexed pad number the rectangle is to be applied to\n> - * \\param[inout] rect The rectangle describing the compose target area\n> - * \\return 0 on success or a negative error code otherwise\n> - */\n> -int V4L2Subdevice::setCompose(unsigned int pad, Rectangle *rect)\n> -{\n> -\treturn setSelection(pad, V4L2_SEL_TGT_COMPOSE, rect);\n> -}\n> +\tsel.which = V4L2_SUBDEV_FORMAT_ACTIVE;\n> +\tsel.pad = pad;\n> +\tsel.target = target;\n> +\tsel.flags = 0;\n>  \n> +\tsel.r.left = rect->x;\n> +\tsel.r.top = rect->y;\n> +\tsel.r.width = rect->width;\n> +\tsel.r.height = rect->height;\n> +\n> +\tint ret = ioctl(VIDIOC_SUBDEV_S_SELECTION, &sel);\n> +\tif (ret < 0) {\n> +\t\tLOG(V4L2, Error)\n> +\t\t\t<< \"Unable to set 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->width = sel.r.width;\n> +\trect->height = sel.r.height;\n> +\n> +\treturn 0;\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> @@ -343,35 +358,4 @@ std::vector<SizeRange> V4L2Subdevice::enumPadSizes(unsigned int pad,\n>  \treturn sizes;\n>  }\n>  \n> -int V4L2Subdevice::setSelection(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> -\tsel.r.left = rect->x;\n> -\tsel.r.top = rect->y;\n> -\tsel.r.width = rect->width;\n> -\tsel.r.height = rect->height;\n> -\n> -\tint ret = ioctl(VIDIOC_SUBDEV_S_SELECTION, &sel);\n> -\tif (ret < 0) {\n> -\t\tLOG(V4L2, Error)\n> -\t\t\t<< \"Unable to set 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->width = sel.r.width;\n> -\trect->height = 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 874A7603F5\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue, 28 Apr 2020 03:36:59 +0200 (CEST)","from pendragon.ideasonboard.com (81-175-216-236.bb.dnainternet.fi\n\t[81.175.216.236])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id B0334583;\n\tTue, 28 Apr 2020 03:36:58 +0200 (CEST)"],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key; \n\tunprotected) header.d=ideasonboard.com\n\theader.i=@ideasonboard.com\n\theader.b=\"UE1Lfp3W\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1588037818;\n\tbh=TasXo7nwu0Rv2in0gvb/9b2+Oh5TnQzctrrRfKnyU1A=;\n\th=Date:From:To:Cc:Subject:References:In-Reply-To:From;\n\tb=UE1Lfp3WTaCDki7qgGi4jw5rDRAoEkXDz0S9rbHLdoElHY10LrQVf6NvrCBvya4Jl\n\tW/P13GapldJ/KJ63aDaEdgiSk53VB8HhTxjHehirm/c62YxyEnyy8bpbpu1MMkeLK3\n\tqg5MJ+pDhpU+vNiP/cDEeeh+lendnje23Um03Xks=","Date":"Tue, 28 Apr 2020 04:36:43 +0300","From":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>","To":"Jacopo Mondi <jacopo@jmondi.org>","Cc":"libcamera-devel@lists.libcamera.org","Message-ID":"<20200428013643.GA3579@pendragon.ideasonboard.com>","References":"<20200427213236.333777-1-jacopo@jmondi.org>\n\t<20200427213236.333777-2-jacopo@jmondi.org>","MIME-Version":"1.0","Content-Type":"text/plain; charset=utf-8","Content-Disposition":"inline","In-Reply-To":"<20200427213236.333777-2-jacopo@jmondi.org>","Subject":"Re: [libcamera-devel] [PATCH v4 1/7] libcamera: v4l2_subdevice:\n\tExpose setSelection()","X-BeenThere":"libcamera-devel@lists.libcamera.org","X-Mailman-Version":"2.1.29","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":"Tue, 28 Apr 2020 01:36:59 -0000"}},{"id":4608,"web_url":"https://patchwork.libcamera.org/comment/4608/","msgid":"<20200428071000.jyxxe3gmpewxrscc@uno.localdomain>","date":"2020-04-28T07:10:00","subject":"Re: [libcamera-devel] [PATCH v4 1/7] libcamera: v4l2_subdevice:\n\tExpose setSelection()","submitter":{"id":3,"url":"https://patchwork.libcamera.org/api/people/3/","name":"Jacopo Mondi","email":"jacopo@jmondi.org"},"content":"HI Laurent,\n\nOn Tue, Apr 28, 2020 at 04:36:43AM +0300, Laurent Pinchart wrote:\n> Hi Jacopo,\n>\n> Thank you for the patch.\n>\n> On Mon, Apr 27, 2020 at 11:32:30PM +0200, Jacopo Mondi wrote:\n> > Expose V4L2Subdevice::setSelection() method and drop\n> > V4L2Subdevice::setCrop() and V4L2Subdevice::setComopse() as wrapping\n> > each target with a single function does not provide any benefit.\n> >\n> > Signed-off-by: Jacopo Mondi <jacopo@jmondi.org>\n> > ---\n> >  src/libcamera/include/v4l2_subdevice.h |  7 +--\n> >  src/libcamera/pipeline/ipu3/ipu3.cpp   |  4 +-\n> >  src/libcamera/v4l2_subdevice.cpp       | 76 ++++++++++----------------\n> >  3 files changed, 34 insertions(+), 53 deletions(-)\n> >\n> > diff --git a/src/libcamera/include/v4l2_subdevice.h b/src/libcamera/include/v4l2_subdevice.h\n> > index 4a04eadfb1f9..9a5c812db9b6 100644\n> > --- a/src/libcamera/include/v4l2_subdevice.h\n> > +++ b/src/libcamera/include/v4l2_subdevice.h\n> > @@ -46,8 +46,8 @@ public:\n> >\n> >  \tconst MediaEntity *entity() const { return entity_; }\n> >\n> > -\tint setCrop(unsigned int pad, Rectangle *rect);\n> > -\tint setCompose(unsigned int pad, Rectangle *rect);\n> > +\tint setSelection(unsigned int pad, unsigned int target,\n> > +\t\t\t Rectangle *rect);\n>\n> A note on API design, not intended to be applied to this patch: with two\n> integer parameters for pad and target, there's a risk that the caller\n> would use them in the wrong order. If we defined\n>\n> \tenum V4L2SelectionTarget {\n> \t\tV4L2SelectionTargetCrop = V4L2_SEL_TGT_CROP,\n> \t\t...\n> \t};\n>\n> and turned the function into\n>\n> \tint setSelection(unsigned int pad, V4L2SelectionTarget target,\n> \t\t\t Rectangle *rect);\n>\n> then the compiler would tell us if we called\n>\n> \tsubdev->setSelection(V4L2SelectionTargetCrop, 0, &rect);\n>\n> >\n> >  \tImageFormats formats(unsigned int pad);\n> >\n> > @@ -67,9 +67,6 @@ private:\n> >  \tstd::vector<SizeRange> enumPadSizes(unsigned int pad,\n> >  \t\t\t\t\t    unsigned int code);\n> >\n> > -\tint setSelection(unsigned int pad, unsigned int target,\n> > -\t\t\t Rectangle *rect);\n> > -\n> >  \tconst MediaEntity *entity_;\n> >  };\n> >\n> > diff --git a/src/libcamera/pipeline/ipu3/ipu3.cpp b/src/libcamera/pipeline/ipu3/ipu3.cpp\n> > index b45900159d06..ff33f15f9eac 100644\n> > --- a/src/libcamera/pipeline/ipu3/ipu3.cpp\n> > +++ b/src/libcamera/pipeline/ipu3/ipu3.cpp\n> > @@ -1135,11 +1135,11 @@ int ImgUDevice::configureInput(const Size &size,\n> >  \t\t.width = inputFormat->size.width,\n> >  \t\t.height = inputFormat->size.height,\n> >  \t};\n> > -\tret = imgu_->setCrop(PAD_INPUT, &rect);\n> > +\tret = imgu_->setSelection(PAD_INPUT, V4L2_SEL_TGT_CROP, &rect);\n> >  \tif (ret)\n> >  \t\treturn ret;\n> >\n> > -\tret = imgu_->setCompose(PAD_INPUT, &rect);\n> > +\tret = imgu_->setSelection(PAD_INPUT, V4L2_SEL_TGT_COMPOSE, &rect);\n> >  \tif (ret)\n> >  \t\treturn ret;\n> >\n> > diff --git a/src/libcamera/v4l2_subdevice.cpp b/src/libcamera/v4l2_subdevice.cpp\n> > index 5a479a96b795..432e89eacbd3 100644\n> > --- a/src/libcamera/v4l2_subdevice.cpp\n> > +++ b/src/libcamera/v4l2_subdevice.cpp\n> > @@ -134,27 +134,42 @@ int V4L2Subdevice::open()\n> >   */\n> >\n> >  /**\n> > - * \\brief Set a crop rectangle on one of the V4L2 subdevice pads\n> > + * \\brief Set selection rectangle \\a rect for \\a target\n> >   * \\param[in] pad The 0-indexed pad number the rectangle is to be applied to\n> > - * \\param[inout] rect The rectangle describing crop target area\n> > + * \\param[in] target The selection target defined by the V4L2_SEL_TGT_* flags\n> > + * \\param[inout] rect The selection rectangle to be applied\n>\n> Maybe you could add\n>\n>   * \\todo Define a V4L2SelectionTarget enum for the selection target\n>\n> here to remember the comment above.\n\nWe could, yes, not something I would concern, as if one calls a\nfunction with paramters in a different order than expected, there's\nnot much we can do. But this is tricky as pad and target could be\nvalid for the kernel driver as well, so it's worth recording this\n\n>\n> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n>\n> (and no need to submit a new version just for this, you can fix when\n> pushing if you agree with the comment.\n\nThanks\n   j\n\n>\n> >   * \\return 0 on success or a negative error code otherwise\n> >   */\n> > -int V4L2Subdevice::setCrop(unsigned int pad, Rectangle *rect)\n> > +int V4L2Subdevice::setSelection(unsigned int pad, unsigned int target,\n> > +\t\t\t\tRectangle *rect)\n> >  {\n> > -\treturn setSelection(pad, V4L2_SEL_TGT_CROP, rect);\n> > -}\n> > +\tstruct v4l2_subdev_selection sel = {};\n> >\n> > -/**\n> > - * \\brief Set a compose rectangle on one of the V4L2 subdevice pads\n> > - * \\param[in] pad The 0-indexed pad number the rectangle is to be applied to\n> > - * \\param[inout] rect The rectangle describing the compose target area\n> > - * \\return 0 on success or a negative error code otherwise\n> > - */\n> > -int V4L2Subdevice::setCompose(unsigned int pad, Rectangle *rect)\n> > -{\n> > -\treturn setSelection(pad, V4L2_SEL_TGT_COMPOSE, rect);\n> > -}\n> > +\tsel.which = V4L2_SUBDEV_FORMAT_ACTIVE;\n> > +\tsel.pad = pad;\n> > +\tsel.target = target;\n> > +\tsel.flags = 0;\n> >\n> > +\tsel.r.left = rect->x;\n> > +\tsel.r.top = rect->y;\n> > +\tsel.r.width = rect->width;\n> > +\tsel.r.height = rect->height;\n> > +\n> > +\tint ret = ioctl(VIDIOC_SUBDEV_S_SELECTION, &sel);\n> > +\tif (ret < 0) {\n> > +\t\tLOG(V4L2, Error)\n> > +\t\t\t<< \"Unable to set 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->width = sel.r.width;\n> > +\trect->height = sel.r.height;\n> > +\n> > +\treturn 0;\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> > @@ -343,35 +358,4 @@ std::vector<SizeRange> V4L2Subdevice::enumPadSizes(unsigned int pad,\n> >  \treturn sizes;\n> >  }\n> >\n> > -int V4L2Subdevice::setSelection(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> > -\tsel.r.left = rect->x;\n> > -\tsel.r.top = rect->y;\n> > -\tsel.r.width = rect->width;\n> > -\tsel.r.height = rect->height;\n> > -\n> > -\tint ret = ioctl(VIDIOC_SUBDEV_S_SELECTION, &sel);\n> > -\tif (ret < 0) {\n> > -\t\tLOG(V4L2, Error)\n> > -\t\t\t<< \"Unable to set 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->width = sel.r.width;\n> > -\trect->height = 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 relay2-d.mail.gandi.net (relay2-d.mail.gandi.net\n\t[217.70.183.194])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id CDA56603F7\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue, 28 Apr 2020 09:06:50 +0200 (CEST)","from uno.localdomain (a-ur1-85.tin.it [212.216.150.148])\n\t(Authenticated sender: jacopo@jmondi.org)\n\tby relay2-d.mail.gandi.net (Postfix) with ESMTPSA id CF3BC4000A;\n\tTue, 28 Apr 2020 07:06:49 +0000 (UTC)"],"X-Originating-IP":"212.216.150.148","Date":"Tue, 28 Apr 2020 09:10:00 +0200","From":"Jacopo Mondi <jacopo@jmondi.org>","To":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>","Cc":"libcamera-devel@lists.libcamera.org","Message-ID":"<20200428071000.jyxxe3gmpewxrscc@uno.localdomain>","References":"<20200427213236.333777-1-jacopo@jmondi.org>\n\t<20200427213236.333777-2-jacopo@jmondi.org>\n\t<20200428013643.GA3579@pendragon.ideasonboard.com>","MIME-Version":"1.0","Content-Type":"text/plain; charset=utf-8","Content-Disposition":"inline","In-Reply-To":"<20200428013643.GA3579@pendragon.ideasonboard.com>","Subject":"Re: [libcamera-devel] [PATCH v4 1/7] libcamera: v4l2_subdevice:\n\tExpose setSelection()","X-BeenThere":"libcamera-devel@lists.libcamera.org","X-Mailman-Version":"2.1.29","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":"Tue, 28 Apr 2020 07:06:51 -0000"}},{"id":4614,"web_url":"https://patchwork.libcamera.org/comment/4614/","msgid":"<20200428105129.GC5859@pendragon.ideasonboard.com>","date":"2020-04-28T10:51:29","subject":"Re: [libcamera-devel] [PATCH v4 1/7] libcamera: v4l2_subdevice:\n\tExpose setSelection()","submitter":{"id":2,"url":"https://patchwork.libcamera.org/api/people/2/","name":"Laurent Pinchart","email":"laurent.pinchart@ideasonboard.com"},"content":"Hi Jacopo,\n\nOn Tue, Apr 28, 2020 at 09:10:00AM +0200, Jacopo Mondi wrote:\n> On Tue, Apr 28, 2020 at 04:36:43AM +0300, Laurent Pinchart wrote:\n> > On Mon, Apr 27, 2020 at 11:32:30PM +0200, Jacopo Mondi wrote:\n> > > Expose V4L2Subdevice::setSelection() method and drop\n> > > V4L2Subdevice::setCrop() and V4L2Subdevice::setComopse() as wrapping\n> > > each target with a single function does not provide any benefit.\n> > >\n> > > Signed-off-by: Jacopo Mondi <jacopo@jmondi.org>\n> > > ---\n> > >  src/libcamera/include/v4l2_subdevice.h |  7 +--\n> > >  src/libcamera/pipeline/ipu3/ipu3.cpp   |  4 +-\n> > >  src/libcamera/v4l2_subdevice.cpp       | 76 ++++++++++----------------\n> > >  3 files changed, 34 insertions(+), 53 deletions(-)\n> > >\n> > > diff --git a/src/libcamera/include/v4l2_subdevice.h b/src/libcamera/include/v4l2_subdevice.h\n> > > index 4a04eadfb1f9..9a5c812db9b6 100644\n> > > --- a/src/libcamera/include/v4l2_subdevice.h\n> > > +++ b/src/libcamera/include/v4l2_subdevice.h\n> > > @@ -46,8 +46,8 @@ public:\n> > >\n> > >  \tconst MediaEntity *entity() const { return entity_; }\n> > >\n> > > -\tint setCrop(unsigned int pad, Rectangle *rect);\n> > > -\tint setCompose(unsigned int pad, Rectangle *rect);\n> > > +\tint setSelection(unsigned int pad, unsigned int target,\n> > > +\t\t\t Rectangle *rect);\n> >\n> > A note on API design, not intended to be applied to this patch: with two\n> > integer parameters for pad and target, there's a risk that the caller\n> > would use them in the wrong order. If we defined\n> >\n> > \tenum V4L2SelectionTarget {\n> > \t\tV4L2SelectionTargetCrop = V4L2_SEL_TGT_CROP,\n> > \t\t...\n> > \t};\n> >\n> > and turned the function into\n> >\n> > \tint setSelection(unsigned int pad, V4L2SelectionTarget target,\n> > \t\t\t Rectangle *rect);\n> >\n> > then the compiler would tell us if we called\n> >\n> > \tsubdev->setSelection(V4L2SelectionTargetCrop, 0, &rect);\n> >\n> > >\n> > >  \tImageFormats formats(unsigned int pad);\n> > >\n> > > @@ -67,9 +67,6 @@ private:\n> > >  \tstd::vector<SizeRange> enumPadSizes(unsigned int pad,\n> > >  \t\t\t\t\t    unsigned int code);\n> > >\n> > > -\tint setSelection(unsigned int pad, unsigned int target,\n> > > -\t\t\t Rectangle *rect);\n> > > -\n> > >  \tconst MediaEntity *entity_;\n> > >  };\n> > >\n> > > diff --git a/src/libcamera/pipeline/ipu3/ipu3.cpp b/src/libcamera/pipeline/ipu3/ipu3.cpp\n> > > index b45900159d06..ff33f15f9eac 100644\n> > > --- a/src/libcamera/pipeline/ipu3/ipu3.cpp\n> > > +++ b/src/libcamera/pipeline/ipu3/ipu3.cpp\n> > > @@ -1135,11 +1135,11 @@ int ImgUDevice::configureInput(const Size &size,\n> > >  \t\t.width = inputFormat->size.width,\n> > >  \t\t.height = inputFormat->size.height,\n> > >  \t};\n> > > -\tret = imgu_->setCrop(PAD_INPUT, &rect);\n> > > +\tret = imgu_->setSelection(PAD_INPUT, V4L2_SEL_TGT_CROP, &rect);\n> > >  \tif (ret)\n> > >  \t\treturn ret;\n> > >\n> > > -\tret = imgu_->setCompose(PAD_INPUT, &rect);\n> > > +\tret = imgu_->setSelection(PAD_INPUT, V4L2_SEL_TGT_COMPOSE, &rect);\n> > >  \tif (ret)\n> > >  \t\treturn ret;\n> > >\n> > > diff --git a/src/libcamera/v4l2_subdevice.cpp b/src/libcamera/v4l2_subdevice.cpp\n> > > index 5a479a96b795..432e89eacbd3 100644\n> > > --- a/src/libcamera/v4l2_subdevice.cpp\n> > > +++ b/src/libcamera/v4l2_subdevice.cpp\n> > > @@ -134,27 +134,42 @@ int V4L2Subdevice::open()\n> > >   */\n> > >\n> > >  /**\n> > > - * \\brief Set a crop rectangle on one of the V4L2 subdevice pads\n> > > + * \\brief Set selection rectangle \\a rect for \\a target\n> > >   * \\param[in] pad The 0-indexed pad number the rectangle is to be applied to\n> > > - * \\param[inout] rect The rectangle describing crop target area\n> > > + * \\param[in] target The selection target defined by the V4L2_SEL_TGT_* flags\n> > > + * \\param[inout] rect The selection rectangle to be applied\n> >\n> > Maybe you could add\n> >\n> >   * \\todo Define a V4L2SelectionTarget enum for the selection target\n> >\n> > here to remember the comment above.\n> \n> We could, yes, not something I would concern, as if one calls a\n> function with paramters in a different order than expected, there's\n> not much we can do. But this is tricky as pad and target could be\n> valid for the kernel driver as well, so it's worth recording this\n\nThat's where I don't agree :-) By using an enum, we would ensure the\ncompiler catches this error. Not something we have to do now, but it's a\nmatter of API design. A great API is an API that is not possible to\nmisuse :-)\n\n> > Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n> >\n> > (and no need to submit a new version just for this, you can fix when\n> > pushing if you agree with the comment.\n> >\n> > >   * \\return 0 on success or a negative error code otherwise\n> > >   */\n> > > -int V4L2Subdevice::setCrop(unsigned int pad, Rectangle *rect)\n> > > +int V4L2Subdevice::setSelection(unsigned int pad, unsigned int target,\n> > > +\t\t\t\tRectangle *rect)\n> > >  {\n> > > -\treturn setSelection(pad, V4L2_SEL_TGT_CROP, rect);\n> > > -}\n> > > +\tstruct v4l2_subdev_selection sel = {};\n> > >\n> > > -/**\n> > > - * \\brief Set a compose rectangle on one of the V4L2 subdevice pads\n> > > - * \\param[in] pad The 0-indexed pad number the rectangle is to be applied to\n> > > - * \\param[inout] rect The rectangle describing the compose target area\n> > > - * \\return 0 on success or a negative error code otherwise\n> > > - */\n> > > -int V4L2Subdevice::setCompose(unsigned int pad, Rectangle *rect)\n> > > -{\n> > > -\treturn setSelection(pad, V4L2_SEL_TGT_COMPOSE, rect);\n> > > -}\n> > > +\tsel.which = V4L2_SUBDEV_FORMAT_ACTIVE;\n> > > +\tsel.pad = pad;\n> > > +\tsel.target = target;\n> > > +\tsel.flags = 0;\n> > >\n> > > +\tsel.r.left = rect->x;\n> > > +\tsel.r.top = rect->y;\n> > > +\tsel.r.width = rect->width;\n> > > +\tsel.r.height = rect->height;\n> > > +\n> > > +\tint ret = ioctl(VIDIOC_SUBDEV_S_SELECTION, &sel);\n> > > +\tif (ret < 0) {\n> > > +\t\tLOG(V4L2, Error)\n> > > +\t\t\t<< \"Unable to set 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->width = sel.r.width;\n> > > +\trect->height = sel.r.height;\n> > > +\n> > > +\treturn 0;\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> > > @@ -343,35 +358,4 @@ std::vector<SizeRange> V4L2Subdevice::enumPadSizes(unsigned int pad,\n> > >  \treturn sizes;\n> > >  }\n> > >\n> > > -int V4L2Subdevice::setSelection(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> > > -\tsel.r.left = rect->x;\n> > > -\tsel.r.top = rect->y;\n> > > -\tsel.r.width = rect->width;\n> > > -\tsel.r.height = rect->height;\n> > > -\n> > > -\tint ret = ioctl(VIDIOC_SUBDEV_S_SELECTION, &sel);\n> > > -\tif (ret < 0) {\n> > > -\t\tLOG(V4L2, Error)\n> > > -\t\t\t<< \"Unable to set 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->width = sel.r.width;\n> > > -\trect->height = 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 788ED60AF5\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue, 28 Apr 2020 12:51:45 +0200 (CEST)","from pendragon.ideasonboard.com (81-175-216-236.bb.dnainternet.fi\n\t[81.175.216.236])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id D524072C;\n\tTue, 28 Apr 2020 12:51:44 +0200 (CEST)"],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key; \n\tunprotected) header.d=ideasonboard.com\n\theader.i=@ideasonboard.com\n\theader.b=\"HSIUYYW8\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1588071105;\n\tbh=Xoq+as3XQiNgooOMGs2UOKddoXwtcGrcDWk0MZhqnWQ=;\n\th=Date:From:To:Cc:Subject:References:In-Reply-To:From;\n\tb=HSIUYYW8/VM/UbJlAXTogtcU29GVHam4W77wpkOyOEIMx0ywv7j12dENtLALJZJpl\n\tlu29IGHwNT3bGvxMC7xWVzwo/3sfeIGRCAMKjBw7OUA7u7SNtxvo48QSgoi8XppTlI\n\taF4GP+jgUzr6IwixNX40eIDlFYsmfG48dIvFIkCg=","Date":"Tue, 28 Apr 2020 13:51:29 +0300","From":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>","To":"Jacopo Mondi <jacopo@jmondi.org>","Cc":"libcamera-devel@lists.libcamera.org","Message-ID":"<20200428105129.GC5859@pendragon.ideasonboard.com>","References":"<20200427213236.333777-1-jacopo@jmondi.org>\n\t<20200427213236.333777-2-jacopo@jmondi.org>\n\t<20200428013643.GA3579@pendragon.ideasonboard.com>\n\t<20200428071000.jyxxe3gmpewxrscc@uno.localdomain>","MIME-Version":"1.0","Content-Type":"text/plain; charset=utf-8","Content-Disposition":"inline","In-Reply-To":"<20200428071000.jyxxe3gmpewxrscc@uno.localdomain>","Subject":"Re: [libcamera-devel] [PATCH v4 1/7] libcamera: v4l2_subdevice:\n\tExpose setSelection()","X-BeenThere":"libcamera-devel@lists.libcamera.org","X-Mailman-Version":"2.1.29","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":"Tue, 28 Apr 2020 10:51:45 -0000"}}]