summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2020-05-11meson: Use files() instead of find_program() for internal scriptsLaurent Pinchart
Using find_program() to locate scripts part of the source tree causes meson to print messages at setup time for each of those scripts: Program ipa-sign.sh found: YES (/home/user/src/libcamera/src/ipa/ipa-sign.sh) This pollutes the meson setup log with useless messages, as we know the scripts are present. Use files() instead to avoid this. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
2020-05-11Documentation: coding-style: Fix ordered listsLaurent Pinchart
The syntax used for ordered lists is incorrect. Fix it. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
2020-05-10libcamera: pipeline: simple: Support multiple capture video nodesLaurent Pinchart
The simple pipeline handler rejects devices that have multiple capture video nodes. There's no real reason to do so, a more dynamic approach is possible as the pipeline handler already locates the video device by walking the media graph. Rework the match sequence by skipping any check on the video nodes, and create the V4L2VideoDevice for the media entity at the end of the pipeline when initializing the camera data. The V4L2VideoDevice instances are managed by the pipeline handler itself, to avoid creating separate instances in the camera data if multiple sensors are routed to the same video device. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Andrey Konovalov <andrey.konovalov@linaro.org> Reviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
2020-05-10libcamera: pipeline: simple: Integrate converter supportLaurent Pinchart
Add support for an optional format converter, supported by the SimpleConverter class. If a converter is available for the pipeline, it will be used to expose additional pixel formats. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
2020-05-10libcamera: pipeline: simple: Add simple format converterLaurent Pinchart
The simple format converter supports V4L2 M2M devices that convert pixel formats. 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>
2020-05-10libcamera: pipeline: Add a simple pipeline handlerMartijn Braam
This new pipeline handler aims at supporting any simple device without requiring any device-specific code. Simple devices are currently defined as a graph made of one or multiple camera sensors and a single video node, with each sensor connected to the video node through a linear pipeline. The simple pipeline handler will automatically parse the media graph, enumerate sensors, build supported stream configurations, and configure the pipeline, without any device-specific knowledge. It doesn't support configuration of any processing in the pipeline at the moment, but may be extended to support simple processing such as format conversion or scaling in the future. The only device-specific information in the pipeline handler is the list of supported drivers, required for device matching. We may be able to remove this in the future by matching with the simple pipeline handler as a last resort option, after all other pipeline handlers have been tried. Signed-off-by: Martijn Braam <martijn@brixit.nl> 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> Reviewed-by: Andrey Konovalov <andrey.konovalov@linaro.org>
2020-05-10libcamera: v4l2_videodevice: Support filtering formats by media bus codeLaurent Pinchart
Add support for the recent V4L2 extension to VIDIOC_ENUM_FMT that allows filtering pixel formats by media bus codes. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
2020-05-10include: linux: Extend VIDIOC_ENUM_FMT to support MC-centric devicesLaurent Pinchart
This integrates the Linux kernel upstream commits e5b6b07a1b45 ("media: v4l2: Extend VIDIOC_ENUM_FMT to support MC-centric devices") and f645e6256bd1 ("media: v4l2-dev/ioctl: Add V4L2_CAP_IO_MC") that are scheduled for v5.8. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
2020-05-10pkgconfig: Fix include directory pathNicolas Dufresne
Should be $includedir/libcamera, as we install into a subdirectory name 'libcamera'. This is fixed by passing the 'subdirs' argument to the pkgconfig generator. Signed-off-by: Nicolas Dufresne <nicolas.dufresne@collabora.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2020-05-10android: hal: License camera3_hal.cpp as LGPL-2.1-or-laterLaurent Pinchart
The camera3_hal.cpp is incorrectly licensed as GPL-2.0-or-later, instead of LGPL-2.1-or-later as the rest of the HAL implementation. Fix it. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Acked-by: Jacopo Mondi <jacopo@jmondi.org>
2020-05-04qcam: dng_writer: Write EXIF IFD as custom directoryLaurent Pinchart
The EXIF IFD is incorrectly chained to IFD 0 in addition to being a referenced as a sub IFD through the EXIFIFD tag. While the libtiff API doesn't clearly document why this happens, inspection of the TIFFWriteDirectory() source code show that the function treats the IFD being written as containing an image, which isn't correct for the EXIF IFD. Use TIFFWriteCustomDirectory() instead, which fixes the problem. The resulting DNG file can now be opened with darktable in addition to rawtherapee. 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>
2020-05-03libcamera: camera_sensor: Relax restriction on sizesLaurent Pinchart
The CameraSensor class assumes that camera sensors support the exact same list of sizes of all media bus codes. While allowing a simpler API, this assumption is incorrect and is blocking usage of some camera sensors. Relaxing the constraint is possible without changes to the CameraSensor API syntax, but requires changing its semantics. The sizes() function now returns the list of all sizes for all media bus codes, and the getFormat() function now searches in all supported media bus codes. The former is likely not the most useful option for pipeline handlers, but the sizes() function is currently unused. Designing a better API will require inspecting current and expected future use cases in pipeline handlers to determine proper heuristics. While at it, fix a small typo in an unrelated comment. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
2020-05-03qcam: dng_writer: Remove colon from \todoNiklas Söderlund
Todo statements should not end with a colon, remove it. Signed-off-by: Niklas Söderlund <niklas.soderlund@ragnatech.se> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2020-05-03qcam: dng_writer: Generate thumbnail in RGB formatLaurent Pinchart
While the DNG specification supports greyscale ("BlackIsZero") for thumbnails, RawTherapee seems to have trouble reading them. Generate thumbnails in RGB instead (but still with greyscale content, to avoid having to interpolate colour components). Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
2020-05-03qcam: dng_writer: Populate DNG tags from metadataLaurent Pinchart
Populate the DNG black level, ISO speed rating and exposure time from metadata. The ISO speed rating and exposure time are standardized as EXIF tags, not TIFF tags, and require a separate EXIF IFD. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
2020-05-03qcam: dng_writer: Output thumbnailLaurent Pinchart
Generate a greyscale, 1/16 resolution thumbnail and add it to the DNG file. This requires shuffling the RAW image generation as the thumbnail has to be stored in the main IFD as per the DNG and TIFF/EP specifications. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
2020-05-03qcam: dng_writer: Name arguments to packScanline()Laurent Pinchart
Name arguments to the FormatInfo::packScanline function pointer to make it easier to understand its usage when reading the function declaration. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
2020-05-03qcam: Pass request metadata to DNG writerLaurent Pinchart
The DNG writer will use the metadata to populate DNG tags. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
2020-05-03libcamera: camera_sensor: Prepare for multi-subdev camera sensorsLaurent Pinchart
While most camera sensors are exposed to userspace as a single subdev, this is not always the case. A notable exception is the smiapp driver, which exposes two or three subdevs. The subdev at the output of the camera sensor will thus have more than one pad. Prepare for this by removing the single-pad restriction, and locating the source pad dynamically. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
2020-05-03libcamera: camera_sensor: Store subdevice in std::unique_ptrLaurent Pinchart
Avoid the need for a manual delete in the destructor by using a unique pointer. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
2020-05-03libcamera: camera_sensor: Access entity directlyLaurent Pinchart
The CameraSensor::logPrefix() function accesses the entity from the subdev. Remove the level of indirection as we stored a pointer to the entity internally. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
2020-05-03qcam: dng_writer: Fix missing field nameNiklas Söderlund
While reformatting the table the field name was missed for one entry, add it. Fixes: db7235b7141aa4e2 ("qcam: Add DNGWriter") Signed-off-by: Niklas Söderlund <niklas.soderlund@ragnatech.se> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2020-05-02qcam: Add RAW capture supportNiklas Söderlund
Add a toolbar button that captures RAW data to disk. The button is only enabled if the camera is configured to provide a raw stream to the application. Only when the capture action is triggered will a request with a raw buffer be queued to the camera. Signed-off-by: Niklas Söderlund <niklas.soderlund@ragnatech.se> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2020-05-02qcam: Add DNGWriterNiklas Söderlund
Add an initial DNG file writer. The writer can only deal with a small set of pixel formats. The generated file is consumable by standard tools. The writer needs to be extended to write more metadata to the generated file. Signed-off-by: Niklas Söderlund <niklas.soderlund@ragnatech.se> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2020-05-02qcam: Allow for a second raw stream to be configuredNiklas Söderlund
Allow a second stream to be configured for raw capture. This change only adds support for configuring and allocating buffers for the second stream. Later changes are needed to queue the allocated buffers to the camera when the user wishes to capture a raw frame. Signed-off-by: Niklas Söderlund <niklas.soderlund@ragnatech.se> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2020-05-02libcamera: vimc: Adjust crop rectangleJacopo Mondi
Since the Linux kernel commit: 69e39d40587b ("media: vimc: Implement get/set selection in sink") the crop rectangle on the VIMC scaler sink pad needs to be reset to match the requested format to avoid hitting a pipeline format misconfiguration when the applied format is larger than the one set in a previous capture session. As the V4L2 specification is not clear on what the correct behaviour is, if the crop rectangle should be reset automatically or not on a set_fmt operation, momentary fix the pipeline handler to please the driver and manually reset the crop rectangle. Signed-off-by: Jacopo Mondi <jacopo@jmondi.org> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2020-05-02libcamera: pipeline: vimc: Store media device pointer in camera dataLaurent Pinchart
Store the MediaDevice for the VIMC instance in the VimcCameraData class. This will be used to check the media device version at runtime. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
2020-05-02libcamera: media_device: Expose media device API version numberLaurent Pinchart
Add a MediaDevice::version() function to expose the media device API version number. This can be useful to support driver API changes in pipeline handlers. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
2020-05-01libcamera: stream: Expose stride valueNiklas Söderlund
Expose the image stride which may be retrieved after a video device has been configured. It may only be retrieved at that point as the assignment of video devices takes place at this point. In the future video devices should be assigned at configuration validation time and the stride value retrieved at that point. Signed-off-by: Niklas Söderlund <niklas.soderlund@ragnatech.se> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2020-05-01libcamera: Add Python cache and compiled files to .gitignoreLaurent Pinchart
To prepare for more widespread use of Python in libcamera, ignore Python cache and compiled files produced when importing modules directly from the source tree. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
2020-05-01libcamera: Set -Wno-psabi on gcc 7 and 8 for armLaurent Pinchart
gcc 7.1 introduced processor-specific ABI breakages related to parameter passing on ARM platforms. This generates a large number of messages during compilation with gcc >=7.1 until gcc 9. Silence them. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
2020-05-01qcam: Check that camera can generate configuration from rolesNiklas Söderlund
If the camera can not generate a configuration from the requested roles it returns a nullptr which leads to a nullptr dereference. Fix this by adding a check that the camera generated a configuration before trying to access it. Signed-off-by: Niklas Söderlund <niklas.soderlund@ragnatech.se> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2020-05-01qcam: Make use of StreamKeyValueParserNiklas Söderlund
Use the StreamKeyValueParser helper to parse stream configuration from the command line. This extends qcam to accept role hints and pixel format in addition to a size. Currently only one viewfinder stream is supported, add a check to keep this behavior. Going forward this restriction will be lifted to support more then one stream. Signed-off-by: Niklas Söderlund <niklas.soderlund@ragnatech.se> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2020-05-01cam: Make use of StreamKeyValueParserNiklas Söderlund
Use the StreamOptionsParser helper to parse stream configuration from the command line. Signed-off-by: Niklas Söderlund <niklas.soderlund@ragnatech.se> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2020-05-01cam: Add helper class to parse stream configurationNiklas Söderlund
Create a new helper class StreamKeyValueParser to parse command line options describing stream configurations. The goal is to share this new class between cam and qcam. Signed-off-by: Niklas Söderlund <niklas.soderlund@ragnatech.se> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2020-05-01cam: options: Add public method to invalidate optionsNiklas Söderlund
Extend OptionsBase<T> with a public invalidate() method. This allows for further examination of the options and if found unsuitable be invalidated. The intended user for this new interface are subclasses of KeyValueParser. Signed-off-by: Niklas Söderlund <niklas.soderlund@ragnatech.se> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2020-05-01cam: options: Make KeyValueParser::parse() virtualNiklas Söderlund
Prepare for sub-classing of the KeyValueParser by making the parse() method virtual. Signed-off-by: Niklas Söderlund <niklas.soderlund@ragnatech.se> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2020-04-30qcam: main_window: Fix combo-box entry selection on startupUmang Jain
When one of the camera is selected and opened from the "Select Cameras" items list, the entry of the combo-box in the main-window doesn't update its item index to reflect the camera which was earlier selected. Fix that. Signed-off-by: Umang Jain <email@uajain.com> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Tested-by: Kieran Bingham <kieran.bingham@ideasonboard.com> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2020-04-30qcam: main_window: Make cameraCombo_ privateUmang Jain
This commit introduces no functional changes. This is required so that the combo-box list can be managed conveniently from various private functions in subsequent commit. Signed-off-by: Umang Jain <email@uajain.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>
2020-04-30libcamera: v4l2_pixelformat: Fix V4L2_PIX_FMT_SBGGR10P formatLaurent Pinchart
The V4L2_PIX_FMT_SBGGR10P format was misspecified as V4L2_PIX_FMT_SBGGR10. Fix it. Fixes: 00d639d951e7 ("libcamera: formats: Add support for 8-, 10- and 12-bit Bayer formats") Reported-by: Niklas Söderlund <niklas.soderlund@ragnatech.se> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Tested-by: Niklas Söderlund <niklas.soderlund@ragnatech.se> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
2020-04-30libcamera: formats: Add additional data to PixelFormatInfoLaurent Pinchart
Add three additional fields to PixelFormatInfo to report the number of bits per pixel, the colour encoding, and the data packing. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
2020-04-30libcamera: formats: Add support for 8-, 10- and 12-bit Bayer formatsLaurent Pinchart
Add the 8-, 10- and 12-but Bayer formats, in both unpacked and MIPI-packed variants, to the format tables in PixelFormatInfo and V4L2PixelFormat. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
2020-04-30libcamera: formats: Expose PixelFormatInfo as an internal APILaurent Pinchart
To prepare for storing more information about pixel formats in PixelFormatInfo, move the class to formats.cpp and document it. The pixel formats database is moved to the same file, and a new static function is added to PixelFormatInfo to retrieve a PixelFormatInfo for a PixelFormat. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
2020-04-30libcamera: v4l2_pixelformat: Use maps to convert between DRM and V4L2Laurent Pinchart
Replace the two big manual switch...case with maps. This should not just improve efficiency when we will have a larger number of formats, but also paves the way to storing more format information to create additional helpers. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
2020-04-30libcamera: v4l2_pixelformat: Move DRM/V4L2 format conversionLaurent Pinchart
Move the DRM/V4L2 format conversion code from V4L2VideoDevice to V4L2PixelFormat. This is a more natural home for the code. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
2020-04-30libcamera: v4l2_pixelformat: Move V4L2PixelFormat to a new fileLaurent Pinchart
Move the V4L2PixelFormat class to a new file to prepare for additional changes that will make it grow. No functional modification is included. 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>
2020-04-30libcamera: Build IPA module signatures by defaultLaurent Pinchart
Commit 7206035ee609 ("libcamera: Regenerate IPA module signatures at install time") replaced installation of the IPA module signatures with an install script that signs all modules. While doing so, it inadvertently also disabled generation of the signature at build time by default. This breaks running libcamera binaries from the build directory. Fix it. Fixes: 7206035ee609 ("libcamera: Regenerate IPA module signatures at install time") 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>
2020-04-30libcamera: utils: Identify the 'real' build pathKieran Bingham
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>
2020-04-30libcamera: ipa_manager: Fix build path commentsKieran Bingham
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>
2020-04-30libcamera: ipa_module: Add log prefixLaurent Pinchart
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>