[{"id":16231,"web_url":"https://patchwork.libcamera.org/comment/16231/","msgid":"<CAO4hSrjodv26ueg37FTqbNhG4KGSZZzE2Px7g6Mm1k9azsM46Q@mail.gmail.com>","date":"2021-04-13T10:12:24","subject":"Re: [libcamera-devel] [PATCH] pipeline: simple: Fix an issue in\n\tbreadth-first search","submitter":{"id":79,"url":"https://patchwork.libcamera.org/api/people/79/","name":"Phi-bang Nguyen","email":"pnguyen@baylibre.com"},"content":"Hi Laurent,\n\nJust a kind reminder to see if you have some feedback on the patch :-)\n\nThanks !\n\nOn Sun, Apr 4, 2021 at 11:04 PM Phi-Bang Nguyen <pnguyen@baylibre.com>\nwrote:\n\n> When seting up the pipeline, the latest entity in the queue is\n> taken but the oldest one is poped. This is a mistake. Fix it.\n>\n> Fixes: 4671911df040 (\"pipeline: simple: Use breadth-first search\n> to setup media pipeline\")\n>\n> Signed-off-by: Phi-Bang Nguyen <pnguyen@baylibre.com>\n> ---\n>  src/libcamera/pipeline/simple/simple.cpp | 6 +++---\n>  1 file changed, 3 insertions(+), 3 deletions(-)\n>\n> diff --git a/src/libcamera/pipeline/simple/simple.cpp\n> b/src/libcamera/pipeline/simple/simple.cpp\n> index f81a4d15..a2dbc336 100644\n> --- a/src/libcamera/pipeline/simple/simple.cpp\n> +++ b/src/libcamera/pipeline/simple/simple.cpp\n> @@ -288,12 +288,12 @@\n> SimpleCameraData::SimpleCameraData(SimplePipelineHandler *pipe,\n>\n>         /* Remember at each entity where we came from. */\n>         std::unordered_map<MediaEntity *, Entity> parents;\n> -       queue.push(sensor);\n> -\n>         MediaEntity *entity = nullptr;\n>\n> +       queue.push(sensor);\n> +\n>         while (!queue.empty()) {\n> -               entity = queue.back();\n> +               entity = queue.front();\n>                 queue.pop();\n>\n>                 /* Found the capture device. */\n> --\n> 2.25.1\n>\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 40900BD1F6\n\tfor <parsemail@patchwork.libcamera.org>;\n\tTue, 13 Apr 2021 10:12:39 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id ADD21687FE;\n\tTue, 13 Apr 2021 12:12:38 +0200 (CEST)","from mail-il1-x130.google.com (mail-il1-x130.google.com\n\t[IPv6:2607:f8b0:4864:20::130])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 40935602C8\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue, 13 Apr 2021 12:12:37 +0200 (CEST)","by mail-il1-x130.google.com with SMTP id c18so13605315iln.7\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue, 13 Apr 2021 03:12:37 -0700 (PDT)"],"Authentication-Results":"lancelot.ideasonboard.com;\n\tdkim=fail reason=\"signature verification failed\" (2048-bit key;\n\tunprotected) header.d=baylibre-com.20150623.gappssmtp.com\n\theader.i=@baylibre-com.20150623.gappssmtp.com\n\theader.b=\"W3HuK1PR\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=baylibre-com.20150623.gappssmtp.com; s=20150623;\n\th=mime-version:references:in-reply-to:from:date:message-id:subject:to\n\t:cc; bh=lPQQ91/n4pUNBcXZZR8oDGraACNxzdJfxrC+HkF133o=;\n\tb=W3HuK1PRsvLHd6/JtaHbO4FZYG9fWJGWfUG8ouHBPJ0QFDmG4Ookf5s7nDruQE8BIz\n\tUXo57exITPm80vu0ycQr63pxMhDAN82sYz0LqoIBm6JChwRJdb933OQasIyz+qXddcyy\n\tr7YN1X6yfLV40bJl+MO2QL6zrgDL5NU12JDaTv7XO6adidjLXbranPGeC6N6kMyV3rsL\n\t2VJZ9QOMJrdI/kYuFcMMRVl4wvPxIVIhKyrWwdlrUJS+mn1UozEETFFMYuznvDz+IAiv\n\t1NX+nlwmYJkPBVw3hihSwo0dNFS/GsHlIg+xC6dpunk1uwRjMBG8ZqGbWMd4TinH5fHY\n\tHTPw==","X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20161025;\n\th=x-gm-message-state:mime-version:references:in-reply-to:from:date\n\t:message-id:subject:to:cc;\n\tbh=lPQQ91/n4pUNBcXZZR8oDGraACNxzdJfxrC+HkF133o=;\n\tb=NVWk8BYTJzA+5Q3MglqmchIq4kOhsi0MiVhUvE0ujxp4YDklwzKAleLDPJHm8Pt2uI\n\tDDE4OaQXgP+gzMgJd+5i0YD49UXLpuEv6Spgp0dLqfxLlJVRtqVdxLn/Dw5mVV1SjFA8\n\tYjf2TzlQ22C7qIo3JBwKOtf3+e4JmYIsd21yvGUbeNskQruWI/uMpGRLjfcI7WMNUvoO\n\tIlh3fxQijI9w36/RVRVWdkUFnG/U9d7Iq3KWsLuh+tabSxCMK2Sr7VuWaoBB4Dm9Zu+y\n\tskG7SDVWht220Q/rVEAN36gR7Do3pubF0cneUxM5obXZb8vqT/vSHrx8R9KXuOTkhekj\n\tQsvA==","X-Gm-Message-State":"AOAM532pxKz6ylArA0/S9/lBJjVaN5tKnnu9JXxZlu4MWUt9G2LZCvTQ\n\t0IJOV4cuLHPCCI+ux1ZHvb/w/KxasuAJ3w+9tC8kKpIl4k9L7g==","X-Google-Smtp-Source":"ABdhPJx3fbFtzDbeulO9s33Iza8D2F547B4MLCqKGZnfWiPvXuMgHM8SUdq8burD+4KXzKLcEMv5UE1p9H8/1/0mZsI=","X-Received":"by 2002:a05:6e02:1c2d:: with SMTP id\n\tm13mr22324087ilh.124.1618308755708; \n\tTue, 13 Apr 2021 03:12:35 -0700 (PDT)","MIME-Version":"1.0","References":"<20210404210353.268967-1-pnguyen@baylibre.com>","In-Reply-To":"<20210404210353.268967-1-pnguyen@baylibre.com>","From":"Phi-bang Nguyen <pnguyen@baylibre.com>","Date":"Tue, 13 Apr 2021 12:12:24 +0200","Message-ID":"<CAO4hSrjodv26ueg37FTqbNhG4KGSZZzE2Px7g6Mm1k9azsM46Q@mail.gmail.com>","To":"libcamera-devel@lists.libcamera.org","Subject":"Re: [libcamera-devel] [PATCH] pipeline: simple: Fix an issue in\n\tbreadth-first search","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>","Content-Type":"multipart/mixed;\n\tboundary=\"===============6477445537932391535==\"","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}},{"id":16256,"web_url":"https://patchwork.libcamera.org/comment/16256/","msgid":"<YHYrZGUF3i7llIOz@pendragon.ideasonboard.com>","date":"2021-04-13T23:38:12","subject":"Re: [libcamera-devel] [PATCH] pipeline: simple: Fix an issue in\n\tbreadth-first search","submitter":{"id":2,"url":"https://patchwork.libcamera.org/api/people/2/","name":"Laurent Pinchart","email":"laurent.pinchart@ideasonboard.com"},"content":"Hi Phi-Bang,\n\nThank you for the patch, and sorry for the delay.\n\nOn Sun, Apr 04, 2021 at 11:03:53PM +0200, Phi-Bang Nguyen wrote:\n> When seting up the pipeline, the latest entity in the queue is\n> taken but the oldest one is poped. This is a mistake. Fix it.\n> \n> Fixes: 4671911df040 (\"pipeline: simple: Use breadth-first search\n> to setup media pipeline\")\n\nMinor issue, the Fixes: line shouldn't be wrapped (to make it easy for\nscripts to parse it). I've fixed this and pushed the patch.\n\n> Signed-off-by: Phi-Bang Nguyen <pnguyen@baylibre.com>\n\nReviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n\n> ---\n>  src/libcamera/pipeline/simple/simple.cpp | 6 +++---\n>  1 file changed, 3 insertions(+), 3 deletions(-)\n> \n> diff --git a/src/libcamera/pipeline/simple/simple.cpp b/src/libcamera/pipeline/simple/simple.cpp\n> index f81a4d15..a2dbc336 100644\n> --- a/src/libcamera/pipeline/simple/simple.cpp\n> +++ b/src/libcamera/pipeline/simple/simple.cpp\n> @@ -288,12 +288,12 @@ SimpleCameraData::SimpleCameraData(SimplePipelineHandler *pipe,\n>  \n>  \t/* Remember at each entity where we came from. */\n>  \tstd::unordered_map<MediaEntity *, Entity> parents;\n> -\tqueue.push(sensor);\n> -\n>  \tMediaEntity *entity = nullptr;\n>  \n> +\tqueue.push(sensor);\n> +\n>  \twhile (!queue.empty()) {\n> -\t\tentity = queue.back();\n> +\t\tentity = queue.front();\n>  \t\tqueue.pop();\n>  \n>  \t\t/* Found the capture device. */","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 587CFBD1F6\n\tfor <parsemail@patchwork.libcamera.org>;\n\tTue, 13 Apr 2021 23:38:16 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 861D0687EC;\n\tWed, 14 Apr 2021 01:38:15 +0200 (CEST)","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 15456602CD\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tWed, 14 Apr 2021 01:38:14 +0200 (CEST)","from pendragon.ideasonboard.com (62-78-145-57.bb.dnainternet.fi\n\t[62.78.145.57])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 7508F88C;\n\tWed, 14 Apr 2021 01:38:13 +0200 (CEST)"],"Authentication-Results":"lancelot.ideasonboard.com;\n\tdkim=fail reason=\"signature verification failed\" (1024-bit key;\n\tunprotected) header.d=ideasonboard.com header.i=@ideasonboard.com\n\theader.b=\"UHiJcNck\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1618357093;\n\tbh=Zta/IxMRp4xKyJEh1n5wjYP/PUCcvc98OaulmDzJ0Ss=;\n\th=Date:From:To:Cc:Subject:References:In-Reply-To:From;\n\tb=UHiJcNckq6szmZgYLQuFw2ofAMlV5odGxeMhO9WRz+fKb5k1o6FF+S3mjCTLnO8//\n\t7zxtmfHESCRmcUxdq/hVRWc2GU8qpx6vu/xnIYGq0JgZkiDY8rwIEwUWx+mLyMO9Zk\n\tr9DcCtsyqe/wnukH/2tuVHPee5JvZMUjYvaiYV7I=","Date":"Wed, 14 Apr 2021 02:38:12 +0300","From":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>","To":"Phi-Bang Nguyen <pnguyen@baylibre.com>","Message-ID":"<YHYrZGUF3i7llIOz@pendragon.ideasonboard.com>","References":"<20210404210353.268967-1-pnguyen@baylibre.com>","MIME-Version":"1.0","Content-Disposition":"inline","In-Reply-To":"<20210404210353.268967-1-pnguyen@baylibre.com>","Subject":"Re: [libcamera-devel] [PATCH] pipeline: simple: Fix an issue in\n\tbreadth-first search","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","Content-Type":"text/plain; charset=\"us-ascii\"","Content-Transfer-Encoding":"7bit","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}}]