Commit graph

5583 commits

Author SHA1 Message Date
Kieran Bingham
7401f5002e libcamera: camera: Unmap buffers before release
Buffers must have all mappings destroyed before buffers can be freed by the
V4L2 device that has allocated them.

Swap the ordering of freeBuffers() and destroyBuffers() to correct this.

Fixes: bd38112b77 ("libcamera: camera: Extend the interface to support capture")
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
2019-03-05 15:20:50 +00:00
Kieran Bingham
cbdc4b9ad3 libcamera: v4l2_device: Close Plane dmabuf fd
When constructing a Plane, the exported buffer provides a dmabuf handle which
is set to the Plane object.

This action duplicates the handle for internal storage, and the original fd is
not used and needs to be closed.

Close the handle, ensuring that the resources can be correctly managed.

Fixes: 771befc6dc ("libcamera: v4l2_device: Request buffers from the device")
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
2019-03-05 15:06:29 +00:00
Jacopo Mondi
ba90504cac libcamera: v4l2_device: Cosmetic update
Cosmetic update of V4L2Device class: remove the return type from Doxygen
documentation of inline functions.

Cosmetic update, no functional changes intended.

Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Jacopo Mondi <jacopo@jmondi.org>
2019-03-02 18:32:09 +01:00
Jacopo Mondi
3e94f9d7a2 libcamera: v4l2_device: Add support for META_CAPTURE devices
Add support for devices that provide video meta-data to v4l2_device.cpp
and re-arrange bufferType handling in open() method.

Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Jacopo Mondi <jacopo@jmondi.org>
2019-03-02 18:32:00 +01:00
Jacopo Mondi
0088979683 libcamera: v4l2_subdevice: Cosmetic update
Cosmetic updated of V4L2Subdevice class: re-sort methods and comments to
reflect the declaration order in the class definition.

Cosmetic update, no functional changes intended.

Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Jacopo Mondi <jacopo@jmondi.org>
2019-03-02 18:31:40 +01:00
Jacopo Mondi
de16573bcc test: v4l2_subdevice: Add ListFormat test
Add test to list formats on a v4l2 subdevice.

Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Jacopo Mondi <jacopo@jmondi.org>
2019-03-02 18:31:30 +01:00
Jacopo Mondi
0559c740f2 libcamera: v4l2_subdevice: Implement ENUM_FRAME_SIZES
Implement format and size enumeration methods to list all the available
subdevice image resolutions and formats.

Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Jacopo Mondi <jacopo@jmondi.org>
2019-03-02 18:31:02 +01:00
Laurent Pinchart
54e6a3eb1f cam: Don't requeue requests when stopping stream
When stopping the stream all pending requests are cancelled, resulting
in the request completion signal being emitted with the request status
set appropriately. Check the request status in the request completion
slot and skip requeuing the request if it has been cancelled.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
2019-03-01 20:46:43 +02:00
Laurent Pinchart
b2c06cf409 libcamera: Handle request completion explicitly in pipeline handlers
Request complete by themselves when all the buffers they contain have
completed, connecting the buffer's completed signal to be notified of
buffer completion. While this works for now, it prevents pipelines from
delaying request completion until all metadata is available, and makes
it impossible to ensure that requests complete in the order they are
queued.

To fix this, make request completion handling explicit in pipeline
handlers. The base PipelineHandler class is extended with
implementations of the queueRequest() and stop() methods and gets new
completeBuffer() and completeRequest() methods to help pipeline handlers
tracking requests and buffers.

The three existing pipeline handlers connect the bufferReady signal of
their capture video node to a slot of their respective camera data
instance, where they use the PipelineHandler helpers to notify buffer
and request completion. Request completion is handled synchronously with
buffer completion as the pipeline handlers don't need to support more
advanced use cases, but this paves the road for future work.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
2019-03-01 20:46:40 +02:00
Laurent Pinchart
1accc258cc libcamera: request: Add request completion status
Add a new field to the Request class to report its completion status,
and a new complete() method to update the status.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
2019-03-01 15:45:09 +02:00
Laurent Pinchart
fca7602c3c libcamera: buffer: Add buffer completion status
Add a new field to the Buffer class to report its completion status,
with a new cancel() method to mark the buffer as cancelled.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
2019-03-01 15:45:09 +02:00
Laurent Pinchart
b581b9576a libcamera: pipeline_handler: Make pipeline-specific data mandatory
Mandate creationg of pipeline-specific data by pipeline handlers. This
allows simplifying the API by passing the pipeline-specific data to the
registerCamera() method and removing the separate setCameraData()
method.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
2019-03-01 15:45:09 +02:00
Laurent Pinchart
61a62ddbd8 libcamera: pipeline_handler: Store pipe and camera in CameraData
Extend the CameraData class with two member variables pipe_ and camera_
that store pointers to the pipeline handler and camera that the
CameraData instance is related to. This will be used by pipeline
handlers to access the camera and the pipeline in member methods of
their CameraData derived classes.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
2019-03-01 15:45:07 +02:00
Laurent Pinchart
40439a933f libcamera: pipeline_handler: Pass a non-const Camera to methods
The start(), stop() and queueRequest() methods receive a const pointer
to the related Camera object. The stop() request will need to modify the
state of the camera, in order to report completion of pending requests.
Un-constify the Camera pointer to that method, and update the start()
and queueRequest() methods similarly for coherency.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
Reviewed-by: Jacopo Mondi <jacopo@jmondi.org>
2019-03-01 15:44:35 +02:00
Laurent Pinchart
fedad60b76 libcamera: pipeline: vimc: Create VimcCameraData
Subclassing CameraData will become mandatory for pipeline handlers.
Create a new VimcCameraData class and instantiate it when creating
cameras to prepare for that change. The video_ and stream_ fields of the
VIMC pipeline handler belong to the camera data, move them there.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
Reviewed-by: Jacopo Mondi <jacopo@jmondi.org>
2019-03-01 15:44:35 +02:00
Laurent Pinchart
19dfe91e17 libcamera: pipeline: uvcvideo: Create UVCCameraData
Subclassing CameraData will become mandatory for pipeline handlers.
Create a new UVCCameraData class and instantiate it when creating
cameras to prepare for that change. The video_ and stream_ fields of the
UVC pipeline handler belong to the camera data, move them there.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
2019-03-01 15:44:33 +02:00
Laurent Pinchart
e6eff721d7 libcamera: pipeline: Fix double release of media devices
Media devices are acquired in the match() function of pipeline handlers,
and explicitly released if no match is found. The pipeline handler is
then deleted, which causes a second release of the media device in the
destructor. Fix this by removing the explicit release in the match()
function.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
Acked-by: Jacopo Mondi <jacopo@jmondi.org>
2019-03-01 15:26:03 +02:00
Jacopo Mondi
3ab7f65d6f libcamera: v4l2_device: Expose the device node path
Provide a getter method to access the device node path. For video
devices it is usually the most informative description.

Signed-off-by: Jacopo Mondi <jacopo@jmondi.org>
2019-03-01 12:34:41 +01:00
Jacopo Mondi
617a3aa582 test: v4l2_device: Add format handling test
Add test for V4L2Device set and get format methods.

Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Jacopo Mondi <jacopo@jmondi.org>
2019-03-01 12:34:13 +01:00
Jacopo Mondi
7f4ce94ad9 test: v4l2_subdevice: Add format handling test
Add test for video format get and set operations on V4L2Subdevice class.

Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Jacopo Mondi <jacopo@jmondi.org>
2019-03-01 12:33:17 +01:00
Jacopo Mondi
a56f8a57b5 libcamera: v4l2_subdevice: Update crop/compose rectangle
Update the crop/compose rectangle provided to setCrop()/setCompose()
methods with the rectangle sizes set by the device driver after a
S_SELECTION ioctl operation.

While at there, fix the use of 'top' and 'left' field of the selection
rectangle, which where wrongly used.

Fixes: 468176fa07 ("libcamera: Add V4L2Subdevice")
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Jacopo Mondi <jacopo@jmondi.org>
2019-03-01 12:33:04 +01:00
Jacopo Mondi
204d5c9f09 libcamera: v4l2_subdevice: Inherit from Loggable
Prefix the V4L2Subdevice error messages with the name of the entity.
Remove the manually printed name from log messages where it was used and
standardize error messages while at there.

Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Jacopo Mondi <jacopo@jmondi.org>
2019-03-01 12:32:28 +01:00
Jacopo Mondi
c6daee909c libcamera: v4l2_subdevice: Store media entity
Store the media entity backing the V4L2Subdevice and add a deviceName()
method to retrieve the human readable name of the subdevice, which is
created using the name of the associated media entity.

Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Jacopo Mondi <jacopo@jmondi.org>
2019-03-01 12:31:45 +01:00
Niklas Söderlund
77100a7578 libcamera: camera: add state machine to control access from applications
There is a need to better control the order of operations an application
performs on a camera for it to function correctly. Add a basic state
machine to ensure applications perform operations on the camera in good
order.

Internal to the Camera states are added; Available, Acquired,
Configured, Prepared and Running. Each state represents a higher state
of configuration of the camera ultimately leading to the highest state
where the camera is capturing frames. Each state supports a subset of
operations the application may perform.

Signed-off-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2019-03-01 00:28:17 +01:00
Niklas Söderlund
132ce9c1cf libcamera: store stream pointers in sets instead of a vectors
The arrays that store Stream pointers shall always contain unique
values. Storing them in vectors opens up for the same stream pointer
appearing twice. Remove this possibility by storing them in a set which
guarantees each element is unique.

Signed-off-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
Reviewed-by: Jacopo Mondi <jacopo@jmondi.org>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2019-02-28 18:41:52 +01:00
Niklas Söderlund
dc01a5bc43 cam: fix order camera is operated on
Upcoming enforcing of order the camera shall be operate on is not
compatible with the cam utility. Requests shall be queued after the
camera is started, not before.

Signed-off-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2019-02-28 18:41:21 +01:00
Niklas Söderlund
acb56ebef8 libcamera: align the documentation for numeric error codes
Rapid growth of the library have resulted in slightly different wording
to document that a function returns 0 on success or a negative error
code otherwise. Align all different variations.

Signed-off-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
Reviewed-by: Jacopo Mondi <jacopo@jmondi.org>
Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2019-02-27 17:36:30 +01:00
Niklas Söderlund
9aceed70a2 libcamera: camera: fix bug in error check for streamConfiguration()
The return statement is missing altogether and an error is silently
ignored. Fix this and also update the empty map to use the correct type
for the map key.

Fixes: 65ea2422d2 ("libcamera: camera: extend camera object to support configuration of streams")
Signed-off-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
Reviewed-by: Jacopo Mondi <jacopo@jmondi.org>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2019-02-27 17:21:40 +01:00
Niklas Söderlund
374c102073 cam: Improve when usage information is printed
Running the cam tool without any options results in the tool to exit
with EXIT_FAILURE but no usage being printed, this is confusing. Improve
this by also printing the usage text.

Signed-off-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2019-02-25 23:14:39 +01:00
Niklas Söderlund
71e84c22da cam: fix printing of camera name
Since commit c8c546fe99 ("cam: options: Add option type handling
to options parser") introduced type handling for options the context the
option is read became important. When reading the camera option for
printing there is no explicit context to print it as a string and
instead the int context was chosen resulting in:

    $ cam --camera foo
    Camera 0 not found

While the expected output is:

    $ cam --camera foo
    Camera foo not found

Fix this by providing the correct context for the camera option when
printing it.

Fixes: c8c546fe99 ("cam: options: Add option type handling to options parser")
Signed-off-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2019-02-25 23:13:33 +01:00
Niklas Söderlund
dd14f1ec2c cam: improve error checking when capturing
The return value when start() and stop() the camera should be checked
and handled.

Signed-off-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2019-02-25 23:13:33 +01:00
Niklas Söderlund
24cb563853 cam: free allocated buffers when done capturing
The allocated buffers needs to be freed once the application is done
with them.

Signed-off-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2019-02-25 23:13:33 +01:00
Niklas Söderlund
2090f8fdd8 cam: fix return type of configureStreams()
The only caller of configureStreams() stores its return value as an int
and not bool. This is confusing and also prevents the (possibly)
different error codes returned by Camera::configureStreams() to be
propagated inside the cam tool. Fix this by changing the return type to
int and propagate the return value from the camera.

Signed-off-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2019-02-25 23:12:57 +01:00
Niklas Söderlund
0cd7602e9c libcamera: pipeline: vimc: enforce stream configuration
The format requested by configureStreams() should exactly match what is
programmed on the video device. If they do not match the call should
fail as the application in that case will not know what configuration
was actually programmed.

Signed-off-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2019-02-25 23:12:57 +01:00
Niklas Söderlund
facb80bc5c libcamera: pipeline: uvcvideo: enforce stream configuration
The format requested by configureStreams() should exactly match what is
programmed on the video device. If they do not match the call should
fail as the application in that case will not know what configuration
was actually programmed.

Signed-off-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2019-02-25 23:12:57 +01:00
Niklas Söderlund
9a37b4c5a8 libcamera: pipeline_handler: extend documentation for configureStreams()
Extend the documentation to explicitly state that the pipeline handler
implementations are responsible for validating that the requested
configuration can be exactly satisfied by the hardware.

Signed-off-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2019-02-25 23:12:49 +01:00
Jacopo Mondi
143b5cc33f libcamera: v4l2_subdevice: Fix S_SELECTION ioctl argument
The SUBDEV_S_SELECTION argument needs to be a pointer. Fix it.

Fixes: 468176fa07 ("libcamera: Add V4L2Subdevice")
Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
Signed-off-by: Jacopo Mondi <jacopo@jmondi.org>
2019-02-19 09:29:00 +01:00
Jacopo Mondi
fbc67a54f3 Documentation: coding-style: Discourage move on shared_ptr<>
Using std::move() on return statement of a method or on the its returned
value prevents the compiler from implementing copy-elision. Discourage
that in the coding style document.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Jacopo Mondi <jacopo@jmondi.org>
2019-02-14 05:32:17 +01:00
Jacopo Mondi
ddcd8ebb3d libcamera: device_enumerator: Remove move() on search() return
Remove the std::move() call on the shared_ptr<MediaDevice *> returned by
the search() method and remove the std::move() call on temporary return
value in pipeline handlers that use the method.

Thanks to copy elision, the regular constructor of the newly created
object is called, avoiding un-necessary copies.

Furthermore, the use of std::move() in the return and assignment
statements prevents the compiler from performing copy elision, forcing
it to generate two sequences of un-necessary calls to the class'
move constructor and destructor.

Reviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Jacopo Mondi <jacopo@jmondi.org>
2019-02-14 05:31:23 +01:00
Jacopo Mondi
fea6dc9365 libcamera: device_enumerator: Break line longer than 80 columns
Since there is no valid reason to exceed 80 columns for this lane, break
it.

Reviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Jacopo Mondi <jacopo@jmondi.org>
2019-02-14 05:27:20 +01:00
Jacopo Mondi
26df58377b libcamera: v4l2_subdevice: Forward-declare MediaEntity
The V4L2Subdevice class uses MediaEntity instances, and the
corresponding header is not included.

Fix this by forward declaring the MediaEntity class.

Fixes: 468176fa07 ("libcamera: Add V4L2Subdevice")
Reviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Jacopo Mondi <jacopo@jmondi.org>
2019-02-14 05:25:29 +01:00
Kieran Bingham
220106b1fe test: v4l2_device: Provide buffer sharing test
Obtain two V4L2Devices and use one to obtain a BufferPool.

Propagate the formats from the first to the second device and then commence
sending buffers between the two devices in a ping-pong fashion.

Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
2019-02-13 17:32:31 +00:00
Kieran Bingham
9cee8620c3 test: v4l2_device: release capture device resources
Ensure that the cleanup operation releases the device and resources.

Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
2019-02-13 17:27:46 +00: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
819eb422b3 libcamera: v4l2_device: importBuffers support
Provide the ability to import a BufferPool into the V4L2Device allowing
external dmabuf backed buffers to be queued.

Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
2019-02-13 15:58:06 +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
3e354b00b4 libcamera: v4l2_device: Use non-interlaced frames
Use V4L2_FIELD_NONE where applicable to disable support for interlaced frames.
We are unlikely to support interlaced frames on cameras so hardcode this field
type for now. If we decide to support interlacing later it can be revisited.

Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
2019-02-13 15:50:05 +00:00
Kieran Bingham
8a46873e04 libcamera: v4l2_device: Support queueing buffers to an output device
To queue a buffer to an output device, we must set the buffer properties.

Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
2019-02-13 15:49:21 +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
9fa7934239 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>
2019-02-13 15:46:18 +00:00