Commit graph

5598 commits

Author SHA1 Message Date
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
Kieran Bingham
613fc4000f libcamera: device_enumerator: Fix LOG usage
Add the DeviceEnumerator category to the last LOG() call requiring it.

Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
2019-02-13 15:43:59 +00:00
Kieran Bingham
8cdc3148ad libcamera: v4l2_subdevice: Fix LOG usage
Add the V4L2Subdev category to the last LOG() call requiring it.

Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
2019-02-13 15:43:55 +00:00
Kieran Bingham
0a443b589b libcamera: v4l2_device: Fix LOG usage
Add the V4L2 category to the LOG() statements.

Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
2019-02-13 15:43:27 +00:00
Laurent Pinchart
98bd9cb8c9 libcamera: signal: Disconnect signal automatically on slot deletion
When a signal is connected to a member function slot, the slot is not
disconnected when the slot object is deleted. This can lead to calling a
member function of a deleted object if the signal isn't disconnected
manually by the slot object's destructor.

Make signal handling easier by implementing a base Object class that
tracks all connected signals and disconnects from them automatically
when the object is deleted, using template specialization resolution in
the Signal class.

As inheriting from the Object class may to a too harsh requirement for
Signal usage in applications, keep the existing behaviour working if the
slot doesn't inherit from the Object class. We may reconsider this later
and require all slot objects to inherit from the Object class.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
2019-02-13 13:23:43 +02:00
Laurent Pinchart
73a1bea709 libcamera: signal: Fix coding style issues
Fix issues reported by checkstyle.py in preparation for further changes.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
2019-02-13 13:23:38 +02:00
Laurent Pinchart
dc642f6d0b libcamera: pipeline_handler: Disconnect MediaDevice::disconnected signal
The pipeline handler connects the disconnected signal of MediaDevice
instances registered for hotplug handling to a member slot. Disconnect
the signal when the slot is called, as the pipeline handler will be
deleted.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
2019-02-13 13:23:37 +02:00
Laurent Pinchart
0c0b1e4dbe cam: options: Fix coding style issue related to templates
Our coding style doesn't add a space after the template keyword. Fix the
source code accordingly.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
2019-02-13 13:23:36 +02:00
Laurent Pinchart
5fb0ea016c utils: checkstyle: Catch LOG() usage without an explicit category
Add support for checkers not related to code formatting to the
checkstyle.py script, and create a first checker that catches usage of
the LOG() macro without an explicit category.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
Reviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
2019-02-13 13:23:34 +02:00
Laurent Pinchart
bc4cace5f3 clang-format: Remove space after template
Our coding style doesn't require a space after the template keyword.
Adjust .clang-format accordingly.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
2019-02-13 13:23:32 +02:00
Laurent Pinchart
04d5be7f76 libcamera: v4l2_device: Inherit from Loggable to print device node name
Automate printing of device node name in log messages by inheriting from
the Loggable class.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
2019-02-11 11:23:51 +02:00
Laurent Pinchart
8a401ed411 libcamera: log: Allow extending log messages
Introduce a base Loggable class that can be inherited from by other
classes to support adding per-instance information to the log messages.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
2019-02-11 11:23:51 +02:00
Laurent Pinchart
d8f2ed7d0d libcamera: pipeline_handler: Reorder member declaration order
Reorder the member declaration order in the PipelineHandler class to
match the control flow order, and to declare variables after methods
according to the coding style. Update the documentation accordingly,
preserving the order within the public, protected and private sections,
but grouping related methods together between the sections.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
2019-02-11 11:23:51 +02:00
Niklas Söderlund
fd38fa66c3 libcamera: pipeline: vimc: Fix name of pipeline handler class
Rename the VIMC pipeline handler to match the naming convention.

Signed-off-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2019-02-08 15:36:25 +01:00
Niklas Söderlund
8b27416267 cam: Add option to write raw frames to disk
Use the helper BufferWriter to optionally write frames to disk as they
are captured.

Signed-off-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
Signed-off-by: Jacopo Mondi <jacopo@jmondi.org>
Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2019-02-06 08:03:03 +02:00
Niklas Söderlund
46ca8eeca0 cam: Add BufferWriter helper
Add a simpler helper to allow the cam application to write raw captured
frames to disk.

Signed-off-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
Signed-off-by: Jacopo Mondi <jacopo@jmondi.org>
Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2019-02-06 08:03:03 +02:00
Niklas Söderlund
dbe7a28377 cam: Add capture operation
Add an option to capture frames from a camera and keep it running until
the user terminates by sending SIGINT.

Signed-off-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
Signed-off-by: Jacopo Mondi <jacopo@jmondi.org>
Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2019-02-06 08:03:03 +02:00
Jacopo Mondi
edfdace1d5 libcamera: pipeline: ipu3: Implement capture support
Replace the buffer allocation, capture start/stop and request queue
stubs with real implementations.

Signed-off-by: Jacopo Mondi <jacopo@jmondi.org>
Reviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2019-02-06 08:03:03 +02:00
Jacopo Mondi
7da6b95283 libcamera: pipeline: ipu3: Create video devices and subdevices
Create the video devices and subdevices associated with an IPU3 camera.
While at there, move the IPU3 pipeline handler class definition and the
associated IPU3CameraData to a separate header as the class has now
grown enough.

Signed-off-by: Jacopo Mondi <jacopo@jmondi.org>
Reviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2019-02-06 08:03:03 +02:00
Niklas Söderlund
8cbe8fe650 libcamera: pipeline: vimc: Implement capture support
Replace the buffer allocation, capture start/stop and request queue
stubs with real implementations.

Signed-off-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
Signed-off-by: Jacopo Mondi <jacopo@jmondi.org>
Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2019-02-06 08:03:03 +02:00
Niklas Söderlund
bbbf76a6c5 libcamera: pipeline: vimc: Set a default format
Pick a default format for the one stream in a vimc camera. This is
just a starting point to define a good default format for the vimc
camera, and is expected to evolve over time as the capabilities of the
library grows.

Signed-off-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
Signed-off-by: Jacopo Mondi <jacopo@jmondi.org>
Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2019-02-06 08:03:03 +02:00
Kieran Bingham
17ae772e8d libcamera: pipeline: uvcvideo: Implement capture support
Replace the buffer allocation, capture start/stop and request queue
stubs with real implementations.

Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
Signed-off-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
Signed-off-by: Jacopo Mondi <jacopo@jmondi.org>
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2019-02-06 08:03:03 +02:00
Niklas Söderlund
bd38112b77 libcamera: camera: Extend the interface to support capture
In order to support capture, the camera needs methods to allocate and
free buffers, to start and stop the capture and to queue requests.
Define those interfaces in the Camera class and implement them to call
the corresponding pipeline handler methods.

Once a camera is started the pipeline handler of the camera will begin
processing requests queued to the camera by the application until it
gets stopped.

Once a request is created it can be queued to the camera and the
application will be notified asynchronously once the request is
completed and be able to process all the buffers involved in the
request.

At this point the request objects don't support controls. This will be
extended in the future.

Signed-off-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
Signed-off-by: Jacopo Mondi <jacopo@jmondi.org>
Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2019-02-06 07:41:51 +02:00
Niklas Söderlund
98edf29e01 libcamera: camera: Cache the stream configuration in the stream object
The API towards the application and pipeline handler can be simplified
if the camera caches which streams have been selected and their
respective configuration.

Signed-off-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
Signed-off-by: Jacopo Mondi <jacopo@jmondi.org>
Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2019-02-06 07:41:51 +02:00
Niklas Söderlund
31bb25ae8d libcamera: camera: Add helper to check for exclusive access
Some operations on the camera requires the application to have exclusive
access to the camera. To help check for this in these operations add a
helper.

Signed-off-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
Signed-off-by: Jacopo Mondi <jacopo@jmondi.org>
Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2019-02-06 07:41:51 +02:00
Niklas Söderlund
5239f6e656 libcamera: pipeline_handler: Extend the interface to support capture
In order to support capture, the pipeline handler needs methods to
allocate and free buffers, to start and stop the capture and to queue
requests. Define those interfaces in the PipelineHandler class and
implement them as stubs in the existing pipeline handlers.

This initial implementation only considers the allocation of new
buffers. Future work would need to expand this to also cover importing
buffers from an external source.

Signed-off-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
Signed-off-by: Jacopo Mondi <jacopo@jmondi.org>
Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2019-02-06 07:41:51 +02:00
Jacopo Mondi
5aef825764 libcamera: Provide a Request object
Implement a Request object used by applications to queue image capture
requests to a camera.

Signed-off-by: Jacopo Mondi <jacopo@jmondi.org>
Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
2019-02-06 07:41:51 +02:00
Niklas Söderlund
1d7b6297f2 libcamera: stream: Add stream configuration to the stream object
Add a cache of the active stream configuration to the stream object.
This cache is to be updated from the Camera object and can be accessed
read only from both the application and pipeline handlers.

Signed-off-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
Signed-off-by: Jacopo Mondi <jacopo@jmondi.org>
Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2019-02-06 07:41:51 +02:00
Kieran Bingham
1b7051b492 libcamera: stream: Construct a stream
Construct a stream object with a default internal pool.

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 07:41:51 +02:00
Jacopo Mondi
468176fa07 libcamera: Add V4L2Subdevice
Add V4L2Subdevice class that provides an interface to interact with
V4L2 defined sub-devices.

Signed-off-by: Jacopo Mondi <jacopo@jmondi.org>
Reviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2019-02-06 07:41:50 +02:00
Jacopo Mondi
8dbc203bb2 libcamera: Add geometry.h
Add geometry-related definitions in the geometry.h internal header.

Signed-off-by: Jacopo Mondi <jacopo@jmondi.org>
Reviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2019-02-06 07:41:48 +02:00
Jacopo Mondi
8628b1e560 libcamera: v4l2_device: Add comments to method parameters
Add missing parameter documentation for set and get format methods.

Signed-off-by: Jacopo Mondi <jacopo@jmondi.org>
Reviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2019-02-06 07:41:39 +02:00
Niklas Söderlund
e94e52c0cb libcamera: v4l2_device: Update dequeued buffer information
Copy the information from the struct v4l2_buffer when dequeueing the
buffer as applications need this information to make sense of the
captured data.

Signed-off-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
Signed-off-by: Jacopo Mondi <jacopo@jmondi.org>
Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2019-02-06 06:49:45 +02: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
Kieran Bingham
d2046d863b test: v4l2_device: Add StreamOn/StreamOff test
Provide a small test to exercise the streamOn() and streamOff() calls.
8 buffers are requested locally.

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:41 +02:00
Kieran Bingham
374673f84a libcamera: v4l2_device: Implement stream{On,Off}
Support starting and stopping a stream on a V4L2 device. Buffers must be
queued before the stream is started.

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