Age | Commit message (Collapse) | Author |
|
Add live .ebuild file for libcamera.
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>
|
|
Name all instances of CameraConfiguration "config", and all instances of
StreamConfiguration "cfg" accross the cam and qcam applications.
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
|
|
Name all instances of CameraConfiguration "config", and all instances of
StreamConfiguration "cfg" accross all tests.
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
|
|
Name all instances of CameraConfiguration "config", and all instances of
StreamConfiguration "cfg" accross all pipeline handlers.
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
|
|
Several of our structures include width and height fields that model a
size while we have a Size class for that purpose. Use the Size class
through libcamera, and give it a toString() method like other geometry
and format classes.
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
|
|
The uvcvideo and vimc pipeline handlers print the requested resolution
in their configureStreams() operation. This duplicates a generic log
statement in the Camera::configureStreams() method, remove it.
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
|
|
The makedev() macro is defined in sys/sysmacros.h, include the header
explicitly.
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Jacopo Mondi <jacopo@jmondi.org>
|
|
The glibc read() and write() functions are defined with the
__warn_unused_result__ attribute when using FORTIFY_SOURCE. Don't ignore
their return value.
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Jacopo Mondi <jacopo@jmondi.org>
Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
|
|
Building the documentation reports warnings,
WARNING: Project targetting '>= 0.40' but tried to use feature introduced in '0.50.0': install arg in configure_file
WARNING: Project specifies a minimum meson_version '>= 0.40' but uses features which were added in newer versions:
* 0.50.0: {'install arg in configure_file'}
Due to the usage of the directive configure_file { install: false } in
Documentation/meason.build which is introduced in meson 0.50. As we do
not wish to install the Doxyfile no install_dir is set so there is no
need to explicitly state that it should not be installed. Silence the
warning by dropping the install directive.
Fixes: 53c4d4c34fc49b95 ("Documentation: Generate source code documentation using Doxygen")
Signed-off-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
|
|
The IPU3 and RKISP1 pipeline handlers log the camera configuration they
propose in their streamConfiguration() methods. Other pipeline handlers
are expected to log similar information, move it to the Camera class.
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
|
|
Make sure all requests queued to a camera only contain streams which
have been configured and belong to the camera.
Signed-off-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
|
|
Member slots for objects deriving from the Object class receive special
handling. Add one test to make sure we exercise the related code paths.
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
|
|
libcamera depends on libudev for device enumeration. It is however
useful to allow building documentation without requiring the dependency
to be installed. Make the libudev dependency optional and compile the
udev-based device enumerator out when libudev is not present.
Note that while libcamera will compile without libudev, it will not be
able to enumerate devices. A sysfs-based device enumerator is planned as
a fallback but not implemented yet.
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
|
|
The V4L2Device will use the same deviceNode for two directions in the
case of an M2M device.
Add the direction to identify the queue direction on each instance.
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
|
|
Some \todo comments are outdated and refer to tasks that have been
completed. Remove them.
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
|
|
Adding an integer value to a char pointer doesn't concatenate strings,
it indexes in the pointed string. Fix it.
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>
|
|
According to clang, variable-length arrays can't be initialised. Don't
do so, and explicitly set the last element to 0 instead.
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>
|
|
Moving a temporary value prevents copy elision. Remove it.
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>
|
|
Buffer is a class, not a struct. Fix a variable declaration accordingly.
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>
|
|
Several overridden virtual functions are not marked with override. Fix
it.
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>
|
|
enum LogSeverity values are assigned or compared to -1 to flag invalid
log severities. This generates compilation warnings with clang. Fix it
by adding an explicit LogInvalid entry to the enumeration.
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>
|
|
Add missing parentheses to fix a bitwise test.
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>
|
|
Several structures are forward-declarated as classes. Fix this by using
the struct keyword where appropriate, or removing the forward
declaration when not needed.
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>
|
|
issetugid()
When secure_getenv() is not available, need to have a workaround.
Check if secure_getenv() is present, otherwise call issetugid() on its
place.
Signed-off-by: Giulio Benetti <giulio.benetti@micronovasrl.com>
Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
[Kieran: include stdlib.h]
Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
|
|
Not all libc make secure_getenv() available, this could lead to build
failure on certain build systems.
Check if secure_getenv() is available and emit #define
HAVE_SECURE_GETENV to config.h Include config.h to every c/c++ file
during building by adding `-include config.h` to project arguments for
both c and c++.
Signed-off-by: Giulio Benetti <giulio.benetti@micronovasrl.com>
Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
[Kieran: Drop unnessecary meson message
Update commit message]
Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
|
|
The viewfinder and main output require identical logic for buffer and
request completion. Connect the viewfinder bufferReady signal to the slot
and handle requests for both main output and viewfinder there.
Update the slot logic to complete the request only when the last buffer
has completed, and make sure to complete requests in the same order they
have been queued to the pipeline handler.
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Jacopo Mondi <jacopo@jmondi.org>
|
|
Add support for queueing requests for multiple streams in the IPU3
pipeline handler class.
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Jacopo Mondi <jacopo@jmondi.org>
|
|
Perform allocation and setup of memory sharing between the CIO2 output
and the ImgU input and allocate memory for each active stream.
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Jacopo Mondi <jacopo@jmondi.org>
|
|
Use and inspect the stream roles provided by the application to
streamConfiguration() to assign streams to their intended roles and
return a default configuration associated with them.
Support a limited number of usages, with the viewfinder stream able to
capture both continuous video streams and still images, and the main
output stream supporting still images only. This is an artificial
limitation until we figure out the exact capabilities of the hardware.
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Jacopo Mondi <jacopo@jmondi.org>
|
|
Sub-class the Stream class with an IPU3-specific implementation and
create each IPU3 camera with two streams: 'output' and 'viewfinder'
which represent the video streams from main and secondary ImgU output
respectively.
Rework stream configuration to handle the two video streams 'output'
and 'viewfinder' separately.
As the IPU3 driver requires viewfinder and stat video nodes to be
started not to stall ImgU processing, configure 'output', 'viewfinder'
and 'stat' regardless of the user-requested active streams.
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Jacopo Mondi <jacopo@jmondi.org>
|
|
When logging the camera configuration, the same ostringstream instance
is used to assemble a message describing configuration of all the
configured streams.
After the first stream configuration has been assembled, the use of
std::hex modifies the ostringstream basefield, causing all successive
integers values inserted in the stream to be expressed as hexadecimals.
Fix that by resetting the stream's basefield to decimal, before
assembling a stream configuration description.
Before this patch:
INFO Camera camera.cpp:615 (0) 640x480-0x3231564e (1) 140xa0-0x3231564e
After this patch:
INFO Camera camera.cpp:616 (0) 640x480-0x3231564e (1) 320x160-0x3231564e
Fixes: 9c9078133216 ("libcamera: camera: Log requested configuration in configureStreams()")
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Jacopo Mondi <jacopo@jmondi.org>
|
|
Since commit: 4e1dc9004fca ("libcamera: stream: Make Stream inheritable")
the private members of the Stream class have been turned into protected,
to allows subclasses to access them.
As Doxygen generates documentation for protected members (but not for
private memebers), add documentation to the stream class for the
'bufferMap_' and 'configuration_' members.
Fixes: 4e1dc9004fca ("libcamera: stream: Make Stream inheritable")
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Jacopo Mondi <jacopo@jmondi.org>
|
|
Include the header file corresponding to the source file in the very
first position. This complies with the Google C++ coding style
guideliens, and helps ensuring that the headers are self-contained.
Three bugs are already caught by this change (missing includes or
forward declarations) in device_enumerator.h, event_dispatcher_poll.h
and pipeline_handler.h. Fix them.
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Jacopo Mondi <jacopo@jmondi.org>
|
|
Add a toString() method to the StreamConfiguration class, and replace
all manually coded implementations through the source code.
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Jacopo Mondi <jacopo@jmondi.org>
|
|
Use the pixel format requested by the application in the
RkISP1PipelineHandler::configureStreams() method instead of hardcoding
NV12. The streamsConfiguration() method still proposes NV12 by default.
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Jacopo Mondi <jacopo@jmondi.org>
|
|
The documentation style for the Doxygen comment blocks is inconsistent
in the library. Document the expectations and update all existing
comment blocks to match.
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Acked-by: Jacopo Mondi <jacopo@jmondi.org>
|
|
The pipeline handler for the Rockchip ISP creates one camera instance
per detected raw Bayer CSI-2 sensor. Parallel sensors and YUV sensors
are not supported yet.
As the ISP has a single CSI-2 receiver, only one camera can be used at a
time. Mutual exclusion isn't implemented yet.
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
Tested-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
Reviewed-by: Jacopo Mondi <jacopo@jmondi.org>
|
|
Replace the manual handling of sensor formats with usage of the new
CameraSensor class.
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>
|
|
The CameraSensor class abstracts camera sensors and provides helper
functions to ease interactions with them. It is currently limited to
sensors that expose a single subdev, and offer the same frame sizes for
all media bus codes, but will be extended to support more complex
sensors as the needs arise.
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>
|
|
Add a method to retrieve the media entity associated with a subdevice.
The entityName() and deviceNode() methods are not needed anymore as they
can be accessed through the media entity, remove them.
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 the subdevice file descriptor isn't leaked by closing it when
the V4L2Subdevice instance is destroyed.
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>
|
|
The new set_overlap() function counts the number of overlapping elements
in the intersection of two sorted ranges defined by their beginning and
ending iterators.
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>
|
|
Add a test that exercises all the comparison operators for the Size
class.
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>
|
|
Add equality and inequality comparison operators for the Rectangle, Size
and SizeRange classes.
For the Size class, also add ordering operators. Sizes are first
compared on combined width and height, then on area, and finally on
width only to achieve a stable ordering.
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>
|
|
Instead of storing four integers for the minimum and maximum width and
height in the SizeRange class, use two instance of the Size class for
the minimum and maximum sizes.
While it at replace the mention of image size with size in the SizeRange
documentation, as the Size class isn't limited to image sizes.
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>
|
|
Move the Size class before the SizeRange class. No functional change.
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>
|
|
The IPU3 pipeline handler logs the requested configuration in its
configureStreams() handler. This is useful for other pipeline handlers
as well, move it to the Camera class.
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>
|
|
The methods don't modify the object instance, mark them as const. This
allows using the LOG() macro from a const method of a Loggable object.
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>
|
|
The cam and qcam utilities are meant to be shipped with libcamera,
install them by default.
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>
|
|
Add to the Buffer class methods to set and retrieve a reference to the
Request instance the buffer is part of.
As buffers outlive the Request they are associated with, the reference
is only temporary valid during the buffer completion interval (from when
the buffer gets queued to Camera for processing, until it gets marked as
completed).
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>
|