From patchwork Wed Feb 9 07:19:14 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hanlin Chen X-Patchwork-Id: 15350 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 8AB1AC3257 for ; Wed, 9 Feb 2022 07:19:42 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 3ED83610AD; Wed, 9 Feb 2022 08:19:42 +0100 (CET) Authentication-Results: lancelot.ideasonboard.com; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.b="JH8e250O"; dkim-atps=neutral Received: from mail-pj1-x102e.google.com (mail-pj1-x102e.google.com [IPv6:2607:f8b0:4864:20::102e]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id C52DA610AD for ; Wed, 9 Feb 2022 08:19:38 +0100 (CET) Received: by mail-pj1-x102e.google.com with SMTP id t4-20020a17090a510400b001b8c4a6cd5dso1388767pjh.5 for ; Tue, 08 Feb 2022 23:19:38 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=fa3mkD3ACoS+DPsjqPN52SMehX2h2X5YPUKVCZ/aGyc=; b=JH8e250OnhXTvoWjgNbqSCcFIJ81FBcZTEuC7FuVixpB6HjUX/GK3HqhCrYFdN7+/F DYdSFivv5hC4Xb0s+2MhFiGMbaySXc+o4bU/QssiVm/oNhdFuLQLgyf+HHXOzllcNAV4 2/ksbk0HC01Dj9dZTZZj2eN4LI61bvlXcHtEY= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=fa3mkD3ACoS+DPsjqPN52SMehX2h2X5YPUKVCZ/aGyc=; b=AvQ8BzAd9q/HPoV/04ghyMCRBtaxc6UXCl28s/S//BjLgZVKECcmDtMRx90RNxHCby DYImdFALmYQiQH04hbX7jA0QazNNJ5+PC7GoEOH///6g7iKpdRZiUaU2xC9cXUZ05G4C l5Wd0zf9mlA37V/ybreDW2Aa6wszTfw5Y4ufbcQRFwitnNIEcyr8cAP2XqKV0qOpKZCW nq8QCGuhSy9mQbdw6tCkRIy86/V4SPht5XxzioDCvN8vDq45m/qCoBmu5HGq+3glsGr3 G+h4p/zWyMsqAkfPTYGRfPk2Kv0ERJOr7OXJxNUV+P9PFHkg4XBgZd9fVgegZZbH4Ght HE7Q== X-Gm-Message-State: AOAM531ZArc5Gcjdya1Pmt92GuVYpifKRWmcxzjS5WLfyI8q/ePS1Vpp tdNkVuhWSzQA/S3bUUEJ28cHCXi8wcdo0g== X-Google-Smtp-Source: ABdhPJwwmcDov8KaFQyWQKI2s6BBDXEbwrgpf25RfRin8CF+3LWkvMQmYfGZWB7UezH/aKIUUVdaHQ== X-Received: by 2002:a17:902:760e:: with SMTP id k14mr923625pll.11.1644391176663; Tue, 08 Feb 2022 23:19:36 -0800 (PST) Received: from localhost ([2401:fa00:1:10:a5cf:9a43:1c6d:824]) by smtp.gmail.com with UTF8SMTPSA id h18sm18038960pfh.51.2022.02.08.23.19.35 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 08 Feb 2022 23:19:36 -0800 (PST) From: Han-Lin Chen To: libcamera-devel@lists.libcamera.org Date: Wed, 9 Feb 2022 15:19:14 +0800 Message-Id: <20220209071917.559993-7-hanlinchen@chromium.org> X-Mailer: git-send-email 2.35.0.263.gb82422642f-goog In-Reply-To: <20220209071917.559993-1-hanlinchen@chromium.org> References: <20220209071917.559993-1-hanlinchen@chromium.org> MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH 6/9] android: Set PipelineConfigFile option if it's supported by the camera 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" If the libcamera::Camera supports the PipelineConfigFile option and the HAL configuration file provides the path, set the option before opening the camera. Signed-off-by: Han-Lin Chen --- src/android/camera_device.cpp | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/src/android/camera_device.cpp b/src/android/camera_device.cpp index 83825736..61883a54 100644 --- a/src/android/camera_device.cpp +++ b/src/android/camera_device.cpp @@ -20,6 +20,7 @@ #include #include #include +#include #include #include @@ -293,6 +294,24 @@ std::unique_ptr CameraDevice::create(unsigned int id, */ int CameraDevice::initialize(const CameraConfigData *cameraConfigData) { + /* + * Initialize pipeline configuration file for the camera. + * + * If the libcamera::Camera supports the PipelineConfigFile option and + * the HAL configuration file provides the path, set the option before + * opening the camera. + */ + const ControlInfoMap optionInfo = camera_->options(); + + if (cameraConfigData && + cameraConfigData->pipelineConfigFile != "" && + optionInfo.count(&options::PipelineConfigFile)) { + ControlList options(optionInfo); + options.set(options::PipelineConfigFile, + cameraConfigData->pipelineConfigFile); + camera_->setOptions(&options); + } + /* * Initialize orientation and facing side of the camera. *