summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
6 daysapps: cam: capture_script: Disallow arrays of stringsBarnabás Pőcze
The current `ControlValue` mechanism does not support arrays of strings, the assignment in the removed snippet will in fact trigger an assertion failure in `ControlValue::set()` because `sizeof(std::string) != ControlValueSize[ControlTypeString]`. Fixes: b35f04b3c194 ("cam: capture_script: Support parsing array controls") Signed-off-by: Barnabás Pőcze <barnabas.pocze@ideasonboard.com> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com> Reviewed-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com> Reviewed-by: Paul Elder <paul.elder@ideasonboard.com>
6 dayslibcamera: pipeline: uvcvideo: Report new AeEnable control as availableBarnabás Pőcze
The `AeEnable` control is handled by the `Camera` class directly, but it still has to be added because `ControlInfoMap`s are not easily modifiable. See 338ba00e7abfe8 ("ipa: rkisp1: agc: Report new AeEnable control as available") for more details and a similar change in rkisp1. Signed-off-by: Barnabás Pőcze <barnabas.pocze@ideasonboard.com> Reviewed-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
6 dayslibcamera: controls: Fix `ControlInfoMap::count(unsigned int)`Barnabás Pőcze
The two overloads of `find()` and `at()` have the same behaviour regardless of the argument type: `unsigned int` or `const ControlId *`. However, `count()` is not so because `count(unsigned int)` only checks the `ControlIdMap`, and it does not check if the given id is actually present in the map storing the `ControlInfo` objects. So `count()` returns 1 for every control id that is present in the associated `ControlIdMap` regardless of whether there is an actual entry for the `ControlId` associated with the given numeric id. Fix that by simply using `find()` to determine the return value. Fixes: 76b9923e55fd61 ("libcamera: controls: Avoid exception in ControlInfoMap count() and find()") Signed-off-by: Barnabás Pőcze <barnabas.pocze@ideasonboard.com> Reviewed-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com> Reviewed-by: Paul Elder <paul.elder@ideasonboard.com>
8 daysipa: rkisp1: awb: Avoid division by zeroStefan Klug
As the gains can also be specified manually, the regulation can run into numeric instabilities by dividing by near zero. Mitigate that by applying a small minium value. Signed-off-by: Stefan Klug <stefan.klug@ideasonboard.com> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com> Reviewed-by: Paul Elder <paul.elder@ideasonboard.com>
8 daysipa: rkisp1: awb: Take the CCM into account for the AWB gains calculationStefan Klug
The AWB measurements are taken after the CCM. This can be seen by enabling debug logging on AWB, disabling AWB (stats will still be processed) and manually chaning the CCM. This means that the estimated colour temperature and the corresponding CCM also lead to changed rgbMeans which in turn leads to oscillations. Fix that by applying the inverse transform on the rgbMeans. Signed-off-by: Stefan Klug <stefan.klug@ideasonboard.com> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Paul Elder <paul.elder@ideasonboard.com>
8 daysipa: rkisp1: Damp color temperature regulationStefan Klug
Damp the regulation of the color temperature with the same factor as the gains. Not damping the color temperature leads to visible flicker, as the CCM changes too much. Signed-off-by: Stefan Klug <stefan.klug@ideasonboard.com> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com> Reviewed-by: Paul Elder <paul.elder@ideasonboard.com>
8 dayslibipa: awb: Make result of gainsFromColourTemp optionalStefan Klug
In the grey world AWB case, if no colour gains are contained in the tuning file, the colour gains get reset to 1 when the colour temperature is set manually. This is unexpected and undesirable. Allow the gainsFromColourTemp() function to return a std::nullopt to handle that case. While at it, remove an unnecessary import from rkisp1/algorithms/awb.h. Signed-off-by: Stefan Klug <stefan.klug@ideasonboard.com> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com> Reviewed-by: Paul Elder <paul.elder@ideasonboard.com>
8 daysipa: rkisp1: Implement manual ColourCorrectionMatrix controlStefan Klug
Add a manual ColourCorrectionMatrix control. This was already discussed while implementing manual colour temperature but was never implemented. The control allows to manually specify the CCM when AwbEnable is false. Signed-off-by: Stefan Klug <stefan.klug@ideasonboard.com> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com> Reviewed-by: Paul Elder <paul.elder@ideasonboard.com>
8 daysipa: rkisp1: ccm/lsc: Fix CCM/LSC based on manual color temperatureStefan Klug
In RkISP1Awb::process(), the color temperature in the active state is updated every time new statistics are available. The CCM/LSC algorithms use that value in prepare() to update the CCM/LSC. This is not correct if the color temperature was specified manually and leads to visible flicker even when AwbEnable is set to false. To fix that, track the auto and manual color temperature separately in active state. In Awb::prepare() the current frame context is updated with the corresponding value from active state. Change the algorithms to fetch the color temperature from the frame context instead of the active state in prepare(). Fixes: 02308809548d ("ipa: rkisp1: awb: Implement ColourTemperature control") Signed-off-by: Stefan Klug <stefan.klug@ideasonboard.com> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com> Reviewed-by: Paul Elder <paul.elder@ideasonboard.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
9 daysipa: rkisp1: algorithms: awb: Fix wrong colour temperature reportingStefan Klug
In commit b60bd37b1a49 ("ipa: rkisp1: Move calculation of RGB means into own function") the output of the current measured colour temperature as metadata was incorrectly added. Remove it. Fixes: b60bd37b1a49 ("ipa: rkisp1: Move calculation of RGB means into own function") Signed-off-by: Stefan Klug <stefan.klug@ideasonboard.com> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Paul Elder <paul.elder@ideasonboard.com>
9 daysipa: rkisp1: Refactor automatic/manual structure in IPAActiveStateStefan Klug
Swap gains and automatic/manual in the IPAActiveState structure. This is in preparation to adding another member, which is easier in the new structure. The patch contains no functional changes. Signed-off-by: Stefan Klug <stefan.klug@ideasonboard.com> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
9 dayslibcamera: vector: Extend matrix multiplication operator to heterogenous typesLaurent Pinchart
It is useful to multiply matrices and vectors of heterogeneous types, for instance float and double. Extend the multiplication operator to support this, avoiding the need to convert one of the operations. The type of the returned vector is selected automatically to avoid loosing precision. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Stefan Klug <stefan.klug@ideasonboard.com> Acked-by: Kieran Bingham <kieran.bingham@ideasonboard.com> Reviewed-by: Paul Elder <paul.elder@ideasonboard.com>
9 dayslibcamera: matrix: Extend multiplication operator to heterogenous typesLaurent Pinchart
It is useful to multiply matrices of heterogneous types, for instance float and double. Extend the multiplication operator to support this, avoiding the need to convert one of the matrices. The type of the returned matrix is selected automatically to avoid loosing precision. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Stefan Klug <stefan.klug@ideasonboard.com> Acked-by: Kieran Bingham <kieran.bingham@ideasonboard.com> Reviewed-by: Paul Elder <paul.elder@ideasonboard.com>
9 daystest: Add minimal test for MatrixStefan Klug
Add a few tests for the Matrix class. This is not full fledged but at least a starter. Signed-off-by: Stefan Klug <stefan.klug@ideasonboard.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com> Reviewed-by: Paul Elder <paul.elder@ideasonboard.com>
9 dayslibcamera: matrix: Add inverse() functionStefan Klug
For calculations in upcoming algorithm patches, the inverse of a matrix is required. Add an implementation of the inverse() function for square matrices. Signed-off-by: Stefan Klug <stefan.klug@ideasonboard.com> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com> Reviewed-by: Paul Elder <paul.elder@ideasonboard.com>
9 dayslibcamera: vector: Add a Span based constructorStefan Klug
When one wants to create a Vector from existing data, currently the only way is via std::array. Add a Span based constructor to allow creation from std::vectors and alike. While at it, replace the manual loop with std::copy. Signed-off-by: Stefan Klug <stefan.klug@ideasonboard.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com> Reviewed-by: Paul Elder <paul.elder@ideasonboard.com>
9 dayslibcamera: matrix: Add a Span based constructorStefan Klug
When one wants to create a Matrix from existing data, currently the only way is via std::array. Add a Span based constructor to allow creation from vectors and alike. Signed-off-by: Stefan Klug <stefan.klug@ideasonboard.com> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Paul Elder <paul.elder@ideasonboard.com>
9 dayslibcamera: matrix: Make most functions constexprStefan Klug
By zero-initializing the data_ member we can make most functions constexpr which will come in handy in upcoming patches. Note that this is due to C++17. In C++20 we will be able to leave data_ uninitialized for constexpr. The Matrix(std::array) version of the constructor can not be constexpr because std::copy only became constexpr in C++20. Signed-off-by: Stefan Klug <stefan.klug@ideasonboard.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com> Reviewed-by: Paul Elder <paul.elder@ideasonboard.com>
9 dayslibcamera: matrix: Replace SFINAE with static_assertsStefan Klug
SFINAE is difficult to read and not needed in these cases. Replace it with static_asserts. The idea came from [1] where it is stated: "The use of enable_if seems misguided to me. SFINAE is useful for the situation where we consider multiple candidates for something (overloads or class template specializations) and try to choose the correct one, without causing compilation to fail." [1]: https://stackoverflow.com/questions/62109526/c-friend-template-that-use-sfinae Signed-off-by: Stefan Klug <stefan.klug@ideasonboard.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Paul Elder <paul.elder@ideasonboard.com> Reviewed-by: Barnabás Pőcze <barnabas.pocze@ideasonboard.com>
9 daysipa: rkisp1: awb: Ignore empty AWB statisticsStefan Klug
When the AWB engine doesn't find a valid pixel because all pixels lie outside the configured colour range it returns an AWB measurement value of 255, 255, 255. This leaves the regulation in an unrecoverable state noticeable by a completely green image. Fix that by skipping the AWB calculation in case there were no valid pixels. Signed-off-by: Stefan Klug <stefan.klug@ideasonboard.com> Reviewed-by: Daniel Scally <dan.scally@ideasonboard.com> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
10 daysgstreamer: Add GstVideoMeta supportHou Qi
GStreamer video-info calculated stride and offset may differ from those used by the camera. For stride and offset mismatch, this patch adds video meta to buffer if downstream supports VideoMeta through allocation query. Otherwise, create a internal VideoPool using the caps, and copy video frame to this system memory. Signed-off-by: Hou Qi <qi.hou@nxp.com> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com> Tested-by: Nicolas Dufresne <nicolas.dufresne@collabora.com> Reviewed-by: Nicolas Dufresne <nicolas.dufresne@collabora.com> Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
13 daysapps: cam: sdl_sink: Support more single-plane formatsBarnabás Pőcze
With the newly introduced `SDLTexture1Plane` it is easy to handle any single-plane format that has an SDL equivalent. So use it for more YUV and RGB formats. The mapping of RGB formats is not entirely straightforward because `SDL_PIXELFORMAT_ZZZ...888...` defines a format where the order of the components is endian dependent, while libcamera's `ZZZ...888...` formats are derived from the matching DRM formats, and the RGB formats in question are defined to be little-endian there. So the endian-independent `SDL_PIXELFORMAT_{ZZZ24,ZZZZ32}` are used. Signed-off-by: Barnabás Pőcze <barnabas.pocze@ideasonboard.com> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
13 daysapps: cam: sdl_texture: Add `SDLTexture1Plane`Barnabás Pőcze
`SDLTextureYUYV` uses `SDL_PIXELFORMAT_YUY2`, which is a single plane format. To support other single plane formats, replace `SDLTextureYUYV` with `SDLTexture1Plane` that can be instantiated with an arbitrary SDL pixel format and that uses `SDL_UpdateTexture()` to update the texture using exactly a single plane. Signed-off-by: Barnabás Pőcze <barnabas.pocze@ideasonboard.com> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
13 daysapps: cam: sdl_texture: Drop `&rect_` from `SDL_Update{NV,}Texture()` callBarnabás Pőcze
If the entire texture is to be updated, there is no need to specify the target area explicitly. Signed-off-by: Barnabás Pőcze <barnabas.pocze@ideasonboard.com> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
13 daysapps: cam: sdl_texture: Take list of buffers in spanBarnabás Pőcze
A non-owning span is sufficient, so use that instead of a vector. Signed-off-by: Barnabás Pőcze <barnabas.pocze@ideasonboard.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
2025-05-13lc-compliance: Move camera setup to CameraHolder classNícolas F. R. A. Prado
Different base classes can be used for different setups on tests, but all of them will need to setup the camera for the test. To reuse that code, move it to a separate CameraHolder class that is inherited by test classes. Signed-off-by: Nícolas F. R. A. Prado <nfraprado@collabora.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Paul Elder <paul.elder@ideasonboard.com> Signed-off-by: Paul Elder <paul.elder@ideasonboard.com> Signed-off-by: Sven Püschel <s.pueschel@pengutronix.de>
2025-05-13ipa: rkisp1: awb: Declare ControlInfo in AWBPaul Elder
The ControlInfo information for AwbEnable and ColourGains are declared and exposed in the top-level IPA. These should instead be exposed by the AWB part of the IPA, as it doesn't make sense to support these controls when AWB is disabled, for example. Move the declaration of these controls out of the top-level IPA and into AWB. 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>
2025-05-12ipa: Move IPA installations to a subdirKieran Bingham
IPAs are expected to live within a directory that is searched by the IPAManager. If other non-IPA so files are installed in the same location, then the user may be presented with an error message reporting that the module could not be parsed. Move IPA modules to an ipa specific subdirectory to ensure we only parse .so files that are expected to be IPA modules at load time. Bug: https://bugs.libcamera.org/show_bug.cgi?id=268 Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com> Reviewed-by: Isaac Scott <isaac.scott@ideasonboard.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Paul Elder <paul.elder@ideasonboard.com> Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
2025-05-12py: Set `PYTHONPATH` in devenvBarnabás Pőcze
If the python bindings are built, then set the `PYTHONPATH` environmental variable in the meson devenv accordingly to make it easy to use. $ meson devenv -C build [libcamera] $ echo $PYTHONPATH /libcamera/build/src/py [libcamera] $ python Python 3.13.3 (main, Apr 9 2025, 07:44:25) [GCC 14.2.1 20250207] on linux Type "help", "copyright", "credits" or "license" for more information. >>> import libcamera >>> cm = libcamera.CameraManager.singleton() [...] [129:52:33.293860558] [4133380] INFO Camera camera_manager.cpp:326 libcamera v0.5.0+169-7dbe74b5-dirty (2025-05-01) [...] Signed-off-by: Barnabás Pőcze <barnabas.pocze@ideasonboard.com> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com> Reviewed-by: Paul Elder <paul.elder@ideasonboard.com>
2025-05-09libcamera: v4l2_videodevice: Log buffer count on allocation errorSven Püschel
Log the actual and requested buffers count in case of a V4L2 buffers allocation error, when the requested buffers count could not be allocated. Signed-off-by: Sven Püschel <s.pueschel@pengutronix.de> Reviewed-by: Barnabás Pőcze <barnabas.pocze@ideasonboard.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2025-05-08apps: qcam: Push the viewfinder role to vectorKieran Bingham
In commit ee2b011b65c6 ("apps: cam: Try raw role if default viewfinder role fails"), the viewfinder role is specified as the default if no role is yet chosen. This was unfortunately added by directly accessing the vector rather than extending the size when the vector is empty. Fix the code to push the default viewfinder role on to the back of the vector, increasing the size appropriately. Fixes: ee2b011b65c6 ("apps: cam: Try raw role if default viewfinder role fails") Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com> Reviewed-by: Barnabás Pőcze <barnabas.pocze@ideasonboard.com> Tested-by: Barnabás Pőcze <barnabas.pocze@ideasonboard.com> Reviewed-by: Paul Elder <paul.elder@ideasonboard.com> Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
2025-05-08utils: raspberrypi: ctt: Fix integer division error calculating LSC cell sizeDavid Plowman
The cell sizes must be cast to integers as the parameters that were passed in may be floats. Bug: https://github.com/raspberrypi/libcamera/issues/260 Signed-off-by: David Plowman <david.plowman@raspberrypi.com> Fixes: 36ba0e551507 ("utils: raspberrypi: ctt: Fix NaNs in lens shading tables") Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com> Reviewed-by: Naushir Patuck <naush@raspberrypi.com> Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
2025-05-05Documentation: guides: application-developer: Remove unnecessary argumentBarnabás Pőcze
`required: true` is the default for meson's `dependency()` function. Signed-off-by: Barnabás Pőcze <barnabas.pocze@ideasonboard.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
2025-05-02Documentation: guides: pipeline-handler: Query pixel formats onceBarnabás Pőcze
There is no reason to create an entire new copy of the same thing, so use the already existing `formats` object. Signed-off-by: Barnabás Pőcze <barnabas.pocze@ideasonboard.com> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
2025-05-02Documentation: guides: pipeline-handler: Simplify format collectionBarnabás Pőcze
I believe a simple range based for loop is easier to understand here than `std::transform()`. Furthermore, using a for loop enables the easy filtering of invalid pixel formats. Signed-off-by: Barnabás Pőcze <barnabas.pocze@ideasonboard.com> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
2025-05-02Documentation: guides: pipeline-handler: Fix `Camera::create()` linkBarnabás Pőcze
Since 6b4771d4604c ("libcamera: camera: Hide Camera::create() from the public API") `Camera::create()` is documented in the internal documentation. Signed-off-by: Barnabás Pőcze <barnabas.pocze@ideasonboard.com> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
2025-05-02Documentation: guides: pipeline-handler: Fix configuration creationBarnabás Pőcze
`PipelineHandler::generateConfiguration()` returns a `std::unique_ptr`. Signed-off-by: Barnabás Pőcze <barnabas.pocze@ideasonboard.com> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
2025-05-02Documentation: guides: pipeline-handler: Fix property list file nameBarnabás Pőcze
It is `property_ids_core.yaml`. Signed-off-by: Barnabás Pőcze <barnabas.pocze@ideasonboard.com> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
2025-05-02Documentation: guides: pipeline-handler: Fix camera creationBarnabás Pőcze
1. The unique_ptr containing the private data must be passed to `Camera::create()`. 2. `registerCamera()` needs only the pointer to the `Camera` Signed-off-by: Barnabás Pőcze <barnabas.pocze@ideasonboard.com> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
2025-05-01README.rst: remove unnecessary dependency for qcamQuentin Schulz
The introducing commit (dff416a84b78 ("README: Add missing package for Qt5 tools"); for Qt 5 originally) stated that without the dependency we would get the following messages: Program /usr/lib/x86_64-linux-gnu/qt5/bin/lrelease found: NO Program lrelease-qt5 found: NO Program lrelease found: NO found but need: '== 5.14.2' That was the case for qt5 and is still true for qt6 but this actually is neither breaking the build nor is it doing anything to the outcome of the build (for both qt5 and qt6) as qcam is bit to bit identical with and without that package. Therefore, let's not mislead users to install an unnecessary package. Signed-off-by: Quentin Schulz <quentin.schulz@cherry.de> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com> Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
2025-04-30ipa: rpi: awb: Remove "fast" parameterBarnabás Pőcze
The "fast" parameter has not been used since it first appeared in the source code. And not only is it not used, but its retrieval from the configuration since c1597f989654 ("ipa: raspberrypi: Use YamlParser to replace dependency on boost") has been incorrect. So remove it. Signed-off-by: Barnabás Pőcze <barnabas.pocze@ideasonboard.com> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com> Reviewed-by: David Plowman <david.plowman@raspberrypi.com>
2025-04-29ipa: rpi: common: Avoid warnings when AeEnable control is usedDavid Plowman
The AeEnable control is now just a wrapper that is converted to ExposureTimeMode and AnalogueGainMode controls instead. Therefore, it should simply be ignored when we encounter it, without the need for any warnings. Signed-off-by: David Plowman <david.plowman@raspberrypi.com> Reviewed-by: Naushir Patuck <naush@raspberrypi.com> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com> Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
2025-04-29utils: raspberrypi: ctt: Fix NaNs in chromatic aberration tablesDavid Plowman
NaNs can appear if no black dots can be found and analysed in a particular region of the calibration image. There needs to be at least one such dot in every 8x8 cell covering the image. This is now detected, and an error message issued. No CAC tables are generated, so CAC is disabled. Bug: https://github.com/raspberrypi/libcamera/issues/254 Signed-off-by: David Plowman <david.plowman@raspberrypi.com> Reviewed-by: Naushir Patuck <naush@raspberrypi.com> Acked-by: Kieran Bingham <kieran.bingham@ideasonboard.com> Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
2025-04-29utils: raspberrypi: ctt: Fix NaNs in lens shading tablesDavid Plowman
The problem occurs when the calculation could lead to a final row (or column) of grid squares with no pixels in them (and hence, NaNs). One specific case is a Pi 5 with an image width (or height) of 1364, so that's 682 Bayer quads. To give 32 grid squares it was calculating 22 quads per cell. However, 31 * 22 = 682 leaving nothing in the final column. The fix is to do a rounding-down division by the number of cells minus one, rather than a rounding-up division by the number of cells. This turns the corner case from one where the final row/column has no pixels to one where we don't quite cover the full image, which is how we have to handle these cases. Bug: https://github.com/raspberrypi/libcamera/issues/254 Signed-off-by: David Plowman <david.plowman@raspberrypi.com> Reviewed-by: Naushir Patuck <naush@raspberrypi.com> Acked-by: Kieran Bingham <kieran.bingham@ideasonboard.com> Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
2025-04-29libcamera: stream: Add color space to configuration string representationLaurent Pinchart
Extend the string representation of StreamConfiguration, as returned by the toString() and operator<<() functions, with color space information. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com> Reviewed-by: Milan Zamazal <mzamazal@redhat.com>
2025-04-29libcamera: pipeline: rkisp1: Convert to use MediaPipelineKieran Bingham
Use the new MediaPipeline to manage and identify all sensors connected to complex pipelines that can connect to the CSI2 receiver before the ISP. This can include chained multiplexors that supply multiple cameras, so make use of the MediaDevice::locateEntities to search for all cameras and construct a pipeline for each. Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com> Reviewed-by: Umang Jain <umang.jain@ideasonboard.com> Reviewed-by: Daniel Scally <dan.scally@ideasonboard.com> Reviewed-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com> Signed-off-by: Paul Elder <paul.elder@ideasonboard.com> Acked-by: Stefan Klug <stefan.klug@ideasonboard.com>
2025-04-29libcamera: internal: Add MediaPipeline helperKieran Bingham
Provide a MediaPipeline class to help identifing and managing pipelines across a MediaDevice graph. Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com> Reviewed-by: Umang Jain <umang.jain@ideasonboard.com> Reviewed-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com> Signed-off-by: Paul Elder <paul.elder@ideasonboard.com> Reviewed-by: Stefan Klug <stefan.klug@ideasonboard.com>
2025-04-29libcamera: media_device: Add helper to return matching entitiesKieran Bingham
Provide a helper on the MediaDevice to return a list of all available entities which match a given function in the graph. As a drive by, also fix a whitespace error in the documentation of MediaDevice::setupLink. Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com> Reviewed-by: Umang Jain <umang.jain@ideasonboard.com> Reviewed-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com> Reviewed-by: Daniel Scally <dan.scally@ideasonboard.com> Signed-off-by: Paul Elder <paul.elder@ideasonboard.com> Reviewed-by: Stefan Klug <stefan.klug@ideasonboard.com>
2025-04-29apps: cam: Try raw role if default viewfinder role failsPaul Elder
cam currently defaults to the viewfinder role when no role is specified. This means that on platforms that only support the raw role (such as a raw sensor with no softISP on a simple pipeline platform), generateConfiguration() would return nullptr and cam would bail out. At least this is what is supposed to happen based on the little documentation that we have written regarding generateConfiguration(), specifically in the application writer's guide, which is probably the most influential piece of documentation: The ``Camera::generateConfiguration()`` function accepts a list of desired roles and generates a ``CameraConfiguration`` with the best stream parameters configuration for each of the requested roles. If the camera can handle the requested roles, it returns an initialized ``CameraConfiguration`` and a null pointer if it can't. Currently the simple pipeline handler will return a raw configuration anyway (if it only supports raw) even if a non-raw role was requested. Thus cam receives a raw configuration instead of a nullptr when no role is specified and viewfinder is requested. However, in the near future, support for raw streams with softISP on the simple pipeline handler will be merged. This will notably change the behavior of the simple pipeline handler to return nullptr if a non-raw role was requested on a platform that only supports raw. This is proper behavior according to documentation, but changes cam's behavior as it used to capture fine with no parameters but will no longer be able to. Technically this is an issue with the roles API, as we are mixing roles in the sense of "configuration hints" (eg. viewfinder vs recording vs still capture) with roles in the sense of "platform capabilities" (raw vs everything else). In the long term the proper solution is to rework the roles API. In the meantime, fix cam so that it will try the raw role if the default viewfinder role returns no configuration. cam is an app that is capable of using the raw stream, so this is appropriate behavior. If roles are specified, then do not retry, as in this situation the user knows what streams they can use and what they want. Signed-off-by: Paul Elder <paul.elder@ideasonboard.com> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com> Reviewed-by: Milan Zamazal <mzamazal@redhat.com>
2025-04-25libcamera: controls: Disallow arrays of arraysBarnabás Pőcze
Arrays of arrays, even arrays of strings, are not supported by the current `ControlValue` mechanism, so disable them for now to trigger compile time errors if attempts are made to use them. Signed-off-by: Barnabás Pőcze <barnabas.pocze@ideasonboard.com> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>