Commit graph

4 commits

Author SHA1 Message Date
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
1db3ea08b6 test: v4l2_device: capture_async: End test at 30 frames
The capture_async test was written to run for a fixed 5 second duration.
Modify the test such that it runs until it has captured 30 frames, or a 10
second time out occurs.

Running the capture_async test on an ARM64 platform using VIVID captures 30
frames in 6.15 seconds.

There may be scope to optimise this speed by changing the format on the capture
device.

Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
2019-02-13 15:46:30 +00:00
Kieran Bingham
ba4dfa7471 test: v4l2_device: Provide asynchronous capture test
Utilise the event_dispatcher to create a default event loop, and process
asynchronous buffer receive events.

If no frames are captured in 5 seconds, the test will fail.
It will also fail if less than 30 frames have been captured in the same
timeout period.

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:43 +02:00