Commit graph

534 commits

Author SHA1 Message Date
Laurent Pinchart
778f6b1d70 test: Simplify tests with parent-child relationships
Create object instances with a parent to avoid the need for reparenting
objects manually.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Jacopo Mondi <jacopo@jmondi.org>
Reviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
2019-08-17 18:47:17 +03:00
Laurent Pinchart
d7aded92d3 test: object: Extend object test to verify parent-child relationships
The test verifies correct behaviour of parent-child relationships in
relation to thread affinity.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Jacopo Mondi <jacopo@jmondi.org>
Reviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
2019-08-17 18:47:17 +03:00
Laurent Pinchart
4d9f1a0efc test: Add Timer thread move test
The test verifies correct behaviour of a running timer moved to a
different thread.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Jacopo Mondi <jacopo@jmondi.org>
Reviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
2019-08-17 18:47:17 +03:00
Laurent Pinchart
92b4af98cd test: Add EventNotifier thread move test
The test verifies correct behaviour of an enabled event notifier moved
to a different thread.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Jacopo Mondi <jacopo@jmondi.org>
Reviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
2019-08-17 18:46:54 +03:00
Laurent Pinchart
980d1ee0c0 test: Add Object class thread affinity test
The test verifies thread affinity and thread move notifications.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Jacopo Mondi <jacopo@jmondi.org>
Reviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
2019-08-17 18:32:37 +03:00
Laurent Pinchart
a991d5aac0 test: Add Object::invokeMethod() test
The test verifies correct behaviour of asynchronous method invocation
for Object instances.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Jacopo Mondi <jacopo@jmondi.org>
Reviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
2019-08-17 18:32:36 +03:00
Kieran Bingham
0268984c0d test: v4l2_device: Remove unused function
The 'exists()' call is not used within the code base.
Remove it.

Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Jacopo Mondi <jacopo@jmondi.org>
2019-08-13 15:36:04 +01:00
Kieran Bingham
093573db19 test: v4l2_videodevice: Add M2M device test
The V4L2M2MDevice requires two video devices to be configured. This
makes it unsuitable to reuse the existing V4L2DeviceTest test library in
its current form.

Implement a full test to run the two M2M pipelines through VIM2M.

Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Jacopo Mondi <jacopo@jmondi.org>
2019-08-13 15:36:04 +01:00
Niklas Söderlund
c64b898a35 tests: camera-sensor: Test using invalid media bus format
Linux commit b6c61a6c37317efd ("media: vimc: propagate pixel format in
the stream") changes the sensor in the vimc media graph to accept all
media bus format currently described in Linux. This prevents the
camera-sensor test case to verify that a supported media bus format is
selected from a list of defined formats, fix this by using an invalid
media bus format in the test case.

Signed-off-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2019-08-11 02:16:21 +02:00
Niklas Söderlund
440f7b4153 tests: v4l2_videodevice: Set media bus and pixel formats for vimc
Most of the video device tests are based on vimc and Linux commit
85ab1aa1fac17bcd ("media: vimc: deb: fix default sink bayer format")
changes the default media bus format for the debayer subdevices. This
leads to a -EPIPE error when trying to use the raw capture video device
nodes.

Fix this by explicitly setting media bus and pixel formats to known good
values which works before and after the upstream change.

Signed-off-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2019-08-11 02:16:21 +02:00
Niklas Söderlund
4debc71ffa libcamera: pipeline: vimc: Switch to using the RGB/YUV Capture video node
Linux commit 85ab1aa1fac17bcd ("media: vimc: deb: fix default sink bayer
format") which is part of v5.2 changes the default media bus format for
the debayer subdevices. This leads to a -EPIPE error when trying to use
the raw capture video device nodes.

Fix this by moving the vimc pipeline to use the RGB/YUV Capture capture
video node. As a consequence of this change the scaler in the vimc
pipeline is used and a hard coded upscale of 3 is present in the video
pipeline. This limits the sizes exposed and accepted by libcamera to
multiples of 3.

Update the buffer import test case to match this  new format constraint
by setting the resolution to 1920x1080, a resolution which works with
both vimc and vivid. With this new resolution the buffer import test
takes a bit more time to complete 60 buffers and it's runtime also needs
to be increased.

The raw capture video node still needs to be handled by the pipeline as
its format needs to be updated to allow the pipeline format validation
to pass.

Signed-off-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2019-08-11 02:16:21 +02:00
Kieran Bingham
1a6b80e4a0 test: camera: buffer_import: clear video pointer
The FrameSink::cleanup() call checks if video_ is set before cleaning up
and then deleting the object.

If the cleanup() call is called twice for any reason, this will
encounter a use-after-free as the video_ pointer is not cleared after
deletion.

Whilst cleanup() is not currently called twice consecutively, to prevent
errors in the future, make it explicit that the object has been deleted
by clearing the stale pointer.

Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
2019-08-01 10:53:04 +01:00
Paul Elder
36d62298b2 test: logging: move logging tests to a subdirectory
Since there are two logging tests now, move them to their own
subdirectory. Update meson as necessary.

Signed-off-by: Paul Elder <paul.elder@ideasonboard.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2019-07-17 14:36:35 +09:00
Paul Elder
4cdabcddc5 test: logging: add logging process test
Add a test to test that logging works in isolated child processes.
Only logSetFile is tested, because stdout and stderr are closed for
isolated child processes, and syslog and the none logging destinations
are expected to be the same as non-isolated processes.

Signed-off-by: Paul Elder <paul.elder@ideasonboard.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2019-07-17 14:36:35 +09:00
Paul Elder
42760092e7 test: logging: add logSetStream test
Test the new logSetStream logging API call. Reorganize the logging API
tests at the same time.

logSetTarget for the syslog logging destination is not tested.

Signed-off-by: Paul Elder <paul.elder@ideasonboard.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2019-07-17 14:36:35 +09:00
Jacopo Mondi
fae053307d libcamera: message: Add user message types
Reserve identifiers for user-defined message types and add an operation
to the Message class to register the type identifiers.

Signed-off-by: Jacopo Mondi <jacopo@jmondi.org>
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Jacopo Mondi <jacopo@jmondi.org>
2019-07-16 10:55:27 +03:00
Jacopo Mondi
e1a5873701 test: camera: Add buffer import and mapping test
Test buffer importing and mapping by streaming the VIMC camera to VIVID
video output device performing zero-copy memory sharing using dmabuf
file descriptors.

The test cycle 20 buffers between the camera and the output with a 1:1
buffer index to dmabuf fd mapping, then randomises the mapping with the
same number of buffers on each side for 20 more frames, to finally
increase the number of buffers on the output side for the 20 last
frames. No remapping of dmabuf fd to buffer index should occur for the
first 40 frames.

Signed-off-by: Jacopo Mondi <jacopo@jmondi.org>
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
2019-07-14 16:01:11 +03:00
Laurent Pinchart
5085bc03bc libcamera: Stop using Stream::bufferPool to get the number of buffers
The cam and qcam applications, as well as the camera capture test case,
access the Stream::bufferPool in order to know how many requests to
initially queue. As part of an effort to remove access to the buffer
pool from applications, use the buffer count from the stream
configuration instead.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
2019-07-14 16:00:58 +03:00
Laurent Pinchart
4e79b2ef31 libcamera: v4l2_videodevice: Signal buffer completion at streamoff time
When stopping the stream buffers have been queued, in which case their
completion is never be notified to the user. This can lead to memory
leaks. Fix it by notifying completion of all queued buffers with the
status set to error.

As a result the base PipelineHandler implementation can be simplified,
as all requests complete as the result of stopping the stream. The
stop() method that manually completes all queued requests isn't needed
anymore.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
2019-07-14 16:00:56 +03:00
Laurent Pinchart
a2bcf6feee libcamera: buffer: Split memory information to BufferMemory
The Buffer class is a large beast the stores information about the
buffer memory, dynamic metadata related to the frame stored in the
buffer, and buffer reference data (in the index). In order to implement
buffer import we will need to extend this with dmabuf file descriptors,
making usage of the class even more complex.

Refactor the Buffer class by splitting the buffer memory information to
a BufferMemory class, and repurposing the Buffer class to reference a
buffer and to store dynamic metadata. The BufferMemory class becomes a
long term storage, valid and stable from the time buffer memory is
allocated to the time it is freed. The Buffer class, on the other hand,
becomes transient, is created on demand when an application requires a
buffer, is given to a request, and is deleted when the request
completes.

Buffer and BufferMemory don't need to be copied, so their copy
constructor and assignment operators are deleted.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
2019-07-14 16:00:54 +03:00
Laurent Pinchart
9bb36ec274 libcamera: v4l2_videodevice: Add helper to queue all buffers
When starting the stream on a capture video device it is often needed to
queue all the allocated buffers. Add a helper method to do so, and
refactor the existing queueBuffer() method to make it clearer.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
2019-07-14 16:00:51 +03:00
Laurent Pinchart
1a7f1610e9 test: v4l2_videodevice: buffer_sharing: Lower resolution to speed up test
Lower the resolution to the smallest vivid supports, 320x180, in order
to speed up the test. This isn't enough in itself as the frame rate also
has to be configured, but the V4L2VideoDevice class doesn't support
frame rate control yet. In the meantime the frame rate can be set
manually with yavta or v4l2-ctl.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Paul Elder <paul.elder@ideasonboard.com>
2019-07-13 07:47:36 +03:00
Paul Elder
b5cffad2d4 test: logging: fix compilation on Chromium OS
Commit a25c937f8a ("test: add logging API test") causes the build to
fail in the Chromium OS build environment, because the return value of a
function call marked with the __warn_unused_result__ attribute is ignored.
Fix this.

Fixes: a25c937f8a ("test: add logging API test")
Signed-off-by: Paul Elder <paul.elder@ideasonboard.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2019-07-12 17:37:44 +09:00
Paul Elder
c2a8217df5 libcamera: add IPA proxy
Add an IPAProxy class whose implementations will act as a proxy between a
pipeline handler and an isolated IPA interface. Also add an IPAProxyFactory
that will construct the IPAProxy implementations as necessary.

Update Doxygen to ignore the directory where IPAProxy implementations will
reside.

Signed-off-by: Paul Elder <paul.elder@ideasonboard.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2019-07-12 16:32:29 +09:00
Paul Elder
3d20beca66 libcamera: Add Process and ProcessManager classes
Add a Process class to abstract a process, and a ProcessManager singleton
to monitor and manage the processes.

Signed-off-by: Paul Elder <paul.elder@ideasonboard.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2019-07-12 16:32:29 +09:00
Paul Elder
dfc9a8db09 libcamera: ipa_module_info: add license field
Add a field to IPAModuleInfo to contain the license of the module.

This license field will be used to determine whether the IPA module
should be run in an isolated process or not. If the license is open
source, then the IPA module will be allowed to run without process
isolation, if the user enables it. If the license is not open source,
then the IPA module will be run with process isolation.

Update the dummy IPA and IPA test to conform to the new struct layout.

Signed-off-by: Paul Elder <paul.elder@ideasonboard.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2019-07-12 15:52:30 +09:00
Paul Elder
a25c937f8a test: add logging API test
Test that setting the log file and log levels works from an application
point of view. The test uses the internal logging mechanism as well,
just to write to the log file.

Signed-off-by: Paul Elder <paul.elder@ideasonboard.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2019-07-12 13:46:48 +09:00
Laurent Pinchart
b462f2bfd6 test: signal: Extend Signal test with multi-inheritance reeiver
Add tests that exercises the Object-related signal code paths (in
particular automatic disconnection on Signal deletion) when the receiver
inherits from multiple base classes, with Object being the second base.
This tests the casts to and from Object * in the signal implementation.

The new tests segfault due bugs in the signal/slot implementation.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
2019-07-11 16:38:18 +03:00
Laurent Pinchart
a1b1551446 test: Add test case for signal delivery across threads
The test case creates a receiver inheriting from Object, connects a
signal to one of its slot, moves the receiver to a different thread,
emits the signal and verifies that it gets delivered in the correct
thread with the expected value.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
2019-07-11 11:57:37 +03:00
Laurent Pinchart
851eaeb9cd test: Add Message test case
The Message class test creates a receiver inheriting from Object, moves
it to a different thread, sends a message to the receiver and verifies
that the message is delivered in the correct thread.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
2019-07-11 11:57:37 +03:00
Laurent Pinchart
a7fb1db1fa test: Add Thread test cases
The Thread test case verifies that

- a Thread instance is created for the main thread
- a new Thread can be created, started, and stopped

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
2019-07-11 11:57:37 +03:00
Niklas Söderlund
cea3ecc8e1 test: Allow self-contained tests to run in parallel
The IPA, IPC and Stream tests are self-contained so they can run in
parallel.

Signed-off-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2019-07-04 16:42:08 +02:00
Kieran Bingham
6481c71a61 libcamera: test: Add ControlList tests
Add tests of the ControlList infrastructure and public API.

Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
2019-07-02 16:59:53 +03:00
Kieran Bingham
41c184afc3 libcamera: test: Add ControlInfo test
Provide an initial test coverage for the ControlInfo class.

Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
2019-07-02 16:59:49 +03:00
Kieran Bingham
4cbf83da40 libcamera: test: Add ControlValue test
Add initial basic testing for the new ControlValue class.

Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
Reviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2019-07-02 16:59:46 +03:00
Niklas Söderlund
a00fdabacd test: ipc: unix: Add test for IPCUnixSocket
Test that the IPC supports sending data and file descriptors over the
IPC medium. To be able to execute the test two parts are needed, one
to drive the test and act as the libcamera (master) and a one to act as
the IPA (slave).

The master drives the testing posting requests to the slave to process
and sometimes respond to. A few different tests are performed.

- Master sends an array to the slave which responds with a reversed copy
  of the array. The master verifies that a reversed array is returned.

- Master tries to send an empty message making sure that the send call
  fails.

- Master sends a list of file descriptors and ask the slave to calculate
  and respond with the sum of the size of the files. The master verifies
  that the calculated size is correct.

- Master sends a pre-computed size and a list of file descriptors and
  asks the slave to verify that the pre-computed size matches the sum of
  the size of the file descriptors.

- Master sends two file descriptors and asks the slave to join the file
  contents in a new file and respond with its file descriptor. The
  master then verifies that the content of the returned file descriptor
  matches the order of the original two files.

Signed-off-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2019-07-02 02:25:59 +03:00
Laurent Pinchart
3952d49d8d test: timer: Add dynamically allocated timer test
Timers should be automatically stopped and unregistered when deleted.
Add a test to verify this is the case.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
2019-07-01 23:48:37 +02:00
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
5ed3a89480 test: stream: Add test for StreamFormat
Test that both discrete and range based stream format descriptions
result in good discrete frame sizes. The range based stream formats
needs to be fitted with a table of resolutions inside libcamera so if
that table is updated this test might need to be updated.

Signed-off-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2019-06-19 12:25:12 +02:00
Niklas Söderlund
ce02ea29cd libcamera: v4l2_subdevice: Replace FormatEnum with ImageFormats
Replace all usage of FormatEnum with ImageFormats and completely
remove FormatEnum which is no longer needed.

Signed-off-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2019-06-19 03:06:33 +02:00
Laurent Pinchart
b2b3599b5b tests: Add CameraSensor class test
Add a test to verify media bus codes, sizes and resolution retrieval
through the CameraSensor API based on the Sensor A in the vimc pipeline.
Also check that the getFormat() method returns the expected media bus
code and size.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
2019-06-12 15:10:38 +03:00
Niklas Söderlund
d9a468aaac test: camera: Increase runtime for capture test
Upstream commit 2978a505aaa981b2 ("media: vimc: stream: fix thread state
before sleep") changes the frame rate when capturing from the vimc raw
capture video nodes. The commit changes the frame rate from thousands of
frames per second to to roughly fifty.

The libcamera capture test was written with the assumption that vimc
would keep providing this fast frame rate and ran for a very short time
to decrease the overall run time of tests. This is no longer possible
and the test fails as it can't capture enough frames in its runtime,
increase the runtime to match the new vimc frame rate.

Signed-off-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2019-06-11 15:56:36 +02:00
Kieran Bingham
339e9b2d97 test: camera: Fix initialisation
Three tests {capture,configuration_set,statemachine} override the
CameraTest::init() function, and call it as the first action.

However they were not checking the return value, and each of the tests
will segfault if the VIMC camera is not obtained.

Check the return value of the CameraTest base class initialisation and
return any errors to the test suite if initialisation fails.

Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
2019-06-10 12:29:40 +01:00
Paul Elder
87a93e17f8 libcamera: test: remove test IPA and use dummy IPA instead
Use the dummy IPA for testing/sample IPA instead of the earlier test
IPA. Remove the test IPA, and update tests and meson accordingly.

Signed-off-by: Paul Elder <paul.elder@ideasonboard.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2019-06-05 10:44:52 -04:00
Paul Elder
7fa98a4cdd libcamera: ipa_manager: implement class for managing IPA modules
IPAManager is a class that will search in given directories for IPA
modules, and will load them into a list. It also provides an interface
for pipeline handlers to acquire an IPA.

A meson build file for the IPAs is added, which also specifies a
hard-coded path for where to load the IPAs from in the installation
directory. More paths can be specified with the environment variable
LIBCAMERA_IPA_MODULE_PATH, with the same syntax as the regular PATH
environment variable. Make the test framework set this environment
variable.

Signed-off-by: Paul Elder <paul.elder@ideasonboard.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2019-06-05 10:44:52 -04:00
Paul Elder
677e8e1dfe libcamera: ipa_module_info: update struct to allow IPA matching
We need a way to match pipelines with IPA modules, so add fields in
IPAModuleInfo to hold the IPA module API version number, the pipeline
name, and the pipeline version.

The module API version is used to determine the layout of struct
IPAModuleInfo.

Also update IPA module tests and Doxygen accordingly. Doxygen needs to
be updated to accomodate __attribute__((packed)).

Signed-off-by: Paul Elder <paul.elder@ideasonboard.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2019-06-05 10:44:51 -04:00
Paul Elder
46ae1775b0 libcamera: ipa_interface: add header
Define an IPAInterface class which will contain an IPA implementation.
The methods that the IPAInterface exposes form the interface to the IPA
implementation, hence the name. IPA module shared objects will implement
this class.

This also means that IPA module shared objects must be implemented in
C++, so remove the C test IPA module.

Signed-off-by: Paul Elder <paul.elder@ideasonboard.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2019-06-05 10:44:51 -04:00
Niklas Söderlund
9342c60649 tests: list_formats: Fix argument names and add const
Argument name differs from definition and implementation, fix it by
renaming the definition. While at it make the argument const.

Signed-off-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2019-05-25 14:26:40 +02:00
Laurent Pinchart
3fac104158 meson: Create and use a dependency for libcamera and its headers
Instead of manually adding the libcamera library and include path to
every target that requires it, declare a dependency that groups the
headers as source, the library and the include path, and use it through
the project. This simplifies handling of the dependency.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
2019-05-23 13:56:33 +03:00
Laurent Pinchart
41adc3f8d3 meson: Fix coding style in meson.build files
Consistently go for 4 spaces indentation, and always put a space between
the colon in argument lists, as per the examples from the meson
documentation.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2019-05-23 11:55:45 +03:00