summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2024-08-16libcamera: controls: Improve formatting of control descriptions in YAMLLaurent Pinchart
The control descriptions from YAML files are extracted to generate Doxygen documentation blocks for the controls, which are then compiled to HTML. The extraction script uses the first line of the description as the Doxygen \brief, and preserves blank lines to keep paragraphs. The control descriptions in the YAML files have however not all been written with this in mind. Many description elements are not formatted as block string scalars, in the first place, so blank lines are lost when parsing YAML. Furthermore, they often start with a long initial paragraph, making the \brief description very long. Improve the documentation formatting by marking all multiline descriptions as block string scalars, and try to provide a short one-line first paragraph to be used as a \brief. While at it, reflow the documentation to the 80 columns limit. The draft controls are left as-is, as they should evolve to non-draft controls eventually (and ideally sooner than later). Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Milan Zamazal <mzamazal@redhat.com> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
2024-08-16py: gen-py-controls: Convert to jinja2 templatesLaurent Pinchart
Jinja2 templates help separate the logic related to the template from the generation of the data. The python code becomes much clearer as a result. As an added bonus, we can use a single template file for both controls and properties. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com> Acked-by: Paul Elder <paul.elder@ideasonboard.com>
2024-08-16py: gen-py-controls: Use Control classLaurent Pinchart
Replace manual extraction of data from YAML with the Control helper class. This centralizes YAML parsing and avoids manual mistakes. In order to import the controls module, add the utils/codegen/ directory to the PYTHONPATH through the Python build environment. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com> Reviewed-by: Paul Elder <paul.elder@ideasonboard.com>
2024-08-16utils: codegen: gen-controls.py: Move helper classes to separate fileLaurent Pinchart
The ControlEnum and Control helper classes defined in gen-controls.py are useful for other generator scripts. Move them to a separate file to make it possible to share them. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Daniel Scally <dan.scally@ideasonboard.com>
2024-08-16utils: codegen: gen-controls.py: Convert to jinja2 templatesLaurent Pinchart
Jinja2 templates help separate the logic related to the template from the generation of the data. The python code becomes much clearer as a result. As an added bonus, we can use a single template file for both controls and properties. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Paul Elder <paul.elder@ideasonboard.com>
2024-08-16utils: codegen: gen-header.sh: Generate libcamera.h based on meson.buildLaurent Pinchart
The libcamera.h header is a top-level library header that contains every other libcamera header. It is currently generated by listing the files in include/libcamera/ and dropping the .in suffix from template files. This assumes a 1:1 mapping between generated header file names and the name of their templates. Drop that assumption and base the libcamera.h generation on the libcamera public headers listed in meson.build. This makes the libcamera.h header generation more future-proof. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Daniel Scally <dan.scally@ideasonboard.com> Reviewed-by: Paul Elder <paul.elder@ideasonboard.com>
2024-08-16meson: utils: Provide environment for Python scriptsLaurent Pinchart
Python scripts run as part of the build process need to take a few actions specific to the environment in which they operate. One of those is disabling the Python bytecode cache, to avoid writing .pyc files to the source tree. This is done manually in the IPC generate.py and parser.py scripts. The current implementation is not ideal because it hardcodes in the scripts information related to the environment in which they operate. As those scripts are part of libcamera this is more of a theoretical issue than a practical one. A second issue is that future Python scripts will need to duplicate similar mechanisms, resulting in a higher maintenance burden. Address the issue with a different approach, by creating a meson environment for the Python scripts, and passing it to the custom_target() functions. The environment only disables the bytecode cache for now. The diffstat shows an increase in code size. This is expected to be offset by usage of the environment for more Python scripts, as well as support of more variables in the environment. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com> Reviewed-by: Daniel Scally <dan.scally@ideasonboard.com> Reviewed-by: Paul Elder <paul.elder@ideasonboard.com>
2024-08-15meson: Move all code generation scripts to utils/codegen/Laurent Pinchart
We have multiple code generation scripts in utils/, mixed with other miscellaneous utilities, as well as a larger code base based on mojom in utils/ipc/. To make code sharing easier between the generator scripts, without creating a mess in the utils/ directory, move all the code generation code to utils/codegen/. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Daniel Scally <dan.scally@ideasonboard.com> Reviewed-by: Paul Elder <paul.elder@ideasonboard.com>
2024-08-15libcamera: Drop remaining file names from header comment blocksLaurent Pinchart
Commit 829acb3ab0b1 ("libcamera: Drop file name from header comment blocks in templates") dropped file names from header comment blocks in templates, but forgot the control and property .cpp templates. Fix it. Fixes: 829acb3ab0b1 ("libcamera: Drop file name from header comment blocks in templates") Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Daniel Scally <dan.scally@ideasonboard.com> Reviewed-by: Paul Elder <paul.elder@ideasonboard.com>
2024-08-15meson: Fix mismatch in controls and properties generated file namesLaurent Pinchart
The header for controls and properties are generated from the control_ids.h.in and property_ids.h.in templates respectively, and the generated files are named control_ids.h and property_ids.h. For sources, the templates are named control_ids.cpp.in and property_ids.cpp.in, but the output files are named controls_ids.cpp and properties_ids.cpp. This discrepancy causes confusion. Fix it. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Daniel Scally <dan.scally@ideasonboard.com> Reviewed-by: Paul Elder <paul.elder@ideasonboard.com>
2024-08-15meson: Store controls and properties YAML files in variablesLaurent Pinchart
When generating control headers, the YAML files to be used are determined dynamically based on the selected pipeline handlers. As part of this process, the build system populates an array of meson File objects used as an input for the control headers generation custom target, as well as an array of file names (as strings). The file names array is later used to generate the control source files for the libcamera core, as well as the source code for controls support in the Python bindings. Both of the source code generators manually turn the array of file names into File objects. This duplicates code and reduces readability. A third similar implementation has also been proposed to generate control support sources in the GStreamer element, making the issue worse. To simplify this, store File objects instead of file names in the controls_files array. As the meson configuration summary doesn't support File objects, create a separate controls_files_names to store the file names for that sole purpose. The exact same process occurs for properties, address them the same way. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Daniel Scally <dan.scally@ideasonboard.com> Reviewed-by: Paul Elder <paul.elder@ideasonboard.com>
2024-08-14utils: tuning: Change Tuner.add() to accept a list of modulesStefan Klug
Change the first parameter of Tuner.add() to accept either a list of modules or a single module. This allows more compact code and is in sync with Tuner.set_output_order(). 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-08-14utils: tuning: rkisp1: Clean up tuner constructionStefan Klug
The instances of the static modules need to be passed to tuner.set_output_order() instead of the class. This is the reason for the intermediate variables. To keep the code tidy, apply the same pattern to the other modules. 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-08-14libcamera: camera: Hide Camera::create() from the public APILaurent Pinchart
The Camera::create() function is internal. Hide it from the public API documentation. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com> Reviewed-by: Daniel Scally <dan.scally@ideasonboard.com>
2024-08-14Documentation: Improve doxygen main pageDaniel Scally
The "Main Page" of the doxygen generated API reference is currently totally empty. Expand it with some introductory text along with links to the developer's guide, application developer's guide and the pipeline and IPA module writer's guides. Provide an easy link to switch between the reduced public reference pages and the more complete internal ones. Reviewed-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com> Signed-off-by: Daniel Scally <dan.scally@ideasonboard.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2024-08-14Documentation: Split public/private documentationDaniel Scally
The API reference pages generated by Doxygen are comprehensive, but therefore quite overwhelming for application developers who will likely never need to use the majority of the library's objects. To reduce the complexity of the documentation, split it into two runs of doxygen. The first run of doxygen is for the public API. We pass a specific list of source files to parse, which is built from the arrays of public headers and sources in meson build files. This ensures that we only generate the documentation for code from those files. A custom Python script is needed to add the list of input files to Doxyfile, as several of the objects included in the header and source array are custom_tgt objects, which can't be handled as strings to populate a variable in the configuration data. The headers defining the Extensible and Object classes (class.h and object.h respectively), as well as the corresponding source files, are excluded from the public API documentation despite being referenced in the meson public headers and sources arrays. This is due to the fact that public API classes inherit from Extensible and Object, making the Extensible and Object classes part of the public ABI. Those two base classes are however implementation details and must not be accessed directly by application code. The second run of doxygen is for the internal API. This contains documentation for all of the library's objects as it currently does. This set will now be output into build/Documentation/internal-api-html. Signed-off-by: Daniel Scally <dan.scally@ideasonboard.com> Co-developed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com> Reviewed-by: Daniel Scally <dan.scally@ideasonboard.com>
2024-08-14Documentation: Split doxygen_input in public and internal inputsLaurent Pinchart
To prepare for splitting the API documentation in public and internal documents, split the doxygen_input list in the public and internal counterparts. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Daniel Scally <dan.scally@ideasonboard.com> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
2024-08-14Documentation: Add Thread safety pageDaniel Scally
Move the section of the Thread support page dealing with thread safety to a dedicated .dox file at Documentation/. This is done to support the splitting of the Documentation into a public and internal version. With a separate page, references can be made to thread safety without having to include the Thread class in the doxygen run. Some sections of the new page are still specific to internal implementations and so are hidden with the \internal flag and an internal section which is conditionally included. For now, hardcode it to be included in the Doxyfile. Signed-off-by: Daniel Scally <dan.scally@ideasonboard.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2024-08-12py: cam: Convert to PyQt6Tomi Valkeinen
Qt5 is now end of life. The libcamera 'qcam' application has removed support for Qt5, and updated to Qt6. Update the python 'cam' application accordingly to Qt6. 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>
2024-08-12libcamera: simple: Fix a typo in a doc stringMilan Zamazal
Rectify incorrect phrase in the sentence -- s/their share/they share/. Signed-off-by: Milan Zamazal <mzamazal@redhat.com> Reviewed-by: Umang Jain <umang.jain@ideasonboard.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2024-08-12ipa: libipa: Add missing CameraSensorHelper fn label in docsMilan Zamazal
The constructor reference was missing, causing the constructor documentation to appear in blackLevel() documentation. Signed-off-by: Milan Zamazal <mzamazal@redhat.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-08-12utils: checkstyle.py: Add __repr__ method to Commit classLaurent Pinchart
When debugging issues with the Commit class, a __repr__ method proved to be useful to quickly print all the parsed information about a commit. To avoid reimplementing the method over and over again in the future, add it to the class, even if it is not actually used. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Milan Zamazal <mzamazal@redhat.com> Reviewed-by: Daniel Scally <dan.scally@ideasonboard.com>
2024-08-12utils: checkstyle.py: Skip title and trailers checkers for pre-commitLaurent Pinchart
When running checkstyle.py in a pre-commit hook, there is either no commit message at all (when committing staged changes as a new commit), or the commit message comes from a previous commit being amended. In either case, there's no new commit message yet, and thus nothing to validate for the title and trailers checkers. The trailers checker, in particular, will always flag an error, making all commits fail. To fix that, just skip the two checkers during pre-commit. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Milan Zamazal <mzamazal@redhat.com> Reviewed-by: Daniel Scally <dan.scally@ideasonboard.com>
2024-08-12utils: checkstyle.py: Rework commit message parsingLaurent Pinchart
When parsing commit messages, the Commit class tries to optimize the process by invoking git-show once only, extracting both the commit author, title and modified files in one go. As a result, the derived Amendment class needs to implement the commit parsing separately, as the modified files need to be extracted differently for amendments (and the commit ID also needs to be retrieved differently). Furthermore, because of the list of named files, extracting the trailers needs to invoke git-show separately. Improve the situation by reworking the commit message parsing in three steps. In the first step, use git-show to extract the commit ID, author, title and body. In the second step, invoke git-interpret-trailers to extract the trailers from the body that was previously extracted. The third and final step extracts the list of modified files, using different methods for regular commits and amendments. This allows sharing code for the first two steps between the Commit and Amendment classes, making the code simpler. The Commit class still invokes git three times, while the Amendment class runs it three times instead of four, improving performance slightly. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Milan Zamazal <mzamazal@redhat.com> Reviewed-by: Daniel Scally <dan.scally@ideasonboard.com>
2024-08-12libcamera: formats: Adding Support for Y12Pwill whang
Add support for a 12-bit Mono format named formats::R12_CSI2P. This format is added to support the IMX585 mono sensor, which uses the MEDIA_BUS_FMT_Y12_1X12 media bus format. Signed-off-by: will whang <will@willwhang.com> Signed-off-by: Naushir Patuck <naush@raspberrypi.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Daniel Scally <dan.scally@ideasonboard.com>
2024-08-12libcamera: Fix header groupingLaurent Pinchart
The libcamera coding style groups the C and C++ standard library headers in a single group. Fix the few offenders in the source tree. While at it, add a missing blank line between header groups in a separate location. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Milan Zamazal <mzamazal@redhat.com> Reviewed-by: Daniel Scally <dan.scally@ideasonboard.com>
2024-08-12libcamera: Add missing <stdint.h> include to internal/yaml_parser.hSergei Trofimovich
Without the change the build fails on upcoming `gcc-15` as: In file included from ../src/libcamera/yaml_parser.cpp:8: ../include/libcamera/internal/yaml_parser.h:183:41: error: 'uint8_t' was not declared in this scope 183 | std::is_same_v<uint8_t, T> || | ^~~~~~~ Signed-off-by: Sergei Trofimovich <slyich@gmail.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Daniel Scally <dan.scally@ideasonboard.com>
2024-08-12libcamera: Add missing <stdint.h> include to base/file.hSergei Trofimovich
Without the change the build fails on upcoming `gcc-15` as: In file included from ../src/libcamera/base/file.cpp:8: ../include/libcamera/base/file.h:62:33: error: 'uint8_t' was not declared in this scope 62 | ssize_t read(const Span<uint8_t> &data); | ^~~~~~~ Signed-off-by: Sergei Trofimovich <slyich@gmail.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Daniel Scally <dan.scally@ideasonboard.com>
2024-08-08libcamera: udev: Catch udev notification errorsKieran Bingham
The udev_monitor_receive_device() can return NULL on an error as detailed in the man pages for the function. The udevNotify() handler in the DeviceEnumeratorUdev directly uses the return value of udev_monitor_receive_device() in successive calls to process the event without having first checked the udev_device. Ensure we identify, and handle events where the udev_device can not be returned successfully. Bug: https://bugs.libcamera.org/show_bug.cgi?id=230 Reviewed-by: Stefan Klug <stefan.klug@ideasonboard.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
2024-08-07libcamera: ipa_manager: Remove singleton requirementLaurent Pinchart
The IPAManager class implements a singleton pattern due to the need of accessing the instance in a static member function. The function now takes a pointer to a PipelineHandler, which we can use to access the CameraManager, and from there, the IPAManager. Add accessors to the internal API to expose the CameraManager from the PipelineHandler, and the IPAManager from the CameraManager. This requires allocating the IPAManager dynamically to avoid a loop in includes. Use those accessors to replace the IPAManager singleton. Update the IPA interface unit test to instantiate a CameraManager instead of an IPAManager and ProcessManager, to reflect the new way that the IPAManager is accessed. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
2024-08-07utils: checkstyle.py: Fix trailer parsing for commits with changelogsLaurent Pinchart
Trailers are extracted from commits using the '(trailers:*)' formatting specifier. git ignores dividers when doing so, as if the --no-divider options was passed to git-interpret-trailers. This prevents trailers from being located when the patch contains a local changelog. There is unfortuantely no 'no-no-divider' option to the trailers format specifier. Fix the issue by extracting trailers with git-interpret-trailers, that gives better control of the parsing. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
2024-08-07gstreamer: Fix missing "greater than" symbol in author stringJaslo Ziska
Signed-off-by: Jaslo Ziska <jaslo@ziska.de> Reviewed-by: Nicolas Dufresne <nicolas.dufresne@collabora.com> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2024-08-07utils: checkstyle.py: Validate SoB trailer against authorLaurent Pinchart
The TrailersChecker enforces the presence of a Signed-off-by tag in the trailer, but doesn't verify that the tag matches the commit's author. Add that verification, as required by the libcamera contribution process. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Stefan Klug <stefan.klug@ideasonboard.com> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
2024-08-07utils: checkstyle.py: Add author property to Commit classLaurent Pinchart
Extend the Commit class with an author property, retrieved from the commit. It will be used to extend checkers. While at it, drop the unneeded .strip() call when retrieving the title for amendment commits. The call got carried over from code that initially needed it to strip the new line character, but that need disappeard with usage of .splitlines(). Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Stefan Klug <stefan.klug@ideasonboard.com> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
2024-08-07libcamera: Don't add libcamera_public_headers to libcamera_public_sourcesLaurent Pinchart
Now that libcamera_internal_sources is separate from libcamera_internal_headers, perform the same split for libcamera_public_sources and libcamera_public_headers to ensure consistency of the build system variables. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Daniel Scally <dan.scally@ideasonboard.com> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
2024-08-07libcamera: Consolidate tracepoint header in libcamera_internal_headersLaurent Pinchart
The libcamera_tracepoint_header variable stores the tracepoints.h header custom target, for the sole purpose of being listed as a source of the libcamera shared library, through the libcamera_internal_sources variable. Add the tracepoints.h header to libcamera_internal_headers instead of libcamera_internal_sources, and list libcamera_internal_headers as a source of the shared library, alongside libcamera_internal_sources. This makes libcamera_internal_sources contain sources only, improving clarity of the build system variables. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Daniel Scally <dan.scally@ideasonboard.com> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
2024-08-07libcamera: Add missing headers to libcamera_internal_headersLaurent Pinchart
The ipa_data_serializer.h and ipc_pipe.h headers are missing from libcamera_internal_headers. Add them. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Daniel Scally <dan.scally@ideasonboard.com> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
2024-08-07libcamera: Consolidate all IPA headers in libcamera_ipa_headersLaurent Pinchart
The IPA headers are listed in two different meson variables, one for generated headers, and one for the other headers. There's no real reason for this split, consolidate all of them in the libcamera_ipa_headers variable. While at it, don't add the IPA headers to the libcamera_internal_sources variable, but list libcamera_ipa_headers in the sources for the shared library. This moves the libcamera_internal_sources variable towards holding source files, not header files, to improve clarity of the build system. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Daniel Scally <dan.scally@ideasonboard.com> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
2024-08-07libcamera: Move IPA headers to the libcamera_private dependencyLaurent Pinchart
The IPA headers are listed in the libcamera_public and libcamera_private dependency objects, with the generated headers part of the private dependency object and the non-generated headers part of the public dependency object. As neither set of IPA headers are part of the public API, list them both in the libcamera_private dependency object. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Daniel Scally <dan.scally@ideasonboard.com> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
2024-08-07libcamera: Drop libcamera_generated_ipa_headers from sourcesLaurent Pinchart
The libcamera_generated_ipa_headers variable, containing the list of generated IPA headers, is listed in the sources of IPA modules, as well as IPA tests. This was done to ensure that the modules and tests get rebuilt when the generate IPA headers change. However, the dependency is already handled through the libcamera_private dependency object, specified for all those modules and tests. There's no need to list the IPA generated headers as sources. Drop them. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Daniel Scally <dan.scally@ideasonboard.com> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
2024-08-07libcamera: Add version.h to public headersLaurent Pinchart
The generated version.h header is part of the public headers, but is missing from the libcamera_public_headers variable. Add it. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Daniel Scally <dan.scally@ideasonboard.com> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
2024-08-07libcamera: Split public and internal source arraysDaniel Scally
Meson array variables hold lists of libcamera's source files. To help facilitate the splitting of Doxygen generated documentation into distinct public and internal versions, split those arrays to separate public and internal variables. Signed-off-by: Daniel Scally <dan.scally@ideasonboard.com> Co-developed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
2024-08-07libcamera: Hide *::Private classes with __DOXYGEN_PUBLIC__Laurent Pinchart
The *::Private classes are part of the internal API, as their name implies. They are defined in internal headers, but implemented in the same source file as their public counterparts. This will cause Doxygen to complain about missing class definition when splitting the public and internal API documents, as the internal headers won't be parsed by Doxygen for the public API documentation. Marking the classes with \internal isn't enough. The directive prevents the documentation block from being included in the output, but this occurs at the generation stage, after the documentation blocks are parsed. Fix this by completely hidding the implementation of the *::Private classes from Doxygen using preprocessor conditional compilation. To do so, introduce a new macro, __DOXYGEN_PUBLIC__, that will be defined for the public API documentation only. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Daniel Scally <dan.scally@ideasonboard.com> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
2024-08-07libcamera: Mark internal parts of public classes with \internalLaurent Pinchart
The libcamera public API exposes classes that have parts considered internal. They inherit the Extensible class, and their internal parts are split into a Private class. Those classes are defined in public API headers, and their Private counterparts are defined in internal headers sharing a common file name (in a different directory). Both headers are documented in the same source file. For instance, include/libcamera/camera.h contains the public API of the Camera class, and include/libcamera/internal/camera.h its internal counterpart. Both are documented in src/libcamera/camera.cpp. As the internal headers are not part of the public API, they need to be hidden from the future public API builds. To prepare for doing so, mark them with the \internal Doxygen directive. Hardcode the Doxygen INTERNAL_DOCS option to YES to include the internal API. This will be changed later for the public API documentation build. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Daniel Scally <dan.scally@ideasonboard.com> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
2024-08-07libcamera: Unify Doxygen file directive prefix for formats.hLaurent Pinchart
libcamera has two formats.h headers, an internal one in include/libcamera/internal/, and a public one generated at build time. The convention is to prefix the internal header name with libcamera/internal/ in the Doxygen file directive, but formats.cpp only uses internal/ as a prefix. Unify it with the rest of the code base. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Daniel Scally <dan.scally@ideasonboard.com> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
2024-08-07libcamera: Make all internal headers visible to DoxygenLaurent Pinchart
Two classes that have both public and internal headers, namely Camera and Request, make only their public header visible to Doxygen through a file directive. Fix them. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Daniel Scally <dan.scally@ideasonboard.com> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
2024-08-07libcamera: Drop path prefix from Doxygen file directiveLaurent Pinchart
The Doxygen directive only requires qualifying header file names with a path to differentiate between multiple header files with the same name. Most file directives that refer to unambiguous files do not have a libcamera/ and/or internal/ path prefix, but a few do, most likely due to copy&paste. Drop the prefix in those few files for consistency. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Daniel Scally <dan.scally@ideasonboard.com> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
2024-08-05utils: checkstyle.py: Warn when no valid Signed-off-by line is foundLaurent Pinchart
All commits to libcamera must include a Signed-off-by line, and that rule is enforced through git hooks and CI. This however doesn't prevent patches from being submitted without an SoB tag, as noticed multiple times in the past. Extend the checkstyle.py trailer checker to issue a warning when the SoB line is missing to try and improve the situation. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Milan Zamazal <mzamazal@redhat.com> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
2024-08-05libcamera: software_isp: Replace malloc() with std::vector<>Laurent Pinchart
libcamera is implemented in C++, use std::vector<> to manage the dynamically allocated line buffers instead of malloc() and free(). This simplifies the code and improves memory safety by ensuring no allocation will be leaked. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Milan Zamazal <mzamazal@redhat.com> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com> Tested-by: Hans de Goede <hdegoede@redhat.com>
2024-08-05ipa: libipa: camera_sensor_helper: Reference blackLevel() in documentationLaurent Pinchart
The documentation for the blackLevel_ member is very terse. Reference the more complete documentation of the sibling blackLevel() member function to provide more information. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Milan Zamazal <mzamazal@redhat.com> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>