summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2022-06-29ipa: libipa: Move ipa namespace documentation to module.cppLaurent Pinchart
The libipa.cpp file exists for the sole purpose of documentating the ipa namespace. As we now have a top-level module.cpp file in libipa, move the documentation there, and drop libipa.cpp. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Paul Elder <paul.elder@ideasonboard.com>
2022-06-29ipa: libipa: Introduce a Module class templateLaurent Pinchart
libipa defines an abstract Algorithm class template that is specialized by IPA modules. IPA modules then instantiate and manage algorithms internally, without help from libipa. With ongoing work on tuning data support for the RkISP1, and future similar work for the IPU3, more code duplication for algorithms management is expected. To address this and share code between multiple IPA modules, introduce a new Module class template that will define and manage top-level concepts for the IPA module. The Module class template needs to be specialized with the same types as the Algorithm class. To avoid manual specialization of both classes, store the types in the Module class, and replace the template arguments of the Algorithm class with a single Module argument from which the other types are retrieved. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Paul Elder <paul.elder@ideasonboard.com>
2022-06-29pipeline: raspberrypi: Advertise ScalerCrop from the pipeline handlerNaushir Patuck
The ScalerCrop control is handled directly by the pipeline handler. Remove the control from the IPA's static ControlInfoMap, and let the pipeline handler add it to the ControlInfoMap advertised to the application, ensuring the limits are set appropriately based on the current sensor mode. Signed-off-by: Naushir Patuck <naush@raspberrypi.com> Reviewed-by: David Plowman <david.plowman@raspberrypi.com> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com> Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
2022-06-29pipeline: ipa: raspberrypi: Correctly report available control limitsNaushir Patuck
The ipa currently advertises a static ControlInfoMap to specify the available controls and their limits. Fix this limitation by having the IPA populate a new ControlInfoMap with updated limits for ExposureTime, AnalogueGain, and FrameDurationLimits controls based on the current sensor mode. This new ControlInfoMap is then returned back to the pipeline handler and available to the application after a successful Camera::configure() call. Before the first call to Camera::configure(), this ControlInfoMap provides some reasonable default limits for ExposureTime, AnalogueGain, and FrameDurationLimits. However, applications must not rely on these values, but obtain the correct limits after the call to Camera::configure(). Signed-off-by: Naushir Patuck <naush@raspberrypi.com> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com> Reviewed-by: David Plowman <david.plowman@raspberrypi.com> Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
2022-06-29pipeline: ipa: raspberrypi: Move ControlInfoMap to the IPANaushir Patuck
Currently the pipeline handler advertises controls handled by the IPA from a static ControlInfoMap defined in the raspberrypi.h header. This change removes this header file, and instead the IPA returns the ControlInfoMap to the pipeline handler from the ipa::init() function. This is done to allow the IPA to adjust the limits of the controls based on the sensor mode in a subsequent change. Bug: https://bugs.libcamera.org/show_bug.cgi?id=83 Signed-off-by: Naushir Patuck <naush@raspberrypi.com> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com> Reviewed-by: David Plowman <david.plowman@raspberrypi.com> Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
2022-06-29ipa: raspberrypi: Use std::optional in DeviceStatusNaushir Patuck
Switch the aperture, lens_position, and flash_intensity fields in the DeviceStatus structure to use std::optional instead of using invalid default values. Signed-off-by: Naushir Patuck <naush@raspberrypi.com> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com> Reviewed-by: David Plowman <david.plowman@raspberrypi.com> Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
2022-06-29ipa: raspberrypi: imx477: Get sensor temperature from embedded dataNaushir Patuck
Fetch the sensor temperature value from the embedded data buffer and add it to the DeviceStatus structure in CamHelperImx477::PopulateMetadata(). Signed-off-by: Naushir Patuck <naush@raspberrypi.com> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com> Reviewed-by: David Plowman <david.plowman@raspberrypi.com> Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
2022-06-29ipa: raspberrypi: Add sensor temperature to DeviceStatusNaushir Patuck
Add an optional sensor_temperature field to the DeviceStatus structure. If a temperature measurement is available for a frame, the value is returned out through the SensorTemperature control in the Request metadata. Additionally, provide the sensor temperature value from the std::ostream &operator<< overload. Signed-off-by: Naushir Patuck <naush@raspberrypi.com> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com> Reviewed-by: David Plowman <david.plowman@raspberrypi.com> Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
2022-06-29libcamera: controls: Add SensorTemperature controlNaushir Patuck
Add a SensorTemperature control to return the temperature of the camera sensor in Celsius. This control will only be present in the Request metadata if a thermal sensor is available to the camera sensor. Signed-off-by: Naushir Patuck <naush@raspberrypi.com> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com> Reviewed-by: David Plowman <david.plowman@raspberrypi.com> Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
2022-06-27libcamera: v4l2_videodevice: Identify non-zero stream startsKieran Bingham
V4L2 Video devices should always start streaming from index zero. Identify and report a warning if they don't, and correct for any offset. Reviewed-by: Jacopo Mondi <jacopo@jmondi.org> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
2022-06-27README: Add some extra optional dependencies for cam sinksEric Curtin
KMS sink requires some DRM libraries, SDL sink requires some SDL libraries. Suggested-by: Pavel Machek <pavel@ucw.cz> Signed-off-by: Eric Curtin <ecurtin@redhat.com> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Jacopo Mondi <jacopo@jmondi.org>
2022-06-23meson: options: Disable pycamera by defaultJavier Martinez Canillas
The libcamera Python bindings is still experimental and it relies on some features in pybind11 that are not yet upstreamed, so a special branch has to be downloaded as a subproject. This conflicts with the build process used by most Linux distributions, since there is expected that all the dependencies will be fulfilled by -devel packages present in the build root. To allow libcamera to be built by distros, let's disable the pycamera by default. This can still be enabled with `meson build -Dpycamera=enabled`. Suggested-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com> Signed-off-by: Javier Martinez Canillas <javierm@redhat.com> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2022-06-22README: Add short testing instructions with camLaurent Pinchart
The README.rst file contains the getting started instructions, but lacks a simple way to test libcamera. Add a short section about basic cam usage. Suggested-by: Pavel Machek <pavel@ucw.cz> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com> Reviewed-by: Jacopo Mondi <jacopo@jmondi.org>
2022-06-22Documentation: Fix length of title underlinesLaurent Pinchart
Some title underlines don't match the title text. Fix them. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
2022-06-20Documentation: Use language 'en' for Sphinx 5.0.0Jacopo Mondi
Recent versions of Sphinx (> 5.0.0) have dropped support for the 'None' keyword as language specifier: https://www.sphinx-doc.org/en/master/changes.html#release-5-0-0-released-may-30-2022 10474: language does not accept None as it value. The default value of language becomes to 'en' now. Patch by Adam Turner and Takeshi KOMIYA. Causing a compile time warning: WARNING: Invalid configuration value found: 'language = None'. Update your configuration to a valid language code. Falling back to 'en' (English). Change the language setting to 'en' to silence the warning. Signed-off-by: Jacopo Mondi <jacopo@jmondi.org> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
2022-06-20cam: kms_sink: Remove limitation that camera and display must matchEric Curtin
There is a limitation that requires input and output to be pixel for pixel identical in terms of height and width. Remove this limitation to enable more hardware that doesn't match. Just start drawing from top left 0, 0 corner. Signed-off-by: Eric Curtin <ecurtin@redhat.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Tested-by: Eric Curtin <ecurtin@redhat.com>
2022-06-20libcamera: yaml_parser: Add get() specializations for 16-bit integersLaurent Pinchart
Extend the YamlObject::get() function template to support 16-bit integers. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Jacopo Mondi <jacopo@jmondi.org> Reviewed-by: Han-Lin Chen <hanlinchen@chromium.org>
2022-06-20libcamera: yaml_parser: Fix range checks for 32-bit integersLaurent Pinchart
The strtol() and strtoul() functions return long integers, which may be larger than 32-bit integers. Add manual range checks. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Jacopo Mondi <jacopo@jmondi.org> Reviewed-by: Han-Lin Chen <hanlinchen@chromium.org>
2022-06-20libcamera: yaml_parser: Remove memberNames() functionLaurent Pinchart
Now that YamlObject supports iteration, the memberNames() function isn't useful anymore as it can be implemented using utils::map_keys() if really needed. Drop it. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Jacopo Mondi <jacopo@jmondi.org> Reviewed-by: Han-Lin Chen <hanlinchen@chromium.org>
2022-06-20android: Use the YamlObject iterator APILaurent Pinchart
Replace usage of YamlObject::memberNames() with the more efficient iterator API. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Jacopo Mondi <jacopo@jmondi.org> Reviewed-by: Han-Lin Chen <hanlinchen@chromium.org>
2022-06-20test: yaml_parser: Extend tests to cover the iterator APILaurent Pinchart
Test iteration over lists and dictionaries to test the YamlObject iterator API. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Jacopo Mondi <jacopo@jmondi.org> Reviewed-by: Han-Lin Chen <hanlinchen@chromium.org>
2022-06-20libcamera: yaml_parser: Add iterator APILaurent Pinchart
Allow using range-based for loops over YamlObject instances by implementing iterators. New YamlObject::DictAdapter and YamlObject::ListAdapter adapter classes are introduced to provide different iterators depending on the object type. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Jacopo Mondi <jacopo@jmondi.org> Reviewed-by: Han-Lin Chen <hanlinchen@chromium.org>
2022-06-20libcamera: yaml_parser: Use std::is_same_v<>Laurent Pinchart
As the YamlObject class is internal to libcamera, it can use the full C++17 API. Replace std::is_same<>::value with std::is_same_v<>. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Jacopo Mondi <jacopo@jmondi.org> Reviewed-by: Han-Lin Chen <hanlinchen@chromium.org>
2022-06-19cam: drm: Support /dev/dri cards other than 0Eric Curtin
Existing code is hardcoded to card0. Since recent fedora upgrades, we have noticed on more than one machine that card1 is present as the lowest numbered device, could theoretically be higher. This technique tries every file starting with card and continue only when we have successfully opened one. These devices with card1 as the lowest device were simply failing when they do not see a /dev/dri/card0 file present. Reported-by: Ian Mullins <imullins@redhat.com> Tested-by: Ian Mullins <imullins@redhat.com> Signed-off-by: Eric Curtin <ecurtin@redhat.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2022-06-18ipa: ipu3: awb: Correct the gains calculationJean-Michel Hautbois
The factor used right now in the IPU3 is 8192, as a multiplier of the estimated gain. This is wrong, as the isp is adding 1.0 to the gain applied, ie Pout = { Pin * (1 + Gx) }. Fix it, and to ease the reading, introduce a small helper function. Signed-off-by: Jean-Michel Hautbois <jeanmichel.hautbois@ideasonboard.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
2022-06-17Documentation: Update the "Start an event loop" sectionDaniel Semkowicz
Event loop was moved to be a part of CameraManager, so it is no longer a user responsibility to control the event dispatching. Signed-off-by: Daniel Semkowicz <dse@thaumatec.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Jacopo Mondi <jacopo@jmondi.org> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2022-06-17Documentation: Update code examples to use the Request::reuse() methodDaniel Semkowicz
After introduction of reuse(), there is no need of manual request reconfiguration. Furthermore, current example code does not work anymore. Signed-off-by: Daniel Semkowicz <dse@thaumatec.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Jacopo Mondi <jacopo@jmondi.org> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2022-06-17Documentation: Add the missing const to the example codeDaniel Semkowicz
Request::BufferMap key type is now const Signed-off-by: Daniel Semkowicz <dse@thaumatec.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Jacopo Mondi <jacopo@jmondi.org> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2022-06-17Documentation: Fix createRequest unique_ptrTommaso Merciai
camera->createRequest() function return std::unique_ptr<Request>, then manipulate Request as std::unique_ptr. This solve the following error, during compilation: error: cannot convert ‘std::unique_ptr<libcamera::Request>’ to ‘libcamera::Request*’ in initialization References: - https://github.com/kbingham/simple-cam/blob/bb97f3bbd96a9d347e1b7f6cb68d94efaf8db574/simple-cam.cpp#L369 Signed-off-by: Tommaso Merciai <tommaso.merciai@amarulasolutions.com> Reviewed-by: Jacopo Mondi <jacopo@jmondi.org> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2022-06-16libcamera: pipeline: simple: Support scaling on the sensorLaurent Pinchart
As the simple pipeline handler targets simple pipelines on the SoC side, it often gets used with platforms that have a YUV sensor capable of outputting different sizes. Extend the heuristics used for pipeline discovery and configuration to scale as much as possible on the sensor side, in order to minimize the required bandwidth. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Tested-by: Dorota Czaplejewicz <dorota.czaplejewicz@puri.sm> Reviewed-by: Dorota Czaplejewicz <dorota.czaplejewicz@puri.sm> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
2022-06-16libcamera: pipeline: simple: Store sensor resolution in configurationLaurent Pinchart
When enumerating the supported configurations, store the corresponding sensor resolution in the SimpleCameraData::Configuration structure and use it when configuring the camera, instead of hardcoding the sensor full resolution. This prepares for support of downscaling in the camera sensor. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Tested-by: Dorota Czaplejewicz <dorota.czaplejewicz@puri.sm> Reviewed-by: Dorota Czaplejewicz <dorota.czaplejewicz@puri.sm> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
2022-06-16libcamera: pipeline: simple: Factor out format test to separate functionLaurent Pinchart
To prepare for the implementation of a more complex format discovery method, factor out code that tries a pipeline configuration to a separate function. No functional change intended. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Tested-by: Dorota Czaplejewicz <dorota.czaplejewicz@puri.sm> Reviewed-by: Dorota Czaplejewicz <dorota.czaplejewicz@puri.sm> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
2022-06-16libcamera: pipeline: simple: Document the pipeline traversal algorithmLaurent Pinchart
Add a section to the documentation at the top of the file to describe in a bit more details how the media graph is traversed. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Tested-by: Dorota Czaplejewicz <dorota.czaplejewicz@puri.sm> Reviewed-by: Dorota Czaplejewicz <dorota.czaplejewicz@puri.sm> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
2022-06-16libcamera: pipeline: simple: Improve debug message on config failureLaurent Pinchart
When pipeline configuration fails, print the format returned by the kernel in addition to the one requested by libcamera, to ease debugging. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Tested-by: Dorota Czaplejewicz <dorota.czaplejewicz@puri.sm> Reviewed-by: Dorota Czaplejewicz <dorota.czaplejewicz@puri.sm> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
2022-06-16test: yaml-parser: Use write() instead of fwrite()Laurent Pinchart
There's no point in wrapping a fd into a FILE to then only call fwrite() and fclose(). Use write() and close() directly. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Paul Elder <paul.elder@ideasonboard.com>
2022-06-16libcamera: yaml_parser: Switch from FILE to FileLaurent Pinchart
THe FILE object isn't very user-friendly as it requires manual close. Replace it with File to provide RAII-style resource management in the YamlParser API. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Paul Elder <paul.elder@ideasonboard.com>
2022-06-16libcamera: yaml_parser: Extend YamlObject::size() to dictionariesLaurent Pinchart
Dictionaries have a size too, extend the size() function to support them. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Paul Elder <paul.elder@ideasonboard.com>
2022-06-16libcamera: yaml_object: Turn Type into an enum classLaurent Pinchart
Turn the Type enum into an enum class to force qualifying 'List' and 'Dictionary' in the YamlObject namespace scope. This will help avoiding ambiguities when adding iterator support. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Paul Elder <paul.elder@ideasonboard.com>
2022-06-10android: camera_device: Print the correct number of completed streamsJacopo Mondi
When a request completes, a debug message is generated to help identify the request and the number of streams it contains. The printed number of streams is however the number of output buffers requested by the camera framework, not the number of streams generated by libcamera. In facts, some output buffers are generated by post-processing, and not directly from the camera. As the debug message prints the libcamera identifier for the Request, it is more logical to print the number of streams generated by the camera instead of the total number of streams. Reviewed-by: Hirokazu Honda <hiroh@chromium.org> Reviewed-by: Paul Elder <paul.elder@ideasonboard.com> Signed-off-by: Jacopo Mondi <jacopo@jmondi.org> Signed-off-by: Paul Elder <paul.elder@ideasonboard.com> Reviewed-by: Umang Jain <umang.jain@ideasonboard.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2022-06-10android: camera_device: Use YUV post-processorHirokazu Honda
When creating the list of StreamConfiguration to be requested to the camera, map NV12 streams of equal size and format together, so that they will be generated by using the YUV post-processor. Signed-off-by: Hirokazu Honda <hiroh@chromium.org> Signed-off-by: Jacopo Mondi <jacopo@jmondi.org> Reviewed-by: Umang Jain <umang.jain@ideasonboard.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2022-06-10android: camera_device: Postpone mapped streams handlingJacopo Mondi
Mapped streams are generated by post-processing and always require a source buffer to process image data from. In case a Mapped stream is requested but its source stream is not, it is required to allocate a buffer on the fly and add it to the libcamera::Request. Make sure a source stream is available for all mapped streams, and if that's not the case, add a dedicated buffer to the request for that purpose. Signed-off-by: Jacopo Mondi <jacopo@jmondi.org> Signed-off-by: Paul Elder <paul.elder@ideasonboard.com> Reviewed-by: Umang Jain <umang.jain@ideasonboard.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2022-06-10android: camera_stream: Create allocator unconditionallyJacopo Mondi
Originally buffer allocation was only required for Internal streams which are not backed by a frame buffer provided by the Android framework. Now that mapped streams can be generated without the corresponding source stream being part of the Android's provided stream list, also buffers of type Mapped can be required to allocate buffers on demand. Create CameraStream::allocator_ and the associated mutex unconditionally for all types of stream. Signed-off-by: Jacopo Mondi <jacopo@jmondi.org> Reviewed-by: Umang Jain <umang.jain@ideasonboard.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2022-06-10android: camera_stream: Add sourceStreamHirokazu Honda
Add a sourceStream field to the CameraStream class, meant to contain a reference to the direct stream which produces actual image data for streams of type CameraStream::Mapped. The sourceStream of mapped streams will be used in later patches to make sure for each Mapped stream at least one libcamera::Stream is queued to the libcamera::Camera. Signed-off-by: Hirokazu Honda <hiroh@chromium.org> Signed-off-by: Jacopo Mondi <jacopo@jmondi.org> Signed-off-by: Paul Elder <paul.elder@ideasonboard.com> Reviewed-by: Umang Jain <umang.jain@ideasonboard.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2022-06-08py: examples: Add simple-cam.pyTomi Valkeinen
Add a Python version of simple-cam from: https://git.libcamera.org/libcamera/simple-cam.git Let's keep this in the libcamera repository until the Python API has stabilized a bit more, and then we could move this to the simple-cam repo. Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com> Reviewed-by: Jacopo Mondi <jacopo@jmondi.org> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2022-06-08py: examples: Add simple-continuous-capture.pyTomi Valkeinen
Add a slightly more complex, and I think a more realistic, example, where the script reacts to events and re-queues the buffers. Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com> Reviewed-by: Jacopo Mondi <jacopo@jmondi.org> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2022-06-08py: examples: Add simple-capture.pyTomi Valkeinen
Add an example to showcase the more-or-less minimal capture case. Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com> Reviewed-by: Jacopo Mondi <jacopo@jmondi.org> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2022-06-08Documentation: Add python-bindings.rstTomi Valkeinen
Add a basic doc for the Python bindings. While not really proper documentation yet, the file and the examples should give enough guidance for users who are somewhat familiar with libcamera. Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Jacopo Mondi <jacopo@jmondi.org> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2022-06-06libcamera: base: log: Color the log prefixLaurent Pinchart
Add coloring to the log prefix to increase log readability. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Umang Jain <umang.jain@ideasonboard.com> Reviewed-by: Paul Elder <paul.elder@ideasonboard.com> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
2022-06-06libcamera: base: log: Add coloring to the log outputLaurent Pinchart
Extend the logger to support coloring messages. The log level is colorized with per-level colors, and the category with a fixed color. This makes the log output more readable. Coloring is enabled by default when logging to std::cerr, and can be disabled by setting the LIBCAMERA_LOG_NO_COLOR environment variable. When logging to a file with LIBCAMERA_LOG_FILE, coloring is disabled. It can be enabled for file logging using the logSetFile() function. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Umang Jain <umang.jain@ideasonboard.com> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
2022-06-06camera_sensor: Suppress error message if test patterns are unavailableNaushir Patuck
If a sensor driver does not support test patterns (e.g. IMX477), libcamera throws an unnecessary error message during initialisation when it sets the test pattern to off. Fix this by moving the error message into setTestPatternMode() where the pipeline handler explicitly requests to set a test pattern. Signed-off-by: Naushir Patuck <naush@raspberrypi.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>