[{"id":583,"web_url":"https://patchwork.libcamera.org/comment/583/","msgid":"<20190125110418.GD2934@pendragon.ideasonboard.com>","date":"2019-01-25T11:04:18","subject":"Re: [libcamera-devel] [PATCH 1/2] libcamera: MediaEntity: expose\n\tthe entity flags","submitter":{"id":2,"url":"https://patchwork.libcamera.org/api/people/2/","name":"Laurent Pinchart","email":"laurent.pinchart@ideasonboard.com"},"content":"Hi Niklas,\n\nThank you for the patch.\n\nOn Wed, Jan 23, 2019 at 04:03:50PM +0100, Niklas Söderlund wrote:\n> The media entity flags can be useful for pipeline handlers to find the\n> default device in a media graph which is marked with the\n> MEDIA_ENT_FL_DEFAULT flag. This will be especially useful for the UVC\n> pipeline handler where the entity names differ per device.\n> \n> Signed-off-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>\n\nWe might want a helper to find the default entity, but this patch looks\ngood to me regardless.\n\nReviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n\n> ---\n>  src/libcamera/include/media_object.h |  2 ++\n>  src/libcamera/media_object.cpp       | 13 ++++++++++++-\n>  2 files changed, 14 insertions(+), 1 deletion(-)\n> \n> diff --git a/src/libcamera/include/media_object.h b/src/libcamera/include/media_object.h\n> index 64095bec8606bd32..2a3ffc06c876d792 100644\n> --- a/src/libcamera/include/media_object.h\n> +++ b/src/libcamera/include/media_object.h\n> @@ -85,6 +85,7 @@ class MediaEntity : public MediaObject\n>  public:\n>  \tconst std::string &name() const { return name_; }\n>  \tunsigned int function() const { return function_; }\n> +\tunsigned int flags() const { return flags_; }\n>  \tconst std::string &deviceNode() const { return deviceNode_; }\n>  \tunsigned int deviceMajor() const { return major_; }\n>  \tunsigned int deviceMinor() const { return minor_; }\n> @@ -106,6 +107,7 @@ private:\n>  \n>  \tstd::string name_;\n>  \tunsigned int function_;\n> +\tunsigned int flags_;\n>  \tstd::string deviceNode_;\n>  \tunsigned int major_;\n>  \tunsigned int minor_;\n> diff --git a/src/libcamera/media_object.cpp b/src/libcamera/media_object.cpp\n> index baf9aeaa8fffe1a6..f6abcd8676a3866d 100644\n> --- a/src/libcamera/media_object.cpp\n> +++ b/src/libcamera/media_object.cpp\n> @@ -265,6 +265,16 @@ void MediaPad::addLink(MediaLink *link)\n>   * \\return The entity's function\n>   */\n>  \n> +/**\n> + * \\fn MediaEntity::flags()\n> + * \\brief Retrieve the entity's flags\n> + *\n> + * Media entity flags are expressed using the MEDIA_ENT_FL_* macros\n> + * defined by the Media Controller API.\n> + *\n> + * \\return The entity's flags\n> + */\n> +\n>  /**\n>   * \\fn MediaEntity::deviceNode()\n>   * \\brief Retrieve the entity's device node path, if any\n> @@ -358,7 +368,8 @@ MediaEntity::MediaEntity(MediaDevice *dev,\n>  \t\t\t const struct media_v2_entity *entity,\n>  \t\t\t unsigned int major, unsigned int minor)\n>  \t: MediaObject(dev, entity->id), name_(entity->name),\n> -\t  function_(entity->function), major_(major), minor_(minor)\n> +\t  function_(entity->function), flags_(entity->flags),\n> +\t  major_(major), minor_(minor)\n>  {\n>  }\n>","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 6EE7360B1D\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tFri, 25 Jan 2019 12:04:19 +0100 (CET)","from pendragon.ideasonboard.com (unknown\n\t[IPv6:2a02:a03f:4499:2700:1060:1d4c:d6a:8e80])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id F14D0325;\n\tFri, 25 Jan 2019 12:04:18 +0100 (CET)"],"DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1548414259;\n\tbh=BgoLU/690g4YcjODxCdAlJTPDxN5l7ivr5LvQYgR7Dg=;\n\th=Date:From:To:Cc:Subject:References:In-Reply-To:From;\n\tb=IggtXN10j1oJwy7kl4PHfq+wgAoovbLf2NSxspMBdxntcuJlvlC/eTEymZXDNVhCS\n\trgZLmCvKRd2s16dZplC+K0R6Sjxe6DQ1ZzHAGgl7WpfOLet6jL/6KTNHkKjolL6DE7\n\tqxqDgABkwbrDidqhulKDMf8KMZB2V+P/qMQ+7SQ0=","Date":"Fri, 25 Jan 2019 13:04:18 +0200","From":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>","To":"Niklas =?utf-8?q?S=C3=B6derlund?= <niklas.soderlund@ragnatech.se>","Cc":"libcamera-devel@lists.libcamera.org","Message-ID":"<20190125110418.GD2934@pendragon.ideasonboard.com>","References":"<20190123150351.8307-1-niklas.soderlund@ragnatech.se>\n\t<20190123150351.8307-2-niklas.soderlund@ragnatech.se>","MIME-Version":"1.0","Content-Type":"text/plain; charset=utf-8","Content-Disposition":"inline","Content-Transfer-Encoding":"8bit","In-Reply-To":"<20190123150351.8307-2-niklas.soderlund@ragnatech.se>","User-Agent":"Mutt/1.10.1 (2018-07-13)","Subject":"Re: [libcamera-devel] [PATCH 1/2] libcamera: MediaEntity: expose\n\tthe entity flags","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":"Fri, 25 Jan 2019 11:04:19 -0000"}},{"id":590,"web_url":"https://patchwork.libcamera.org/comment/590/","msgid":"<20190125143550.GK4127@bigcity.dyn.berto.se>","date":"2019-01-25T14:35:50","subject":"Re: [libcamera-devel] [PATCH 1/2] libcamera: MediaEntity: expose\n\tthe entity flags","submitter":{"id":5,"url":"https://patchwork.libcamera.org/api/people/5/","name":"Niklas Söderlund","email":"niklas.soderlund@ragnatech.se"},"content":"Hi,\n\nOn 2019-01-25 13:04:18 +0200, Laurent Pinchart wrote:\n> Hi Niklas,\n> \n> Thank you for the patch.\n> \n> On Wed, Jan 23, 2019 at 04:03:50PM +0100, Niklas Söderlund wrote:\n> > The media entity flags can be useful for pipeline handlers to find the\n> > default device in a media graph which is marked with the\n> > MEDIA_ENT_FL_DEFAULT flag. This will be especially useful for the UVC\n> > pipeline handler where the entity names differ per device.\n> > \n> > Signed-off-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>\n> \n> We might want a helper to find the default entity, but this patch looks\n> good to me regardless.\n> \n> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n\nThanks I pushed this to master.\n\n> \n> > ---\n> >  src/libcamera/include/media_object.h |  2 ++\n> >  src/libcamera/media_object.cpp       | 13 ++++++++++++-\n> >  2 files changed, 14 insertions(+), 1 deletion(-)\n> > \n> > diff --git a/src/libcamera/include/media_object.h b/src/libcamera/include/media_object.h\n> > index 64095bec8606bd32..2a3ffc06c876d792 100644\n> > --- a/src/libcamera/include/media_object.h\n> > +++ b/src/libcamera/include/media_object.h\n> > @@ -85,6 +85,7 @@ class MediaEntity : public MediaObject\n> >  public:\n> >  \tconst std::string &name() const { return name_; }\n> >  \tunsigned int function() const { return function_; }\n> > +\tunsigned int flags() const { return flags_; }\n> >  \tconst std::string &deviceNode() const { return deviceNode_; }\n> >  \tunsigned int deviceMajor() const { return major_; }\n> >  \tunsigned int deviceMinor() const { return minor_; }\n> > @@ -106,6 +107,7 @@ private:\n> >  \n> >  \tstd::string name_;\n> >  \tunsigned int function_;\n> > +\tunsigned int flags_;\n> >  \tstd::string deviceNode_;\n> >  \tunsigned int major_;\n> >  \tunsigned int minor_;\n> > diff --git a/src/libcamera/media_object.cpp b/src/libcamera/media_object.cpp\n> > index baf9aeaa8fffe1a6..f6abcd8676a3866d 100644\n> > --- a/src/libcamera/media_object.cpp\n> > +++ b/src/libcamera/media_object.cpp\n> > @@ -265,6 +265,16 @@ void MediaPad::addLink(MediaLink *link)\n> >   * \\return The entity's function\n> >   */\n> >  \n> > +/**\n> > + * \\fn MediaEntity::flags()\n> > + * \\brief Retrieve the entity's flags\n> > + *\n> > + * Media entity flags are expressed using the MEDIA_ENT_FL_* macros\n> > + * defined by the Media Controller API.\n> > + *\n> > + * \\return The entity's flags\n> > + */\n> > +\n> >  /**\n> >   * \\fn MediaEntity::deviceNode()\n> >   * \\brief Retrieve the entity's device node path, if any\n> > @@ -358,7 +368,8 @@ MediaEntity::MediaEntity(MediaDevice *dev,\n> >  \t\t\t const struct media_v2_entity *entity,\n> >  \t\t\t unsigned int major, unsigned int minor)\n> >  \t: MediaObject(dev, entity->id), name_(entity->name),\n> > -\t  function_(entity->function), major_(major), minor_(minor)\n> > +\t  function_(entity->function), flags_(entity->flags),\n> > +\t  major_(major), minor_(minor)\n> >  {\n> >  }\n> >  \n> \n> -- \n> Regards,\n> \n> Laurent Pinchart","headers":{"Return-Path":"<niklas.soderlund@ragnatech.se>","Received":["from mail-lf1-x141.google.com (mail-lf1-x141.google.com\n\t[IPv6:2a00:1450:4864:20::141])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id D1C6160B1D\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tFri, 25 Jan 2019 15:35:52 +0100 (CET)","by mail-lf1-x141.google.com with SMTP id a16so7087889lfg.3\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tFri, 25 Jan 2019 06:35:52 -0800 (PST)","from localhost (89-233-230-99.cust.bredband2.com. [89.233.230.99])\n\tby smtp.gmail.com with ESMTPSA id\n\tm12sm1485643lfc.30.2019.01.25.06.35.50\n\t(version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256);\n\tFri, 25 Jan 2019 06:35:50 -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=HI4ohRpKUQB8D09gIdeaTI68wQIm0EZGmTO1ZaMtm90=;\n\tb=YR8loGHVEoE+bOGmaMb1rw0uQteOjUtaYP86D9DJGf3VvujKmklFOpqbqIQh5DkMdF\n\tOvnpAqYdQ3uPYHyiwCF+0y1gYb5u4IX6//yPcjUsAqNR+dP+rJ2k99XmKMAQ5+Mr+0m+\n\tarAooChWm+Xqw38G3hIub5TigbZruWRxARIxE5Z1wi5+YMsMOp28vba9B89xOjhhz96U\n\tUqNIQAieWcLRy99BKmZjR40E6gSk01PTjEYLE/qpoo5Ld9v5tgy8S38GGc3chfskUlXm\n\tgWDhfog3FC0rUzp77c8NGPfw6dMAk2tyuHELTmLS0DE8FooIFpf50Pe/KkQfMd7D/6K7\n\txMWg==","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=HI4ohRpKUQB8D09gIdeaTI68wQIm0EZGmTO1ZaMtm90=;\n\tb=VCvqxZVPz02FqimTMRR0VtPTfhCHo13IuSh5opWMbQ2hmqdPlYwXP6ShF6UalWrbP6\n\tWZ2ucqqGDwOo04aHLapxKqKOnMfyuJO1cQUrb8plQgU3TpwcQxbOX1m5aKUx1JmtJ91F\n\tiiuE8h1jquOM4AsaEjnf5h93a9y4slJ0Nk9obyCeE1WARw/R4l9Ue2GpM0kXOdoyFMKf\n\tKgATJdmR67S5V/rmEo+Z/fxbB+xPZlK1AKBsD1lzm5uLnv2rosL7/x0nQK+O8sMWnYaW\n\tl6QI6xwC1PMzAHmbZo67D7WJFtvVpz+3040+c+O5PTu8jkgnzppZ3RCSC/GlR7L44D1z\n\t6J3g==","X-Gm-Message-State":"AJcUukfmiQXh7wZ+3i+MY9fWMaHGJhAiIAYm+uZD5TgobYeN2DdI+RUH\n\tLekoxqNJKSfiY9+rFMP7wqDNzle/vfU=","X-Google-Smtp-Source":"ALg8bN6aV9XNFI95TmNDQpBd77uxKDxCiTu/kwaw1epFIV71uTiJ7VBsuYjyEojjPgdAqI4fLSDPBw==","X-Received":"by 2002:a19:df41:: with SMTP id q1mr9406244lfj.25.1548426951908; \n\tFri, 25 Jan 2019 06:35:51 -0800 (PST)","Date":"Fri, 25 Jan 2019 15:35:50 +0100","From":"Niklas =?iso-8859-1?q?S=F6derlund?= <niklas.soderlund@ragnatech.se>","To":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>","Cc":"libcamera-devel@lists.libcamera.org","Message-ID":"<20190125143550.GK4127@bigcity.dyn.berto.se>","References":"<20190123150351.8307-1-niklas.soderlund@ragnatech.se>\n\t<20190123150351.8307-2-niklas.soderlund@ragnatech.se>\n\t<20190125110418.GD2934@pendragon.ideasonboard.com>","MIME-Version":"1.0","Content-Type":"text/plain; charset=iso-8859-1","Content-Disposition":"inline","Content-Transfer-Encoding":"8bit","In-Reply-To":"<20190125110418.GD2934@pendragon.ideasonboard.com>","User-Agent":"Mutt/1.10.1 (2018-07-13)","Subject":"Re: [libcamera-devel] [PATCH 1/2] libcamera: MediaEntity: expose\n\tthe entity flags","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":"Fri, 25 Jan 2019 14:35:53 -0000"}}]