From patchwork Mon Aug 17 20:26:38 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Umang Jain X-Patchwork-Id: 9334 Return-Path: X-Original-To: parsemail@patchwork.libcamera.org Delivered-To: parsemail@patchwork.libcamera.org Received: from lancelot.ideasonboard.com (lancelot.ideasonboard.com [92.243.16.209]) by patchwork.libcamera.org (Postfix) with ESMTPS id 555B7BD87C for ; Mon, 17 Aug 2020 20:26:45 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 1D5B161992; Mon, 17 Aug 2020 22:26:45 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=uajain.com header.i=@uajain.com header.b="LMIYMhzi"; dkim-atps=neutral Received: from o1.f.az.sendgrid.net (o1.f.az.sendgrid.net [208.117.55.132]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id F1244616B1 for ; Mon, 17 Aug 2020 22:26:40 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=uajain.com; h=from:subject:in-reply-to:references:mime-version:to:cc:content-type: content-transfer-encoding; s=s1; bh=WlyI45ayfL5lw/SJQXCZOK/kp6kF5E1uzpkjn96L88U=; b=LMIYMhziUC8Rxfqbn/sR4rSHQA8/ldEiqdCnXLW0dokXYpstnn3yCPlDlQ8Omy3T1PUA v6CaV0Ch2SNCsY+qZPWNJIlM/0chQvDmOh8R6Kv1AlVX8yDdTn6kXiqPTk+Deiu+O0VnkU mBTmCuBzb75A8haOZBExmLADA/DjRy0vg= Received: by filterdrecv-p3las1-5785d94c6b-nwwmr with SMTP id filterdrecv-p3las1-5785d94c6b-nwwmr-20-5F3AE7FD-59 2020-08-17 20:26:38.073478137 +0000 UTC m=+359831.740488720 Received: from mail.uajain.com (unknown) by ismtpd0004p1maa1.sendgrid.net (SG) with ESMTP id LtHSEsxLQ92TgN7RevA2LQ Mon, 17 Aug 2020 20:26:37.250 +0000 (UTC) From: Umang Jain Date: Mon, 17 Aug 2020 20:26:38 +0000 (UTC) Message-Id: <20200817202629.4277-3-email@uajain.com> In-Reply-To: <20200817202629.4277-1-email@uajain.com> References: <20200817202629.4277-1-email@uajain.com> Mime-Version: 1.0 X-SG-EID: 1Q40EQ7YGir8a9gjSIAdTjhngY657NMk9ckeo4dbHZDiOpywc/L3L9rFqlwE4KPcQ/i1ji5k4eTSSnQ1oTeZ4t6d2b9GmSo6yY9OJZQOVguTKvxACBn5rSs0UFG7sXgVj0oQCsUpQifx+/Ee/ukgGyAFfPq2xqRvPP4uVzgvxHmTaWoAwN76VrZIV9PcSkSZpjYSMW2wZwRTsWj6xGJCnW1WVvcRMC+0OnsSCaHuVe4XtMk2gIJAd2xwEim/85nDI3LhGorlyWcelSQcizuwUw== To: libcamera-devel@lists.libcamera.org Subject: [libcamera-devel] [PATCH v3 2/5] android: camera_hal_manager: Set camera module callbacks X-BeenThere: libcamera-devel@lists.libcamera.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libcamera-devel-bounces@lists.libcamera.org Sender: "libcamera-devel" camera_module_callbacks are invoked to inform the framework about the events occurring module-wide. Allow to set these callbacks in camera_hal_manager as this will be used to integration camera hotplug support via camera_module_callbacks::camera_device_status_change in subsequent commit. Signed-off-by: Umang Jain Reviewed-by: Laurent Pinchart Reviewed-by: Niklas Söderlund Reviewed-by: Kieran Bingham --- src/android/camera3_hal.cpp | 2 ++ src/android/camera_hal_manager.cpp | 5 +++++ src/android/camera_hal_manager.h | 3 +++ 3 files changed, 10 insertions(+) diff --git a/src/android/camera3_hal.cpp b/src/android/camera3_hal.cpp index 716e36c..c2cba29 100644 --- a/src/android/camera3_hal.cpp +++ b/src/android/camera3_hal.cpp @@ -34,6 +34,8 @@ static int hal_get_camera_info(int id, struct camera_info *info) static int hal_set_callbacks(const camera_module_callbacks_t *callbacks) { + cameraManager.setCallbacks(callbacks); + return 0; } diff --git a/src/android/camera_hal_manager.cpp b/src/android/camera_hal_manager.cpp index 02b6418..3d6d2b4 100644 --- a/src/android/camera_hal_manager.cpp +++ b/src/android/camera_hal_manager.cpp @@ -120,3 +120,8 @@ int CameraHalManager::getCameraInfo(unsigned int id, struct camera_info *info) return 0; } + +void CameraHalManager::setCallbacks(const camera_module_callbacks_t *callbacks) +{ + callbacks_ = callbacks; +} diff --git a/src/android/camera_hal_manager.h b/src/android/camera_hal_manager.h index 0619037..a582f04 100644 --- a/src/android/camera_hal_manager.h +++ b/src/android/camera_hal_manager.h @@ -10,6 +10,7 @@ #include #include +#include #include #include @@ -29,10 +30,12 @@ public: unsigned int numCameras() const; int getCameraInfo(unsigned int id, struct camera_info *info); + void setCallbacks(const camera_module_callbacks_t *callbacks); private: libcamera::CameraManager *cameraManager_; + const camera_module_callbacks_t *callbacks_; std::vector> cameras_; };