[{"id":32347,"web_url":"https://patchwork.libcamera.org/comment/32347/","msgid":"<CAEB1ahv+ZiXMwC+RWasWXOUxu-EqVmWgG+6_YUAhb+ti7_tXyw@mail.gmail.com>","date":"2024-11-25T06:08:46","subject":"Re: [PATCH] meson: Don't unnecessarily fallback to libyuv wrap","submitter":{"id":117,"url":"https://patchwork.libcamera.org/api/people/117/","name":"Cheng-Hao Yang","email":"chenghaoyang@chromium.org"},"content":"Hi Laurent,\n\nThanks for the fix.\n\nOn Mon, Nov 25, 2024 at 8:52 AM Laurent Pinchart\n<laurent.pinchart@ideasonboard.com> wrote:\n>\n> Before commit eeaa7de21b8c (\"libcamera: pipeline: Add test pattern for\n> VirtualPipelineHandler\") the libyuv dependency was only needed for the\n> Android adaptation layer. As libyuv isn't packaged by most distribution,\n> meson fell back to using a meson wrap if the Android adaptation layer\n> was enabled and the library wasn't found.\n>\n> With commit eeaa7de21b8c, libyuv is also used by the virtual pipeline\n> handler, and the meson wrap fallback handling got centralized and became\n> unconditional, so the wrap is downloaded even if the components\n> depending on libyuv are all disabled. This causes unnecessary downloads\n> at setup time, which can be problematic on build systems without an\n> internet connection.\n>\n> Fix this by making the wrap fallback conditional on the components that\n> use libyuv.\n>\n> Fixes: eeaa7de21b8c (\"libcamera: pipeline: Add test pattern for VirtualPipelineHandler\")\n> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n> ---\n>  src/android/meson.build | 3 +--\n>  src/meson.build         | 8 +++++---\n>  2 files changed, 6 insertions(+), 5 deletions(-)\n>\n> diff --git a/src/android/meson.build b/src/android/meson.build\n> index 6341ee8b0bfb..7b226a4b5d35 100644\n> --- a/src/android/meson.build\n> +++ b/src/android/meson.build\n> @@ -4,6 +4,7 @@ android_deps = [\n>      dependency('libexif', required : get_option('android')),\n>      dependency('libjpeg', required : get_option('android')),\n>      libcamera_private,\n> +    libyuv_dep,\n>  ]\n>\n>  android_enabled = true\n> @@ -15,8 +16,6 @@ foreach dep : android_deps\n>      endif\n>  endforeach\n>\n> -android_deps += [libyuv_dep]\n> -\n>  android_hal_sources = files([\n>      'camera3_hal.cpp',\n>      'camera_capabilities.cpp',\n> diff --git a/src/meson.build b/src/meson.build\n> index 91bea7753a2e..76198e9535db 100644\n> --- a/src/meson.build\n> +++ b/src/meson.build\n> @@ -27,11 +27,13 @@ else\n>      ipa_sign_module = false\n>  endif\n>\n> +# libyuv, used by the Android adaptation layer and the virtual pipeline handler.\n> +# Fallback to a subproject if libyuv isn't found, as it's typically not provided\n> +# by distributions.\n>  libyuv_dep = dependency('libyuv', required : false)\n>\n> -# Fallback to a subproject if libyuv isn't found, as it's typically not\n> -# provided by distributions.\n> -if not libyuv_dep.found()\n> +if (pipelines.contains('virtual') or get_option('android').allowed()) and \\\n> +   not libyuv_dep.found()\n>      cmake = import('cmake')\n>\n>      libyuv_vars = cmake.subproject_options()\n>\n> base-commit: 9a5f91c78abc8985baff89563992be3644f861b0\n\nReviewed-by: Harvey Yang <chenghaoyang@chromium.org>\n\nBR,\nHarvey\n\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 5C7FBBD160\n\tfor <parsemail@patchwork.libcamera.org>;\n\tMon, 25 Nov 2024 06:09:02 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 3E55666005;\n\tMon, 25 Nov 2024 07:09:01 +0100 (CET)","from mail-lj1-x229.google.com (mail-lj1-x229.google.com\n\t[IPv6:2a00:1450:4864:20::229])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 0F2B865FFA\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tMon, 25 Nov 2024 07:08:59 +0100 (CET)","by mail-lj1-x229.google.com with SMTP id\n\t38308e7fff4ca-2ffbea0acc2so7676161fa.1\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tSun, 24 Nov 2024 22:08:58 -0800 (PST)"],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key;\n\tunprotected) header.d=chromium.org header.i=@chromium.org\n\theader.b=\"Jtt1JVXD\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=chromium.org; s=google; t=1732514938; x=1733119738;\n\tdarn=lists.libcamera.org; \n\th=content-transfer-encoding:cc:to:subject:message-id:date:from\n\t:in-reply-to:references:mime-version:from:to:cc:subject:date\n\t:message-id:reply-to;\n\tbh=V/zCVoIsH8lEvT+u87kmkWK0muTYnWPKJRl8tnrYQAA=;\n\tb=Jtt1JVXD8M/HBtuxkpRo0jBLqsstJEZOeREEXWq5kRN8N5Q82mO0E9M0lZ4QWvnY5T\n\tUnbc2kiWajKFluuMOYduwwKndYWmQy3YUP1pK44H5nypWmYuInibW0XtBj5j0osJhk82\n\t8EZvqutPL+nVuKvdTu3TZZ6MBb8lbhtjxbSxs=","X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20230601; t=1732514938; x=1733119738;\n\th=content-transfer-encoding:cc:to:subject:message-id:date:from\n\t:in-reply-to:references:mime-version:x-gm-message-state:from:to:cc\n\t:subject:date:message-id:reply-to;\n\tbh=V/zCVoIsH8lEvT+u87kmkWK0muTYnWPKJRl8tnrYQAA=;\n\tb=DAQviPJLS7gkrQ3FevRd1AqzfpACnDWDst3fQd7AL6/vtfJbHrvmDF7kJTwBd3Pgsw\n\tEmImbEen8u3eRzLuJ4wPwvhz1t6/W6PRDv82xCA06HbZFgk2jxwI1ObO9OzqNqFTmElw\n\tjMX+PsR0BRZs0/QI3dK888TPh1vCF/6YL4nCpO+R0MAKiMedzdDtVcJG1A9xpZVrtVqh\n\tZE9UnQXepyuhnXEhwhTvhIlXyC4EssFbYk0SM4jO8IECLSI2+ZSNANjkRW+aVDkYMJtA\n\tW/QPb+e5LgWKjE7IVNkVszJx5TynR5mCCc9H1F3a8zLu89z8N+0ht4ZnHLUX/tBYeOpL\n\tcjOQ==","X-Gm-Message-State":"AOJu0Yy/eo8VLuKz1iJUz+bTYwm25V8twJ4aBgLg0SrtwzRmHzBNhIik\n\t2JV+9CF34bk1efKN99zUZgR9QKdbXYMsWX8xEVUAO3dhgwCdnOCLyp2AutIBBn3MvY1Nfip39GT\n\tSdvvdhB5X3FCDXWIjoIvw6cwQhdMeMsQDlaT65CAOxlItKizEiw==","X-Gm-Gg":"ASbGncu7zsLIFTPZJJl2yo+NL4PKH/3RP/bTsIpqnC8PCwhRgq3q1lpT4v6qSRRu24b\n\tmBqcTX56Q1tcqfsgDiAX0W2/HemRCObKwFf7TSRh1qXWC6yVT6BgwKeB2VY4=","X-Google-Smtp-Source":"AGHT+IE83YtNtRvtwDYGk2NsE/6AUZc38AaQViJF2knsHfmD3y+MNrZyFNXeBG3YlYKFbfccQ7Vcfr9wqMD/lBrUX9U=","X-Received":"by 2002:a2e:9044:0:b0:2ff:b7ff:4791 with SMTP id\n\t38308e7fff4ca-2ffb7ff4a92mr12888141fa.20.1732514938018;\n\tSun, 24 Nov 2024 22:08:58 -0800 (PST)","MIME-Version":"1.0","References":"<20241125005228.24737-1-laurent.pinchart@ideasonboard.com>","In-Reply-To":"<20241125005228.24737-1-laurent.pinchart@ideasonboard.com>","From":"Cheng-Hao Yang <chenghaoyang@chromium.org>","Date":"Mon, 25 Nov 2024 14:08:46 +0800","Message-ID":"<CAEB1ahv+ZiXMwC+RWasWXOUxu-EqVmWgG+6_YUAhb+ti7_tXyw@mail.gmail.com>","Subject":"Re: [PATCH] meson: Don't unnecessarily fallback to libyuv wrap","To":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>","Cc":"libcamera-devel@lists.libcamera.org","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>"}},{"id":32349,"web_url":"https://patchwork.libcamera.org/comment/32349/","msgid":"<173252559176.1409963.562341928123081684@ping.linuxembedded.co.uk>","date":"2024-11-25T09:06:31","subject":"Re: [PATCH] meson: Don't unnecessarily fallback to libyuv wrap","submitter":{"id":4,"url":"https://patchwork.libcamera.org/api/people/4/","name":"Kieran Bingham","email":"kieran.bingham@ideasonboard.com"},"content":"Quoting Laurent Pinchart (2024-11-25 00:52:28)\n> Before commit eeaa7de21b8c (\"libcamera: pipeline: Add test pattern for\n> VirtualPipelineHandler\") the libyuv dependency was only needed for the\n> Android adaptation layer. As libyuv isn't packaged by most distribution,\n> meson fell back to using a meson wrap if the Android adaptation layer\n> was enabled and the library wasn't found.\n> \n> With commit eeaa7de21b8c, libyuv is also used by the virtual pipeline\n> handler, and the meson wrap fallback handling got centralized and became\n> unconditional, so the wrap is downloaded even if the components\n> depending on libyuv are all disabled. This causes unnecessary downloads\n> at setup time, which can be problematic on build systems without an\n> internet connection.\n> \n> Fix this by making the wrap fallback conditional on the components that\n> use libyuv.\n> \n> Fixes: eeaa7de21b8c (\"libcamera: pipeline: Add test pattern for VirtualPipelineHandler\")\n> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n\n\nReviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>\n> ---\n>  src/android/meson.build | 3 +--\n>  src/meson.build         | 8 +++++---\n>  2 files changed, 6 insertions(+), 5 deletions(-)\n> \n> diff --git a/src/android/meson.build b/src/android/meson.build\n> index 6341ee8b0bfb..7b226a4b5d35 100644\n> --- a/src/android/meson.build\n> +++ b/src/android/meson.build\n> @@ -4,6 +4,7 @@ android_deps = [\n>      dependency('libexif', required : get_option('android')),\n>      dependency('libjpeg', required : get_option('android')),\n>      libcamera_private,\n> +    libyuv_dep,\n>  ]\n>  \n>  android_enabled = true\n> @@ -15,8 +16,6 @@ foreach dep : android_deps\n>      endif\n>  endforeach\n>  \n> -android_deps += [libyuv_dep]\n> -\n>  android_hal_sources = files([\n>      'camera3_hal.cpp',\n>      'camera_capabilities.cpp',\n> diff --git a/src/meson.build b/src/meson.build\n> index 91bea7753a2e..76198e9535db 100644\n> --- a/src/meson.build\n> +++ b/src/meson.build\n> @@ -27,11 +27,13 @@ else\n>      ipa_sign_module = false\n>  endif\n>  \n> +# libyuv, used by the Android adaptation layer and the virtual pipeline handler.\n> +# Fallback to a subproject if libyuv isn't found, as it's typically not provided\n> +# by distributions.\n>  libyuv_dep = dependency('libyuv', required : false)\n>  \n> -# Fallback to a subproject if libyuv isn't found, as it's typically not\n> -# provided by distributions.\n> -if not libyuv_dep.found()\n> +if (pipelines.contains('virtual') or get_option('android').allowed()) and \\\n> +   not libyuv_dep.found()\n>      cmake = import('cmake')\n>  \n>      libyuv_vars = cmake.subproject_options()\n> \n> base-commit: 9a5f91c78abc8985baff89563992be3644f861b0\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 5EDBEBD808\n\tfor <parsemail@patchwork.libcamera.org>;\n\tMon, 25 Nov 2024 09:06:38 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 44E446600D;\n\tMon, 25 Nov 2024 10:06:37 +0100 (CET)","from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id A09B365FFA\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tMon, 25 Nov 2024 10:06:35 +0100 (CET)","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 D0B904AD;\n\tMon, 25 Nov 2024 10:06:13 +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=\"UXDYtD3b\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1732525573;\n\tbh=3pcXJOkE0lt8pcYVtBh7UlgvRoW7C93d6H1TWr6dEX8=;\n\th=In-Reply-To:References:Subject:From:Cc:To:Date:From;\n\tb=UXDYtD3buBk0ck7Ok8QeTdh5Ak46n4qchvqybE01sjfqueIAv9jktEQHIMYKVzn9/\n\tvsxmR75mntBfsbrZud4lz4W8A6mI5eE5Up2OzkDgpJSuabu6QjbrSh0DFxX953tP0P\n\tvpjSvGbRVLiVvLuFvZpD2gc+1EJx3RuLPPhmnGrk=","Content-Type":"text/plain; charset=\"utf-8\"","MIME-Version":"1.0","Content-Transfer-Encoding":"quoted-printable","In-Reply-To":"<20241125005228.24737-1-laurent.pinchart@ideasonboard.com>","References":"<20241125005228.24737-1-laurent.pinchart@ideasonboard.com>","Subject":"Re: [PATCH] meson: Don't unnecessarily fallback to libyuv wrap","From":"Kieran Bingham <kieran.bingham@ideasonboard.com>","Cc":"Harvey Yang <chenghaoyang@chromium.org>","To":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>,\n\tlibcamera-devel@lists.libcamera.org","Date":"Mon, 25 Nov 2024 09:06:31 +0000","Message-ID":"<173252559176.1409963.562341928123081684@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>"}}]