[{"id":11895,"web_url":"https://patchwork.libcamera.org/comment/11895/","msgid":"<20200805165855.GL6751@pendragon.ideasonboard.com>","date":"2020-08-05T16:58:55","subject":"Re: [libcamera-devel] [PATCH 1/2] android: camera_hal_manager: Set\n\tcamera module callbacks","submitter":{"id":2,"url":"https://patchwork.libcamera.org/api/people/2/","name":"Laurent Pinchart","email":"laurent.pinchart@ideasonboard.com"},"content":"Hi Umang,\n\nThank you for the patch.\n\nOn Wed, Aug 05, 2020 at 03:14:43PM +0000, Umang Jain wrote:\n> camera_module_callbacks are invoked to inform the framework about\n> the events occuring module-wide. Allow to set these callbacks in\n> camera_hal_manager as this will be used to integration camera hotplug\n> support via camera_module_callbacks::camera_device_status_change in\n> subsequent commit.\n> \n> Signed-off-by: Umang Jain <email@uajain.com>\n> ---\n>  src/android/camera3_hal.cpp        | 2 +-\n>  src/android/camera_hal_manager.cpp | 7 +++++++\n>  src/android/camera_hal_manager.h   | 3 +++\n>  3 files changed, 11 insertions(+), 1 deletion(-)\n> \n> diff --git a/src/android/camera3_hal.cpp b/src/android/camera3_hal.cpp\n> index 716e36c..47c1aa9 100644\n> --- a/src/android/camera3_hal.cpp\n> +++ b/src/android/camera3_hal.cpp\n> @@ -34,7 +34,7 @@ static int hal_get_camera_info(int id, struct camera_info *info)\n>  \n>  static int hal_set_callbacks(const camera_module_callbacks_t *callbacks)\n>  {\n> -\treturn 0;\n> +\treturn cameraManager.setCallbacks(callbacks);\n>  }\n>  \n>  static int hal_open_legacy(const struct hw_module_t *module, const char *id,\n> diff --git a/src/android/camera_hal_manager.cpp b/src/android/camera_hal_manager.cpp\n> index 02b6418..3ddcab5 100644\n> --- a/src/android/camera_hal_manager.cpp\n> +++ b/src/android/camera_hal_manager.cpp\n> @@ -120,3 +120,10 @@ int CameraHalManager::getCameraInfo(unsigned int id, struct camera_info *info)\n>  \n>  \treturn 0;\n>  }\n> +\n> +int CameraHalManager::setCallbacks(const camera_module_callbacks_t *callbacks)\n> +{\n> +\tcallbacks_ = callbacks;\n> +\n> +\treturn 0;\n\nAs this can't fail, I'd make it a void function.\n\nReviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n\n> +}\n> diff --git a/src/android/camera_hal_manager.h b/src/android/camera_hal_manager.h\n> index 0619037..4345b1e 100644\n> --- a/src/android/camera_hal_manager.h\n> +++ b/src/android/camera_hal_manager.h\n> @@ -10,6 +10,7 @@\n>  #include <stddef.h>\n>  #include <vector>\n>  \n> +#include <hardware/camera_common.h>\n>  #include <hardware/hardware.h>\n>  #include <system/camera_metadata.h>\n>  \n> @@ -29,10 +30,12 @@ public:\n>  \n>  \tunsigned int numCameras() const;\n>  \tint getCameraInfo(unsigned int id, struct camera_info *info);\n> +\tint setCallbacks(const camera_module_callbacks_t *callbacks);\n>  \n>  private:\n>  \tlibcamera::CameraManager *cameraManager_;\n>  \n> +\tconst camera_module_callbacks_t *callbacks_;\n>  \tstd::vector<std::unique_ptr<CameraDevice>> cameras_;\n>  };\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 80D57BD86F\n\tfor <parsemail@patchwork.libcamera.org>;\n\tWed,  5 Aug 2020 16:59:09 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 09583605C0;\n\tWed,  5 Aug 2020 18:59:09 +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 8A06760599\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tWed,  5 Aug 2020 18:59:07 +0200 (CEST)","from pendragon.ideasonboard.com (81-175-216-236.bb.dnainternet.fi\n\t[81.175.216.236])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id EE42E2C0;\n\tWed,  5 Aug 2020 18:59:06 +0200 (CEST)"],"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=\"LII/nBNE\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1596646747;\n\tbh=iyYqTAxgboBh5yQ+87x9EksY+YmyDMwIRD2RP1EQgck=;\n\th=Date:From:To:Cc:Subject:References:In-Reply-To:From;\n\tb=LII/nBNEQ3i90A0g6mMZy+JaVMHQDeMjf+epAjkiI2DiDLHJYCV+KINlyypgZvacR\n\tq1mNvFgTbsS4suzaNO0wdhwk5+RJTvptQ72UeX14j6kgHI2NlnNVRZmIVpTsMtGiDN\n\t/ImQzmZ6cjQwhAqB81RBBPQ7TjGmqSoRU96s+apk=","Date":"Wed, 5 Aug 2020 19:58:55 +0300","From":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>","To":"Umang Jain <email@uajain.com>","Message-ID":"<20200805165855.GL6751@pendragon.ideasonboard.com>","References":"<20200805151437.157155-1-email@uajain.com>\n\t<20200805151437.157155-2-email@uajain.com>","MIME-Version":"1.0","Content-Disposition":"inline","In-Reply-To":"<20200805151437.157155-2-email@uajain.com>","Subject":"Re: [libcamera-devel] [PATCH 1/2] android: camera_hal_manager: Set\n\tcamera module callbacks","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>","Cc":"libcamera-devel@lists.libcamera.org","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>"}},{"id":11899,"web_url":"https://patchwork.libcamera.org/comment/11899/","msgid":"<20200805212529.GH2712616@oden.dyn.berto.se>","date":"2020-08-05T21:25:29","subject":"Re: [libcamera-devel] [PATCH 1/2] android: camera_hal_manager: Set\n\tcamera module callbacks","submitter":{"id":5,"url":"https://patchwork.libcamera.org/api/people/5/","name":"Niklas Söderlund","email":"niklas.soderlund@ragnatech.se"},"content":"Hi Umang,\n\nThanks for your work.\n\nOn 2020-08-05 15:14:43 +0000, Umang Jain wrote:\n> camera_module_callbacks are invoked to inform the framework about\n> the events occuring module-wide. Allow to set these callbacks in\n> camera_hal_manager as this will be used to integration camera hotplug\n> support via camera_module_callbacks::camera_device_status_change in\n> subsequent commit.\n> \n> Signed-off-by: Umang Jain <email@uajain.com>\n\nWith the comment pointed out by Laurent fixed,\n\nReviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>\n\n> ---\n>  src/android/camera3_hal.cpp        | 2 +-\n>  src/android/camera_hal_manager.cpp | 7 +++++++\n>  src/android/camera_hal_manager.h   | 3 +++\n>  3 files changed, 11 insertions(+), 1 deletion(-)\n> \n> diff --git a/src/android/camera3_hal.cpp b/src/android/camera3_hal.cpp\n> index 716e36c..47c1aa9 100644\n> --- a/src/android/camera3_hal.cpp\n> +++ b/src/android/camera3_hal.cpp\n> @@ -34,7 +34,7 @@ static int hal_get_camera_info(int id, struct camera_info *info)\n>  \n>  static int hal_set_callbacks(const camera_module_callbacks_t *callbacks)\n>  {\n> -\treturn 0;\n> +\treturn cameraManager.setCallbacks(callbacks);\n>  }\n>  \n>  static int hal_open_legacy(const struct hw_module_t *module, const char *id,\n> diff --git a/src/android/camera_hal_manager.cpp b/src/android/camera_hal_manager.cpp\n> index 02b6418..3ddcab5 100644\n> --- a/src/android/camera_hal_manager.cpp\n> +++ b/src/android/camera_hal_manager.cpp\n> @@ -120,3 +120,10 @@ int CameraHalManager::getCameraInfo(unsigned int id, struct camera_info *info)\n>  \n>  \treturn 0;\n>  }\n> +\n> +int CameraHalManager::setCallbacks(const camera_module_callbacks_t *callbacks)\n> +{\n> +\tcallbacks_ = callbacks;\n> +\n> +\treturn 0;\n> +}\n> diff --git a/src/android/camera_hal_manager.h b/src/android/camera_hal_manager.h\n> index 0619037..4345b1e 100644\n> --- a/src/android/camera_hal_manager.h\n> +++ b/src/android/camera_hal_manager.h\n> @@ -10,6 +10,7 @@\n>  #include <stddef.h>\n>  #include <vector>\n>  \n> +#include <hardware/camera_common.h>\n>  #include <hardware/hardware.h>\n>  #include <system/camera_metadata.h>\n>  \n> @@ -29,10 +30,12 @@ public:\n>  \n>  \tunsigned int numCameras() const;\n>  \tint getCameraInfo(unsigned int id, struct camera_info *info);\n> +\tint setCallbacks(const camera_module_callbacks_t *callbacks);\n>  \n>  private:\n>  \tlibcamera::CameraManager *cameraManager_;\n>  \n> +\tconst camera_module_callbacks_t *callbacks_;\n>  \tstd::vector<std::unique_ptr<CameraDevice>> cameras_;\n>  };\n>  \n> -- \n> 2.26.2\n> \n> _______________________________________________\n> libcamera-devel mailing list\n> libcamera-devel@lists.libcamera.org\n> https://lists.libcamera.org/listinfo/libcamera-devel","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 3A2AEBD86F\n\tfor <parsemail@patchwork.libcamera.org>;\n\tWed,  5 Aug 2020 21:25:33 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 95D866071B;\n\tWed,  5 Aug 2020 23:25:32 +0200 (CEST)","from mail-lj1-x242.google.com (mail-lj1-x242.google.com\n\t[IPv6:2a00:1450:4864:20::242])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id BB17E6039D\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tWed,  5 Aug 2020 23:25:31 +0200 (CEST)","by mail-lj1-x242.google.com with SMTP id v4so39682225ljd.0\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tWed, 05 Aug 2020 14:25:31 -0700 (PDT)","from localhost (h-209-203.A463.priv.bahnhof.se. [155.4.209.203])\n\tby smtp.gmail.com with ESMTPSA id\n\tc23sm1629213lfm.83.2020.08.05.14.25.30\n\t(version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n\tWed, 05 Aug 2020 14:25:30 -0700 (PDT)"],"Authentication-Results":"lancelot.ideasonboard.com;\n\tdkim=fail reason=\"signature verification failed\" (2048-bit key;\n\tunprotected) header.d=ragnatech-se.20150623.gappssmtp.com\n\theader.i=@ragnatech-se.20150623.gappssmtp.com\n\theader.b=\"r0x1iRsV\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=ragnatech-se.20150623.gappssmtp.com; s=20150623;\n\th=date:from:to:cc:subject:message-id:references:mime-version\n\t:content-disposition:content-transfer-encoding:in-reply-to;\n\tbh=fDNMwObuHEPWjVfNXwXOr0knSk194WAXGxMah/pbWZw=;\n\tb=r0x1iRsVxGKCOgxNFWurmnx8Wg4JR60Ek/OsNzFGmTUHtjMjFulDJtfNVeTKdV9G8k\n\tx2kWm/xjvyKTeDm9p0xT7jeRI4s2LiCU6NSyg1jSwybkS7HE++FEE2CNPUt2ZIw2vNJv\n\tdxlTfiAoH5vBrdrClyaChhUyOrYSQh7etSZa8k0SgKYyjh/gkX21MDMduSDDqT3oXCZh\n\tr8OTQRIo06oeqU5RxUdlR9ZA7IJEvSnGNRBv/ncgZ0/K7wwK6n1hwIwc7BjgW4d732ch\n\tROIAxAeBdt70iTUJueMUKPDeWgNSRT2Oml1X00PLJniwCJ5JiCKSxY6neMhngBAGKOR+\n\tOw0g==","X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20161025;\n\th=x-gm-message-state:date:from:to:cc:subject:message-id:references\n\t:mime-version:content-disposition:content-transfer-encoding\n\t:in-reply-to;\n\tbh=fDNMwObuHEPWjVfNXwXOr0knSk194WAXGxMah/pbWZw=;\n\tb=uXosxXaR7j8i1+4algR9ZpZLNKZ8JHZMWkoOyaEIqF0WfBOHiBOGFUHpIDhJPqsIUJ\n\tVjICsP3yVi8WQ6sPeM6RrrnlarYKTT15yF9ka6JrzzVsTDuxPum2eN1/GQyZbjkZpRiI\n\tCjZBLp6RQTl/KuipVjoItZOnjTeiZ20wa8Df3fem4TdAlvmA9QiwysirX/DLsd0DG9ba\n\tVuOMwEEZaA0iYKbMBYb4fQrwIjUXxHwio8Y1ZmhrGdVft+C0gSl4eyS5Kqz3ieI/mZ/j\n\tGqFTF6TWfYm2f/Nnx17wB/StdMqqwGDF1ghH+GO+ZLP2tBtnC1qb1KPEDGPKGs1ahXid\n\tfoug==","X-Gm-Message-State":"AOAM531oB1uP5OTMYuERFsE7dufUG3YUe7Jrylq1Fu2pqeIdskpnvVhi\n\tFtyjxeyNGR7rugdlZEUaciwunMbSb4Q=","X-Google-Smtp-Source":"ABdhPJwLEt+SJ0YwlzwOZI0KYRiX7X/11oqd0qusUWJHJ9kIVwZloqBLolIxf4htu+18my75zYfd9A==","X-Received":"by 2002:a2e:82c4:: with SMTP id n4mr2241223ljh.105.1596662731055;\n\tWed, 05 Aug 2020 14:25:31 -0700 (PDT)","Date":"Wed, 5 Aug 2020 23:25:29 +0200","From":"Niklas =?iso-8859-1?q?S=F6derlund?= <niklas.soderlund@ragnatech.se>","To":"Umang Jain <email@uajain.com>","Message-ID":"<20200805212529.GH2712616@oden.dyn.berto.se>","References":"<20200805151437.157155-1-email@uajain.com>\n\t<20200805151437.157155-2-email@uajain.com>","MIME-Version":"1.0","Content-Disposition":"inline","In-Reply-To":"<20200805151437.157155-2-email@uajain.com>","Subject":"Re: [libcamera-devel] [PATCH 1/2] android: camera_hal_manager: Set\n\tcamera module callbacks","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>","Cc":"libcamera-devel@lists.libcamera.org","Content-Type":"text/plain; charset=\"iso-8859-1\"","Content-Transfer-Encoding":"quoted-printable","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}}]