From patchwork Wed May 29 07:02:44 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Umang Jain X-Patchwork-Id: 20112 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 10498BD87C for ; Wed, 29 May 2024 07:03:01 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 917A3634B2; Wed, 29 May 2024 09:02:59 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (1024-bit key; unprotected) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="DYQN1Gsp"; dkim-atps=neutral Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [IPv6:2001:4b98:dc2:55:216:3eff:fef7:d647]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id F305261A46 for ; Wed, 29 May 2024 09:02:57 +0200 (CEST) Received: from fedora.local (unknown [IPv6:2409:4055:4e99:4251:f523:b915:4362:f847]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 9BFC866F; Wed, 29 May 2024 09:02:52 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1716966174; bh=NF+ph4HFAce3hJk0tVK+tAFpcdYKDl0jEH2UzGNB0Ag=; h=From:To:Cc:Subject:Date:From; b=DYQN1GspE/+3nlV0dcRDIckMzSgd9wD7c0uXl8r5Xd4auoPeBAxFxRWNkv09Z/xj1 oEa+cG0z60AirTtq0i8ifdpX/k8SzG3Rz67o6ktT/TBQ4sY4T0aGBb7HuesjuB+OD1 QjKFahJOt2/bID9l60N+ZnDHEXk99iCetjiDX7KE= From: Umang Jain To: libcamera-devel@lists.libcamera.org Cc: Milan Zamazal , Andrey Konovalov , Umang Jain Subject: [PATCH v2 0/4] libcamera: converter: Replace usage of stream index by Stream pointer Date: Wed, 29 May 2024 12:32:44 +0530 Message-ID: <20240529070248.12186-1-umang.jain@ideasonboard.com> X-Mailer: git-send-email 2.44.0 MIME-Version: 1.0 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" The converter interface uses the unsigned int output stream index to map to the output frame buffers. This is cumbersome to implement new converters because one has to keep around additional book keeping to track the streams with their correct indexes. This patch (still an RFC) intends to drop stream index usage. The index is replaced by Stream pointer. This is convenient since Stream pointers are easily accessible at configuration time (from StreamConfiguration) and from Request objects. The v4l2_converter_m2m and simple pipeline handler are adapt to use the new interface. This work roped in software ISP as well, which also seems to use indexes (although it doesn't implement converter interface) because of a common conversionQueue_ queue used for converter_ and swIsp_. Patch 1/4 and 2/4 drop redundant validation of outputs std::map<>. Patch 3/4 renames private class V4L2M2MConverter::Stream to V4L2M2Mconverter::V4L2M2MStream Patch 4/4 replaces the stream index usage from converter interface and soft isp. changes in v2: - Split out patches 1/4 and 2/4 to tackle validation/sanity check - Rename V4L2M2MConverter::Stream to V4L2M2Mconverter::V4L2M2MStrea Umang Jain (4): converter: converter_v4l2_m2m: Rectify streams sanity check libcamera: software_isp: Drop unnecessary sanity check converter: converter_v4l2_m2m: Rename private Stream class libcamera: converter: Replace usage of stream index by Stream pointer include/libcamera/internal/converter.h | 5 +- .../internal/converter/converter_v4l2_m2m.h | 13 ++-- .../internal/software_isp/software_isp.h | 5 +- .../converter/converter_v4l2_m2m.cpp | 77 ++++++++++--------- src/libcamera/pipeline/simple/simple.cpp | 14 ++-- src/libcamera/software_isp/software_isp.cpp | 22 ++---- 6 files changed, 67 insertions(+), 69 deletions(-)