From patchwork Fri Aug 21 14:46:07 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Umang Jain X-Patchwork-Id: 9343 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 F1323BE174 for ; Fri, 21 Aug 2020 14:46:12 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 11D0762113; Fri, 21 Aug 2020 16:46:12 +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="RMgLOP+r"; 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 AB7E461B4F for ; Fri, 21 Aug 2020 16:46:08 +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=RMgLOP+rIFpv/x9RZEqLMXdGsefzs/5MNpiP3PeCa/k+buY55gk+g8VznbEfN8ld+nID ccTLArTrSH/n4fczOwtb/tpJSImouvMiX9KJwqjsc7Ck3b/yQnBtRjdZjt/RjAo9hN7OwX GoNl8+z6rWSOIj4totb6bsHOt2YxAMxm4= Received: by filterdrecv-p3iad2-86945d9569-wzrpx with SMTP id filterdrecv-p3iad2-86945d9569-wzrpx-18-5F3FDE2F-2C 2020-08-21 14:46:07.451894897 +0000 UTC m=+74583.034326788 Received: from mail.uajain.com (unknown) by ismtpd0008p1maa1.sendgrid.net (SG) with ESMTP id gGxWJ-QDRkmfi3o3ouVs8A Fri, 21 Aug 2020 14:46:06.680 +0000 (UTC) From: Umang Jain Date: Fri, 21 Aug 2020 14:46:07 +0000 (UTC) Message-Id: <20200821144601.67860-3-email@uajain.com> In-Reply-To: <20200821144601.67860-1-email@uajain.com> References: <20200821144601.67860-1-email@uajain.com> Mime-Version: 1.0 X-SG-EID: 1Q40EQ7YGir8a9gjSIAdTjhngY657NMk9ckeo4dbHZDiOpywc/L3L9rFqlwE4KPcj9TjcWbOI2k4lJ0fKJaeewpvHcUm93kY5HdydhkbnJ7nXQIpKLvE5/Gga7wednw3myD8ny9GkcvFk3HjjNVaIsMWBE20ZZlLWRS8XXSIqknyJZ8GcC6TN8bgThPjrKG3Vwq9q9qsiuTtYwCWhRNQgSsLz7M2H4yqCN5BRny1DeOhQTV/3+bgEJ113Brdtg+PsdANtduT+BZad5qKAhX9HQ== To: libcamera-devel@lists.libcamera.org Subject: [libcamera-devel] [PATCH v4 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_; };