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>
This commit is contained in:
parent
613fc4000f
commit
9fa7934239
1 changed files with 10 additions and 10 deletions
|
@ -39,23 +39,23 @@ 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;
|
||||
}
|
||||
}
|
||||
|
||||
if (!dev_)
|
||||
MediaEntity *entity = media_->getEntityByName("vivid-000-vid-cap");
|
||||
if (!entity)
|
||||
return TestSkip;
|
||||
|
||||
dev_ = new V4L2Device(entity);
|
||||
if (!dev_)
|
||||
return TestFail;
|
||||
|
||||
return dev_->open();
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue