[{"id":34698,"web_url":"https://patchwork.libcamera.org/comment/34698/","msgid":"<fc8a6d76-a983-4c52-8472-840b8afc8d23@ideasonboard.com>","date":"2025-06-27T14:00:44","subject":"Re: [PATCH v11 06/12] config: Look up pipelines match list in\n\tconfiguration file","submitter":{"id":216,"url":"https://patchwork.libcamera.org/api/people/216/","name":"Barnabás Pőcze","email":"barnabas.pocze@ideasonboard.com"},"content":"Hi\n\n2025. 06. 24. 10:36 keltezéssel, Milan Zamazal írta:\n> Let's add a configuration file item for the pipelines match list.\n> \n> The configuration snippet:\n> \n>    configuration:\n>      pipelines_match_list: rkisp1,simple\n> \n> Signed-off-by: Milan Zamazal <mzamazal@redhat.com>\n> ---\n>   src/libcamera/camera_manager.cpp | 9 +++++----\n>   1 file changed, 5 insertions(+), 4 deletions(-)\n> \n> diff --git a/src/libcamera/camera_manager.cpp b/src/libcamera/camera_manager.cpp\n> index c47fd3677..b4d56c3aa 100644\n> --- a/src/libcamera/camera_manager.cpp\n> +++ b/src/libcamera/camera_manager.cpp\n> @@ -111,14 +111,15 @@ void CameraManager::Private::createPipelineHandlers()\n>   \t * file and only fallback on environment variable or all handlers, if\n>   \t * there is no configuration file.\n>   \t */\n> -\tconst char *pipesList =\n> -\t\tutils::secure_getenv(\"LIBCAMERA_PIPELINES_MATCH_LIST\");\n> -\tif (pipesList) {\n> +\tstd::optional<std::string> pipesList =\n> +\t\tconfiguration().envOption(\"LIBCAMERA_PIPELINES_MATCH_LIST\",\n> +\t\t\t\t\t  \"pipelines_match_list\");\n\nWouldn't it be better to use `envListOption()`? I realize that the separator\nis different (':' vs ','), but it still seems better to me. The separator\ncould be an argument of `envListOption()` I believe.\n\n\nRegards,\nBarnabás Pőcze\n\n\n\n> +\tif (pipesList.has_value()) {\n>   \t\t/*\n>   \t\t * When a list of preferred pipelines is defined, iterate\n>   \t\t * through the ordered list to match the enumerated devices.\n>   \t\t */\n> -\t\tfor (const auto &pipeName : utils::split(pipesList, \",\")) {\n> +\t\tfor (const auto &pipeName : utils::split(pipesList.value(), \",\")) {\n>   \t\t\tconst PipelineHandlerFactoryBase *factory;\n>   \t\t\tfactory = PipelineHandlerFactoryBase::getFactoryByName(pipeName);\n>   \t\t\tif (!factory)","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 2DBD9C3237\n\tfor <parsemail@patchwork.libcamera.org>;\n\tFri, 27 Jun 2025 14:01:06 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 69B7768E07;\n\tFri, 27 Jun 2025 16:01:05 +0200 (CEST)","from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 2A5D768E07\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tFri, 27 Jun 2025 16:00:52 +0200 (CEST)","from [192.168.33.12] (185.221.143.107.nat.pool.zt.hu\n\t[185.221.143.107])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 734BC165B;\n\tFri, 27 Jun 2025 16:00:32 +0200 (CEST)"],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key;\n\tunprotected) header.d=ideasonboard.com header.i=@ideasonboard.com\n\theader.b=\"C4TnyZSw\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1751032832;\n\tbh=mvTvfIZ7UfA3IvntOzT0yRRZZiBDesW4gqo7BnQBsvw=;\n\th=Date:Subject:To:Cc:References:From:In-Reply-To:From;\n\tb=C4TnyZSwGL6XKVwnBkz9KbQ8M5PGqTJW4jgQsa+QJa1V3H521otrez4Pe7Gl4aUNr\n\t/g4onE9JgPv80b1l9/UZwBY++n89+ndqZZCPktrByiXxnB1/l0hHP1B3L4WjKWneaj\n\tcmB+oaGgEySyY8FnpZf9FRgsbL/hFXFDlqZE9AeM=","Message-ID":"<fc8a6d76-a983-4c52-8472-840b8afc8d23@ideasonboard.com>","Date":"Fri, 27 Jun 2025 16:00:44 +0200","MIME-Version":"1.0","User-Agent":"Mozilla Thunderbird","Subject":"Re: [PATCH v11 06/12] config: Look up pipelines match list in\n\tconfiguration file","To":"Milan Zamazal <mzamazal@redhat.com>, libcamera-devel@lists.libcamera.org","Cc":"Kieran Bingham <kieran.bingham@ideasonboard.com>,\n\tLaurent Pinchart <laurent.pinchart@ideasonboard.com>","References":"<20250624083612.27230-1-mzamazal@redhat.com>\n\t<20250624083612.27230-7-mzamazal@redhat.com>","From":"=?utf-8?q?Barnab=C3=A1s_P=C5=91cze?= <barnabas.pocze@ideasonboard.com>","Content-Language":"en-US, hu-HU","In-Reply-To":"<20250624083612.27230-7-mzamazal@redhat.com>","Content-Type":"text/plain; charset=UTF-8; format=flowed","Content-Transfer-Encoding":"8bit","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":34716,"web_url":"https://patchwork.libcamera.org/comment/34716/","msgid":"<85y0tcvqiq.fsf@mzamazal-thinkpadp1gen7.tpbc.csb>","date":"2025-06-27T21:11:25","subject":"Re: [PATCH v11 06/12] config: Look up pipelines match list in\n\tconfiguration file","submitter":{"id":177,"url":"https://patchwork.libcamera.org/api/people/177/","name":"Milan Zamazal","email":"mzamazal@redhat.com"},"content":"Hi Barnabás,\n\nBarnabás Pőcze <barnabas.pocze@ideasonboard.com> writes:\n\n> Hi\n>\n> 2025. 06. 24. 10:36 keltezéssel, Milan Zamazal írta:\n>> Let's add a configuration file item for the pipelines match list.\n>> The configuration snippet:\n>>    configuration:\n>>      pipelines_match_list: rkisp1,simple\n>> Signed-off-by: Milan Zamazal <mzamazal@redhat.com>\n>> ---\n>>   src/libcamera/camera_manager.cpp | 9 +++++----\n>>   1 file changed, 5 insertions(+), 4 deletions(-)\n>> diff --git a/src/libcamera/camera_manager.cpp b/src/libcamera/camera_manager.cpp\n>> index c47fd3677..b4d56c3aa 100644\n>> --- a/src/libcamera/camera_manager.cpp\n>> +++ b/src/libcamera/camera_manager.cpp\n>> @@ -111,14 +111,15 @@ void CameraManager::Private::createPipelineHandlers()\n>>   \t * file and only fallback on environment variable or all handlers, if\n>>   \t * there is no configuration file.\n>>   \t */\n>> -\tconst char *pipesList =\n>> -\t\tutils::secure_getenv(\"LIBCAMERA_PIPELINES_MATCH_LIST\");\n>> -\tif (pipesList) {\n>> +\tstd::optional<std::string> pipesList =\n>> +\t\tconfiguration().envOption(\"LIBCAMERA_PIPELINES_MATCH_LIST\",\n>> +\t\t\t\t\t  \"pipelines_match_list\");\n>\n> Wouldn't it be better to use `envListOption()`? I realize that the separator\n> is different (':' vs ','), but it still seems better to me. The separator\n> could be an argument of `envListOption()` I believe.\n\nProbably.  (Well, new environment variables are introduced more quickly\nthan these patches merged, which means new creations are handled\nafterwards rather than before...)\n\n> Regards,\n> Barnabás Pőcze\n>\n>\n>\n>> +\tif (pipesList.has_value()) {\n>>   \t\t/*\n>>   \t\t * When a list of preferred pipelines is defined, iterate\n>>   \t\t * through the ordered list to match the enumerated devices.\n>>   \t\t */\n>> -\t\tfor (const auto &pipeName : utils::split(pipesList, \",\")) {\n>> +\t\tfor (const auto &pipeName : utils::split(pipesList.value(), \",\")) {\n>>   \t\t\tconst PipelineHandlerFactoryBase *factory;\n>>   \t\t\tfactory = PipelineHandlerFactoryBase::getFactoryByName(pipeName);\n>>   \t\t\tif (!factory)","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 4E164C3237\n\tfor <parsemail@patchwork.libcamera.org>;\n\tFri, 27 Jun 2025 21:11:47 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 0AE8568E04;\n\tFri, 27 Jun 2025 23:11:46 +0200 (CEST)","from us-smtp-delivery-124.mimecast.com\n\t(us-smtp-delivery-124.mimecast.com [170.10.133.124])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 2306068DE5\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tFri, 27 Jun 2025 23:11:44 +0200 (CEST)","from mail-wr1-f71.google.com (mail-wr1-f71.google.com\n\t[209.85.221.71]) by relay.mimecast.com with ESMTP with STARTTLS\n\t(version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id\n\tus-mta-400-_LOnbLNgMUWcMQrXr8Zdew-1; Fri, 27 Jun 2025 17:11:28 -0400","by mail-wr1-f71.google.com with SMTP id\n\tffacd0b85a97d-3a6df0c67a6so106254f8f.3\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tFri, 27 Jun 2025 14:11:28 -0700 (PDT)","from mzamazal-thinkpadp1gen7.tpbc.csb\n\t(ip-77-48-47-2.net.vodafone.cz. [77.48.47.2])\n\tby smtp.gmail.com with ESMTPSA id\n\tffacd0b85a97d-3a892e52c23sm3693442f8f.52.2025.06.27.14.11.25\n\t(version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n\tFri, 27 Jun 2025 14:11:26 -0700 (PDT)"],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key;\n\tunprotected) header.d=redhat.com header.i=@redhat.com\n\theader.b=\"PjDLr5ck\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com;\n\ts=mimecast20190719; t=1751058703;\n\th=from:from:reply-to:subject:subject:date:date:message-id:message-id:\n\tto:to:cc:cc:mime-version:mime-version:content-type:content-type:\n\tcontent-transfer-encoding:content-transfer-encoding:\n\tin-reply-to:in-reply-to:references:references;\n\tbh=z8mJfPNTav8/h2bimlfz2jCCFR+ttmhwqk+PlOtZLFc=;\n\tb=PjDLr5ckf3ZzQvcvcuEgRRSVla2VQxtz70oVjKMNLnqBd92Ws5c6p+gL7nm+zWCaXkacsF\n\tm6SheSCe4b34eftmzUTObIwskoo4sKwBAXbGpAdWyG+ugbVpuijOb2Z3HhhdNoJOySe3jz\n\tenGvwL/LySuDQCeQlpk/sgHM32f+4kM=","X-MC-Unique":"_LOnbLNgMUWcMQrXr8Zdew-1","X-Mimecast-MFC-AGG-ID":"_LOnbLNgMUWcMQrXr8Zdew_1751058687","X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20230601; t=1751058687; x=1751663487;\n\th=content-transfer-encoding:mime-version:user-agent:message-id:date\n\t:references:in-reply-to:subject:cc:to:from:x-gm-message-state:from\n\t:to:cc:subject:date:message-id:reply-to;\n\tbh=nJr9chO4QWF3Ap6/RGZbMkHRuFHCdQghF9IxzOfiLao=;\n\tb=mnnCoanW4m106FVongieh4Q8ekT/0xu86gdVbMDx+W+0xSGW7fEPw0rMMs0kbPQTRG\n\tFDYjqoj8NGqPoVgT9eNY9DaCzlT7EFElLeIVWgP9jcJlR4DqZGoCnGH6vCIi7vj8AeDg\n\tblGD+UHd30ulEF6Vi2l5voLlfehKp57wAzIY9vrJ9yXlX0J1fgCIleTdsniqPjpXVXHf\n\ti0L9EOvssikSoT3PlZcKXqFMQ8WTCsnIhfxeJyBAVcrrTtXjtJ56mr1LCsO8Z9/0LITa\n\tGzW6TBSEPVfEoIjt9X9ZT5+d7CKQh7fLqd6DkjL8b2beBlc1gMrBPmUAPVZ1Lg7yJ5J7\n\tnjNg==","X-Gm-Message-State":"AOJu0Yy4eXNRit9rcOv5NP7SEcYX9SR+RaTAat+14snJLjcydxh6RUo5\n\tdepPwuym5foC9wfRxMEvPYAMsp9FUPnCOD3pd4yurhwFrYiXRYmuBPB0R6Mncc/NJUWa4Q5MGTD\n\tbAnePmfxB04SxZVro/YGAwGA/Tdgg6CVtFHsX8V6mjyATsP1kV9qPRJGZp4fH+7VJPB9SqTGy/9\n\tQ=","X-Gm-Gg":"ASbGnct3Yz4WXN/3UToHyRxjG8xhuawuLQ55zEIFnsMi9U/J4a6AFSIM1l7lhSKhLAz\n\t6JOPFtF6E8zAYLyJcMfWrCj3AtG8u1jtnrvlqeS3aHyLSviknOG7RfNQAt3L4hRE6VlJ6l7KsoK\n\t5y7BKNSUIaGVoIHiBM98RtAwKmtQf6vrWFDT10Mnx/nudRjuUzXXsbxfbRtl1LZTaP2uCBuI97Q\n\tSvuJdpgQ6siJxumLKjpGees/djz+QpiGyj4yKGey5nn93DEdFU9qYCG/YyxmyZp2W9Q3ln+fKPD\n\tH+vQ8s2ZxjPwLY9NNgIx4toaZkZd+gq/9lkEWJ/g8GnqFD8lFE7acvuUOwQPTf3iZXci4OX2eFg\n\t=","X-Received":["by 2002:adf:9d82:0:b0:3a4:fcc3:4a14 with SMTP id\n\tffacd0b85a97d-3a8fdeff8acmr3580378f8f.34.1751058686991; \n\tFri, 27 Jun 2025 14:11:26 -0700 (PDT)","by 2002:adf:9d82:0:b0:3a4:fcc3:4a14 with SMTP id\n\tffacd0b85a97d-3a8fdeff8acmr3580363f8f.34.1751058686568; \n\tFri, 27 Jun 2025 14:11:26 -0700 (PDT)"],"X-Google-Smtp-Source":"AGHT+IFOy3XauHG/Bm+OofXw+UJuInGCgrn1arNZvU3fYsjmqhH8/8UirHobBJjBBzGU1j1yZa2aOg==","From":"Milan Zamazal <mzamazal@redhat.com>","To":"=?utf-8?q?Barnab=C3=A1s_P=C5=91cze?= <barnabas.pocze@ideasonboard.com>","Cc":"libcamera-devel@lists.libcamera.org,  Kieran Bingham\n\t<kieran.bingham@ideasonboard.com>,  Laurent Pinchart\n\t<laurent.pinchart@ideasonboard.com>","Subject":"Re: [PATCH v11 06/12] config: Look up pipelines match list in\n\tconfiguration file","In-Reply-To":"<fc8a6d76-a983-4c52-8472-840b8afc8d23@ideasonboard.com> (\n\t=?utf-8?b?IkJhcm5hYsOhcyBQxZFjemUiJ3M=?= message of \"Fri,\n\t27 Jun 2025  16:00:44 +0200\")","References":"<20250624083612.27230-1-mzamazal@redhat.com>\n\t<20250624083612.27230-7-mzamazal@redhat.com>\n\t<fc8a6d76-a983-4c52-8472-840b8afc8d23@ideasonboard.com>","Date":"Fri, 27 Jun 2025 23:11:25 +0200","Message-ID":"<85y0tcvqiq.fsf@mzamazal-thinkpadp1gen7.tpbc.csb>","User-Agent":"Gnus/5.13 (Gnus v5.13)","MIME-Version":"1.0","X-Mimecast-Spam-Score":"0","X-Mimecast-MFC-PROC-ID":"6pID0P7nj45gBV_ajlEz408gU03zE23fHAWXQPZxldA_1751058687","X-Mimecast-Originator":"redhat.com","Content-Type":"text/plain; charset=utf-8","Content-Transfer-Encoding":"quoted-printable","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>"}}]