summaryrefslogtreecommitdiff
path: root/test/v4l2_device
diff options
context:
space:
mode:
authorKieran Bingham <kieran.bingham@ideasonboard.com>2019-02-13 11:12:11 +0000
committerKieran Bingham <kieran.bingham@ideasonboard.com>2019-02-13 15:46:18 +0000
commit9fa7934239f259af8b86ea3395baa3b30e3a0d33 (patch)
tree46c3030362a043340f15ebb9f9db3744f67a9892 /test/v4l2_device
parent613fc4000fa844174c86152d7131087e5a8feb06 (diff)
test: v4l2_device: Use VIVID capture stream
Utilise the VIVID capture device for testing the V4L2Device objects. Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
Diffstat (limited to 'test/v4l2_device')
-rw-r--r--test/v4l2_device/v4l2_device_test.cpp18
1 files changed, 9 insertions, 9 deletions
diff --git a/test/v4l2_device/v4l2_device_test.cpp b/test/v4l2_device/v4l2_device_test.cpp
index 18d014ca..a2a7ba82 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();
}