Commit graph

187 commits

Author SHA1 Message Date
Barnabás Pőcze
96cd064214 Documentation: Specify Doxygen OUTPUT_DIRECTORY explicitly
Currently, doxygen is run by ninja in the top-level build directory,
therefore the "Documentation" folder is always created there. However,
when libcamera is built as a subproject, it should not touch the
top-level build directory because it can cause conflicts and because
the documentation won't be created where meson thinks it will be, so
the "doxygen" target will always be dirty and installation will fail.

Signed-off-by: Barnabás Pőcze <pobrn@protonmail.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2023-01-05 12:08:35 +02:00
Laurent Pinchart
e653f4c13e Documentation: contributing: Add commit message guidelines
All developers, whether junior or experienced, can benefit from
improving their commit message writing skills. Add a paragraph to the
contribution documentation to explain this, with a link to a good guide.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
Reviewed-by: Umang Jain <umang.jain@ideasonboard.com>
2022-12-12 15:51:39 +02:00
Jacopo Mondi
29d6d0e93b libcamera: Move IPA sensor controls validation to CameraSensor
The CameraSensor class validates that the sensor driver in use supports
the controls required for IPA modules to work correctly.

For in-tree IPA modules, whose pipeline handlers already use
CameraSensor there's no need to validate such controls again.

Remove controls validation from the IPU3 and RkISP1 IPA modules and rely
on CameraSensor doing that at initialization time.

The list of mandatory controls is expanded to add V4L2_CID_ANALOGUE_GAIN
without which IPA modules cannot function.

The new requirement only applies to RAW sensors, platforms like UVC and
Simple are not impacted by this change.

While at it, expand the sensor driver requirements documentation to
include V4L2_ANALOGUE_GAIN in the list of mandatory controls a sensor
driver has to support.

Signed-off-by: Jacopo Mondi <jacopo@jmondi.org>
Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2022-11-23 18:44:35 +01:00
Kieran Bingham
0aac297afd meson: Shared Object version handling
The libcamera project is not yet ready to declare ABI nor API stability,
but it will benefit the community to be able to provide more regular
release cycles to determine 'versioned' points of history.

Ideally, these releases will be made at any ABI breakage, but can be
made at arbitary time based points along the way.

To support releases which may not be ABI stable, declare the soversion
of both the libcamera and libcamera-base library to be dependant upon
both the major minor and patch component of the project version.

As part of this, introduce a new 'Versions' summary section to highlight
the different version components that may become apparent within any
given build.

Bumping versions may leave dangling libcamera.so.* symlinks in build
directories. This will confuse Doxygen which will print during its
directory scanning phase a warning that the symlink can't be read. As we
don't need Doxygen to follow symlinks, disable it with EXCLUDE_SYMLINKS.

Reviewed-by: Jacopo Mondi <jacopo@jmondi.org>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
2022-10-13 12:40:23 +01:00
Laurent Pinchart
930b4927ac Documentation: Add missing SPDX headers
Two documentation files are missing SPDX headers. Add them, with the
CC-BY-SA-4.0 license that covers all the libcamera documentation.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
Reviewed-by: Jacopo Mondi <jacopo@jmondi.org>
2022-09-30 21:50:56 +03:00
Laurent Pinchart
084799bcad Documentation: Align Doxyfile.in style with doxygen
Align the style of Doxyfile.in with the `doxygen -g` output, to minimize
diffs in the future when updating the file with `doxygen -u`. This
includes

- Replacing tabs with spaces
- Replacing += with \ to continue lines
- Dropping the \ on the last line of an option

Also update the Doxygen version number to indicate that the file has
been updated to v1.9.5, even if no modification to the options in use
were needed.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Umang Jain <umang.jain@ideasonboard.com>
Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
2022-08-31 13:14:25 +03:00
Laurent Pinchart
836a2059f8 Documentation: Strip default options and comments from Doxyfile.in
Doxyfile.in was generated using `doxygen -g` with Doxygen v1.8.14. This
has produced a file with all options supported by Doxygen at the time,
and a handful of them have then been modified to support libcamera's
needs, with most options retaining their default.

Some of the default options have been deprecated in newer Doxygen
releases, which led to warnings when generating the documentation. The
usual process to fix this is to update the configuration file with
`doxygen -u`. This creates a big diff due to the large number of changes
to default options, which isn't quite nice. Instead, let's just drop all
the default options and the comments, to produce a small and more
readable Doxyfile.in.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Umang Jain <umang.jain@ideasonboard.com>
Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
2022-08-31 13:14:07 +03:00
Jacopo Mondi
45736468c8 libcamera: v4l2_videodevice: Reintroduce toV4L2PixelFormat()
This is a partial revert of commit 395d43d6d7 ("libcamera:
v4l2_videodevice: Drop toV4L2PixelFormat()")

The function was removed because it incorrectly maps non-contiguous V4L2
format variants (ie V4L2_PIX_FMT_YUV420M) to the API version supported
by the video device (singleplanar API and multiplanar API).  It was
decided at the time to remove the function and let its users call
directly V4L2PixelFormat::fromPixelFormat() which accepts a
'multiplanar' flags.

As we aim to associate multiple V4L2PixelFormat to a single libcamera
format, the next patches will verify which of them is actually supported
by the video device. For now, return the contiguous version
unconditionally.

Re-introduce V4L2VideoDevice::toV4L2PixelFormat() and convert all
the V4L2PixelFormat::fromPixelFormat() users to use it.

The V4L2 compatibility layer is the only outlier as it doesn't have a
video device to poke, hence it still uses
V4L2PixelFormat::fromPixelFormat().

Next patches will implement the device format matching logic and handle
the non-contiguous plane issue in V4L2VideoDevice::toV4L2PixelFormat().

Signed-off-by: Jacopo Mondi <jacopo@jmondi.org>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Tested-by: Paul Elder <paul.elder@ideasonboard.com>
2022-08-03 15:07:20 +02:00
Jacopo Mondi
83e0cee0ba guides: pipeline handler: Remove rogue spaces
Remove 4 rogue spaces from the pipeline developer guide.

Signed-off-by: Jacopo Mondi <jacopo@jmondi.org>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Tested-by: Paul Elder <paul.elder@ideasonboard.com>
2022-08-03 15:07:19 +02:00
Laurent Pinchart
d1934c6490 ipa: libipa: algorithm: Add an algorithm registration mechanism
In order to allow dynamic instantiation of algorithms based on tuning
data files, add a mechanism to register algorithms with the IPA module.
The implementation relies on an AlgorithmFactory class and a
registration macro, similar to the pipeline handler registration
mechanism. The main difference is that the algorithm registration and
instantiation are implemented in the Module class instead of the
AlgorithmFactory class, making the factory an internal implementation
detail.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Paul Elder <paul.elder@ideasonboard.com>
2022-06-29 17:21:03 +03:00
Laurent Pinchart
e135db8cb4 Documentation: Fix length of title underlines
Some title underlines don't match the title text. Fix them.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
2022-06-22 12:35:14 +03:00
Jacopo Mondi
10be87fa7c Documentation: Use language 'en' for Sphinx 5.0.0
Recent versions of Sphinx (> 5.0.0) have dropped support for the
'None' keyword as language specifier:

https://www.sphinx-doc.org/en/master/changes.html#release-5-0-0-released-may-30-2022

10474: language does not accept None as it value. The default value of
       language becomes to 'en' now. Patch by Adam Turner and Takeshi
       KOMIYA.

Causing a compile time warning:

WARNING: Invalid configuration value found: 'language = None'.
Update your configuration to a valid language code. Falling
back to 'en' (English).

Change the language setting to 'en' to silence the warning.

Signed-off-by: Jacopo Mondi <jacopo@jmondi.org>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
2022-06-20 18:19:14 +02:00
Daniel Semkowicz
d2c097c482 Documentation: Update the "Start an event loop" section
Event loop was moved to be a part of CameraManager, so it is no longer
a user responsibility to control the event dispatching.

Signed-off-by: Daniel Semkowicz <dse@thaumatec.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Jacopo Mondi <jacopo@jmondi.org>
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2022-06-17 18:08:55 +03:00
Daniel Semkowicz
d85a91cf56 Documentation: Update code examples to use the Request::reuse() method
After introduction of reuse(), there is no need of manual request
reconfiguration. Furthermore, current example code does not work
anymore.

Signed-off-by: Daniel Semkowicz <dse@thaumatec.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Jacopo Mondi <jacopo@jmondi.org>
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2022-06-17 18:08:53 +03:00
Daniel Semkowicz
14ae86f0c9 Documentation: Add the missing const to the example code
Request::BufferMap key type is now const

Signed-off-by: Daniel Semkowicz <dse@thaumatec.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Jacopo Mondi <jacopo@jmondi.org>
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2022-06-17 18:08:48 +03:00
Tommaso Merciai
f44ce70d9b Documentation: Fix createRequest unique_ptr
camera->createRequest() function return std::unique_ptr<Request>, then
manipulate Request as std::unique_ptr.
This solve the following error, during compilation:

error: cannot convert ‘std::unique_ptr<libcamera::Request>’ to ‘libcamera::Request*’ in initialization

References:
 - bb97f3bbd9/simple-cam.cpp (L369)

Signed-off-by: Tommaso Merciai <tommaso.merciai@amarulasolutions.com>
Reviewed-by: Jacopo Mondi <jacopo@jmondi.org>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2022-06-17 13:22:45 +03:00
Tomi Valkeinen
d0b310b465 Documentation: Add python-bindings.rst
Add a basic doc for the Python bindings. While not really proper
documentation yet, the file and the examples should give enough guidance
for users who are somewhat familiar with libcamera.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Jacopo Mondi <jacopo@jmondi.org>
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2022-06-08 17:31:23 +03:00
Laurent Pinchart
5757038946 libcamera: base: log: Add coloring to the log output
Extend the logger to support coloring messages. The log level is
colorized with per-level colors, and the category with a fixed color.
This makes the log output more readable.

Coloring is enabled by default when logging to std::cerr, and can be
disabled by setting the LIBCAMERA_LOG_NO_COLOR environment variable.
When logging to a file with LIBCAMERA_LOG_FILE, coloring is disabled. It
can be enabled for file logging using the logSetFile() function.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Umang Jain <umang.jain@ideasonboard.com>
Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
2022-06-06 15:09:42 +03:00
Tomi Valkeinen
1ddda31f14 meson: Use new project_*_root() functions
meson.source_root() and meson.build_root() are deprecated. Use
meson.project_source_root() and meson.project_build_root() instead.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.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>
Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
2022-05-10 13:53:43 +02:00
Quentin Schulz
1e4c4ad5f7 Documentation: Use https instead of http
Avoid a redirection from http by using https directly.

Reviewed-by: Jacopo Mondi <jacopo@jmondi.org>
Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
Cc: Quentin Schulz <foss+libcamera@0leil.net>
Signed-off-by: Quentin Schulz <quentin.schulz@theobroma-systems.com>
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2022-05-04 19:46:05 +03:00
Quentin Schulz
f5f1cbbf39 Documentation: Fix typos
A few typos made it to the docs, so let's fix them.

Reviewed-by: Jacopo Mondi <jacopo@jmondi.org>
Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
Cc: Quentin Schulz <foss+libcamera@0leil.net>
Signed-off-by: Quentin Schulz <quentin.schulz@theobroma-systems.com>
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2022-05-04 19:46:04 +03:00
Quentin Schulz
c7dbb45ea6 Documentation: Replace ’ by '
Replace U+2019 unicode character (’; right single quotation mark) by
U+27 unicode character ('; apostrophe) as it is what most people are
used to in sentences.

While Sphinx seems to be rendering both the same way, it makes it easier
for searching in rST files directly.

Reviewed-by: Jacopo Mondi <jacopo@jmondi.org>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Cc: Quentin Schulz <foss+libcamera@0leil.net>
Signed-off-by: Quentin Schulz <quentin.schulz@theobroma-systems.com>
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2022-05-04 19:45:40 +03:00
Rishikesh Donadkar
dd8b1723ac Documentation: Fix spelling error
The introduction incorrectly spells the word Compatibility. Fix it

Signed-off-by: Rishikesh Donadkar <rishikeshdonadkar@gmail.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>
2022-04-15 19:01:51 +03:00
Laurent Pinchart
c45f9ce04c Documentation: Briefly document the mail-based contribution process
While familiarity with git is nowadays common, many developers are not
familiar with mail-based patch submission. Add a paragraph to the
contribution guide to mention that libcamera uses a mail-based process
(which seems to have been taken for granted so much that we forgot to
say it explicitly), and link to git-send-email.io to help newcomers
setup git-send-email.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Umang Jain <umang.jain@ideasonboard.com>
Reviewed-by: Jacopo Mondi <jacopo@jmondi.org>
2022-04-06 13:14:52 +03:00
Kunal Agarwal
a2aa1b4c4e Documentation: guides: introduction: Fix spelling errors
Fixes two spelling mistakes in introduction.rst
This patch has no functional changes.

Signed-off-by: Kunal Agarwal <kunalagarwal1072002@gmail.com>
Reviewed-by: Vedant Paranjape <vedantparanjape160201@gmail.com>
Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
Reviewed-by: Umang Jain <umang.jain@ideasonboard.com>
Signed-off-by: Umang Jain <umang.jain@ideasonboard.com>
2022-04-02 01:10:03 +05:30
Eugen Hristev via libcamera-devel
030e6f389e Documentation: guides: introduction: Fix typos
Fix typos.

Signed-off-by: Eugen Hristev <eugen.hristev@microchip.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Jacopo Mondi <jacopo@jmondi.org>
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2021-12-29 21:35:26 +02:00
Han-Lin Chen
6e80c1bcf4 libcamera: camera_lens: Add a new class to model a camera lens
The CameraLens class abstracts camera lens and provides helper
functions to ease interactions with them.

Signed-off-by: Han-Lin Chen <hanlinchen@chromium.org>
Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Umang Jain <umang.jain@ideasonboard.com>
Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
2021-12-03 10:23:26 +00:00
Paul Elder
8acc82ec0d guides: tracing: Mention where to find the trace file
Add a couple sentences describing where to find the trace file, and how
to view it even after the tracing session is destroyed.

Signed-off-by: Paul Elder <paul.elder@ideasonboard.com>
Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
2021-12-01 15:42:55 +00:00
Laurent Pinchart
f2a1817275 Documentation: coding-style: Document the git commit hooks
checkstyle.py is ignored too often. Document how to automate its usage
through git commit hooks.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Umang Jain <umang.jain@ideasonboard.com>
Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
2021-11-18 17:47:56 +02:00
Laurent Pinchart
79ec22a559 Documentation: coding-style: Document error handling rules
Following a conversation on the mailing list about the use of
assertions, document the error handling strategy in libcamera. This is
an initial set of rules that are expected be extended and detailed in
the future.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
2021-10-30 17:38:11 +03:00
Laurent Pinchart
398c0d611a Documentation: Fix build when the IPU3 pipeline handler is disabled
When the IPU3 pipeline handler is disabled, the corresponding IPA module
isn't compiled, which results in the meson ipu3_ipa_sources variable to
be undefined. The variable is used unconditionally as part of the
Doxygen inputs, so Meson complains at configuration time that it is
undefined.

Fix it by including the IPU3 IPA documentation in the Doxygen build only
when the IPU3 pipeline handler is enabled.

Fixes: 45dd519889 ("Documentation: Include IPU3 in Doxygen build")
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
2021-10-30 17:38:11 +03:00
Kieran Bingham
45dd519889 Documentation: Include IPU3 in Doxygen build
The IPU3 is documented using Doxygen within the code.

Include the IPU3 IPA as part of the doxygen build sources. This will
ideally be split to its own 'section' of the doxygen output.

Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
Signed-off-by: Jean-Michel Hautbois <jeanmichel.hautbois@ideasonboard.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2021-10-26 14:08:37 +02:00
Laurent Pinchart
2d5a78f664 Documentation: application-developer: Add camera detection check
The simple-cam application has a check to ensure that at least one
camera is present before attempting to access the first camera, to avoid
a crash. Update the application developer's guide to match this
behaviour.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Paul Elder <paul.elder@ideasonboard.com>
Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
2021-09-27 23:41:18 +03:00
Laurent Pinchart
348df7bc4b Documentation: application-developer: Use correct type to store size
The return type of std::vector::size() is size_t. Use the same type,
instead of unsigned int, to store its return value when retrieving the
number of allocated buffers.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Paul Elder <paul.elder@ideasonboard.com>
Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
2021-09-27 23:41:18 +03:00
Laurent Pinchart
1ec7072827 Documentation: application-developer: Make global variable static
The global "camera" variable isn't accessed outside of its compilation
unit. Make it static.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Paul Elder <paul.elder@ideasonboard.com>
Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
2021-09-27 23:41:18 +03:00
Laurent Pinchart
40f5fddca7 libcamera: Standardize URLs to git repositories
When the libcamera project was started, we had no public git tree hosted
on git.libcamera.org. The problem has been addressed a while ago, and
the git.linuxtv.org libcamera repository is now a mirror of the main git
tree. The mirror is useful to benefit from the linuxtv.org automated
compile tests, but it can also confuse users who don't know where the
official version is. To try and clarify this, use the git.libcamera.org
URL consistently through the project.

This doesn't void the validatity of the linuxtv.org repository which
will continue to mirror the libcamera.org repository.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Umang Jain <umang.jain@ideasonboard.com>
Reviewed-by: Paul Elder <paul.elder@ideasonboard.com>
2021-09-24 13:25:33 +03:00
Laurent Pinchart
32635054bc libcamera: framebuffer: Prevent modifying the number of metadata planes
The number of metadata planes should always match the number of frame
buffer planes. Enforce this by making the vector private and providing
accessor functions.

As this changes the public API, update all in-tree users accordingly.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
Reviewed-by: Jean-Michel Hautbois <jeanmichel.hautbois@ideasonboard.com>
Reviewed-by: Hirokazu Honda <hiroh@chromium.org>
2021-09-07 19:18:31 +03:00
Laurent Pinchart
395d43d6d7 libcamera: v4l2_videodevice: Drop toV4L2PixelFormat()
The V4L2VideoDevice::toV4L2PixelFormat() function is incorrectly
implemented, as it will pick a multi-planar format if the device
supports the multi-planar API, even if only single-planar formats are
supported. This currently works because the implementation calls
V4L2PixelFormat::fromPixelFormat(), which ignores the multiplanar
argument and always returns a single-planar format.

Fixing this isn't trivial. As we don't need to support multi-planar V4L2
formats at this point, drop the function instead of pretending
everything is fine, and call V4L2PixelFormat::fromPixelFormat() directly
from pipeline handlers. As the single-planar case is the most common,
set the multiplanar argument to false by default to avoid long lines.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Jean-Michel Hautbois <jeanmichel.hautbois@ideasonboard.com>
Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
Reviewed-by: Hirokazu Honda <hiroh@chromium.org>
2021-09-07 19:17:46 +03:00
Laurent Pinchart
58720e1dc9 libcamera: base: signal: Support connecting signals to functors
It can be useful to connect a signal to a functor, and in particular a
lambda function, while still operating in the context of a receiver
object (to support both object-based disconnection and queued
connections to Object instances).

Add a BoundMethodFunctor class to bind a functor, and a corresponding
Signal::connect() function. There is no corresponding disconnect()
function, as a lambda passed to connect() can't be later passed to
disconnect(). Disconnection typically uses disconnect(T *object), which
will cover the vast majority of use cases.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Umang Jain <umang.jain@ideasonboard.com>
2021-09-02 01:16:45 +03:00
Kieran Bingham
183c834b93 Documentation: Explicitly enable Dot
The dot package is identified as a required package for the Documentation, and
already marked as a required dependency with meson.

If meson can not find 'dot', then the documentation will not be built,
so we can explicitly enable it in our Doxyfile.

Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2021-08-27 14:03:47 +01:00
Kieran Bingham
3fc1d1ed51 Documentation: Remove obsoleted config
The CLASS_DIAGRAMS option has become obsolete, and we already define the
default value.

Remove it.

Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2021-08-27 14:03:47 +01:00
Kieran Bingham
e89d8c7e50 Documentation: application-developer: Fix up spelling error
Fix a minor spelling error.

Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
2021-08-25 21:35:03 +01:00
Kieran Bingham
6b9645d894 Documentation: application-developer: Fix reference to cam BufferWriter
The BufferWriter class has been replaced by the FileSink.

Adapt the reference, to match the source code.

Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
2021-08-25 21:35:03 +01:00
Kieran Bingham
e590ca3004 Documentation: application-developer: Recommend unique_ptr for CameraManager
The CameraManager object should be deleted when it is no longer used to
prevent it from leaking.

When the application closes, the memory will be released, but it would
show up in reports from memory validation tools such as valgrind if not
handled correctly.

Recommend best-practices in the guide and ensure it is automatically
cleaned up when the CameraManager goes out of scope.

Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
2021-08-25 21:35:03 +01:00
Kieran Bingham
d2783171dd Documentation: application-developer: Clean up build instructions
The build and run instructions read as if meson is the only way to
compile the application. Although this is recommended, it is not
required - adapt the language to fit better.

While here, fix the naming of the simple_cam meson object to match
the other usages of 'simple-cam'.

Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
2021-08-25 21:35:03 +01:00
Kieran Bingham
fe8b72a595 Documentation: application-developer: Remove irrelevant TODO
This TODO has no real meaning, and isn't an action. Remove it.

Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
2021-08-25 21:35:03 +01:00
Laurent Pinchart
e991bb2c36 Documentation: Drop deprecated Doxygen options
The Doxygen LATEX_SOURCE_CODE, RTF_SOURCE_CODE and
DOCBOOK_PROGRAMLISTING options are deprecated, and generate warnings
with the Doxygen's master branch. Drop them.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
2021-08-21 16:20:46 +03:00
Laurent Pinchart
1815a0290f Documentation: guides: pipeline-handler: Migrate to Camera::Private
Update the pipeline handler guide following the migration from the
CameraData class to the Camera::Private class.

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>
2021-08-17 00:24:16 +03:00
Laurent Pinchart
bcab244b1f libcamera: pipeline_handler: Move CameraData members to Camera::Private
With pipeline handlers now being able to subclass Camera::Private, start
the migration from CameraData to Camera::Private by moving the members
of the base CameraData class. The controlInfo_, properties_ and pipe_
members are duplicated for now, to allow migrating pipeline handlers one
by one.

The Camera::Private class is now properly documented, don't exclude it
from documentation generation.

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>
2021-08-16 23:57:28 +03:00
Kieran Bingham
0e1ff86e78 clang-format: Regroup sort orders
Utilise the clang-format header sort to provide a regex based pattern
match for our header inclusion coding style.

The rules are updated to match as closely as possible the existing
practices and the documentation is updated accordingly.

Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Jean-Michel Hautbois <jeanmichel.hautbois@ideasonboard.com>
Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
2021-08-11 10:33:40 +01:00