From patchwork Mon Aug 10 12:04:13 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Umang Jain X-Patchwork-Id: 9275 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 50088BD87D for ; Mon, 10 Aug 2020 12:04:19 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 02C0D60F27; Mon, 10 Aug 2020 14:04:19 +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="im6wGym6"; 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 E7CC06038C for ; Mon, 10 Aug 2020 14:04:15 +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=NpzXUTaK7DGo35/Hk0V3wovwomh9y0Hw9oJ5sPFR660=; b=im6wGym6pkcy0YLk7fWjOfo+3YfCzrET2rid8xC7B8oy1FH8PpmZ7N4inLGFwVoSBT9s ofYHUyDvvhmf/z4KdePrLTlkN6i0M6syKfnWgE5y2ZG3ng8gD8ZJ55WCJFGbPfUDwsOyqa XE4ADoYYLxVjM2YEfGJUEpglUlCIyk4Rs= Received: by filterdrecv-p3las1-559bd7b968-wk85c with SMTP id filterdrecv-p3las1-559bd7b968-wk85c-19-5F3137BD-D8 2020-08-10 12:04:13.788531266 +0000 UTC m=+1014484.522177987 Received: from mail.uajain.com (unknown) by ismtpd0003p1hnd1.sendgrid.net (SG) with ESMTP id vnrY0zDPRNaRyHvfEjTAKg Mon, 10 Aug 2020 12:04:13.351 +0000 (UTC) From: Umang Jain Date: Mon, 10 Aug 2020 12:04:13 +0000 (UTC) Message-Id: <20200810120406.52654-3-email@uajain.com> In-Reply-To: <20200810120406.52654-1-email@uajain.com> References: <20200810120406.52654-1-email@uajain.com> Mime-Version: 1.0 X-SG-EID: 1Q40EQ7YGir8a9gjSIAdTjhngY657NMk9ckeo4dbHZDiOpywc/L3L9rFqlwE4KPcHFp8snzxo7RIC2IEYmqCh8eqmJwZ8TxXIULxuhbQ1Ep4YxhY1UUk5omtrK3PtBKbCuwDMxAmoDMyp1emDzQ3rSnQfYiu1Y058YyCiizyxQl5fXJK3uUva2/sG7VcvDReqWxBlFQ8hHAP58YKPWAPS9rks5Op8X+ifSkULbKozyL4kt69E1+RQ/I8cJt2asAjzptii+7JfH94ZjNAQV3uug== To: libcamera-devel@lists.libcamera.org Subject: [libcamera-devel] [PATCH v2 2/4] 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 occuring 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_; };