From patchwork Thu Jan 13 10:25:27 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Naushir Patuck X-Patchwork-Id: 15275 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 06867BE086 for ; Thu, 13 Jan 2022 10:25:38 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 676EE604F4; Thu, 13 Jan 2022 11:25:37 +0100 (CET) Authentication-Results: lancelot.ideasonboard.com; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=raspberrypi.com header.i=@raspberrypi.com header.b="A2JTxWid"; dkim-atps=neutral Received: from mail-wr1-x436.google.com (mail-wr1-x436.google.com [IPv6:2a00:1450:4864:20::436]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 80C5E6017E for ; Thu, 13 Jan 2022 11:25:35 +0100 (CET) Received: by mail-wr1-x436.google.com with SMTP id h10so9235290wrb.1 for ; Thu, 13 Jan 2022 02:25:35 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=raspberrypi.com; s=google; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=8+4UngsDGmlpirT7Rok66ibI8lVSBCBsChlVWmeLC2M=; b=A2JTxWidWjLsS1VWBpu1VnkY4ALlOxt/zzLit1UZbOZFY77tnd1P+FXoFASgFr/j9h JgVewJHhyRnpnqQp2hldkAMzRh2HmmKvJTkY4hL+Z14mijh39W8IBiZIYIAolr7tyyqK cvUhMgJlHszSyqKiMgGRgVC0BBJ2YOoO2uWbjNPQhnu/F/wnfuyn0leNOD/1BMv3KQGU WHM6Wev3F72vfIFmfybK5aMWGyPrSsYGzCCPPZrkN0v91cHwYLIG01LyfvxMT1yVSU4R zgEgeQ35PdI9ezJq1XNNUAm5YvtcDehtTCX9l60nUhyDYdCotvLdKCuN42k+ir4xRLTl 3jPg== 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:mime-version :content-transfer-encoding; bh=8+4UngsDGmlpirT7Rok66ibI8lVSBCBsChlVWmeLC2M=; b=BVyHxZjt/hADwdyR61Byzn+Qxdi58nuW+gdmz/jH9UsfxGUiZXMrsOOisd4+28XPWG TyFsYlw/TviLWJo1wzsc1f9aM9epKLcPTAPEC6Qnx6YXZJGxRKBRjFYHYDAQaPn0xA25 Uk7EGyfMV8eMcBVL2Bs+ECynvqMNVnKoOTUUXb/CB+HD659342BZianfNpDTTw+gr7rk eBDFncV0Y4bk91e66HLt0NAj41+veNthCUKVeXyeKyRIejb3Gb1RpXqW8hVa38UeoRK6 wPF4GsyfAdzvv3XDozdRJl8rjDeORH+lD0Z5jAQJjzQ0aKQFTCxZN7ZyqoQMKeW4x9/4 CbuA== X-Gm-Message-State: AOAM53273Cfz6R1TfC93FEB4rK7vL5pRXDPQvh0ShLR6J4PLMcOHTymS +X+0dTKOCCdUYvJG4HApquMdmLLkr9LeMtX7 X-Google-Smtp-Source: ABdhPJxHvcIIxj6qMxvuDPmOYqElyzc8A+yIXq04/y0irtO9rniHZbW5DMipqgG2G6hFysfBlhNibQ== X-Received: by 2002:a05:6000:1843:: with SMTP id c3mr3442500wri.316.1642069534789; Thu, 13 Jan 2022 02:25:34 -0800 (PST) Received: from naush-laptop.pitowers.org ([2a00:1098:3142:14:194e:c2b:3339:eb51]) by smtp.gmail.com with ESMTPSA id s22sm6757855wmc.1.2022.01.13.02.25.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 13 Jan 2022 02:25:34 -0800 (PST) From: Naushir Patuck To: libcamera-devel@lists.libcamera.org Date: Thu, 13 Jan 2022 10:25:27 +0000 Message-Id: <20220113102529.3163441-1-naush@raspberrypi.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Subject: [libcamera-devel] [RFC v1 0/2] MediaDevice enumeration helper 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" Hi, As discussed some time back, I've created a helper to enumerate media device topologies so we don't have to implement similar functions in each pipeline handler. Patch 1 adds a MediaDevice::enumerateMediaWalks() helper function that does the enumeration and returns a vector of "MediaWalks" which pipeline handlers may use to configure the media device topology. Patch 2 updates the RPi pipeline handler to use this helper and remove the existing media device enumeration code. I'm sure this may need to be tweaked for use in other pipeline handlers, and getting feedback on this would be useful. The Simple pipeline handler is an obvious candidate, and after having a brief look through the code, I think the helper introduced here could simplify the Simple(!) pipeline handler as well. However, before committing to changing that code over, I wanted to ensure I was on the right path, and I don't have any means to test any of these changes on other platforms. Thanks, Naush Naushir Patuck (2): libcamera: media_device: Add enumerateMediaWalks() helper pipeline: raspberrypi: Use MediaDevice::enumerateMediaWalks() include/libcamera/internal/media_device.h | 12 ++ src/libcamera/media_device.cpp | 135 +++++++++++++++++ .../pipeline/raspberrypi/raspberrypi.cpp | 142 ++++-------------- 3 files changed, 179 insertions(+), 110 deletions(-)