{"id":12387,"url":"https://patchwork.libcamera.org/api/1.1/patches/12387/?format=json","web_url":"https://patchwork.libcamera.org/patch/12387/","project":{"id":1,"url":"https://patchwork.libcamera.org/api/1.1/projects/1/?format=json","name":"libcamera","link_name":"libcamera","list_id":"libcamera_core","list_email":"libcamera-devel@lists.libcamera.org","web_url":"","scm_url":"","webscm_url":""},"msgid":"<20210524115640.2334778-2-hiroh@chromium.org>","date":"2021-05-24T11:56:39","name":"[libcamera-devel,RFC,1/2] android: Move ChromeOS specific Camera HAL calls to camera3_hal.cpp","commit_ref":null,"pull_url":null,"state":"superseded","archived":false,"hash":"23b299ed7e5e0df991ba363784462923c8f0f61d","submitter":{"id":63,"url":"https://patchwork.libcamera.org/api/1.1/people/63/?format=json","name":"Hirokazu Honda","email":"hiroh@chromium.org"},"delegate":null,"mbox":"https://patchwork.libcamera.org/patch/12387/mbox/","series":[{"id":2055,"url":"https://patchwork.libcamera.org/api/1.1/series/2055/?format=json","web_url":"https://patchwork.libcamera.org/project/libcamera/list/?series=2055","date":"2021-05-24T11:56:38","name":"Fix SIGSEGV in ChromeOS camera3 test","version":1,"mbox":"https://patchwork.libcamera.org/series/2055/mbox/"}],"comments":"https://patchwork.libcamera.org/api/patches/12387/comments/","check":"pending","checks":"https://patchwork.libcamera.org/api/patches/12387/checks/","tags":{},"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 9F8B3C3201\n\tfor <parsemail@patchwork.libcamera.org>;\n\tMon, 24 May 2021 11:56:50 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 414A968921;\n\tMon, 24 May 2021 13:56:50 +0200 (CEST)","from mail-pl1-x62e.google.com (mail-pl1-x62e.google.com\n\t[IPv6:2607:f8b0:4864:20::62e])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 883DD602B0\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tMon, 24 May 2021 13:56:48 +0200 (CEST)","by mail-pl1-x62e.google.com with SMTP id t21so14524313plo.2\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tMon, 24 May 2021 04:56:48 -0700 (PDT)","from hiroh2.tok.corp.google.com\n\t([2401:fa00:8f:2:7208:465c:c4e:2dc3])\n\tby smtp.gmail.com with ESMTPSA id\n\tt19sm11149980pfg.70.2021.05.24.04.56.45\n\t(version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n\tMon, 24 May 2021 04:56:46 -0700 (PDT)"],"Authentication-Results":"lancelot.ideasonboard.com;\n\tdkim=fail reason=\"signature verification failed\" (1024-bit key;\n\tunprotected) header.d=chromium.org header.i=@chromium.org\n\theader.b=\"j5eVjBnC\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org;\n\ts=google; \n\th=from:to:cc:subject:date:message-id:in-reply-to:references\n\t:mime-version:content-transfer-encoding;\n\tbh=lXE2YWM6EqATPCpKWMrkx6hm6hxJy4BMvVLRSweXb9o=;\n\tb=j5eVjBnCQb14Cytpe/XgP/ZmoYymRWR1CUVMl95DijWhxHjoez+6gp6M1z6qcbEy2u\n\tXSydt+468EVB/CIkNqQjgpq38hi2OW1MxK+iS3Cx4ter4bkUmw4yoCZm85q1qz+pnj7S\n\tsYno2dPIowQUZHHBvhD6CO0YLlxdrxRqYS/2k=","X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20161025;\n\th=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to\n\t:references:mime-version:content-transfer-encoding;\n\tbh=lXE2YWM6EqATPCpKWMrkx6hm6hxJy4BMvVLRSweXb9o=;\n\tb=Xey0HrEaot4zHnuCjygPWuDVd8Q55gjFBYx2zQ5CVF3dqv0gmDVIXeSY5uNSB19Eo8\n\tOncE40+u8kk9xZ8BmsPoT+YRPlX6+V3stpIDeTcnnOq8MWAYu2fDzyRuaLhOEuuvH+Cl\n\tOdNFkEr0IU4k76ea/lzwr99lcOuUDLdMcFckeRHIJseHRIMNTD3agsm7SFVivoTRc8oU\n\teE2uuVbzCEPcyVOGlrCaSOtQYbrGUlb1CDdNElP/f3yC/RsWYzRjY9RgjqhJR8OkPYTE\n\tFBzAu3kHL1YnN6MhfZN9876Fromo0pLKbeRFSSAfoCkeohEMpl3RN+WwAdV3sQoGPgth\n\tLAvA==","X-Gm-Message-State":"AOAM530wRzlT3xbio3aCrHqDAisr60iHIyMc/bHTPWc2EFuwyYj1lQ9i\n\tZNv6eNXvCooKguyBjm7ODbd5i0FnLCk34w==","X-Google-Smtp-Source":"ABdhPJyVWqS/SKXQEo4ihXnWUHM5h65bP/4PhkGMsZTitf7bFSsWa+duaoQzwa4ik52Z+V12E7p4Iw==","X-Received":"by 2002:a17:90a:17a6:: with SMTP id\n\tq35mr24552485pja.118.1621857406933; \n\tMon, 24 May 2021 04:56:46 -0700 (PDT)","From":"Hirokazu Honda <hiroh@chromium.org>","To":"libcamera-devel@lists.libcamera.org","Date":"Mon, 24 May 2021 20:56:39 +0900","Message-Id":"<20210524115640.2334778-2-hiroh@chromium.org>","X-Mailer":"git-send-email 2.31.1.818.g46aad6cb9e-goog","In-Reply-To":"<20210524115640.2334778-1-hiroh@chromium.org>","References":"<20210524115640.2334778-1-hiroh@chromium.org>","MIME-Version":"1.0","Content-Transfer-Encoding":"8bit","Subject":"[libcamera-devel] [PATCH RFC 1/2] android: Move ChromeOS specific\n\tCamera HAL calls to camera3_hal.cpp","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>"},"content":"ChromeOS specific Camera HAL calls are in android/cros directory.\nMoves them to android/camera3_hal.cpp by enclosing them with\nOS_CHROMEOS macro.\n\nSigned-off-by: Hirokazu Honda <hiroh@chromium.org>\n\n---\nFound LOG macro conflict issues in libchrome and libcamera.\nSee the error message.  https://paste.debian.net/1198594/\nI ask for comments, while I hack the conflict by undefining LOG of\nlibcamera.\n---\n src/android/camera3_hal.cpp      | 27 +++++++++++++++++++++++++++\n src/android/cros/camera3_hal.cpp | 21 ---------------------\n src/android/cros/meson.build     | 17 -----------------\n src/android/meson.build          |  3 +--\n 4 files changed, 28 insertions(+), 40 deletions(-)\n delete mode 100644 src/android/cros/camera3_hal.cpp\n delete mode 100644 src/android/cros/meson.build\n\n--\n2.31.1.818.g46aad6cb9e-goog","diff":"diff --git a/src/android/camera3_hal.cpp b/src/android/camera3_hal.cpp\nindex 08773d33..f2d4799f 100644\n--- a/src/android/camera3_hal.cpp\n+++ b/src/android/camera3_hal.cpp\n@@ -5,6 +5,14 @@\n  * camera3_hal.cpp - Android Camera HALv3 module\n  */\n\n+#if defined(OS_CHROMEOS)\n+#include <cros-camera/cros_camera_hal.h>\n+/* HACK. LOG is defined in logging.h in chrome. It conflicts LOG macro in\n+ * libcamera.\n+ */\n+#undef LOG\n+#endif\n+\n #include <hardware/camera_common.h>\n\n #include \"libcamera/internal/log.h\"\n@@ -115,3 +123,22 @@ camera_module_t HAL_MODULE_INFO_SYM = {\n \t.init = hal_init,\n \t.reserved = {},\n };\n+\n+#if defined(OS_CHROMEOS)\n+/*------------------------------------------------------------------------------\n+ * ChromeOS specific Camera HAL callbacks\n+ */\n+\n+static void set_up(cros::CameraMojoChannelManagerToken *token)\n+{\n+}\n+\n+static void tear_down()\n+{\n+}\n+\n+cros::cros_camera_hal_t CROS_CAMERA_EXPORT CROS_CAMERA_HAL_INFO_SYM = {\n+\t.set_up = set_up,\n+\t.tear_down = tear_down\n+};\n+#endif\ndiff --git a/src/android/cros/camera3_hal.cpp b/src/android/cros/camera3_hal.cpp\ndeleted file mode 100644\nindex 31ad36ac..00000000\n--- a/src/android/cros/camera3_hal.cpp\n+++ /dev/null\n@@ -1,21 +0,0 @@\n-/* SPDX-License-Identifier: LGPL-2.1-or-later */\n-/*\n- * Copyright (C) 2021, Google Inc.\n- *\n- * camera3_hal.cpp - cros-specific components of Android Camera HALv3 module\n- */\n-\n-#include <cros-camera/cros_camera_hal.h>\n-\n-static void set_up(cros::CameraMojoChannelManagerToken *token)\n-{\n-}\n-\n-static void tear_down()\n-{\n-}\n-\n-cros::cros_camera_hal_t CROS_CAMERA_EXPORT CROS_CAMERA_HAL_INFO_SYM = {\n-\t.set_up = set_up,\n-\t.tear_down = tear_down\n-};\ndiff --git a/src/android/cros/meson.build b/src/android/cros/meson.build\ndeleted file mode 100644\nindex 4aab0f20..00000000\n--- a/src/android/cros/meson.build\n+++ /dev/null\n@@ -1,17 +0,0 @@\n-# SPDX-License-Identifier: CC0-1.0\n-\n-if get_option('android_platform') != 'cros'\n-   subdir_done()\n-endif\n-\n-cros_hal_info_sources = files([\n-    'camera3_hal.cpp',\n-])\n-\n-cros_hal_info = static_library('cros_hal_info',\n-                               cros_hal_info_sources,\n-                               dependencies : dependency('libcros_camera'),\n-                               c_args : '-Wno-shadow',\n-                               include_directories : android_includes)\n-\n-libcamera_objects += cros_hal_info.extract_objects('camera3_hal.cpp')\ndiff --git a/src/android/meson.build b/src/android/meson.build\nindex 2be20c97..84144f33 100644\n--- a/src/android/meson.build\n+++ b/src/android/meson.build\n@@ -37,10 +37,9 @@ android_deps += [libyuv_dep]\n\n if get_option('android_platform') == 'cros'\n    libcamera_cpp_args += [ '-DOS_CHROMEOS']\n+   android_deps += [dependency('libcros_camera')]\n endif\n\n-subdir('cros')\n-\n android_hal_sources = files([\n     'camera3_hal.cpp',\n     'camera_hal_manager.cpp',\n","prefixes":["libcamera-devel","RFC","1/2"]}