{"id":11378,"url":"https://patchwork.libcamera.org/api/patches/11378/?format=json","web_url":"https://patchwork.libcamera.org/patch/11378/","project":{"id":1,"url":"https://patchwork.libcamera.org/api/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":"<20210225104217.108792-4-paul.elder@ideasonboard.com>","date":"2021-02-25T10:42:17","name":"[libcamera-devel,3/3] cros: Support the new cros camera API with set_up and tear_down","commit_ref":null,"pull_url":null,"state":"superseded","archived":false,"hash":"1518873ffb62da7d22d339990152c9db835b65bc","submitter":{"id":17,"url":"https://patchwork.libcamera.org/api/people/17/?format=json","name":"Paul Elder","email":"paul.elder@ideasonboard.com"},"delegate":null,"mbox":"https://patchwork.libcamera.org/patch/11378/mbox/","series":[{"id":1726,"url":"https://patchwork.libcamera.org/api/series/1726/?format=json","web_url":"https://patchwork.libcamera.org/project/libcamera/list/?series=1726","date":"2021-02-25T10:42:14","name":"Support the new cros camera API","version":1,"mbox":"https://patchwork.libcamera.org/series/1726/mbox/"}],"comments":"https://patchwork.libcamera.org/api/patches/11378/comments/","check":"pending","checks":"https://patchwork.libcamera.org/api/patches/11378/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 B1AF0BD1F1\n\tfor <parsemail@patchwork.libcamera.org>;\n\tThu, 25 Feb 2021 10:42:34 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 7FA6B68A51;\n\tThu, 25 Feb 2021 11:42:34 +0100 (CET)","from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id E186A68A3F\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tThu, 25 Feb 2021 11:42:32 +0100 (CET)","from pyrite.rasen.tech (unknown\n\t[IPv6:2400:4051:61:600:2c71:1b79:d06d:5032])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id F2BF058E;\n\tThu, 25 Feb 2021 11:42:30 +0100 (CET)"],"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=\"VxODHMTv\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1614249752;\n\tbh=ERxrHaqfzX4hVm/VZIEgRUDP3yD7A3bongyaX2Khpd8=;\n\th=From:To:Cc:Subject:Date:In-Reply-To:References:From;\n\tb=VxODHMTvHwdiTgHqjeswf5eN1062Q2d7o6ZXGTdhIyoxlW8EhBcVl52l6RUJ3UsrE\n\tli7sxsdGGdNdFP56CU+AlmZgD8O4c9mABvUFOtfPaL0KKYELFbjYhAy4q0Mugqf8HI\n\taU9FJmIJqR4fP+j3GCf9BaN3qHNEamT1gof2L134=","From":"Paul Elder <paul.elder@ideasonboard.com>","To":"libcamera-devel@lists.libcamera.org","Date":"Thu, 25 Feb 2021 19:42:17 +0900","Message-Id":"<20210225104217.108792-4-paul.elder@ideasonboard.com>","X-Mailer":"git-send-email 2.27.0","In-Reply-To":"<20210225104217.108792-1-paul.elder@ideasonboard.com>","References":"<20210225104217.108792-1-paul.elder@ideasonboard.com>","MIME-Version":"1.0","Subject":"[libcamera-devel] [PATCH 3/3] cros: Support the new cros camera API\n\twith set_up and tear_down","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":"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>"},"content":"Implement and expose the symbol and functions that the new cros camera\nAPI requires. Since we don't actually need them, leave them empty.\n\nSigned-off-by: Paul Elder <paul.elder@ideasonboard.com>\n---\n src/cros/camera3_hal.cpp  | 21 +++++++++++++++++++++\n src/cros/meson.build      | 16 ++++++++++++++++\n src/libcamera/meson.build |  6 ++++++\n src/meson.build           |  4 ++++\n 4 files changed, 47 insertions(+)\n create mode 100644 src/cros/camera3_hal.cpp\n create mode 100644 src/cros/meson.build","diff":"diff --git a/src/cros/camera3_hal.cpp b/src/cros/camera3_hal.cpp\nnew file mode 100644\nindex 00000000..31ad36ac\n--- /dev/null\n+++ b/src/cros/camera3_hal.cpp\n@@ -0,0 +1,21 @@\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/cros/meson.build b/src/cros/meson.build\nnew file mode 100644\nindex 00000000..31aa58c9\n--- /dev/null\n+++ b/src/cros/meson.build\n@@ -0,0 +1,16 @@\n+# SPDX-License-Identifier: CC0-1.0\n+\n+cros_hal_include_dir = '/mnt/host/source/src/aosp/external/libchrome'\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+                               c_args : '-Wno-shadow',\n+                               include_directories : [cros_includes,\n+                                                      cros_hal_include_dir,\n+                                                      android_includes])\n+\n+cros_hal_info_obj = cros_hal_info.extract_objects('camera3_hal.cpp')\ndiff --git a/src/libcamera/meson.build b/src/libcamera/meson.build\nindex 4b5e33ce..c40eb41f 100644\n--- a/src/libcamera/meson.build\n+++ b/src/libcamera/meson.build\n@@ -139,6 +139,11 @@ if android_enabled\n     libcamera_deps += android_deps\n endif\n \n+libcamera_objects = []\n+if cros_enabled\n+    libcamera_objects += cros_hal_info_obj\n+endif\n+\n # We add '/' to the build_rpath as a 'safe' path to act as a boolean flag.\n # The build_rpath is stripped at install time by meson, so we determine at\n # runtime if the library is running from an installed location by checking\n@@ -149,6 +154,7 @@ libcamera = shared_library('camera',\n                            install : true,\n                            link_with : libcamera_link_with,\n                            include_directories : includes,\n+                           objects : libcamera_objects,\n                            build_rpath : '/',\n                            dependencies : libcamera_deps)\n \ndiff --git a/src/meson.build b/src/meson.build\nindex 0b26ca70..ec85cc47 100644\n--- a/src/meson.build\n+++ b/src/meson.build\n@@ -15,6 +15,10 @@ endif\n # are included directly into the libcamera library when this is enabled.\n subdir('android')\n \n+if cros_enabled\n+    subdir('cros')\n+endif\n+\n subdir('libcamera')\n subdir('ipa')\n \n","prefixes":["libcamera-devel","3/3"]}