[{"id":21875,"web_url":"https://patchwork.libcamera.org/comment/21875/","msgid":"<164026680424.2512616.5143346053203897281@Monstersaurus>","date":"2021-12-23T13:40:04","subject":"Re: [libcamera-devel] [PATCH] libcamera: pipeline: simple: Rename\n\tEntity::link to sourceLink","submitter":{"id":4,"url":"https://patchwork.libcamera.org/api/people/4/","name":"Kieran Bingham","email":"kieran.bingham@ideasonboard.com"},"content":"Quoting Laurent Pinchart (2021-12-23 02:24:25)\n> The Entity::link member has an ambiguous name. Rename it to sourceLink\n> to clarify that it stores the link on the source pad.\n\nReviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>\n\n> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n> ---\n>  src/libcamera/pipeline/simple/simple.cpp | 20 ++++++++++----------\n>  1 file changed, 10 insertions(+), 10 deletions(-)\n> \n> diff --git a/src/libcamera/pipeline/simple/simple.cpp b/src/libcamera/pipeline/simple/simple.cpp\n> index 8aa36306952b..ece821bfe978 100644\n> --- a/src/libcamera/pipeline/simple/simple.cpp\n> +++ b/src/libcamera/pipeline/simple/simple.cpp\n> @@ -202,10 +202,10 @@ public:\n>                  */\n>                 const MediaPad *source;\n>                 /*\n> -                * The link to the downstream entity, null for the video node at\n> -                * the end of the pipeline.\n> +                * The link on the source pad, to the downstream entity, null\n> +                * for the video node at the end of the pipeline.\n>                  */\n> -               MediaLink *link;\n> +               MediaLink *sourceLink;\n>         };\n>  \n>         struct Configuration {\n> @@ -537,13 +537,13 @@ int SimpleCameraData::setupLinks()\n>          * want to enable) before enabling the pipeline link.\n>          */\n>         for (SimpleCameraData::Entity &e : entities_) {\n> -               if (!e.link)\n> +               if (!e.sourceLink)\n>                         break;\n>  \n> -               MediaEntity *remote = e.link->sink()->entity();\n> +               MediaEntity *remote = e.sourceLink->sink()->entity();\n>                 for (MediaPad *pad : remote->pads()) {\n>                         for (MediaLink *link : pad->links()) {\n> -                               if (link == e.link)\n> +                               if (link == e.sourceLink)\n>                                         continue;\n>  \n>                                 if ((link->flags() & MEDIA_LNK_FL_ENABLED) &&\n> @@ -555,8 +555,8 @@ int SimpleCameraData::setupLinks()\n>                         }\n>                 }\n>  \n> -               if (!(e.link->flags() & MEDIA_LNK_FL_ENABLED)) {\n> -                       ret = e.link->setEnabled(true);\n> +               if (!(e.sourceLink->flags() & MEDIA_LNK_FL_ENABLED)) {\n> +                       ret = e.sourceLink->setEnabled(true);\n>                         if (ret < 0)\n>                                 return ret;\n>                 }\n> @@ -580,10 +580,10 @@ int SimpleCameraData::setupFormats(V4L2SubdeviceFormat *format,\n>                 return ret;\n>  \n>         for (const Entity &e : entities_) {\n> -               if (!e.link)\n> +               if (!e.sourceLink)\n>                         break;\n>  \n> -               MediaLink *link = e.link;\n> +               MediaLink *link = e.sourceLink;\n>                 MediaPad *source = link->source();\n>                 MediaPad *sink = link->sink();\n>  \n> \n> base-commit: 8ff5a8d548eee7c2cb14b355867debdb29e75419\n> -- \n> Regards,\n> \n> Laurent Pinchart\n>","headers":{"Return-Path":"<libcamera-devel-bounces@lists.libcamera.org>","X-Original-To":"parsemail@patchwork.libcamera.org","Delivered-To":"parsemail@patchwork.libcamera.org","Received":["from lancelot.ideasonboard.com (lancelot.ideasonboard.com\n\t[92.243.16.209])\n\tby patchwork.libcamera.org (Postfix) with ESMTPS id 4C22ABE080\n\tfor <parsemail@patchwork.libcamera.org>;\n\tThu, 23 Dec 2021 13:40:09 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 9BBCE608FF;\n\tThu, 23 Dec 2021 14:40:08 +0100 (CET)","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 4512C60115\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tThu, 23 Dec 2021 14:40:07 +0100 (CET)","from pendragon.ideasonboard.com\n\t(cpc89244-aztw30-2-0-cust3082.18-1.cable.virginm.net [86.31.172.11])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 8CB652C5;\n\tThu, 23 Dec 2021 14:40:06 +0100 (CET)"],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key;\n\tunprotected) header.d=ideasonboard.com header.i=@ideasonboard.com\n\theader.b=\"N3aV/J0o\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1640266806;\n\tbh=a4P5bwX4H9g8cZa8xPmv1oS+RaOg0nuv0Vs1mag66mg=;\n\th=In-Reply-To:References:Subject:From:To:Date:From;\n\tb=N3aV/J0oyyWIVhB/UoFgYCGOlYPa/8EcwcshSVXUetx/aA3Bv5RhZuc6uiumq3fiS\n\tUNBzlJjxKDQ5NQdTAz6TNig+LhQTzrKAG2Jbi8uBtRm+AhMpl/s1MvpoSL7tY8UXyw\n\tiuhbzU81OJ4ZlXt/ZRaOJy1kFL9keO20mfjBbW28=","Content-Type":"text/plain; charset=\"utf-8\"","MIME-Version":"1.0","Content-Transfer-Encoding":"quoted-printable","In-Reply-To":"<20211223022425.11927-1-laurent.pinchart@ideasonboard.com>","References":"<20211223022425.11927-1-laurent.pinchart@ideasonboard.com>","From":"Kieran Bingham <kieran.bingham@ideasonboard.com>","To":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>,\n\tlibcamera-devel@lists.libcamera.org","Date":"Thu, 23 Dec 2021 13:40:04 +0000","Message-ID":"<164026680424.2512616.5143346053203897281@Monstersaurus>","User-Agent":"alot/0.10","Subject":"Re: [libcamera-devel] [PATCH] libcamera: pipeline: simple: Rename\n\tEntity::link to sourceLink","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>","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}},{"id":21906,"web_url":"https://patchwork.libcamera.org/comment/21906/","msgid":"<20211229185418.q5p3mepdmh4e5epk@uno.localdomain>","date":"2021-12-29T18:54:18","subject":"Re: [libcamera-devel] [PATCH] libcamera: pipeline: simple: Rename\n\tEntity::link to sourceLink","submitter":{"id":3,"url":"https://patchwork.libcamera.org/api/people/3/","name":"Jacopo Mondi","email":"jacopo@jmondi.org"},"content":"Hi Laurent\n\nOn Thu, Dec 23, 2021 at 04:24:25AM +0200, Laurent Pinchart wrote:\n> The Entity::link member has an ambiguous name. Rename it to sourceLink\n> to clarify that it stores the link on the source pad.\n>\n> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n\nLooks reasonable!\nReviewed-by: Jacopo Mondi <jacopo@jmondi.org>\n\nThanks\n  j\n\n> ---\n>  src/libcamera/pipeline/simple/simple.cpp | 20 ++++++++++----------\n>  1 file changed, 10 insertions(+), 10 deletions(-)\n>\n> diff --git a/src/libcamera/pipeline/simple/simple.cpp b/src/libcamera/pipeline/simple/simple.cpp\n> index 8aa36306952b..ece821bfe978 100644\n> --- a/src/libcamera/pipeline/simple/simple.cpp\n> +++ b/src/libcamera/pipeline/simple/simple.cpp\n> @@ -202,10 +202,10 @@ public:\n>  \t\t */\n>  \t\tconst MediaPad *source;\n>  \t\t/*\n> -\t\t * The link to the downstream entity, null for the video node at\n> -\t\t * the end of the pipeline.\n> +\t\t * The link on the source pad, to the downstream entity, null\n> +\t\t * for the video node at the end of the pipeline.\n>  \t\t */\n> -\t\tMediaLink *link;\n> +\t\tMediaLink *sourceLink;\n>  \t};\n>\n>  \tstruct Configuration {\n> @@ -537,13 +537,13 @@ int SimpleCameraData::setupLinks()\n>  \t * want to enable) before enabling the pipeline link.\n>  \t */\n>  \tfor (SimpleCameraData::Entity &e : entities_) {\n> -\t\tif (!e.link)\n> +\t\tif (!e.sourceLink)\n>  \t\t\tbreak;\n>\n> -\t\tMediaEntity *remote = e.link->sink()->entity();\n> +\t\tMediaEntity *remote = e.sourceLink->sink()->entity();\n>  \t\tfor (MediaPad *pad : remote->pads()) {\n>  \t\t\tfor (MediaLink *link : pad->links()) {\n> -\t\t\t\tif (link == e.link)\n> +\t\t\t\tif (link == e.sourceLink)\n>  \t\t\t\t\tcontinue;\n>\n>  \t\t\t\tif ((link->flags() & MEDIA_LNK_FL_ENABLED) &&\n> @@ -555,8 +555,8 @@ int SimpleCameraData::setupLinks()\n>  \t\t\t}\n>  \t\t}\n>\n> -\t\tif (!(e.link->flags() & MEDIA_LNK_FL_ENABLED)) {\n> -\t\t\tret = e.link->setEnabled(true);\n> +\t\tif (!(e.sourceLink->flags() & MEDIA_LNK_FL_ENABLED)) {\n> +\t\t\tret = e.sourceLink->setEnabled(true);\n>  \t\t\tif (ret < 0)\n>  \t\t\t\treturn ret;\n>  \t\t}\n> @@ -580,10 +580,10 @@ int SimpleCameraData::setupFormats(V4L2SubdeviceFormat *format,\n>  \t\treturn ret;\n>\n>  \tfor (const Entity &e : entities_) {\n> -\t\tif (!e.link)\n> +\t\tif (!e.sourceLink)\n>  \t\t\tbreak;\n>\n> -\t\tMediaLink *link = e.link;\n> +\t\tMediaLink *link = e.sourceLink;\n>  \t\tMediaPad *source = link->source();\n>  \t\tMediaPad *sink = link->sink();\n>\n>\n> base-commit: 8ff5a8d548eee7c2cb14b355867debdb29e75419\n> --\n> Regards,\n>\n> Laurent Pinchart\n>","headers":{"Return-Path":"<libcamera-devel-bounces@lists.libcamera.org>","X-Original-To":"parsemail@patchwork.libcamera.org","Delivered-To":"parsemail@patchwork.libcamera.org","Received":["from lancelot.ideasonboard.com (lancelot.ideasonboard.com\n\t[92.243.16.209])\n\tby patchwork.libcamera.org (Postfix) with ESMTPS id 72692BF415\n\tfor <parsemail@patchwork.libcamera.org>;\n\tWed, 29 Dec 2021 18:53:23 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 395C460905;\n\tWed, 29 Dec 2021 19:53:23 +0100 (CET)","from relay7-d.mail.gandi.net (relay7-d.mail.gandi.net\n\t[217.70.183.200])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 86F92608E9\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tWed, 29 Dec 2021 19:53:21 +0100 (CET)","(Authenticated sender: jacopo@jmondi.org)\n\tby relay7-d.mail.gandi.net (Postfix) with ESMTPSA id 202B720002;\n\tWed, 29 Dec 2021 18:53:20 +0000 (UTC)"],"Date":"Wed, 29 Dec 2021 19:54:18 +0100","From":"Jacopo Mondi <jacopo@jmondi.org>","To":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>","Message-ID":"<20211229185418.q5p3mepdmh4e5epk@uno.localdomain>","References":"<20211223022425.11927-1-laurent.pinchart@ideasonboard.com>","MIME-Version":"1.0","Content-Type":"text/plain; charset=utf-8","Content-Disposition":"inline","In-Reply-To":"<20211223022425.11927-1-laurent.pinchart@ideasonboard.com>","Subject":"Re: [libcamera-devel] [PATCH] libcamera: pipeline: simple: Rename\n\tEntity::link to sourceLink","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>","Cc":"libcamera-devel@lists.libcamera.org","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}}]