Commit graph

1526 commits

Author SHA1 Message Date
Laurent Pinchart
4d50cc9404 libcamera: pipeline: vimc: Store media device pointer in camera data
Store the MediaDevice for the VIMC instance in the VimcCameraData class.
This will be used to check the media device version at runtime.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
2020-05-02 01:11:46 +03:00
Laurent Pinchart
554cbc0fa8 libcamera: media_device: Expose media device API version number
Add a MediaDevice::version() function to expose the media device API
version number. This can be useful to support driver API changes in
pipeline handlers.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
2020-05-02 01:11:46 +03:00
Niklas Söderlund
4866bf6fe7 libcamera: stream: Expose stride value
Expose the image stride  which may be retrieved after a video device
has been configured. It may only be retrieved at that point as the
assignment of video devices takes place at this point.

In the future video devices should be assigned at configuration
validation time and the stride value retrieved at that point.

Signed-off-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2020-05-01 17:07:33 +02:00
Laurent Pinchart
6adb37d719 libcamera: Add Python cache and compiled files to .gitignore
To prepare for more widespread use of Python in libcamera, ignore Python
cache and compiled files produced when importing modules directly from
the source tree.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
2020-05-01 17:51:59 +03:00
Laurent Pinchart
1c883def04 libcamera: Set -Wno-psabi on gcc 7 and 8 for arm
gcc 7.1 introduced processor-specific ABI breakages related to parameter
passing on ARM platforms. This generates a large number of messages
during compilation with gcc >=7.1 until gcc 9. Silence them.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
2020-05-01 17:51:59 +03:00
Niklas Söderlund
dee99d4726 qcam: Check that camera can generate configuration from roles
If the camera can not generate a configuration from the requested roles
it returns a nullptr which leads to a nullptr dereference. Fix this by
adding a check that the camera generated a configuration before trying
to access it.

Signed-off-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2020-05-01 12:24:07 +02:00
Niklas Söderlund
d29c321357 qcam: Make use of StreamKeyValueParser
Use the StreamKeyValueParser helper to parse stream configuration from
the command line. This extends qcam to accept role hints and pixel
format in addition to a size.

Currently only one viewfinder stream is supported, add a check to keep
this behavior. Going forward this restriction will be lifted to support
more then one stream.

Signed-off-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2020-05-01 12:24:07 +02:00
Niklas Söderlund
18cfea19dc cam: Make use of StreamKeyValueParser
Use the StreamOptionsParser helper to parse stream configuration from
the command line.

Signed-off-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2020-05-01 12:24:07 +02:00
Niklas Söderlund
693ab88162 cam: Add helper class to parse stream configuration
Create a new helper class StreamKeyValueParser to parse command line
options describing stream configurations. The goal is to share this new
class between cam and qcam.

Signed-off-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2020-05-01 12:24:07 +02:00
Niklas Söderlund
cdf7fbe35e cam: options: Add public method to invalidate options
Extend OptionsBase<T> with a public invalidate() method. This allows for
further examination of the options and if found unsuitable be
invalidated. The intended user for this new interface are subclasses of
KeyValueParser.

Signed-off-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2020-05-01 12:24:07 +02:00
Niklas Söderlund
e66d4f3823 cam: options: Make KeyValueParser::parse() virtual
Prepare for sub-classing of the KeyValueParser by making the parse()
method virtual.

Signed-off-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2020-05-01 12:24:07 +02:00
Umang Jain
f703aa0600 qcam: main_window: Fix combo-box entry selection on startup
When one of the camera is selected and opened from the
"Select Cameras" items list, the entry of the combo-box
in the main-window doesn't update its item index to reflect
the camera which was earlier selected. Fix that.

Signed-off-by: Umang Jain <email@uajain.com>
Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Tested-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2020-04-30 19:05:46 +03:00
Umang Jain
e5716bebb3 qcam: main_window: Make cameraCombo_ private
This commit introduces no functional changes.
This is required so that the combo-box list can be managed
conveniently from various private functions in subsequent
commit.

Signed-off-by: Umang Jain <email@uajain.com>
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>
2020-04-30 19:04:47 +03:00
Laurent Pinchart
81ac45ba68 libcamera: v4l2_pixelformat: Fix V4L2_PIX_FMT_SBGGR10P format
The V4L2_PIX_FMT_SBGGR10P format was misspecified as
V4L2_PIX_FMT_SBGGR10. Fix it.

Fixes: 00d639d951 ("libcamera: formats: Add support for 8-, 10- and 12-bit Bayer formats")
Reported-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Tested-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
2020-04-30 17:27:34 +03:00
Laurent Pinchart
4615beafd1 libcamera: formats: Add additional data to PixelFormatInfo
Add three additional fields to PixelFormatInfo to report the number of
bits per pixel, the colour encoding, and the data packing.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
2020-04-30 16:37:20 +03:00
Laurent Pinchart
00d639d951 libcamera: formats: Add support for 8-, 10- and 12-bit Bayer formats
Add the 8-, 10- and 12-but Bayer formats, in both unpacked and
MIPI-packed variants, to the format tables in PixelFormatInfo and
V4L2PixelFormat.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
2020-04-30 16:37:17 +03:00
Laurent Pinchart
37332ad50b libcamera: formats: Expose PixelFormatInfo as an internal API
To prepare for storing more information about pixel formats in
PixelFormatInfo, move the class to formats.cpp and document it. The
pixel formats database is moved to the same file, and a new static
function is added to PixelFormatInfo to retrieve a PixelFormatInfo for a
PixelFormat.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
2020-04-30 14:54:03 +03:00
Laurent Pinchart
dcabb8e354 libcamera: v4l2_pixelformat: Use maps to convert between DRM and V4L2
Replace the two big manual switch...case with maps. This should not just
improve efficiency when we will have a larger number of formats, but
also paves the way to storing more format information to create
additional helpers.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
2020-04-30 14:49:00 +03:00
Laurent Pinchart
2bc657f47b libcamera: v4l2_pixelformat: Move DRM/V4L2 format conversion
Move the DRM/V4L2 format conversion code from V4L2VideoDevice to
V4L2PixelFormat. This is a more natural home for the code.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
2020-04-30 14:46:12 +03:00
Laurent Pinchart
09044794b4 libcamera: v4l2_pixelformat: Move V4L2PixelFormat to a new file
Move the V4L2PixelFormat class to a new file to prepare for additional
changes that will make it grow. No functional modification is included.

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>
2020-04-30 14:44:59 +03:00
Laurent Pinchart
25a101846d libcamera: Build IPA module signatures by default
Commit 7206035ee6 ("libcamera: Regenerate IPA module signatures at
install time") replaced installation of the IPA module signatures with
an install script that signs all modules. While doing so, it
inadvertently also disabled generation of the signature at build time by
default. This breaks running libcamera binaries from the build
directory. Fix it.

Fixes: 7206035ee6 ("libcamera: Regenerate IPA module signatures at install time")
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>
2020-04-30 13:18:05 +03:00
Kieran Bingham
9e41dfbbff libcamera: utils: Identify the 'real' build path
Call realpath() to strip out any levels of indirection required in
referencing the root build directory.

This simplifies the debug output when reporting and parsing paths.

Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2020-04-30 10:24:24 +01:00
Kieran Bingham
389c19c267 libcamera: ipa_manager: Fix build path comments
The comments describe functionality before libcameraBuildPath() was
adapted from libcameraPath() to return the root of the build, and
described having to take a relative path.

This is no longer the case, and the comment is inaccurate. Fix it.

Fixes: 1b8ac8473c ("libcamera: utils: Adapt libcameraPath to match use cases")
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>
2020-04-30 10:21:49 +01:00
Laurent Pinchart
bcf986d07b libcamera: ipa_module: Add log prefix
Make the IPAModule class inherit from Loggable to log the IPA module
name in all messages.

Before:

[14:19:55.743795676] [20250] ERROR IPAModule ipa_module.cpp:279 IPA module is not an ELF file

After:

[14:20:22.343795887] [20270] ERROR IPAModule ipa_module.cpp:279 ipa_vimc.so: IPA module is not an ELF file

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
2020-04-30 04:04:04 +03:00
Laurent Pinchart
bf01e04f29 qcam: Fix logging of sequence number
The sequence number of captured frames is logged to the console with
padding to 6 characters to increase readability. The output is however
incorrect, as 123 is printed as 00012300000. This is caused by the
auto-space feature of QDebug, which inserts a space after every field.
This doesn't play well with stream format manipulation, as it ends up
padding the automatically inserted space the same way as the previous
argument.

This is a bug in Qt, work around it by formatting the sequence number
manually.

Fixes: 494da4467d ("qcam: Use Qt qInfo() and qWarning() logging facilities")
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
2020-04-30 03:55:32 +03:00
Dafna Hirschfeld
80551b8754 libcamera: pipeline: rkisp1: Don't fail if sensorInfo fails
When starting the streaming, it might be that the call
to sensorInfo fails. This does not mean that the camera can't
stream so set 'ret' to 0.

Fixes: fd554f9dba ("libcamera: ipa: Add support for CameraSensorInfo")
Signed-off-by: Dafna Hirschfeld <dafna.hirschfeld@collabora.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2020-04-30 00:46:17 +03:00
Laurent Pinchart
49856afa01 utils: hooks: pre-push: Catch commits without reviews
Improve the pre-push git hook script to reject commits without at least
one Reviewed-by line.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
2020-04-30 00:43:09 +03:00
Laurent Pinchart
fcfbec801b utils: hooks: pre-push: Catch commits without committer's SoB
Improve the pre-push git hook script to reject commits without the
committer's Signed-off-by line.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
2020-04-30 00:43:09 +03:00
Laurent Pinchart
7206035ee6 libcamera: Regenerate IPA module signatures at install time
When the IPA modules are installed, meson strips the DT_RPATH and
DT_RUNPATH from the binaries. This invalidates the signatures. Disable
installation of the .sign files and add an installation script to
regenerate them directly in the target directory. The .sign files still
need to be created at build time to support running IPA modules from the
build tree.

Two alternative approaches have been considered:

- meson could be taught a new target argument to preserve binary
  compatibility by skipping any operation that modifies files. This has
  been proposed in the #mesonbuild IRC channel. While this could be
  interesting in the longer term, we need to fix the issue now.

- The module signatures could be computed on selected sections only.
  While skipping the .dynamic section when signing may not cause
  security issues, it would make signature generation and verification
  more complex, and wasn't deemed worth it.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
2020-04-29 15:17:42 +03:00
David Plowman
668cefa7e6 libcamera: controls: Add sensor black levels reporting through metadata
The black levels will be used when saving RAW data in DNG containers.

Four values are reported, one for each channel, in the order R, Gr, Gb
and B. The values are reported as being out of a 16-bit pixel range
(a fully saturated pixel would be 65535), so may need subsequent
re-scaling, depending on use.

Signed-off-by: David Plowman <david.plowman@raspberrypi.com>
Signed-off-by: Naushir Patuck <naush@raspberrypi.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2020-04-29 03:34:24 +03:00
Jacopo Mondi
fd554f9dba libcamera: ipa: Add support for CameraSensorInfo
Add support for camera sensor information in the libcamera IPA protocol.

Define a new 'struct ipa_sensor_info' structure in the IPA context and
use it to perform translation between the C and the C++ API.

Update the IPAInterface::configure() operation to accept a new
CameraSensorInfo parameter and port all users of that function to
the new interface.

Signed-off-by: Jacopo Mondi <jacopo@jmondi.org>
2020-04-28 22:25:23 +02:00
Jacopo Mondi
ee4bb92aae libcamera: camera_sensor: Add method to get sensor info
Add a method to retrieve the CameraSensorInfo to the CameraSensor class.

Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Jacopo Mondi <jacopo@jmondi.org>
2020-04-28 22:25:22 +02:00
Jacopo Mondi
5db1426b60 libcamera: v4l2_subdevice: Add format information
Define a map of static information associated with a media bus code.
Start by reporting the bits-per-pixel for each media bus code defined by
the V4L2 kernel API, to later expand it when necessary.

Add to the V4L2SubdeviceFormat class a method to return the bits per
pixel, retrieved by inspecting the static map of format information.

While at it, remove a rogue map inclusion from header file.

Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Jacopo Mondi <jacopo@jmondi.org>
2020-04-28 22:25:22 +02:00
Jacopo Mondi
56baa28a79 libcamera: camera_sensor: Define CameraSensorInfo
Define the CameraSensorInfo structure that reports the current image sensor
configuration.

Signed-off-by: Jacopo Mondi <jacopo@jmondi.org>
2020-04-28 22:25:22 +02:00
Jacopo Mondi
0e36d26dad libcamera: v4l2_subdevice: Implement getSelection()
Implement V4L2Subdevice::getSelection() to support retrieving selection
rectangles from the V4L2 subdevice.

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>
2020-04-28 22:25:21 +02:00
Jacopo Mondi
b8728b76a6 libcamera: v4l2_videodevice: Expose setSelection()
Expose V4L2Videodevice::setSelection() method and drop
V4L2Videodevice::setCrop() and V4L2Videodevice::setComopse() as wrapping
each target with a single function does not provide any benefit.

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>
2020-04-28 22:24:34 +02:00
Jacopo Mondi
e8d4797ef5 libcamera: v4l2_subdevice: Expose setSelection()
Expose V4L2Subdevice::setSelection() method and drop
V4L2Subdevice::setCrop() and V4L2Subdevice::setComopse() as wrapping
each target with a single function does not provide any benefit.

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>
2020-04-28 22:24:00 +02:00
Laurent Pinchart
6ed463911d libcamera: pipeline: vimc: Name camera based on sensor model
Use the sensor model to create the camera name. The resulting name
should still be "VIMC Sensor B", but prepares for support of Sensor A.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Jacopo Mondi <jacopo@jmondi.org>
2020-04-28 23:13:27 +03:00
Laurent Pinchart
5c8570cf37 test: camera_sensor: Test the model() function
Verify that the sensor model matches the expected value. The whole model
extraction heuristic isn't fully tested as that would require being able
to inject different entity names. It is still useful as an initial step.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Jacopo Mondi <jacopo@jmondi.org>
2020-04-28 23:13:26 +03:00
Laurent Pinchart
6886365753 libcamera: camera_sensor: Add model() function
Add a new model() function to the CameraSensor class to report the
camera sensor model.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Jacopo Mondi <jacopo@jmondi.org>
2020-04-28 23:13:22 +03:00
Laurent Pinchart
79ab0e925a libcamera: v4l2_device: Simplify usage of getControls()
The V4L2Device::getControls() function takes a ControlList that needs to
be pre-populated with dummy entries for the controls that need to be
read. This is a cumbersome API, especially when reading a single
control. Make it nicer by passing the list of V4L2 controls as a vector
of control IDs, and returning a ControlList.

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>
2020-04-28 20:44:48 +03:00
Laurent Pinchart
d4680c8ca2 libcamera: controls: Add rectangle and size control types
Add two control types to store rectangles and sizes. These will be
useful for the properties related to the pixel array.

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>
2020-04-28 20:44:47 +03:00
Laurent Pinchart
8a9be175a7 ipa: vimc: Validate configuration file in init()
Make sure we can open the configuration file passed to the init()
function, and return an error otherwise.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Jacopo Mondi <jacopo@jmondi.org>
Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
2020-04-28 01:54:57 +03:00
Laurent Pinchart
32df46f0b6 test: ipa: ipa_interface: Pass configuration file to IPA init()
Pass the vimc IPA dummy configuration file to the IPA init() function.
This will be used by the IPA to validate the init() call.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Jacopo Mondi <jacopo@jmondi.org>
Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
2020-04-28 01:54:56 +03:00
Laurent Pinchart
e951a2af20 libcamera: pipeline: vimc: Pass configuration file to IPA init()
Pass the vimc IPA dummy configuration file to the IPA init() function.
This will be used by the IPA to validate the init() call.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Jacopo Mondi <jacopo@jmondi.org>
Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
2020-04-28 01:54:55 +03:00
Laurent Pinchart
58e6970ba7 ipa: vimc: Add a dummy configuration file to the vimc IPA
The file will be used to test the corresponding APIs.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Jacopo Mondi <jacopo@jmondi.org>
Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
2020-04-28 01:54:53 +03:00
Laurent Pinchart
a6de903089 ipa: Pass IPA initialization settings to IPAInterface::init()
Add a new IPASettings class to pass IPA initialization settings through
the IPAInterface::init() method. The settings currently only contain the
name of a configuration file, and are expected to be extended later.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Jacopo Mondi <jacopo@jmondi.org>
2020-04-28 01:54:49 +03:00
Laurent Pinchart
26a4b03ed8 libcamera: ipa_manager: Return an IPAProxy from createIPA()
In order to provide pipeline handlers with IPA-related helpers on top of
IPAInterface, return the IPAProxy instance from IPAManager::createIPA().
No change is required in the pipeline handlers as the IPAInterface that
was previously returned is implemented by an IPAProxy instance already.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Jacopo Mondi <jacopo@jmondi.org>
Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
2020-04-28 01:54:47 +03:00
Laurent Pinchart
53d3f4152a libcamera: ipa_proxy: Provide suport for IPA configuration files
IPA modules may require configuration files, which may be stored in
different locations in the file system. To standardize file locations
between all IPAs and pipeline handlers, provide a helper function to
locate a configuration file by searching in the following directories:

- All directories specified in the LIBCAMERA_IPA_CONFIG_PATH environment
  variable ; or
- In the source tree if libcamera is not installed ; otherwise
- In standard system locations (etc and share directories).

When stored in the source tree, configuration files shall be located in
a 'data' subdirectory of their respective IPA directory.

More locations, or extensions to the mechanism, may be implemented
later.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
2020-04-28 01:54:41 +03:00
Laurent Pinchart
78f685df8a libcamera: ipa_proxy: Don't include <iostream>
The iostream header isn't needed. Drop it.

Fixes: c2a8217df5 ("libcamera: add IPA proxy")
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Jacopo Mondi <jacopo@jmondi.org>
Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
2020-04-28 01:54:40 +03:00