Age | Commit message (Collapse) | Author |
|
Call realpath() to strip out any levels of indirection required in
referencing the root build directory.
This simplifies the debug output when reporting and parsing paths.
Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
|
|
The comments describe functionality before libcameraBuildPath() was
adapted from libcameraPath() to return the root of the build, and
described having to take a relative path.
This is no longer the case, and the comment is inaccurate. Fix it.
Fixes: 1b8ac8473c94 ("libcamera: utils: Adapt libcameraPath to match use cases")
Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
Reviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
|
|
Make the IPAModule class inherit from Loggable to log the IPA module
name in all messages.
Before:
[14:19:55.743795676] [20250] ERROR IPAModule ipa_module.cpp:279 IPA module is not an ELF file
After:
[14:20:22.343795887] [20270] ERROR IPAModule ipa_module.cpp:279 ipa_vimc.so: IPA module is not an ELF file
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
|
|
The sequence number of captured frames is logged to the console with
padding to 6 characters to increase readability. The output is however
incorrect, as 123 is printed as 00012300000. This is caused by the
auto-space feature of QDebug, which inserts a space after every field.
This doesn't play well with stream format manipulation, as it ends up
padding the automatically inserted space the same way as the previous
argument.
This is a bug in Qt, work around it by formatting the sequence number
manually.
Fixes: 494da4467ddf ("qcam: Use Qt qInfo() and qWarning() logging facilities")
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
|
|
When starting the streaming, it might be that the call
to sensorInfo fails. This does not mean that the camera can't
stream so set 'ret' to 0.
Fixes: fd554f9dba31 ("libcamera: ipa: Add support for CameraSensorInfo")
Signed-off-by: Dafna Hirschfeld <dafna.hirschfeld@collabora.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
|
|
When the IPA modules are installed, meson strips the DT_RPATH and
DT_RUNPATH from the binaries. This invalidates the signatures. Disable
installation of the .sign files and add an installation script to
regenerate them directly in the target directory. The .sign files still
need to be created at build time to support running IPA modules from the
build tree.
Two alternative approaches have been considered:
- meson could be taught a new target argument to preserve binary
compatibility by skipping any operation that modifies files. This has
been proposed in the #mesonbuild IRC channel. While this could be
interesting in the longer term, we need to fix the issue now.
- The module signatures could be computed on selected sections only.
While skipping the .dynamic section when signing may not cause
security issues, it would make signature generation and verification
more complex, and wasn't deemed worth it.
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
|
|
The black levels will be used when saving RAW data in DNG containers.
Four values are reported, one for each channel, in the order R, Gr, Gb
and B. The values are reported as being out of a 16-bit pixel range
(a fully saturated pixel would be 65535), so may need subsequent
re-scaling, depending on use.
Signed-off-by: David Plowman <david.plowman@raspberrypi.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>
|
|
Add support for camera sensor information in the libcamera IPA protocol.
Define a new 'struct ipa_sensor_info' structure in the IPA context and
use it to perform translation between the C and the C++ API.
Update the IPAInterface::configure() operation to accept a new
CameraSensorInfo parameter and port all users of that function to
the new interface.
Signed-off-by: Jacopo Mondi <jacopo@jmondi.org>
|
|
Add a method to retrieve the CameraSensorInfo to the CameraSensor class.
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Jacopo Mondi <jacopo@jmondi.org>
|
|
Define a map of static information associated with a media bus code.
Start by reporting the bits-per-pixel for each media bus code defined by
the V4L2 kernel API, to later expand it when necessary.
Add to the V4L2SubdeviceFormat class a method to return the bits per
pixel, retrieved by inspecting the static map of format information.
While at it, remove a rogue map inclusion from header file.
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Jacopo Mondi <jacopo@jmondi.org>
|
|
Define the CameraSensorInfo structure that reports the current image sensor
configuration.
Signed-off-by: Jacopo Mondi <jacopo@jmondi.org>
|
|
Implement V4L2Subdevice::getSelection() to support retrieving selection
rectangles from the V4L2 subdevice.
Reviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Jacopo Mondi <jacopo@jmondi.org>
|
|
Expose V4L2Videodevice::setSelection() method and drop
V4L2Videodevice::setCrop() and V4L2Videodevice::setComopse() as wrapping
each target with a single function does not provide any benefit.
Reviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Jacopo Mondi <jacopo@jmondi.org>
|
|
Expose V4L2Subdevice::setSelection() method and drop
V4L2Subdevice::setCrop() and V4L2Subdevice::setComopse() as wrapping
each target with a single function does not provide any benefit.
Reviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Jacopo Mondi <jacopo@jmondi.org>
|
|
Use the sensor model to create the camera name. The resulting name
should still be "VIMC Sensor B", but prepares for support of Sensor A.
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Jacopo Mondi <jacopo@jmondi.org>
|
|
Add a new model() function to the CameraSensor class to report the
camera sensor model.
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Jacopo Mondi <jacopo@jmondi.org>
|
|
The V4L2Device::getControls() function takes a ControlList that needs to
be pre-populated with dummy entries for the controls that need to be
read. This is a cumbersome API, especially when reading a single
control. Make it nicer by passing the list of V4L2 controls as a vector
of control IDs, and returning a ControlList.
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Jacopo Mondi <jacopo@jmondi.org>
Reviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
|
|
Add two control types to store rectangles and sizes. These will be
useful for the properties related to the pixel array.
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
Reviewed-by: Jacopo Mondi <jacopo@jmondi.org>
|
|
Make sure we can open the configuration file passed to the init()
function, and return an error otherwise.
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Jacopo Mondi <jacopo@jmondi.org>
Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
|
|
Pass the vimc IPA dummy configuration file to the IPA init() function.
This will be used by the IPA to validate the init() call.
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Jacopo Mondi <jacopo@jmondi.org>
Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
|
|
The file will be used to test the corresponding APIs.
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Jacopo Mondi <jacopo@jmondi.org>
Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
|
|
Add a new IPASettings class to pass IPA initialization settings through
the IPAInterface::init() method. The settings currently only contain the
name of a configuration file, and are expected to be extended later.
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Jacopo Mondi <jacopo@jmondi.org>
|
|
In order to provide pipeline handlers with IPA-related helpers on top of
IPAInterface, return the IPAProxy instance from IPAManager::createIPA().
No change is required in the pipeline handlers as the IPAInterface that
was previously returned is implemented by an IPAProxy instance already.
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Jacopo Mondi <jacopo@jmondi.org>
Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
|
|
IPA modules may require configuration files, which may be stored in
different locations in the file system. To standardize file locations
between all IPAs and pipeline handlers, provide a helper function to
locate a configuration file by searching in the following directories:
- All directories specified in the LIBCAMERA_IPA_CONFIG_PATH environment
variable ; or
- In the source tree if libcamera is not installed ; otherwise
- In standard system locations (etc and share directories).
When stored in the source tree, configuration files shall be located in
a 'data' subdirectory of their respective IPA directory.
More locations, or extensions to the mechanism, may be implemented
later.
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
|
|
The iostream header isn't needed. Drop it.
Fixes: c2a8217df54c ("libcamera: add IPA proxy")
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Jacopo Mondi <jacopo@jmondi.org>
Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
|
|
The message printed when loading a proxy worker from the build directory
is missing a space. Add it.
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Jacopo Mondi <jacopo@jmondi.org>
|
|
Similarly to libcameraBuildPath(), there's a need to locate resources
within the source tree when running libcamera without installing it.
Support this use case with a new utils::libcameraSourcePath() function.
The implementation uses a symlink from the build root to the source root
in order to avoid hardcoding the path to the source root in the
libcamera.so binary.
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
|
|
The IPAModuleInfo::name field is currently a free-formed string that has
little use. Tighten its usage rules to make it suitable for building
file system paths to IPA-specific resources by matching the directory
name of the IPA module.
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
|
|
If the camera specified on the command line can't be opened, the
MainWindow constructor still proceeds to check the startStopAction_,
which results in MainWindow::startCapture() being called and trying to
use a null camera_ object. Fix this by returning from the constructor as
soon as the error is detected.
This also fixes a similar crash if the camera selection dialog box is
closed without selecting a camera.
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
Reviewed-by: Umang Jain <email@uajain.com>
|
|
AwbMode is a new enum type to specify operating mode of the AWB
algorithm. All modes may not be supported by all platforms.
ColourGains is a new float array type used to specify manual red
and blue (in that order) colour channel gains when AWB is disabled.
ColourTemperature is a new control to return the current estimate of the
colour temperature.
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>
|
|
AeMeteringMode, AeConstraintMode, and AeExposureMode are new enum type
controls used to specify operating modes in the AE algorithm. All modes
may not be supported by all platforms.
ExposureValue is a new control used to set the log2 exposure adjustment
for the AE algorithm.
Lux is a new control that returns the current lux estimate.
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>
|
|
Group AE, AWB, etc. controls together for accessibility.
Update descriptions for Contrast, Brightness, and Saturation controls.
Update the uvcvideo and vimc pipeline handlers to use the new
brightness, contrast and saturation units. UVC has no explicit units for
those controls, so map them with a best effort heuristic. For VIMC,
hardcode the control range based on knowledge of the driver
implementation for simplicity.
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>
|
|
Rename:
ManualExposure -> ExposureTime
ManualGain -> AnalogueGain
Use micro-seconds units for ExposureTime. This is changed from milli-
seconds. The latter would not allow very low exposure times.
AnalogueGain switch to use a float to allow fractional gain adjustments.
Update the uvcvideo pipeline handler to use the new exposure and gain
units. For ExposureTime, UVC uses units of 100 micro-seconds, so map
the values before setting V4L2_CID_EXPOSURE_ABSOLUTE. For AnalogueGain,
UVC has no explicit gain units, so map the default gain value to 1.0
and linearly scale to the requested value.
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: Jacopo Mondi <jacopo@jmondi.org>
|
|
Document that controls are bi-directional by default. If a control
is only returned in metadata, this must be specified in the control's
description.
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: Jacopo Mondi <jacopo@jmondi.org>
|
|
UVC devices support auto-exposure, expose the feature through the
AeEnable control.
Reviewed-by: Jacopo Mondi <jacopo@jmondi.org>
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
|
|
Move addition and processing of individual controls to separate
functions, to prepare for more complex mappings of control values.
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Jacopo Mondi <jacopo@jmondi.org>
|
|
Add a new --list-controls option to print information about all the
controls supported by a camera.
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Jacopo Mondi <jacopo@jmondi.org>
|
|
The name OptProps is not very clear, spell it out fully. The command
line options are not changed.
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Jacopo Mondi <jacopo@jmondi.org>
|
|
Extend the V4L2VideoDevice to support notifying of frame start events.
The events are received from the device through the V4L2 event API, and
passed to users of the class through a signal.
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Jacopo Mondi <jacopo@jmondi.org>
|
|
Compound controls are now supported, but they're still listed as
unsupported in some parts of the V4L2Device class documentation.
Fix this by removing those parts.
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Jacopo Mondi <jacopo@jmondi.org>
|
|
The Rectangle class members that represents the rectangle horizontal and
vertical sizes are named 'w' and 'h', in contrast with the Size and
SizeRange classes which use 'width' and 'height', resulting in having to
look at class definition every time to know which names to use.
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Jacopo Mondi <jacopo@jmondi.org>
|
|
To prepare for the addition of a second notifier for V4L2 events, rename
the current fdEvent_ member to fdBufferNotifier_ to better reflect its
usage.
While at it, simplify allocation of the fdEvent_ notifier.
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
Reviewed-by: Jacopo Mondi <jacopo@jmondi.org>
|
|
Since commit e75ef59e028e ("libcamera: device_enumerator_udev: Update
pending list in addUdevDevice") the populateMediaDevice() function
returns 0 on success instead of the number of missing dependencies,
resulting in a wrong number being logged. Fix it.
Fixes: e75ef59e028e ("libcamera: device_enumerator_udev: Update pending list in addUdevDevice")
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Umang Jain <email@uajain.com>
|
|
When setting format on a metadata video device, the returned format
isn't updated with the actual set format due to a typo. Fix it.
Reported-by: Coverity CID=279098
Fixes: 629e9301c518 ("libcamera: v4l2_device: Add META support in g/s_fmt")
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
|
|
To make the output more readable, break the publicKeyData_ array at 8
bytes boundaries.
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
|
|
IPA module signing is optional, but when not available due to missing
dependencies, we hit failures due to a non fully implemented IPA
isolation. Make module signing mandatory until isolation is functional.
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
|
|
The IPA module signing mechanism relies on openssl to generate keys and
sign the module. If openssl is not found on the system, the build will
fail. Make the dependency optional by detecting openssl, and skip
generation of signatures if openssl isn't found.
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
|
|
DRM has a format for 8-bit greyscale data, DRM_FORMAT_R8. Despite the
'R' name, which comes from GL/Vulkan to mean single-channel data, the
format maps to greyscale for display. We can thus map it to
V4L2_PIX_FMT_GREY.
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
|
|
Failing to convert between V4L2 and DRM 4CCs indicates something is
likely wrong, but doesn't necessarily prevent the camera from being
usable. It may for instance only limit the number of supported formats.
Downgrade the related log messages from LogError to LogWarning.
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
Reviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
|
|
Add a caps() function that exposes the V4L2 capabilities for the device.
This is useful for generic code that can't hardcode any a priori
knowledge of the device, such as in a simple pipeline handler.
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
Reviewed-by: Jacopo Mondi <jacopo@jmondi.org>
|