summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2024-09-30libcamera: controls: Handle enum values without a castLaurent Pinchart
When constructing a ControlValue from an enum value, an explicit cast to int32_t is needed as we use int32_t as the underlying type for all enumerated controls. This makes users of ControlValue more complex. To simplify them, specialize the control_type template for enum types, to support construction of ControlValue directly without a cast. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
2024-09-30libcamera: v4l2_videodevice: Add getSelection() functionLaurent Pinchart
The V4L2VideoDevice class implements setSelection() but not getSelection(). The latter is useful for instance to query crop bounds. Implement the function. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Umang Jain <umang.jain@ideasonboard.com> Reviewed-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com>
2024-09-30apps: cam: Print an error when outputting DNG and DNG support is missingLaurent Pinchart
When DNG support is missing, the cam application ignores the .dng suffix of the file pattern and writes raw binary data instead, without notifying the user. This leads to confusion. Fix it by printing an error message. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Milan Zamazal <mzamazal@redhat.com> Reviewed-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com>
2024-09-30apps: Replace HAVE_DNG with HAVE_TIFFLaurent Pinchart
Support for DNG capture is conditioned by the availability of libtiff, which is indicated by the HAVE_TIFF macro set by meson. The dng_writer.h header then defines HAVE_DNG, which is used in a couple of places to conditionally compile DNG-related code. Most of the other locations where conditional compilation is required use HAVE_TIFF. Using both HAVE_TIFF and HAVE_DNG is confusing. HAVE_DNG would be a better name, but as the macro is defined in dng_writer.h, it would require all files that need to test for DNG support to include that header. Failure to include it (directly or indirectly) would result in the code covered by the macro to be silently disabled. To avoid the confusion, standardize on using HAVE_TIFF everywhere and drop HAVE_DNG. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Milan Zamazal <mzamazal@redhat.com> Reviewed-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com>
2024-09-30pipeline: rkisp1: Filter out sensor sizes not supported by the pipelineUmang Jain
It is possible that the maximum sensor size (returned by CameraSensor::resolution()) is not supported by the pipeline. In such cases, a filter function is required to filter out resolutions of the camera sensor, which cannot be supported by the pipeline. Introduce the filter function filterSensorResolution() in RkISP1Path class and use it for validate() and generateConfiguration(). The maximum sensor resolution is picked from that filtered set of resolutions instead of CameraSensor::resolution(). Signed-off-by: Umang Jain <umang.jain@ideasonboard.com> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com> Tested-by: Kieran Bingham <kieran.bingham@ideasonboard.com> Reviewed-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com>
2024-09-28libcamera: rkisp1: Eliminate hard-coded resizer limitsUmang Jain
The minResolution_ and maxResolution_ limits are dynamically queried in populateFormats() from the RkISP1Path video node. Therefore, initializing these limits with the resizer limits in the constructor is unnecessary. This change allows us to remove the hard-coded max/min resolution limits of the resizer from RkISP1Path, simplifying its constructor further. Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com> Reviewed-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com> Signed-off-by: Umang Jain <umang.jain@ideasonboard.com>
2024-09-27pipeline: simple: Increase buffer count to fourRobert Mader
Which is not only what many other pipeline handlers use, but also a good lower limit when dealing with DRM and similar APIs. Even Mesas EGL and Vulkan WSI implementations use for the reason outlined in mesa commit 992a2dbba80aba35efe83202e1013bd6143f0dba: > When the compositor is directly scanning out from the application's buffer it > may end up holding on to three buffers. These are the one that is is currently > scanning out from, one that has been given to DRM as the next buffer to flip > to, and one that has been attached and will be given to DRM as soon as the > previous flip completes. When we attach a fourth buffer to the compositor it > should replace that third buffer so we should get a release event immediately > after that. This patch therefore also changes the number of buffer slots to 4 > so that we can accomodate that situation. Given the popularity of this buffer number the bump should be unlikely to cause problems. At the same time it may help with performance or even work around glitches. The previous number was introduced in commit a8964c28c80fb520ee3c7b10143371081d41405a without mentioning a specific reason against the change at hand. Signed-off-by: Robert Mader <robert.mader@collabora.com> Reviewed-by: Umang Jain <umang.jain@ideasonboard.com> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com> Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
2024-09-27libcamera: software_isp: Update black level only on exposure changesMilan Zamazal
The black level is likely to get updated, if ever, only after exposure or gain changes. Don't compute its possible updates if exposure and gain are unchanged. It's probably not worth trying to implement something more sophisticated. Better to spend the effort on supporting tuning files. Signed-off-by: Milan Zamazal <mzamazal@redhat.com> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com> Reviewed-by: Umang Jain <umang.jain@ideasonboard.com> Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
2024-09-27libcamera: software_isp: Move exposure+gain to an algorithm moduleMilan Zamazal
This is the last step to fully convert software ISP to Algorithm-based processing. The newly introduced frameContext.sensor parameters are set, and the updated code moved, before calling Algorithm::process() to have the values up-to-date in stats processing. Resolves software ISP TODO #10. Signed-off-by: Milan Zamazal <mzamazal@redhat.com> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com> Reviewed-by: Umang Jain <umang.jain@ideasonboard.com> Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
2024-09-27libcamera: software_isp: Use DelayedControlsMilan Zamazal
Use the standard libcamera mechanism to report the "current" controls rather than delaying updates by counting from the last update. A problem is that with software ISP we cannot be sure about the sensor delay. The original implementation simply skips exposure updates for 2 frames, which should be enough in most cases. After this change, we assume the delay being exactly 2 frames, which may or may not be correct and may work with outdated values if the delay is shorter. According to Kieran, the wrong parts are also wrong on the IPU3/RKISP1/Mali pipelines and only RPi have this correct. We need to fix this, by correctly specifying the gains in the libipa camera sensor helpers. The sooner the better because this change could introduce a risk of increasing oscillations. This patch also prepares moving exposure+gain to an algorithm module where the original delay mechanism would be a (possibly unnecessary) complication. Resolves software ISP TODO #11 + #12. Signed-off-by: Milan Zamazal <mzamazal@redhat.com> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com> Reviewed-by: Umang Jain <umang.jain@ideasonboard.com> Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
2024-09-27libcamera: software_isp: Use floating point for color parametersMilan Zamazal
It's more natural to represent color gains as floating point numbers rather than using a particular pixel-related representation. double is used rather than float because it's a more common floating point type in libcamera algorithms. Otherwise there is no obvious reason to select one over the other here. The constructed color tables still use integer representation for efficiency. Black level still uses pixel (integer) values, for consistency with other libcamera parts. Signed-off-by: Milan Zamazal <mzamazal@redhat.com> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com> Reviewed-by: Umang Jain <umang.jain@ideasonboard.com> Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
2024-09-27libcamera: software_isp: Move color handling to an algorithm moduleMilan Zamazal
After black level handling has been moved to an algorithm module, white balance and the construction of color tables can be moved to algorithm modules too. This time, the moved code is split between stats processing and parameter construction methods. It is also split to two algorithm modules: - White balance computation. - Gamma table computation and color lookup tables construction. While this applies the color gains computed by the white balance algorithm, it is not directly related to white balance. And we may want to modify the color lookup tables in future according to other parameters than just gamma and white balance gains. Gamma table computation and color lookup tables construction could be split to separate algorithms too. But there is no big need for that now so they are kept together for simplicity. This is the only part of the software ISP algorithms that sets the parameters so emitting setIspParams can be moved to prepare() method. A more natural representation of the gains (and black level) would be floating point numbers. This is not done here in order to minimize changes in code movements. It will be addressed in a followup patch. Signed-off-by: Milan Zamazal <mzamazal@redhat.com> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com> Acked-by: Umang Jain <umang.jain@ideasonboard.com> Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
2024-09-27libcamera: software_isp: Move black level to an algorithm moduleMilan Zamazal
The black level determination, already present as a separate class, can be moved to the prepared Algorithm processing structure. It is the first of the current software ISP algorithms that is called in the stats processing sequence, which means it is also the first one that should be moved to the new structure. Stats processing starts with calling Algorithm-based processing so the call order of the algorithms is retained. Movement of this algorithm is relatively straightforward because all it does is processing stats. The comment about getting black level from the tuning files is dropped. The black level will be taken from CameraSensorHelper if available and that will be implemented in one of the followup patches. Black level is now recomputed on each stats processing. In a future patch, after DelayedControls are used, this will be changed to recompute the black level only after exposure/gain changes. The black level depends on the sensor used, the computed value can be reused in a followup capture sessions with the same sensor. Thus it is sufficient to (re)set the initial value in BlackLevel::init. Signed-off-by: Milan Zamazal <mzamazal@redhat.com> Reviewed-by: Umang Jain <umang.jain@ideasonboard.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Daniel Scally <dan.scally@ideasonboard.com> Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
2024-09-27libcamera: software_isp: Call Algorithm::processMilan Zamazal
This patch adds Algorithm::process call for the defined algorithms. This is preparation only since there are currently no Algorithm based algorithms defined. As software ISP currently doesn't produce any metadata, a dummy and unused metadata instance is created to satisfy Algorithm::process API. This should be changed in future. Signed-off-by: Milan Zamazal <mzamazal@redhat.com> Reviewed-by: Umang Jain <umang.jain@ideasonboard.com> Reviewed-by: Daniel Scally <dan.scally@ideasonboard.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
2024-09-27libcamera: software_isp: Call Algorithm::prepareMilan Zamazal
This patch adds Algorithm::prepare call for the defined algorithms. This is preparation only since there are currently no Algorithm based algorithms defined. Signed-off-by: Milan Zamazal <mzamazal@redhat.com> Reviewed-by: Umang Jain <umang.jain@ideasonboard.com> Reviewed-by: Daniel Scally <dan.scally@ideasonboard.com> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com> Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
2024-09-27libcamera: software_isp: Call Algorithm::queueRequestMilan Zamazal
This patch adds Algorithm::queueRequest call for the defined algorithms. As there are currently no control knobs in software ISP nor the corresponding queueRequest call chain, the patch also introduces the queueRequest methods and calls from the pipeline to the IPA. This is preparation only since there are currently no Algorithm based algorithms defined and no current software ISP algorithms support control knobs. Signed-off-by: Milan Zamazal <mzamazal@redhat.com> Reviewed-by: Umang Jain <umang.jain@ideasonboard.com> Reviewed-by: Daniel Scally <dan.scally@ideasonboard.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
2024-09-27libcamera: software_isp: Call Algorithm::configureMilan Zamazal
This patch adds Algorithm::configure call for the defined algorithms. This is preparation only since there are currently no Algorithm based algorithms defined. A part of this change is passing IPAConfigInfo instead of ControlInfoMap to configure() calls as this is what Algorithm::configure expects. Signed-off-by: Milan Zamazal <mzamazal@redhat.com> Reviewed-by: Umang Jain <umang.jain@ideasonboard.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Daniel Scally <dan.scally@ideasonboard.com> Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
2024-09-27libcamera: software_isp: Create algorithmsMilan Zamazal
We are ready to introduce algorithms now. First, let's create algorithms. The algorithms are not called yet, calls to them will be added in followup patches. The maximum number of contexts is set to the same value as in hardware pipelines. Signed-off-by: Milan Zamazal <mzamazal@redhat.com> Reviewed-by: Umang Jain <umang.jain@ideasonboard.com> Reviewed-by: Daniel Scally <dan.scally@ideasonboard.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
2024-09-27libcamera: software_isp: Track and pass frame idsMilan Zamazal
A previous preparation patch implemented passing frame ids to stats processing but without actual meaningful frame id value passed there. This patch extends that by actually providing the frame id and passing it through to the stats processor. The frame id is taken from the request sequence number, the same as in hardware pipelines. Signed-off-by: Milan Zamazal <mzamazal@redhat.com> Reviewed-by: Daniel Scally <dan.scally@ideasonboard.com> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com> Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
2024-09-27libcamera: software_isp: Remove final dots in debayer.cpp docstringsMilan Zamazal
The policy and the style checker require that \brief, \param and \return texts don't finish with a dot. This needs to be fixed in debayer.cpp. Also leading spaces in a \return statement are removed from there. Signed-off-by: Milan Zamazal <mzamazal@redhat.com> Reviewed-by: Umang Jain <umang.jain@ideasonboard.com> Reviewed-by: Daniel Scally <dan.scally@ideasonboard.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
2024-09-27libcamera: software_isp: Make stats frame and buffer awareMilan Zamazal
This patch adds frame and bufferId arguments to stats related calls. Although the parameters are currently unused, because frame ids are not tracked and used and the stats buffer is passed around directly rather than being referred by its id, they bring the internal APIs closer to their counterparts in hardware pipelines. It serves as a preparation for followup patches that will introduce: - Frame number tracking in order to switch to DelayedControls (software ISP TODO #11 + #12). - A ring buffer for stats in order to improve passing the stats (software ISP TODO #2). Frame and buffer ids are unrelated for the given purposes but since they are passed together at the same places, the change is implemented as a single patch rather than two, basically the same, patches. Signed-off-by: Milan Zamazal <mzamazal@redhat.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Daniel Scally <dan.scally@ideasonboard.com> Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
2024-09-27libcamera: software_isp: Let IPASoftSimple inherit ModuleMilan Zamazal
The Module class is a base class for all IPA modules. In addition, implement logPrefix() of the module for the softIPA. Signed-off-by: Milan Zamazal <mzamazal@redhat.com> Reviewed-by: Umang Jain <umang.jain@ideasonboard.com> Reviewed-by: Daniel Scally <dan.scally@ideasonboard.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
2024-09-27libcamera: software_isp: Define skeletons for IPA refactoringMilan Zamazal
Software ISP image processing algorithms are currently defined in a simplified way, different from other libcamera pipelines. This is not good for several reasons: - It makes the software ISP code harder to understand due to its different structuring. - Adding more algorithms may make the code harder to understand generally. - Mass libcamera code changes may not be easily applicable to software ISP. - Algorithm sharing with other pipelines is not easily possible. This patch introduces basic software ISP IPA skeletons structured similarly to the other pipelines. The newly added files are currently not used or compiled and the general skeleton structures don't contain anything particular. It is just a preparation step for a larger refactoring and the code will be actually used and extended as needed in followup patches. Signed-off-by: Milan Zamazal <mzamazal@redhat.com> Reviewed-by: Umang Jain <umang.jain@ideasonboard.com> Reviewed-by: Daniel Scally <dan.scally@ideasonboard.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
2024-09-27libcamera: software_isp: Move BlackLevel to libcamera::ipa::softMilan Zamazal
IPA modules use custom namespaces for all their internal components to avoid namespace clashes. The simple IPA module for the software ISP uses libcamera::ipa::soft for this purpose. It however defines an internal class named BlackLevel in the root of the libcamera namespace, making it prone to clashes. Move it to the ipa::soft namespace along with the rest of the code. Signed-off-by: Milan Zamazal <mzamazal@redhat.com> Reviewed-by: Umang Jain <umang.jain@ideasonboard.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Daniel Scally <dan.scally@ideasonboard.com> Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
2024-09-27libcamera: software_isp: Remove superfluous includesMilan Zamazal
Remove unused libcamera internal headers bayer_format.h, framebuffer.h and mapped_frameBuffer.h. Signed-off-by: Milan Zamazal <mzamazal@redhat.com> Reviewed-by: Umang Jain <umang.jain@ideasonboard.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Daniel Scally <dan.scally@ideasonboard.com> Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
2024-09-25apps: cam: Print control array sizesPaul Elder
Now that controls can be queried for array information, print it in --list-controls when applicable. Example output (with dummy controls added to vimc): $ cam -c 1 --list-controls Using camera platform/vimc.0 Sensor B as cam0 Control: ColourGains: [1.000000..4.000000] Size: 2 Control: Brightness: [-1.000000..1.000000] Control: AfWindows: [(0, 0)/1x1..(0, 0)/100x100] Size: n Control: Contrast: [0.000000..2.000000] Control: Saturation: [0.000000..2.000000] 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: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2024-09-25libcamera: controls: Add array information to ControlIdPaul Elder
Add to ControlId information on whether or not it is an array control, and the size of the control if it is an array control. 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: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2024-09-25py: Add bindings for ControlId enum namePaul Elder
Add python bindings for querying enum value names from a ControlId. Example usage: >>> cid libcamera.ControlId(16, AwbMode, ControlType.Integer32) >>> cid.enumerators() {0: 'AwbAuto', 1: 'AwbIncandescent', 2: 'AwbTungsten', 3: 'AwbFluorescent', 4: 'AwbIndoor', 5: 'AwbDaylight', 6: 'AwbCloudy', 7: 'AwbCustom'} >>> cinfo libcamera.ControlInfo([2..5]) >>> cinfo.values [2, 3, 5] >>> [cid.enumerators()[v] for v in cinfo.values] ['AwbTungsten', 'AwbFluorescent', 'AwbDaylight'] Signed-off-by: Paul Elder <paul.elder@ideasonboard.com> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com> Reviewed-by: Stefan Klug <stefan.klug@ideasonboard.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2024-09-25apps: cam: Print control enum values more nicelyPaul Elder
Now that enum names can be obtained from ControlId, use that information to print out the list of supported enum values in --list-controls. Example output (with a dummy AwbMode ControlInfo added to vimc): $ cam -c 1 --list-controls Using camera platform/vimc.0 Sensor B as cam0 Control: AwbMode: - AwbTungsten (2) - AwbFluorescent (3) - AwbDaylight (5) Control: Brightness: [-1.000000..1.000000] Control: Contrast: [0.000000..2.000000] Control: Saturation: [0.000000..2.000000] Signed-off-by: Paul Elder <paul.elder@ideasonboard.com> Reviewed-by: Umang Jain <umang.jain@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>
2024-09-25libcamera: controls: Add enum names and values map to ControlIdPaul Elder
Add to ControlId information about the names and values of enum, in the event that the ControlId is an enum type. This allows applications to query the ControlId for the names of the enum values, so that they can be displayed on a UI, for example. Without this, it was necessary to use macros of NameOfControlNameValueMap, which is difficult to use and is very inflexible. There already exists a map from name -> value in generated code. Reuse this and pass it to the ControlId constructor, which in turn generates the reverse map. The reverse map is then exposed to applications. Signed-off-by: Paul Elder <paul.elder@ideasonboard.com> Reviewed-by: Umang Jain <umang.jain@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>
2024-09-25utils: abi-compat: sort meson optionsKieran Bingham
Sort the options passed to meson setup alphabetically when performing a slimline libcamera build. Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
2024-09-25utils: abi-compat: Disable python buildKieran Bingham
While building the core libcamera library for ABI compatibility checks, the pycamera python bindings may get built if the required dependencies are found. The ABI compatibility checks do not validate or verify the Python API - so remove this from the intermediate build steps. Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
2024-09-24libcamera v0.3.2Kieran Bingham
abi-compliance-checker reports 100% binary and source compatibility, so this release does not change the SONAME. Binary compatibility: 100% Source compatibility: 100% Total binary compatibility problems: 0, warnings: 0 Total source compatibility problems: 0, warnings: 0 bugs: The following commits in this release relate to either a bug fix or improvement to existing commit. - meson: Enable simple pipeline handler on all platforms by default - Fixes: 06e0d8508e5c ("libcamera: pipeline: simple: Enable intel-ipu6 with Soft ISP") - libcamera: udev: Catch udev notification errors - Bug: https://bugs.libcamera.org/show_bug.cgi?id=230 - libcamera: Drop remaining file names from header comment blocks - Fixes: 829acb3ab0b1 ("libcamera: Drop file name from header comment blocks in templates") - Documentation: Fix link to introduction on mainpage.dox - Fixes: 860a3e30319c ("Documentation: Rework docs.rst into introduction.rst") - Documentation: Fix links from API references to guides - Fixes: e93886178106 ("Documentation: Improve doxygen main page") - pipeline: uvcvideo: Implement acquireDevice() + releaseDevice() - Bug: https://bugs.libcamera.org/show_bug.cgi?id=168 And the following updates have been made in this release, grouped by category: core: - libcamera: Avoid variable-length arrays - meson: Enable simple pipeline handler on all platforms by default - libcamera: base: Add MemFd helper class - libcamera: base: memfd: Handle uClibc compatibility with function wrapper - libcamera: shared_mem_object: Prevent memfd from shrinking or growing - libcamera: simple: Log a missing sensor in a better way - libcamera: ipa_proxy: Unify configurationFile argument name - libcamera: ipa_proxy: Report a missing configuration as a warning - libcamera: Remove spaces at end of lines - meson: Drop gcc 8 support - utils: checkstyle.py: Warn when no valid Signed-off-by line is found - libcamera: Drop path prefix from Doxygen file directive - libcamera: Make all internal headers visible to Doxygen - libcamera: Unify Doxygen file directive prefix for formats.h - libcamera: Mark internal parts of public classes with \internal - libcamera: Hide *::Private classes with __DOXYGEN_PUBLIC__ - libcamera: Split public and internal source arrays - libcamera: Add version.h to public headers - libcamera: Drop libcamera_generated_ipa_headers from sources - libcamera: Move IPA headers to the libcamera_private dependency - libcamera: Consolidate all IPA headers in libcamera_ipa_headers - libcamera: Add missing headers to libcamera_internal_headers - libcamera: Consolidate tracepoint header in libcamera_internal_headers - libcamera: Don't add libcamera_public_headers to libcamera_public_sources - utils: checkstyle.py: Add author property to Commit class - utils: checkstyle.py: Validate SoB trailer against author - utils: checkstyle.py: Fix trailer parsing for commits with changelogs - libcamera: ipa_manager: Remove singleton requirement - libcamera: udev: Catch udev notification errors - libcamera: Add missing <stdint.h> include to base/file.h - libcamera: Add missing <stdint.h> include to internal/yaml_parser.h - libcamera: Fix header grouping - libcamera: formats: Adding Support for Y12P - utils: checkstyle.py: Rework commit message parsing - utils: checkstyle.py: Skip title and trailers checkers for pre-commit - utils: checkstyle.py: Add __repr__ method to Commit class - libcamera: simple: Fix a typo in a doc string - libcamera: camera: Hide Camera::create() from the public API - meson: Store controls and properties YAML files in variables - meson: Fix mismatch in controls and properties generated file names - libcamera: Drop remaining file names from header comment blocks - meson: Move all code generation scripts to utils/codegen/ - meson: utils: Provide environment for Python scripts - utils: codegen: gen-header.sh: Generate libcamera.h based on meson.build - utils: codegen: gen-controls.py: Convert to jinja2 templates - utils: codegen: gen-controls.py: Move helper classes to separate file - libcamera: controls: Improve formatting of control descriptions in YAML - libcamera: pipeline_handler: Fix unlocking media devices too early - libcamera: pipeline_handler: Call releaseDevice() before unlocking media devices - libcamera: controls: Fix example for ExposureValue - utils: update-kernel-headers: Support relative path to kernel git tree - include: linux: Update headers for rkisp1 extensible parameters - libcamera: camera: Use invokeMethod() for pipe_->acquire() and pipe_->release() - libcamera: uvcvideo: Fix includes - libcamera: v4l2: Remove unused includes - libcamera: v4l2: Fix an include placement - libcamera: v4l2: Fix indirect include - libcamera: libcamera: Remove unused includes - libcamera: libcamera: Add missing includes - libcamera: libcamera: Formatting improvements - libcamera: includes: Add missing includes - libcamera: includes: Remove unused includes - libcamera: includes: Formatting improvements - utils: checkstyle: Add a python formatter - utils: checkstyle: Remove style checker for python pep8 - libcamera: utils: Add ScopeExitActions class - libcamera: v4l2_videodevice: Improve readability - libcamera: media_object: Add MediaPad string representations - libcamera: media_object: Add MediaLink string representations - libcamera: media_device: Use MediaLink string helper - libcamera: yaml-parser: Add additional tests - libcamera: yaml-parser: Add failing test for unexpected behavior - libcamera: yaml-parser: Differentiate between empty and empty string - Document additional environmental variables pipeline: - libcamera: software_isp: Remove file seal TODO item - libcamera: software_isp: Replace malloc() with std::vector<> - pipeline: rkisp1: Use the extensible parameters format - pipeline_handler: Add acquireDevice() function to mirror releaseDevice() - pipeline: uvcvideo: Implement acquireDevice() + releaseDevice() - libcamera: ipu3: Remove unused includes - libcamera: ipu3: Replace wrong include - libcamera: ipu3: Formatting improvements - libcamera: rkisp1: Remove unused includes - libcamera: rkisp1: Formatting improvements - pipeline: rkisp1: Use ScopeExitActions to simplify error handling in start - libcamera: pipeline: simple: Fix typos in match routing comment - pipeline: simple: Remove media member variable - libcamera: pipeline: simple: Use MediaLink string helper - libcamera: debayer_cpu: Sync DMABUFs ipa: - ipa: libipa: camera_sensor_helper: Reference blackLevel() in documentation - ipa: libipa: Add missing CameraSensorHelper fn label in docs - ipa: rkisp1: Pass parameters buffer format to IPA module - ipa: rkisp1: Pass parameters buffer size to pipeline handler - ipa: rkisp1: Add ISP parameters abstraction class - ipa: rkisp1: Use the new ISP parameters abstraction - ipa: rkisp1: params: Add companding blocks - ipa: rkisp1: Add compand feature flag to ipa context - ipa: rkisp1: blc: Add support for BLS in compand - libcamera: libipa: Remove unused includes - libcamera: ipa: Remove unused includes - utils: ipc: Include <string> in generated headers where needed - libcamera: ipa: Drop unneded includes from ipa_interface.h - ipa: rpi: agc: Ignore stable region when exposure/gain set manually - ipa: rpi: Adding IMX283 support - libcamera: libipa: camera_sensor: Add IMX283 black level - ipa: libipa: Add generic Interpolator class - ipa: rkisp1: Use generic Interpolator class - ipa: rkisp1: Remove MatrixInterpolator - ipa: rkisp1: Use interpolator in lsc - ipa: rkisp1: Move loader functions into helper class - ipa: libipa: Add lsc polynomial class - ipa: rkisp1: Add sensor info to context - ipa: rkisp1: Add polynomial LSC loader - libcamera: libipa: camera_sensor: Add Sony IMX214 sensor properties apps: - gstreamer: Fix width and height range handling - apps: qcam: Disable -Wextra-semi - gstreamer: Fix missing "greater than" symbol in author string - py: cam: Convert to PyQt6 - py: gen-py-controls: Use Control class - py: gen-py-controls: Convert to jinja2 templates - v4l2: Support setting frame rate in the V4L2 Adaptation layer - qcam: Decrease minimum width of selector dialog - qcam: Drop Qt version checks - qcam: viewfinder_qt: Draw the letterbox background black - qcam: viewfinder_gl: Fix binding of vertex buffer and shader program - qcam: viewfinder_gl: Drop duplicate glClearColor() - qcam: viewfinder_gl: Render image centered in letterbox documentation: - Documentation: Add Thread safety page - Documentation: Split doxygen_input in public and internal inputs - Documentation: Split public/private documentation - Documentation: Improve doxygen main page - Documentation: Add documentation-contents.rst - Documentation: Alphabetise the Documentation toctree - Documentation: Synchronise camera stack details - Documentation: Breakout docs.rst - Documentation: Remove libcamera architecture from introduction.rst - Documentation: Rework docs.rst into introduction.rst - Documentation: Rework index.rst - Documentation: Add internal-api-html placeholder - Documentation: Reformat documentation_contents.rst - Documentation: Rename "API" section to "API Reference" - Documentation: Drop local table of contents from introduction - Documentation: Rename "Documentation" section to "Introduction" - Documentation: Fix link to introduction on mainpage.dox - Documentation: Fix links from API references to guides tuning: - utils: tuning: rkisp1: Clean up tuner construction - utils: tuning: Change Tuner.add() to accept a list of modules test: - tests: Add a missing iostream include - test: ipa: libipa: Add tets for Interpolator Acked-by: Kieran Bingham <kieran.bingham@ideasonboard.com> Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
2024-09-23libcamera: libipa: camera_sensor: Add Sony IMX214 sensor propertiesAndré Apitzsch
Provide the Sony IMX214 camera sensor properties and registration with libipa for the gain code helpers. Signed-off-by: André Apitzsch <git@apitzsch.eu> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com> Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
2024-09-23ipa: rkisp1: Add polynomial LSC loaderStefan Klug
Add a loader that is capable of loading polynomial coefficients from the tuning files. The polynomial is sampled at load time to reduce the computational overhead at runtime. Signed-off-by: Stefan Klug <stefan.klug@ideasonboard.com> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
2024-09-23ipa: rkisp1: Add sensor info to contextStefan Klug
For the LSC algorithm to dynamically calculate the LSC tables based on the sensor size and the crop rectangle it needs access to that data. Provide access to it by adding the sensorInfo object to the context. 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>
2024-09-23ipa: libipa: Add lsc polynomial classStefan Klug
Add a basic class to represent polynomials as specified in the DNG spec for vignetting correction. Signed-off-by: Stefan Klug <stefan.klug@ideasonboard.com> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
2024-09-23ipa: rkisp1: Move loader functions into helper classStefan Klug
In preparation for supporting polynomial LSC data, move the current loader into its own helper class. 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>
2024-09-23ipa: rkisp1: Use interpolator in lscStefan Klug
Now, that the generic interpolator is available, use it to do the interpolation of the lens shading tables. This makes the algorithm easier to read and remove some duplicate code. 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>
2024-09-23ipa: rkisp1: Remove MatrixInterpolatorStefan Klug
The MatrixInterpolator is no longer used. Remove it. 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>
2024-09-23ipa: rkisp1: Use generic Interpolator classStefan Klug
Replace all occurrences of the MatrixInterpolator with the generic one. 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>
2024-09-23test: ipa: libipa: Add tets for InterpolatorStefan Klug
Add tests for the Interpolator class. 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>
2024-09-23ipa: libipa: Add generic Interpolator classStefan Klug
The MatrixInterpolator is great for interpolation of matrices for different color temperatures. It has however one limitation - it can only handle matrices. For LSC it would be great to interpolate the LSC tables (or even polynomials) using the same approach. Add a generic Interpolator class based on the existing MatrixInterpolator. This class can be adapted to any other type using partial template specialization. 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>
2024-09-23libcamera: yaml-parser: Differentiate between empty and empty stringStefan Klug
When accessing a nonexistent key on a dict the YamlObject returns an empty element. This element can happily be cast to a string which is unexpected. For example the following statement: yamlDict["nonexistent"].get<string>("default") is expected to return "default" but actually returns "". Fix this by introducing an empty type to distinguish between an empty YamlObject and a YamlObject of type value containing an empty string. For completeness add an isEmpty() function and an explicit cast to bool to be able to test for that type. Extend the tests accordingly. 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>
2024-09-23libcamera: yaml-parser: Add failing test for unexpected behaviorStefan Klug
When accessing a nonexistent key on a dict the YamlObject returns an empty element. This element can happily be cast to a string. This is unexpected. For example the following statement: yamlDict["nonexistent"].get<string>("default") is expected to return "default" but actually returns "". Add a (failing) testcase for that behavior. 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>
2024-09-23libcamera: yaml-parser: Add additional testsStefan Klug
Add additional tests in preparation for upcoming modifications on the yaml parser. These tests handle the case where the yaml file contains empty items in dictionaries or lists. E.g.: dict: key_with_value: value key_without_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>
2024-09-20libcamera: debayer_cpu: Sync DMABUFsRobert Mader
Using `DMA_BUF_IOCTL_SYNC` is required for DMABUFs in order to ensure correct output. Not doing so currently results in occasional tearing and/or backlashes in GL/VK clients that use the buffers directly for rendering. An alternative approach to have the sync code in `MappedFrameBuffer` was considered but rejected for now, in order to allow clients more flexibility. While the new helper is added to an annoymous namespace, add timeDiff to the same namespace and remove the static definition as a drive by. Signed-off-by: Robert Mader <robert.mader@collabora.com> Tested-by: Milan Zamazal <mzamazal@redhat.com> # Debix Tested-by: Hans de Goede <hdegoede@redhat.com> # IPU6 + ov2740 Tested-by: Kieran Bingham <kieran.bingham@ideasonboard.com> # Lenovo X13s + OV5675 Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com> Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com> Reviewed-by: Nicolas Dufresne <nicolas.dufresne@collabora.com> Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
2024-09-12libcamera: pipeline: simple: Use MediaLink string helperKieran Bingham
Replace the open-coded implementation of a link representation with the operator<< overload string representation to simplify the code and unify appearance of reporting MediaLinks. Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Stefan Klug <stefan.klug@ideasonboard.com> Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
2024-09-12libcamera: media_device: Use MediaLink string helperKieran Bingham
Replace the two open-coded implementations of a link representation with the operator<< overload string representation to simplify the code and unify appearance of reporting MediaLinks. Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Stefan Klug <stefan.klug@ideasonboard.com> Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
2024-09-12libcamera: media_object: Add MediaLink string representationsKieran Bingham
Various parts of libcamera print the representation of a MediaLink by inline joining the parts to make a string representation. This repeated use case can be supported with a common helper to print the MediaLink in a common manner using the existing toString() and operator<< overload style to make it easier to report on MediaLink types. This implementation will report in the following style: 'imx283 1-001a'[0] -> 'video-mux'[0] Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Stefan Klug <stefan.klug@ideasonboard.com> Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>