From patchwork Wed Aug 5 15:14:43 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Umang Jain X-Patchwork-Id: 9224 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 64DBBBD86F for ; Wed, 5 Aug 2020 15:14:47 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id A0320605C8; Wed, 5 Aug 2020 17:14:46 +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="A3GSacnY"; 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 EA0B060392 for ; Wed, 5 Aug 2020 17:14:44 +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-transfer-encoding:content-type; s=s1; bh=VhMV+U4GddRuc6p3Gs2zRH6oPbOEximacaN90MzUup0=; b=A3GSacnYuW2LAAGaBry4Cc3fla4txoDoTGayaESj9ZX1UBsjZXu07uej743mO6RRRqmn s+xjAF5k+8iBKuxs8NsjBzTJZvjWyPOohNCmUEIngW8UYdjbbcptAsD9DWSnBnDFVn/0Gs /Tic5vEpy4BNZO14CiAdGBAWWFR0O+M6M= Received: by filterdrecv-p3mdw1-7ff865655c-v2mn4 with SMTP id filterdrecv-p3mdw1-7ff865655c-v2mn4-20-5F2ACCE3-53 2020-08-05 15:14:43.355425338 +0000 UTC m=+593902.314865933 Received: from mail.uajain.com (unknown) by ismtpd0004p1hnd1.sendgrid.net (SG) with ESMTP id HIWX1sRURUuFpQHMgSJtKw for ; Wed, 05 Aug 2020 15:14:43.055 +0000 (UTC) From: Umang Jain Date: Wed, 05 Aug 2020 15:14:43 +0000 (UTC) Message-Id: <20200805151437.157155-2-email@uajain.com> In-Reply-To: <20200805151437.157155-1-email@uajain.com> References: <20200805151437.157155-1-email@uajain.com> Mime-Version: 1.0 X-SG-EID: 1Q40EQ7YGir8a9gjSIAdTjhngY657NMk9ckeo4dbHZDiOpywc/L3L9rFqlwE4KPcBLpXFhl3+P87RHKL8hWvbDKSmLgbXwLsI2/vRybnYQhtpZ/KUcQqhLGSjdYkhGTZFAAYeIqDmlyA4qRwSulFlKtMrf0POxZpGW6s5Bm2XdszttcJN802lE6RKdRe3svBqeLFh3ro1fLi/wQaSeK7Nax5kB+ZQ1806hVwrCmPAiy/PGrb/9PlkkqHjtLCJxcabapGcXrXLaANkIxVyOke5w== To: libcamera-devel@lists.libcamera.org Subject: [libcamera-devel] [PATCH 1/2] 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 --- src/android/camera3_hal.cpp | 2 +- src/android/camera_hal_manager.cpp | 7 +++++++ src/android/camera_hal_manager.h | 3 +++ 3 files changed, 11 insertions(+), 1 deletion(-) diff --git a/src/android/camera3_hal.cpp b/src/android/camera3_hal.cpp index 716e36c..47c1aa9 100644 --- a/src/android/camera3_hal.cpp +++ b/src/android/camera3_hal.cpp @@ -34,7 +34,7 @@ static int hal_get_camera_info(int id, struct camera_info *info) static int hal_set_callbacks(const camera_module_callbacks_t *callbacks) { - return 0; + return cameraManager.setCallbacks(callbacks); } static int hal_open_legacy(const struct hw_module_t *module, const char *id, diff --git a/src/android/camera_hal_manager.cpp b/src/android/camera_hal_manager.cpp index 02b6418..3ddcab5 100644 --- a/src/android/camera_hal_manager.cpp +++ b/src/android/camera_hal_manager.cpp @@ -120,3 +120,10 @@ int CameraHalManager::getCameraInfo(unsigned int id, struct camera_info *info) return 0; } + +int CameraHalManager::setCallbacks(const camera_module_callbacks_t *callbacks) +{ + callbacks_ = callbacks; + + return 0; +} diff --git a/src/android/camera_hal_manager.h b/src/android/camera_hal_manager.h index 0619037..4345b1e 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); + int setCallbacks(const camera_module_callbacks_t *callbacks); private: libcamera::CameraManager *cameraManager_; + const camera_module_callbacks_t *callbacks_; std::vector> cameras_; };