From patchwork Tue May 2 17:58:43 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Barnab=C3=A1s_P=C5=91cze?= X-Patchwork-Id: 18583 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 EBAF2C0DA4 for ; Tue, 2 May 2023 17:59:00 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 4C874633B4; Tue, 2 May 2023 19:59:00 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org; s=mail; t=1683050340; bh=emx8ytQaQhm3VZdMFuOPKEDkS5gZQ2TmDHMJBIJYNAk=; h=Date:To:Subject:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:From; b=A8gP481PEyZ8pTVd7ICRgoeDtM7s5RdYhLd/68mjcBLs1HbbfzjupRi+DFBdN5Ib4 /WaZoxsqzY81Jt06Uim6Hrbx7PtgW3CrKTGVlpj4sjcr7kbgh/K/Ru5xYR4Rc02SPb VCzUfhDDNlJ8MZBnpg1NJFfV27XbsISSIBdR51BhcDYB5KV8zPq5v2HkBGm3L6wBg0 Xyf5ngRne9XadRAlvmSpRx5/kpY2mFB6DZ5HMxO8LJN9pVNjhWx4b/cISApDHm2VWc bKv3NXab/BH6Swqo6tWO5INmn0BzH8W3GsJNJE7LmVTUHzw2HYKXN5lLoBJF+nm7Ik pLwFgUwcgsavg== Received: from mail-4322.protonmail.ch (mail-4322.protonmail.ch [185.70.43.22]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 7A17160538 for ; Tue, 2 May 2023 19:58:59 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (2048-bit key; unprotected) header.d=protonmail.com header.i=@protonmail.com header.b="rT4fY2Vs"; dkim-atps=neutral Date: Tue, 02 May 2023 17:58:43 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=protonmail.com; s=protonmail3; t=1683050339; x=1683309539; bh=emx8ytQaQhm3VZdMFuOPKEDkS5gZQ2TmDHMJBIJYNAk=; h=Date:To:From:Subject:Message-ID:Feedback-ID:From:To:Cc:Date: Subject:Reply-To:Feedback-ID:Message-ID:BIMI-Selector; b=rT4fY2Vs6tMxoVaiKdTa/eNgtAlY1UatJMWz1rc73/0ns7Qyq7aolScRPdqi32kgv uLobvNphiyfFEGpU8i92HwApLGNWM7+R9X+BGCBjEhcZgi01+dlT/59Mh31HqANnUd AO164hjfdVY+VEoIu5Kemxo/rrTY0m8R64phAcZg5c0utVt8UuwwdF30RvvAKhXzxP tk2opXLDxBL9u06ABEXfHV134lcJqW5yQWIaaWRVEhrnskylG6/k1I0mLFuyeze70o C0V2VS3SWyefulJRemi/2ftJO43sbp1ECtFpXeU6f8r3QW7z4hN24euxISHNOY/xHH O3REvuK3mQXFw== To: libcamera-devel@lists.libcamera.org Message-ID: <20230502175842.70629-1-pobrn@protonmail.com> Feedback-ID: 20568564:user:proton MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH v1] gstreamer: Simplify camera config generation call 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: , X-Patchwork-Original-From: =?utf-8?q?Barnab=C3=A1s_P=C5=91cze_via_libcamera-devel?= From: =?utf-8?q?Barnab=C3=A1s_P=C5=91cze?= Reply-To: =?utf-8?q?Barnab=C3=A1s_P=C5=91cze?= Errors-To: libcamera-devel-bounces@lists.libcamera.org Sender: "libcamera-devel" Instead of explicitly creating a vector of StreamRole, simply use an initializer list as the argument of `Camera::generateConfiguration()`. Signed-off-by: Barnabás Pőcze --- src/gstreamer/gstlibcameraprovider.cpp | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) -- 2.40.1 diff --git a/src/gstreamer/gstlibcameraprovider.cpp b/src/gstreamer/gstlibcameraprovider.cpp index 6eb0a0eb..4f325ad4 100644 --- a/src/gstreamer/gstlibcameraprovider.cpp +++ b/src/gstreamer/gstlibcameraprovider.cpp @@ -128,11 +128,9 @@ gst_libcamera_device_new(const std::shared_ptr &camera) { g_autoptr(GstCaps) caps = gst_caps_new_empty(); const gchar *name = camera->id().c_str(); - StreamRoles roles; - roles.push_back(StreamRole::VideoRecording); - std::unique_ptr config = camera->generateConfiguration(roles); - if (!config || config->size() != roles.size()) { + std::unique_ptr config = camera->generateConfiguration({ StreamRole::VideoRecording }); + if (!config || config->size() != 1) { GST_ERROR("Failed to generate a default configuration for %s", name); return nullptr; }