From patchwork Wed Feb 13 15:10:20 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kieran Bingham X-Patchwork-Id: 570 Return-Path: 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 BF37A610B3 for ; Wed, 13 Feb 2019 16:10:32 +0100 (CET) Received: from localhost.localdomain (cpc89242-aztw30-2-0-cust488.18-1.cable.virginm.net [86.31.129.233]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 44A6E304; Wed, 13 Feb 2019 16:10:32 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1550070632; bh=JDJkQKVftxyHKXfzTyUZcfrR0M385BwFp4tQhRu6w+o=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=jLevdvJnVCX+6zFiTkPAJOM3UbaY9N/zQERORRyKX/E1BP/PcN9VSnVsjSghkzf/Z pvTI1Lzfybl/b86wyee0L+RO92K+Opvmgquh2u/stzj6NVf3ZlDdGKvDp6C8nUUU2l bx1ZSFKf8PTJQxBLTCN9mbdnT8v87YDnFLCCVkKg= From: Kieran Bingham To: LibCamera Devel Date: Wed, 13 Feb 2019 15:10:20 +0000 Message-Id: <20190213151027.6376-2-kieran.bingham@ideasonboard.com> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20190213151027.6376-1-kieran.bingham@ideasonboard.com> References: <20190213151027.6376-1-kieran.bingham@ideasonboard.com> MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH v2 1/8] test: v4l2_device: Use VIVID capture stream X-BeenThere: libcamera-devel@lists.libcamera.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 13 Feb 2019 15:10:32 -0000 Utilise the VIVID capture device for testing the V4L2Device objects. Signed-off-by: Kieran Bingham Reviewed-by: Laurent Pinchart --- test/v4l2_device/v4l2_device_test.cpp | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/test/v4l2_device/v4l2_device_test.cpp b/test/v4l2_device/v4l2_device_test.cpp index 18d014caf4c8..a2a7ba82612d 100644 --- a/test/v4l2_device/v4l2_device_test.cpp +++ b/test/v4l2_device/v4l2_device_test.cpp @@ -39,22 +39,22 @@ int V4L2DeviceTest::init() return TestFail; } - DeviceMatch dm("uvcvideo"); - media_ = std::move(enumerator_->search(dm)); + DeviceMatch dm("vivid"); + dm.add("vivid-000-vid-cap"); + + media_ = enumerator_->search(dm); if (!media_) return TestSkip; media_->acquire(); - for (MediaEntity *entity : media_->entities()) { - if (entity->flags() & MEDIA_ENT_FL_DEFAULT) { - dev_ = new V4L2Device(entity); - break; - } - } + MediaEntity *entity = media_->getEntityByName("vivid-000-vid-cap"); + if (!entity) + return TestSkip; + dev_ = new V4L2Device(entity); if (!dev_) - return TestSkip; + return TestFail; return dev_->open(); }