Commit graph

7 commits

Author SHA1 Message Date
Jacopo Mondi
3a6c4bd146 libcamera: Rename V4L2Device to V4L2VideoDevice
In preparation of creating a new V4L2Device base class, rename
V4L2Device to V4L2VideoDevice.

This is a project wide rename without any intended functional change.

Signed-off-by: Jacopo Mondi <jacopo@jmondi.org>
Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
Reviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2019-06-19 15:46:44 +02:00
Niklas Söderlund
4f8ba02bbc test: v4l2_device: Allow each test to specify which device and entity to test
Prepare for different tests which implements V4L2DeviceTest to specify
which media device and entity they wish to test. There is no functional
changes, all tests still use vivid to perform there tests.

Signed-off-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
Acked-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2019-05-17 20:39:03 +02:00
Kieran Bingham
ff4e882399 test: v4l2_device: Rename dev_ to capture_
Change the variable name globally throughout the tests.

Repair the V4L2DeviceTest constructor style, as checkstyle complained.

Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
2019-02-13 17:27:33 +00:00
Kieran Bingham
03fcc154eb libcamera: v4l2_device: Simplify exportBuffers()
exportBuffers() can only operate on an existing BufferPool allocation. The
pool identifies its size through its .count() method.

Passing a count in to the exportBuffers() call is redundant and can be
incorrect if the value is not the same as the BufferPool size.

Simplify the function and remove the unnecessary argument, correcting all uses
throughout the code base.

While we're here, remove the createBuffers() helper from the V4L2DeviceTest
which only served to obfuscate which pool the buffers were being allocated for.

Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
2019-02-13 15:50:09 +00:00
Kieran Bingham
2843f951d5 test: v4l2_device: Add request_buffers test
Add a utility to the test suite to request and allocate buffers from
a V4L2Device to ensure it functions correctly.

Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
Signed-off-by: Jacopo Mondi <jacopo@jmondi.org>
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
2019-02-06 06:49:31 +02:00
Kieran Bingham
93ec63b867 test: v4l2_device: Use DeviceEnumerator to find a UVCVideo
Utilise the existing DeviceEnumerator system to identify a suitable
V4L2Device for testing.

Specifically target these tests at a uvcvideo driver based device as a known
supported target.

Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
Signed-off-by: Jacopo Mondi <jacopo@jmondi.org>
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
2019-02-06 06:49:25 +02:00
Kieran Bingham
479264dfca test: v4l2_device: Add test suite and initial test
Provide a base class to construct a v4l2_device object for further tests
and an initial test which validates the FD handle can not be leaked.

Reviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
2019-01-17 21:55:27 +00:00