From patchwork Mon Jul 13 13:24:44 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kieran Bingham X-Patchwork-Id: 8763 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 0CC67BD792 for ; Mon, 13 Jul 2020 13:25:00 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 9450960741; Mon, 13 Jul 2020 15:24:59 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="p/ETJTRN"; 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 20864605AE for ; Mon, 13 Jul 2020 15:24:57 +0200 (CEST) Received: from Q.local (cpc89242-aztw30-2-0-cust488.18-1.cable.virginm.net [86.31.129.233]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 8D0A39B1; Mon, 13 Jul 2020 15:24:55 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1594646695; bh=pK/gzlJCFpILRjqW9+slg2XjWKgH7PRhtU6f5FylbBU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=p/ETJTRNdPhzbkb3fOM3vXPsWy0Sa49bdgv1xytkGwnlmJ2/oxBr+q5J9lzFjwhYr oDKpkHoXxjuLj1qh5gNe9xyAVf9DRoExcEhUoTYPf5wNw743qB3+A6cdepLfyb0SNT +3m/Fdwhy6XQ6Wn+UoSIMRmXM9bxWjgabjPuKiXU= From: Kieran Bingham To: libcamera devel Date: Mon, 13 Jul 2020 14:24:44 +0100 Message-Id: <20200713132451.2944673-3-kieran.bingham@ideasonboard.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200713132451.2944673-1-kieran.bingham@ideasonboard.com> References: <20200713132451.2944673-1-kieran.bingham@ideasonboard.com> MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH 2/9] libcamera: pipeline: vivid: Match device 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: , Cc: Chris Ward Errors-To: libcamera-devel-bounces@lists.libcamera.org Sender: "libcamera-devel" Verify that we can match on our expected device(s). Use a temporary debug print to check that the pipeline finds our device: """ LIBCAMERA_LOG_LEVELS=Pipeline,VIVID:0 ./src/cam/cam -l [230:51:10.670503423] [2872877] DEBUG VIVID vivid.cpp:81 Obtained Vivid Device """ Signed-off-by: Kieran Bingham --- src/libcamera/pipeline/vivid/vivid.cpp | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/src/libcamera/pipeline/vivid/vivid.cpp b/src/libcamera/pipeline/vivid/vivid.cpp index 4418f616fe84..9811f6ef5095 100644 --- a/src/libcamera/pipeline/vivid/vivid.cpp +++ b/src/libcamera/pipeline/vivid/vivid.cpp @@ -5,6 +5,7 @@ * vivid.cpp - Pipeline handler for the vivid capture device */ +#include "libcamera/internal/device_enumerator.h" #include "libcamera/internal/log.h" #include "libcamera/internal/pipeline_handler.h" @@ -70,7 +71,16 @@ int PipelineHandlerVivid::queueRequestDevice(Camera *camera, Request *request) bool PipelineHandlerVivid::match(DeviceEnumerator *enumerator) { - return false; + DeviceMatch dm("vivid"); + dm.add("vivid-000-vid-cap"); + + MediaDevice *media = acquireMediaDevice(enumerator, dm); + if (!media) + return false; + + LOG(VIVID, Debug) << "Obtained Vivid Device"; + + return false; // Prevent infinite loops for now } REGISTER_PIPELINE_HANDLER(PipelineHandlerVivid);