From patchwork Sun Sep 10 17:50:24 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrey Konovalov X-Patchwork-Id: 18979 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 F1B44BD160 for ; Sun, 10 Sep 2023 17:51:50 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 4428A628EC; Sun, 10 Sep 2023 19:51:50 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org; s=mail; t=1694368310; bh=xyGParl3Vl0Uc0omDKlTycPnXyvZ/7Yn+bP9qrtauKQ=; h=To:Date:Subject:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:Cc:From; b=lkkeHFu6ztPsYAl3tpmE6ZWfZpXWm8F4J4pfJqEkR/ZGsAJnqLS+MqWfejWCYYZLz qwQmvQoMb9bTTQnb2TCrNU+L9MHsPHKb90sr3Hzvq4337Y/g4YjKEoAx5D5SbftRSj 6T/1pZ/D1ojoh56HVMsN40MAM4kptALBQKY2JJSZHgHgYk+iBy37t97noi6dOO3jAP ZEUQTvSyivQ1XQ6x0GZ8RtXKR7WMJ5J4rqwKZbpN5d4S2XUF0UboylCeVy25+GPQXz FnKl/pj6xtK3Nj1KIrp7f9iJ/VETeTstAB3QfP2p/hJPYjIBdSfJ3YhI8AKyKDp4r0 KJ6ARlm8+Rt0w== Received: from mail-ed1-x530.google.com (mail-ed1-x530.google.com [IPv6:2a00:1450:4864:20::530]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 74FAE61DF6 for ; Sun, 10 Sep 2023 19:51:49 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (2048-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.b="YNaDxZDo"; dkim-atps=neutral Received: by mail-ed1-x530.google.com with SMTP id 4fb4d7f45d1cf-529fb2c6583so4743756a12.1 for ; Sun, 10 Sep 2023 10:51:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1694368309; x=1694973109; darn=lists.libcamera.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=L2WA9lpitX26E+dp1fdtMYkGNmsUkRx/Q37LMP3JDdQ=; b=YNaDxZDoK/XWUuj8A99PziirpvNpl7c7iroSACnpkz6nHEZc5KlxFTVKBmE6lbV+JA sPG+2RVelSZXqMBev03EhfnK33rt92hYzXXCscQBpLZKM8jFolJlNAUgbTn1kHVlkAuu 7keuH+UiAL0Pw8+tLk/IRcJzPZZDXbBgboCzrPpARsHlKtceuRIC0/wTyu39ONT5+gjz goYpkpI+lFrUNdRDFo2O4P0TwxeCz507HnLiPPmKrDOxksPSJFrqTUSgy0AultwaLsyK 2CBNKmswzNBlwfN7A2/qEcVbU5UuFRNcb3FYGtp9nEbCptvoIv2v53lqxK6AMvMOMrsL 58Rw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1694368309; x=1694973109; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=L2WA9lpitX26E+dp1fdtMYkGNmsUkRx/Q37LMP3JDdQ=; b=MjovzI1RY6X4dUHAo7o2+92hyfPSy9VrTN5oXq37B2B35OLb7j13Qw+bOc56YsyN7P 4vV3ceXgw0xOuP/nUEdOMsrYtVPnQOSf+cYoB8RKvXpdZIF8+gJTlhGaELYeooXX0YiN SJcaLRpx/iwCML4/+Qbx7xGGYDHygKQdKOPoYQYuX2ROBIAaCTeyvXE3Ah9sCwNOT0ft Mk+FwNMQnzH9QvXlMVUxUubo6xHZJwF2r+eBoDaoNu9XeiEpkLJ/Z4TEd3XD+UUAP6Uf /lv1zOFllhBn0N7a+13eEuqI0bQ0NMjdBlhuFWP9VfgPwjesdNcDyQTn6fI7S49VC2g0 LC5A== X-Gm-Message-State: AOJu0Yz33n0cacdOlxvqgM0g9Wvg4BGrL12IxRceCwTvG4TPg9vvxcH5 HftE3ULa3CuNyiC0/dYXu2WooFbUtpN1vXh8Aeg= X-Google-Smtp-Source: AGHT+IHb8384JCznHlE56cxErzNl9iLmzYdU1nUFsQmYLxiwGBOCLc+50OhdbzZf5tMB3r2+jFGqyA== X-Received: by 2002:a17:906:10dc:b0:99c:f47a:2354 with SMTP id v28-20020a17090610dc00b0099cf47a2354mr7866171ejv.70.1694368308875; Sun, 10 Sep 2023 10:51:48 -0700 (PDT) Received: from Lat-5310.. ([87.116.166.126]) by smtp.gmail.com with ESMTPSA id kd27-20020a17090798db00b009a57d30df89sm4090089ejc.132.2023.09.10.10.51.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 10 Sep 2023 10:51:48 -0700 (PDT) To: libcamera-devel@lists.libcamera.org Date: Sun, 10 Sep 2023 20:50:24 +0300 Message-Id: <20230910175027.23384-1-andrey.konovalov@linaro.org> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH 0/3] libcamera: converter: generalize Converter to remove MediaDevice dependency 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: Andrey Konovalov via libcamera-devel From: Andrey Konovalov Reply-To: Andrey Konovalov Cc: jacopo.mondi@ideasonboard.com, bryan.odonoghue@linaro.org, srinivas.kandagatla@linaro.org Errors-To: libcamera-devel-bounces@lists.libcamera.org Sender: "libcamera-devel" This series is one patch which makes the Converter class more generic by moving the MediaDevice related part out into derived class, and two more patches which demonstrate a software converter using this generalized version of the Converter class. The raw bayer to RGB software converter implementation is a slightly improved version of the one in my previous patchset [1] (buffers mapping fixed). But this is still work in progress hence the [RFC] for the last two patches. I am almost sure that the software converters deserve their own converter factory, but haven't got to implementing one yet. So for now, in the last patch the Simple pipeline handler just instanciates a SwConverter directly. [1] https://patchwork.libcamera.org/cover/18924/ Andrey Konovalov (3): libcamera: converter: split ConverterMD (media device) out of Converter libcamera: converter: add software converter libcamera: pipeline: simple: add software converter support include/libcamera/internal/converter.h | 49 +-- .../internal/converter/converter_softw.h | 88 ++++ .../internal/converter/converter_v4l2_m2m.h | 4 +- .../libcamera/internal/converter/meson.build | 1 + include/libcamera/internal/converter_media.h | 86 ++++ include/libcamera/internal/meson.build | 1 + src/libcamera/converter.cpp | 191 +------- src/libcamera/converter/converter_softw.cpp | 412 ++++++++++++++++++ .../converter/converter_v4l2_m2m.cpp | 4 +- src/libcamera/converter/meson.build | 3 +- src/libcamera/converter_media.cpp | 241 ++++++++++ src/libcamera/meson.build | 1 + src/libcamera/pipeline/simple/simple.cpp | 38 +- 13 files changed, 865 insertions(+), 254 deletions(-) create mode 100644 include/libcamera/internal/converter/converter_softw.h create mode 100644 include/libcamera/internal/converter_media.h create mode 100644 src/libcamera/converter/converter_softw.cpp create mode 100644 src/libcamera/converter_media.cpp