[{"id":561,"web_url":"https://patchwork.libcamera.org/comment/561/","msgid":"<20190124185132.GC4127@bigcity.dyn.berto.se>","date":"2019-01-24T18:51:32","subject":"Re: [libcamera-devel] [PATCH v2 2/2] libcamera: v4l2_device: Add\n\tstubs to set/get format","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-01-24 12:30:00 +0100, Jacopo Mondi wrote:\n> Add function stubs for set/get format to V4L2Device.\n> \n> Signed-off-by: Jacopo Mondi <jacopo@jmondi.org>\n> ---\n>  src/libcamera/include/v4l2_device.h |  9 ++++++\n>  src/libcamera/v4l2_device.cpp       | 49 +++++++++++++++++++++++++++++\n>  2 files changed, 58 insertions(+)\n> \n> diff --git a/src/libcamera/include/v4l2_device.h b/src/libcamera/include/v4l2_device.h\n> index 413bb7f..2da30d1 100644\n> --- a/src/libcamera/include/v4l2_device.h\n> +++ b/src/libcamera/include/v4l2_device.h\n> @@ -72,10 +72,19 @@ public:\n>  \tconst char *deviceName() const { return caps_.card(); }\n>  \tconst char *busName() const { return caps_.bus_info(); }\n>  \n> +\tint format();\n> +\tint setFormat();\n> +\n>  private:\n>  \tstd::string deviceNode_;\n>  \tint fd_;\n>  \tV4L2Capability caps_;\n> +\n> +\tint getFormatSingleplane();\n\nI think this should be formatSingleplane() to match the naming \nconvention.\n\nI like the structure of this patch and I think this is the way to go. I \ndo think we should hold off on merging this until we can replace the \nstubs with code that do some work. Furthermore I think you can merge 1/2 \nif this series, if there are no other review comments on that in the \nnear future.\n\n> +\tint setFormatSingleplane();\n> +\n> +\tint getFormatMultiplane();\n> +\tint setFormatMultiplane();\n>  };\n>  \n>  } /* namespace libcamera */\n> diff --git a/src/libcamera/v4l2_device.cpp b/src/libcamera/v4l2_device.cpp\n> index 9cb504d..2ddb800 100644\n> --- a/src/libcamera/v4l2_device.cpp\n> +++ b/src/libcamera/v4l2_device.cpp\n> @@ -213,4 +213,53 @@ void V4L2Device::close()\n>   * \\return The string containing the device location\n>   */\n>  \n> +/**\n> + * \\brief Retrieve the image format set on the V4L2 device\n> + *\n> + * TODO: define how the image format is encoded\n> + * FIXME: this function is a stub at the moment\n> + *\n> + * \\return 0 for success, a negative error code otherwise\n> + */\n> +int V4L2Device::format()\n> +{\n> +\treturn caps_.isMultiplanar() ? getFormatMultiplane() :\n> +\t\t\t\t       getFormatSingleplane();\n> +}\n> +\n> +/**\n> + * \\brief Program an image format on the V4L2 device\n> + *\n> + * TODO: define how the image format is encoded\n> + * FIXME: this function is a stub at the moment\n> + *\n> + * \\return 0 for success, a negative error code otherwise\n> + */\n> +int V4L2Device::setFormat()\n> +{\n> +\treturn caps_.isMultiplanar() ? setFormatMultiplane() :\n> +\t\t\t\t       setFormatSingleplane();\n> +}\n> +\n> +/* FIXME: these functions are stubs at the moment. */\n> +int V4L2Device::getFormatSingleplane()\n> +{\n> +\treturn 0;\n> +}\n> +\n> +int V4L2Device::setFormatSingleplane()\n> +{\n> +\treturn 0;\n> +}\n> +\n> +int V4L2Device::getFormatMultiplane()\n> +{\n> +\treturn 0;\n> +}\n> +\n> +int V4L2Device::setFormatMultiplane()\n> +{\n> +\treturn 0;\n> +}\n> +\n>  } /* namespace libcamera */\n> -- \n> 2.20.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-x243.google.com (mail-lj1-x243.google.com\n\t[IPv6:2a00:1450:4864:20::243])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id BCA0260C82\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tThu, 24 Jan 2019 19:51:34 +0100 (CET)","by mail-lj1-x243.google.com with SMTP id n18-v6so6185997lji.7\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tThu, 24 Jan 2019 10:51:34 -0800 (PST)","from localhost (89-233-230-99.cust.bredband2.com. [89.233.230.99])\n\tby smtp.gmail.com with ESMTPSA id\n\t11-v6sm1103252ljv.1.2019.01.24.10.51.33\n\t(version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256);\n\tThu, 24 Jan 2019 10:51:33 -0800 (PST)"],"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=SLnB50z1BQJd/4OJb2CGjfg6bZJo+toGuZoEfnZUHXg=;\n\tb=GjJM3yI/GIBM/RN8W0jasW9w1Our64LyyBA8FvFVCfZWAlJ103JTWcR74+Kj0WHqqA\n\t+m4ietPzL5nZSW9JAd8iFtnzZ6JHPdZcrl2YGXGdlI+pxiToeXGVk09rl6U06zP6e5xy\n\tKDGOGt3To8lKtRqKxq10KqWnzayOJhX8uQ0mt1lvwbuqodLU2nz+nqlyAawKoMR4RVNB\n\tZ1tmHP13cqv3pfZn7Rrducn4B/UcQXDwZXIgkKia8vW2UsZm6cHKbYY6sT8ccqVgrRb0\n\txjeUelTWM0J6yJBY4IrcyAd/y/0z6uAHMq5MZeyJbY90Vj/fx27GYEOPOMuMejWpCvOe\n\t1CMg==","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=SLnB50z1BQJd/4OJb2CGjfg6bZJo+toGuZoEfnZUHXg=;\n\tb=Dsd/6HndVXDU1jQUiuF96R/bwa4sFjYBgLEP+TWVex88lN3XWNyrx5Wm4rLQuL4qBu\n\tGQnsHsFJQdS+gsQUWONpGMFi1M3fYvAqb3TobXT9ngWDPsDN8X4AYyiqy8JcWxpWeknq\n\tg15PZ85bkGO3drzcDMD8OYdlUQJgQSCv4xjwBGMfA/ccA9A0H4+dksf+Z1Ce3AbCzmV6\n\td3wTk5662x1nRcHHcC4a3AYXfN5cjZGIYtdBK8wLNRaO0mDwlQqlhScMtulbT8MU8wzF\n\tXHn7AGdy8eIiFKR0rQzAfMF9X8+bB4RnwNpc+o7plKNECqfbzPKP+YXndPqbnPZJjsHW\n\tXcQw==","X-Gm-Message-State":"AJcUukesNpEqmanB4p6BDuP5Ypz2RQAyn4Ajh7isXXZy9Rb2o40DOOzo\n\twA49vt+f0tERTfP6j1Duj5gEs1tI3qM=","X-Google-Smtp-Source":"ALg8bN7dFWd2MlxZctuPd4GNeHFihFEx0sqZaZgZIdJTRofCML6p3vIlfv7qgf3W5nWKaz9q1RfwOQ==","X-Received":"by 2002:a2e:9595:: with SMTP id\n\tw21-v6mr6312261ljh.194.1548355894039; \n\tThu, 24 Jan 2019 10:51:34 -0800 (PST)","Date":"Thu, 24 Jan 2019 19:51:32 +0100","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":"<20190124185132.GC4127@bigcity.dyn.berto.se>","References":"<20190124113000.7142-1-jacopo@jmondi.org>\n\t<20190124113000.7142-3-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":"<20190124113000.7142-3-jacopo@jmondi.org>","User-Agent":"Mutt/1.10.1 (2018-07-13)","Subject":"Re: [libcamera-devel] [PATCH v2 2/2] libcamera: v4l2_device: Add\n\tstubs to set/get format","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":"Thu, 24 Jan 2019 18:51:35 -0000"}},{"id":565,"web_url":"https://patchwork.libcamera.org/comment/565/","msgid":"<20190124193503.ulbwqs5dlf7ye5pe@uno.localdomain>","date":"2019-01-24T19:35:03","subject":"Re: [libcamera-devel] [PATCH v2 2/2] libcamera: v4l2_device: Add\n\tstubs to set/get format","submitter":{"id":3,"url":"https://patchwork.libcamera.org/api/people/3/","name":"Jacopo Mondi","email":"jacopo@jmondi.org"},"content":"Hi Niklas,\n\nOn Thu, Jan 24, 2019 at 07:51:32PM +0100, Niklas Söderlund wrote:\n> Hi Jacopo,\n>\n> Thanks for your work.\n>\n> On 2019-01-24 12:30:00 +0100, Jacopo Mondi wrote:\n> > Add function stubs for set/get format to V4L2Device.\n> >\n> > Signed-off-by: Jacopo Mondi <jacopo@jmondi.org>\n> > ---\n> >  src/libcamera/include/v4l2_device.h |  9 ++++++\n> >  src/libcamera/v4l2_device.cpp       | 49 +++++++++++++++++++++++++++++\n> >  2 files changed, 58 insertions(+)\n> >\n> > diff --git a/src/libcamera/include/v4l2_device.h b/src/libcamera/include/v4l2_device.h\n> > index 413bb7f..2da30d1 100644\n> > --- a/src/libcamera/include/v4l2_device.h\n> > +++ b/src/libcamera/include/v4l2_device.h\n> > @@ -72,10 +72,19 @@ public:\n> >  \tconst char *deviceName() const { return caps_.card(); }\n> >  \tconst char *busName() const { return caps_.bus_info(); }\n> >\n> > +\tint format();\n> > +\tint setFormat();\n> > +\n> >  private:\n> >  \tstd::string deviceNode_;\n> >  \tint fd_;\n> >  \tV4L2Capability caps_;\n> > +\n> > +\tint getFormatSingleplane();\n>\n> I think this should be formatSingleplane() to match the naming\n> convention.\n\nI see. Being this a private API, I considerd this was not an issue.\nBut you're right, consistency first.\n\n>\n> I like the structure of this patch and I think this is the way to go. I\n> do think we should hold off on merging this until we can replace the\n> stubs with code that do some work. Furthermore I think you can merge 1/2\n> if this series, if there are no other review comments on that in the\n> near future.\n>\n\nI agree this is not useful if not as a place holder without any actual\ncode. If I implement the get/set format, I'll resend. I'm merging\n[1/2] if no other comment arrives though.\n\nThanks\n   j\n\n> > +\tint setFormatSingleplane();\n> > +\n> > +\tint getFormatMultiplane();\n> > +\tint setFormatMultiplane();\n> >  };\n> >\n> >  } /* namespace libcamera */\n> > diff --git a/src/libcamera/v4l2_device.cpp b/src/libcamera/v4l2_device.cpp\n> > index 9cb504d..2ddb800 100644\n> > --- a/src/libcamera/v4l2_device.cpp\n> > +++ b/src/libcamera/v4l2_device.cpp\n> > @@ -213,4 +213,53 @@ void V4L2Device::close()\n> >   * \\return The string containing the device location\n> >   */\n> >\n> > +/**\n> > + * \\brief Retrieve the image format set on the V4L2 device\n> > + *\n> > + * TODO: define how the image format is encoded\n> > + * FIXME: this function is a stub at the moment\n> > + *\n> > + * \\return 0 for success, a negative error code otherwise\n> > + */\n> > +int V4L2Device::format()\n> > +{\n> > +\treturn caps_.isMultiplanar() ? getFormatMultiplane() :\n> > +\t\t\t\t       getFormatSingleplane();\n> > +}\n> > +\n> > +/**\n> > + * \\brief Program an image format on the V4L2 device\n> > + *\n> > + * TODO: define how the image format is encoded\n> > + * FIXME: this function is a stub at the moment\n> > + *\n> > + * \\return 0 for success, a negative error code otherwise\n> > + */\n> > +int V4L2Device::setFormat()\n> > +{\n> > +\treturn caps_.isMultiplanar() ? setFormatMultiplane() :\n> > +\t\t\t\t       setFormatSingleplane();\n> > +}\n> > +\n> > +/* FIXME: these functions are stubs at the moment. */\n> > +int V4L2Device::getFormatSingleplane()\n> > +{\n> > +\treturn 0;\n> > +}\n> > +\n> > +int V4L2Device::setFormatSingleplane()\n> > +{\n> > +\treturn 0;\n> > +}\n> > +\n> > +int V4L2Device::getFormatMultiplane()\n> > +{\n> > +\treturn 0;\n> > +}\n> > +\n> > +int V4L2Device::setFormatMultiplane()\n> > +{\n> > +\treturn 0;\n> > +}\n> > +\n> >  } /* namespace libcamera */\n> > --\n> > 2.20.1\n> >\n> > _______________________________________________\n> > libcamera-devel mailing list\n> > libcamera-devel@lists.libcamera.org\n> > https://lists.libcamera.org/listinfo/libcamera-devel\n>\n> --\n> Regards,\n> Niklas Söderlund","headers":{"Return-Path":"<jacopo@jmondi.org>","Received":["from relay1-d.mail.gandi.net (relay1-d.mail.gandi.net\n\t[217.70.183.193])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id D7ADF60C82\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tThu, 24 Jan 2019 20:34:50 +0100 (CET)","from uno.localdomain (2-224-242-101.ip172.fastwebnet.it\n\t[2.224.242.101]) (Authenticated sender: jacopo@jmondi.org)\n\tby relay1-d.mail.gandi.net (Postfix) with ESMTPSA id 5216A240002;\n\tThu, 24 Jan 2019 19:34:50 +0000 (UTC)"],"X-Originating-IP":"2.224.242.101","Date":"Thu, 24 Jan 2019 20:35:03 +0100","From":"Jacopo Mondi <jacopo@jmondi.org>","To":"Niklas =?utf-8?q?S=C3=B6derlund?= <niklas.soderlund@ragnatech.se>","Cc":"libcamera-devel@lists.libcamera.org","Message-ID":"<20190124193503.ulbwqs5dlf7ye5pe@uno.localdomain>","References":"<20190124113000.7142-1-jacopo@jmondi.org>\n\t<20190124113000.7142-3-jacopo@jmondi.org>\n\t<20190124185132.GC4127@bigcity.dyn.berto.se>","MIME-Version":"1.0","Content-Type":"multipart/signed; micalg=pgp-sha256;\n\tprotocol=\"application/pgp-signature\"; boundary=\"dfsbqu7xtejvzbi5\"","Content-Disposition":"inline","In-Reply-To":"<20190124185132.GC4127@bigcity.dyn.berto.se>","User-Agent":"NeoMutt/20180716","Subject":"Re: [libcamera-devel] [PATCH v2 2/2] libcamera: v4l2_device: Add\n\tstubs to set/get format","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":"Thu, 24 Jan 2019 19:34:51 -0000"}}]