[{"id":31077,"web_url":"https://patchwork.libcamera.org/comment/31077/","msgid":"<87seuh40p4.fsf@redhat.com>","date":"2024-09-03T08:10:31","subject":"Re: [PATCH 1/2] utils: ipc: Include <string> in generated headers\n\twhere needed","submitter":{"id":177,"url":"https://patchwork.libcamera.org/api/people/177/","name":"Milan Zamazal","email":"mzamazal@redhat.com"},"content":"Laurent Pinchart <laurent.pinchart@ideasonboard.com> writes:\n\n> Depending on the types used in the IPA interface, generated headers may\n> use the std::string class. Include <string> when needed.\n>\n> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n\nReviewed-by: Milan Zamazal <mzamazal@redhat.com>\n\n> ---\n>  .../libcamera_templates/core_ipa_interface.h.tmpl          | 1 +\n>  .../libcamera_templates/module_ipa_interface.h.tmpl        | 7 ++++---\n>  utils/codegen/ipc/generators/mojom_libcamera_generator.py  | 2 ++\n>  3 files changed, 7 insertions(+), 3 deletions(-)\n>\n> diff --git a/utils/codegen/ipc/generators/libcamera_templates/core_ipa_interface.h.tmpl b/utils/codegen/ipc/generators/libcamera_templates/core_ipa_interface.h.tmpl\n> index 7f2d0810823b..590135b88421 100644\n> --- a/utils/codegen/ipc/generators/libcamera_templates/core_ipa_interface.h.tmpl\n> +++ b/utils/codegen/ipc/generators/libcamera_templates/core_ipa_interface.h.tmpl\n> @@ -15,6 +15,7 @@\n>  #pragma once\n>  \n>  {% if has_map %}#include <map>{% endif %}\n> +{% if has_string %}#include <string>{% endif %}\n>  {% if has_array %}#include <vector>{% endif %}\n>  \n>  #include <libcamera/ipa/ipa_interface.h>\n> diff --git a/utils/codegen/ipc/generators/libcamera_templates/module_ipa_interface.h.tmpl b/utils/codegen/ipc/generators/libcamera_templates/module_ipa_interface.h.tmpl\n> index 4d88a3d77d0f..0111d0c4c591 100644\n> --- a/utils/codegen/ipc/generators/libcamera_templates/module_ipa_interface.h.tmpl\n> +++ b/utils/codegen/ipc/generators/libcamera_templates/module_ipa_interface.h.tmpl\n> @@ -14,12 +14,13 @@\n>  \n>  #pragma once\n>  \n> +{% if has_map %}#include <map>{% endif %}\n> +{% if has_string %}#include <string>{% endif %}\n> +{% if has_array %}#include <vector>{% endif %}\n> +\n>  #include <libcamera/ipa/core_ipa_interface.h>\n>  #include <libcamera/ipa/ipa_interface.h>\n>  \n> -{% if has_map %}#include <map>{% endif %}\n> -{% if has_array %}#include <vector>{% endif %}\n> -\n>  namespace libcamera {\n>  {%- if has_namespace %}\n>  {% for ns in namespace %}\n> diff --git a/utils/codegen/ipc/generators/mojom_libcamera_generator.py b/utils/codegen/ipc/generators/mojom_libcamera_generator.py\n> index b8209e516297..d9c620a05e2a 100644\n> --- a/utils/codegen/ipc/generators/mojom_libcamera_generator.py\n> +++ b/utils/codegen/ipc/generators/mojom_libcamera_generator.py\n> @@ -467,6 +467,7 @@ class Generator(generator.Generator):\n>              'enums': self.module.enums,\n>              'has_array': len([x for x in self.module.kinds.keys() if x[0] == 'a']) > 0,\n>              'has_map': len([x for x in self.module.kinds.keys() if x[0] == 'm']) > 0,\n> +            'has_string': len([x for x in self.module.kinds.keys() if x[0] == 's']) > 0,\n>              'has_namespace': self.module.mojom_namespace != '',\n>              'interface_event': GetEventInterface(self.module.interfaces),\n>              'interface_main': GetMainInterface(self.module.interfaces),\n> @@ -486,6 +487,7 @@ class Generator(generator.Generator):\n>              'enums_gen_header': [x for x in self.module.enums if x.attributes is None or 'skipHeader' not in x.attributes],\n>              'has_array': len([x for x in self.module.kinds.keys() if x[0] == 'a']) > 0,\n>              'has_map': len([x for x in self.module.kinds.keys() if x[0] == 'm']) > 0,\n> +            'has_string': len([x for x in self.module.kinds.keys() if x[0] == 's']) > 0,\n>              'structs_gen_header': [x for x in self.module.structs if x.attributes is None or 'skipHeader' not in x.attributes],\n>              'structs_gen_serializer': [x for x in self.module.structs if x.attributes is None or 'skipSerdes' not in x.attributes],\n>          }\n>\n> base-commit: ac1c57fcf5dff06ae4e7e5fad7baa8f93c413e37","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 382FBC324C\n\tfor <parsemail@patchwork.libcamera.org>;\n\tTue,  3 Sep 2024 08:10:40 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 0851D634E4;\n\tTue,  3 Sep 2024 10:10:39 +0200 (CEST)","from us-smtp-delivery-124.mimecast.com\n\t(us-smtp-delivery-124.mimecast.com [170.10.129.124])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 26C736345D\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue,  3 Sep 2024 10:10:37 +0200 (CEST)","from mail-wm1-f70.google.com (mail-wm1-f70.google.com\n\t[209.85.128.70]) by relay.mimecast.com with ESMTP with STARTTLS\n\t(version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id\n\tus-mta-335-GbZ54qv7NtiIVe5w_Yp59A-1; Tue, 03 Sep 2024 04:10:34 -0400","by mail-wm1-f70.google.com with SMTP id\n\t5b1f17b1804b1-42bbe70c1c2so33597485e9.1\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue, 03 Sep 2024 01:10:34 -0700 (PDT)","from nuthatch (nat-pool-brq-t.redhat.com. [213.175.37.10])\n\tby smtp.gmail.com with ESMTPSA id\n\t5b1f17b1804b1-42b9e7b7f87sm172751985e9.1.2024.09.03.01.10.31\n\t(version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n\tTue, 03 Sep 2024 01:10:32 -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=\"aAOC4kkU\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com;\n\ts=mimecast20190719; t=1725351035;\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\tin-reply-to:in-reply-to:references:references;\n\tbh=k4lGva+gADnqVpg3lOoefQjLlCR1gG2u8gSGiSVvikg=;\n\tb=aAOC4kkU5fssaiHgLLCW67EabGNcOtggzfhoVUanZsFoAFihugC005/Hsx6BC7cXIs3ymB\n\tElM6Iv+ipICzOJCWOZHkYGjvtmjmuqP7uBzpbVaTkBRyhAIpSUDptMtOGcUvUPj3lAhjKo\n\tmUR4XvFLu3BzvJrsDbHKxxBrq0qXKs8=","X-MC-Unique":"GbZ54qv7NtiIVe5w_Yp59A-1","X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20230601; t=1725351033; x=1725955833;\n\th=mime-version:user-agent:message-id:date:references:in-reply-to\n\t:subject:cc:to:from:x-gm-message-state:from:to:cc:subject:date\n\t:message-id:reply-to;\n\tbh=k4lGva+gADnqVpg3lOoefQjLlCR1gG2u8gSGiSVvikg=;\n\tb=LTPT1FR4+QxmFcwsWMII7UHSZL3QuIKPBWrBAZlLz5T0L8dHnB5Rb3TecQWRwNp6K1\n\t6bCkgFdnZO6h6VGQjBh9YTDaevXULXk/5ZPpdyT8Xsen4EgWyJqTDqMk2MNkzFFRut9x\n\tulIB7JU/kjZdqtWfFqJZig6rFIiiBenG7lFfREF8xJfYGOPuzMmDjvELzAsPp97e4FGN\n\tq0zgIp1MBPNbddbTvxKXSR3wf9yM7acfGdtgGShBNJGgGOQ5lOmr+qbi6Eg/mMYVIjWs\n\tc6/PLiMgTkRmeNuxBUCnKVPGvwtG3gF19oggEubbEsBX27dUEGF/JeeAi74HiqGLKP8o\n\tFwWw==","X-Gm-Message-State":"AOJu0Ywy146xx1Q3Y04nCv05Nm3jndUbSFYAbMsWQyPb42hL6l610mdD\n\tSxUfPCEtTl95zTlLNabuBScwa7tE9GSaPdM65lqKZf67vzOmPSRgSkEvobsJR/CSBpw89VQulfA\n\tYjZ7cJDHWN9kSY2YTVQrwR8Y/x6LTyK2hMjhcu0WZYuxw15lUICYb13h26aDoS6rsy7kjbmk=","X-Received":["by 2002:a05:600c:699b:b0:426:5269:9824 with SMTP id\n\t5b1f17b1804b1-42bb0229f05mr132648175e9.0.1725351033288; \n\tTue, 03 Sep 2024 01:10:33 -0700 (PDT)","by 2002:a05:600c:699b:b0:426:5269:9824 with SMTP id\n\t5b1f17b1804b1-42bb0229f05mr132647865e9.0.1725351032719; \n\tTue, 03 Sep 2024 01:10:32 -0700 (PDT)"],"X-Google-Smtp-Source":"AGHT+IH6Qgs/zbFTD9F6lDvztjTrqY6HnP7NcnDTyJcNyeOGrhFwNI/0/oltc3kut722FyxR6LlERg==","From":"Milan Zamazal <mzamazal@redhat.com>","To":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>","Cc":"libcamera-devel@lists.libcamera.org,  Paul Elder\n\t<paul.elder@ideasonboard.com>","Subject":"Re: [PATCH 1/2] utils: ipc: Include <string> in generated headers\n\twhere needed","In-Reply-To":"<20240902221317.19005-1-laurent.pinchart@ideasonboard.com>\n\t(Laurent Pinchart's message of \"Tue, 3 Sep 2024 01:13:16 +0300\")","References":"<20240902221317.19005-1-laurent.pinchart@ideasonboard.com>","Date":"Tue, 03 Sep 2024 10:10:31 +0200","Message-ID":"<87seuh40p4.fsf@redhat.com>","User-Agent":"Gnus/5.13 (Gnus v5.13)","MIME-Version":"1.0","X-Mimecast-Spam-Score":"0","X-Mimecast-Originator":"redhat.com","Content-Type":"text/plain","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":31087,"web_url":"https://patchwork.libcamera.org/comment/31087/","msgid":"<172544768162.129190.15317213182250482300@ping.linuxembedded.co.uk>","date":"2024-09-04T11:01:21","subject":"Re: [PATCH 1/2] utils: ipc: Include <string> in generated headers\n\twhere needed","submitter":{"id":4,"url":"https://patchwork.libcamera.org/api/people/4/","name":"Kieran Bingham","email":"kieran.bingham@ideasonboard.com"},"content":"Quoting Laurent Pinchart (2024-09-02 23:13:16)\n> Depending on the types used in the IPA interface, generated headers may\n> use the std::string class. Include <string> when needed.\n\nReviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>\n\n> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n> ---\n>  .../libcamera_templates/core_ipa_interface.h.tmpl          | 1 +\n>  .../libcamera_templates/module_ipa_interface.h.tmpl        | 7 ++++---\n>  utils/codegen/ipc/generators/mojom_libcamera_generator.py  | 2 ++\n>  3 files changed, 7 insertions(+), 3 deletions(-)\n> \n> diff --git a/utils/codegen/ipc/generators/libcamera_templates/core_ipa_interface.h.tmpl b/utils/codegen/ipc/generators/libcamera_templates/core_ipa_interface.h.tmpl\n> index 7f2d0810823b..590135b88421 100644\n> --- a/utils/codegen/ipc/generators/libcamera_templates/core_ipa_interface.h.tmpl\n> +++ b/utils/codegen/ipc/generators/libcamera_templates/core_ipa_interface.h.tmpl\n> @@ -15,6 +15,7 @@\n>  #pragma once\n>  \n>  {% if has_map %}#include <map>{% endif %}\n> +{% if has_string %}#include <string>{% endif %}\n>  {% if has_array %}#include <vector>{% endif %}\n>  \n>  #include <libcamera/ipa/ipa_interface.h>\n> diff --git a/utils/codegen/ipc/generators/libcamera_templates/module_ipa_interface.h.tmpl b/utils/codegen/ipc/generators/libcamera_templates/module_ipa_interface.h.tmpl\n> index 4d88a3d77d0f..0111d0c4c591 100644\n> --- a/utils/codegen/ipc/generators/libcamera_templates/module_ipa_interface.h.tmpl\n> +++ b/utils/codegen/ipc/generators/libcamera_templates/module_ipa_interface.h.tmpl\n> @@ -14,12 +14,13 @@\n>  \n>  #pragma once\n>  \n> +{% if has_map %}#include <map>{% endif %}\n> +{% if has_string %}#include <string>{% endif %}\n> +{% if has_array %}#include <vector>{% endif %}\n> +\n>  #include <libcamera/ipa/core_ipa_interface.h>\n>  #include <libcamera/ipa/ipa_interface.h>\n>  \n> -{% if has_map %}#include <map>{% endif %}\n> -{% if has_array %}#include <vector>{% endif %}\n> -\n>  namespace libcamera {\n>  {%- if has_namespace %}\n>  {% for ns in namespace %}\n> diff --git a/utils/codegen/ipc/generators/mojom_libcamera_generator.py b/utils/codegen/ipc/generators/mojom_libcamera_generator.py\n> index b8209e516297..d9c620a05e2a 100644\n> --- a/utils/codegen/ipc/generators/mojom_libcamera_generator.py\n> +++ b/utils/codegen/ipc/generators/mojom_libcamera_generator.py\n> @@ -467,6 +467,7 @@ class Generator(generator.Generator):\n>              'enums': self.module.enums,\n>              'has_array': len([x for x in self.module.kinds.keys() if x[0] == 'a']) > 0,\n>              'has_map': len([x for x in self.module.kinds.keys() if x[0] == 'm']) > 0,\n> +            'has_string': len([x for x in self.module.kinds.keys() if x[0] == 's']) > 0,\n>              'has_namespace': self.module.mojom_namespace != '',\n>              'interface_event': GetEventInterface(self.module.interfaces),\n>              'interface_main': GetMainInterface(self.module.interfaces),\n> @@ -486,6 +487,7 @@ class Generator(generator.Generator):\n>              'enums_gen_header': [x for x in self.module.enums if x.attributes is None or 'skipHeader' not in x.attributes],\n>              'has_array': len([x for x in self.module.kinds.keys() if x[0] == 'a']) > 0,\n>              'has_map': len([x for x in self.module.kinds.keys() if x[0] == 'm']) > 0,\n> +            'has_string': len([x for x in self.module.kinds.keys() if x[0] == 's']) > 0,\n>              'structs_gen_header': [x for x in self.module.structs if x.attributes is None or 'skipHeader' not in x.attributes],\n>              'structs_gen_serializer': [x for x in self.module.structs if x.attributes is None or 'skipSerdes' not in x.attributes],\n>          }\n> \n> base-commit: ac1c57fcf5dff06ae4e7e5fad7baa8f93c413e37\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 1E4EAC324C\n\tfor <parsemail@patchwork.libcamera.org>;\n\tWed,  4 Sep 2024 11:01:28 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 26EA46341E;\n\tWed,  4 Sep 2024 13:01:27 +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 A99FE618FE\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tWed,  4 Sep 2024 13:01:25 +0200 (CEST)","from pendragon.ideasonboard.com\n\t(cpc89244-aztw30-2-0-cust6594.18-1.cable.virginm.net [86.31.185.195])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id CE57B2E3;\n\tWed,  4 Sep 2024 13:00:12 +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=\"Ul1Jjwd1\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1725447612;\n\tbh=6+WFb0oCz14rD+r2dGtDiOBJoQzA4ZrSzk18zOSXIcM=;\n\th=In-Reply-To:References:Subject:From:Cc:To:Date:From;\n\tb=Ul1Jjwd1M+5iqdNZRQNr4CYgM+eOwnyq3eOeWu8acTLUmDHB9c00O3RnzVpScGFSJ\n\ti8DERTKdUMNl8D5hq031dQTPgT1TUGrr+Ke/MryH2baPzmyKtLjHl+4ijWPugLKQbK\n\tE/wV679lbyQFTxwmFBaLnPADOzc/L1UmHp6Bf4r8=","Content-Type":"text/plain; charset=\"utf-8\"","MIME-Version":"1.0","Content-Transfer-Encoding":"quoted-printable","In-Reply-To":"<20240902221317.19005-1-laurent.pinchart@ideasonboard.com>","References":"<20240902221317.19005-1-laurent.pinchart@ideasonboard.com>","Subject":"Re: [PATCH 1/2] utils: ipc: Include <string> in generated headers\n\twhere needed","From":"Kieran Bingham <kieran.bingham@ideasonboard.com>","Cc":"Paul Elder <paul.elder@ideasonboard.com>,\n\tMilan Zamazal <mzamazal@redhat.com>","To":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>,\n\tlibcamera-devel@lists.libcamera.org","Date":"Wed, 04 Sep 2024 12:01:21 +0100","Message-ID":"<172544768162.129190.15317213182250482300@ping.linuxembedded.co.uk>","User-Agent":"alot/0.10","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>"}}]