Age | Commit message (Collapse) | Author |
|
Add the ability to set the Request a buffer is associated with. This is
needed for buffers that live inside a pipeline handler and is
temporarily associated with a request as it's being processed inside the
pipeline.
While we are at it delete a stray semicolon.
Signed-off-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
|
|
This method may be used to memory copy a whole FrameBuffer content
from another buffer. The operation is not fast and should not be used
without great care by pipelines.
The intended use-case is to have an option to copy out RAW buffers from
the middle of a pipeline.
Signed-off-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
|
|
Add Bayer format and modifiers for patch submitted for upstream
inclusion. The formats have not been accepted upstream yet but is needed
to progress with RAW capture support in libcamera.
Intention is to merge this in libcamera and update the header file the
upstream patch is picked up upstream.
Signed-off-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
Reviewed-by: Jacopo Mondi <jacopo@jmondi.org>
Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
|
|
Add a role name 'stillraw' to request a StillCaptureRaw stream.
Signed-off-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Jacopo Mondi <jacopo@jmondi.org>
|
|
Add a role for capturing high resolution, low frame rate, still images
in RAW format.
Signed-off-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Jacopo Mondi <jacopo@jmondi.org>
|
|
Print fourCC characters instead of the hex value in toString() as they are
more informative. Also, write the tests for this in formats.cpp
Signed-off-by: Kaaira Gupta <kgupta@es.iitr.ac.in>
Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
|
|
When changing the VIMC IPA source file structure the path in the
ipa_module_test which needs access to the .so file was not updated, fix
that.
The omission was hard to spot as it requires a clean build of the
project as the old .so file is still in the build tree and the test
passes.
Fixes: a25533089bda04da ("ipa: Move vimc to a subdirectory")
Signed-off-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
|
|
When the validate() function adjusts the stream configuration, we print
the adjusted size for debugging purpose. Switch to printing the whole
configuration, as the pixel format may be useful too.
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
|
|
Add a 'pipelines' project option that specifies which pipeline handlers
to compile in. The corresponding IPA modules are automatically selected.
The default is to compile all pipeline handlers.
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>
|
|
Give a subdirectory to all IPA modules to make the structure of the
source tree more consistent. This will also simplify the implementation
of IPA module selection at build 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>
|
|
Give a subdirectory to all pipeline handlers to make the structure of
the source tree more consistent. This will also simplify the
implementation of pipeline handlers selection at build 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>
|
|
Query the viewfinder for the formats it supports natively, and select
one of them for the stream if possible.
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
|
|
Expose the pixel formats natively supported by the viewfinder, to allow
selection of stream formats that would minimize usage of software
conversion.
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
|
|
Print an info message when initializing the viewfinder to report if the
format converter is used or if zero-copy is enabled. This is useful to
notify of a possible impact on performances.
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
|
|
Qt supports more 24-bit and 32-bit RGB formats for native painting. If
the frame buffer pixel format matches any of them, disable the converter
and create a QImage in the appropriate format.
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
|
|
When stopping capture, display an icon instead of the last frame. This
is required to be able to release the last buffer when the viewfinder
operators in zero-copy mode.
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
|
|
If the frame buffer format is identical to the display format, the
viewfinder still invokes the converter to perform what is essentially a
slow memcpy(). Make it possible to skip that operation by creating a
QImage referencing the buffer memory instead. A reference to the frame
buffer is kept internally, and released when the next buffer is queued,
pushing the current one out.
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
|
|
Reorder the methods in viewfinder.cpp to match the order in
viewfinder.h. No code change.
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
|
|
There's no need to initialize the PixelFormat stored in ViewFinder
explicitly, as PixelFormat is now a class with a default constructor.
Remove the initialization.
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
|
|
The QImage class is a thin wrapper that uses implicit sharing. We can
thus embed it in the ViewFinder class instead of allocating it
dynamically, and assign it at runtime. This simplifies the code.
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
|
|
The viewfinder is currently expected to render frames to the screen
synchronously in the display() function, or at least to copy data so
that the buffer can be queued in a new request when the function
returns. This prevents optimisations when the capture format is
identical to the display format.
Make the viewfinder take ownership of the buffer, and notify of its
release through a signal. The release is currently still synchronous,
this will be addressed in a subsequent patch.
Rename the ViewFinder::display() function to render() to better describe
its purpose, as it's meant to start the rendering and not display the
frame synchronously.
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
|
|
The lack of support for multiplanar buffers comes from the viewfinder.
Move the corresponding check from MainWindow.
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
|
|
The new MappedBuffer structure replaces the std::pair<> used in the
mapped buffers map, and allows passing data to the ViewFinder::display()
function in a more structured way.
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
|
|
Replace manual usage of std::cout and std::cerr with the Qt logging
facilities. This allows redirection log output if needed, and integrates
better with Qt.
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
|
|
Printing the name of the selected camera to the log doesn't provide any
value. Remove it.
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
|
|
The qcam application is our reference implementation of a libcamera GUI
application. Document the code of the MainWindow class to make it easier
to follow, and reorganize the member data in logical groups for clarity.
No code change.
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
|
|
When saving a picture, the application prints a message on cout. This
isn't necessary and doesn't really help with debugging or diagnostics,
remove it.
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
|
|
Allow triggering toolbar actions with keyboard shortcuts.
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
|
|
Use the system icon theme by default, falling back to custom icons if no
theme is available.
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
|
|
The main window toolbar contains a start button and a stop button. This
allows starting an already started camera (which is currently not
handled and results in an error) or stopping an already stopped camera.
Replace the two actions with a single start/stop toggle action,
preventing UI misuse and reducing confusion.
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
|
|
To avoid blocking the camera manager for a long amount of time, move
capture event processing to the main thread. Captured buffers are added
to a queue and an event is posted to the main window to signal
availability of a buffer.
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
|
|
Requests are requeued synchronously from the completion handler. To
prepare for delayed requeuing, move the queuing to a separate function.
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
|
|
Qt has a QSize class to store sizes. Use it to replace width and height
where applicable.
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
|
|
Include the headers corresponding to each compile unit at the very first
line to ensure they are self-contained.
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
|
|
The qcam application installs a custom event dispatcher based on the Qt
event loop. As the camera manager now creates an internal thread, it
doesn't use that event dispatcher of the application thread at all.
Furthermore, the custom event dispatcher is buggy, as it doesn't
dispatch messages posted to the main thread's event loop. This isn't an
issue as no messages are posted there in the first place, but would
cause incorrect behaviour if we were to use that feature (for instance
to deliver signals from the camera manager thread to the application
thread).
Fixing the event dispatcher requires a change in the libcamera public
API, as there's currently no way to dispatch messages using the public
API (Thread::dispatchMessages() is not exposed). This isn't worth it at
the moment, so just remove the custom event dispatcher. If qcam later
needs the libcamera request and buffer completion signals to be
delivered in the application thread, it will need to handle that
internally, using Qt's cross-thread signal delivery.
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
|
|
The V4L2VideoDevice class implements conversion between PixelFormat and
V4L2PixelFormat for a single flavour of the 32-bit ARGB formats. Add the
three missing ones.
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 code handling the stream role option retrieves the role property and
converts it to a string in every branch. Cache it and use the cached
value.
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>
|
|
Test V4L2 array control using vivid control VIVID_CID_U8_4D_ARRAY.
Signed-off-by: Jacopo Mondi <jacopo@jmondi.org>
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Jacopo Mondi <jacopo@jmondi.org>
|
|
Enable the enumeration of V4L2 array controls with V4L2_CTRL_TYPE_U8
type.
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>
|
|
Add support for array controls of type V4L2_CTRL_TYPE_U8.
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>
|
|
Add support to retrieve the value of array controls of type
V4L2_CTRL_TYPE_U8.
Signed-off-by: Jacopo Mondi <jacopo@jmondi.org>
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Jacopo Mondi <jacopo@jmondi.org>
|
|
Add support to write array controls of type V4L2_CTRL_TYPE_U8.
Signed-off-by: Jacopo Mondi <jacopo@jmondi.org>
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Jacopo Mondi <jacopo@jmondi.org>
|
|
Cache the V4L2 control info retrieved with VIDIOC_QUERY_EXT_CTRL
at control listing time for later use.
Signed-off-by: Jacopo Mondi <jacopo@jmondi.org>
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Jacopo Mondi <jacopo@jmondi.org>
|
|
Extend the ControlValue class with a reserve() function to set the value
without actually copying data, and a non-const data() function that
allows writing data directly to the ControlValue storage. This allows
allocating memory directly in ControlValue, potentially removing a data
copy.
Note that this change was implemented before ByteStreamBuffer gained the
zero-copy read() variant, and doesn't actually save a copy in the
control serializer. It however still simplifies
ControlSerializer::loadControlValue().
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Jacopo Mondi <jacopo@jmondi.org>
|
|
Replace usage of shared_ptr with unique_ptr to convey media device
ownership internally in the enumerators when creating the media device.
Once a media device has all its dependencies met, it is converted to a
shared_ptr to keep the external API unchanged.
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>
|
|
Media devices that have unmet dependencies are added to the pending list
in populateMediaDevice(). Move the code to the caller, addUdevDevice(),
as it logically belongs there.
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>
|
|
No code change.
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
|
|
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
|
|
Commit 68daa9302f90 ("libcamera: device_enumerator: Don't stop if one
device fails") introduced a bug in device enumeration. Previously, a
media device would only be added when all its dependencies were present,
as indicated by populateMediaDevice() returning 0. The commit changed
the logic to propagate the populateMediaDevice() return code up, but
mistakenly added the media device to the enumerator even when
dependencies were missing. This causes media devices enumerated with
missing dependencies to be added twice, once when enumerating the media
device itself, and a second time when all the dependencies are found.
Fix it by deferring addition of the media device when dependencies are
missing, and add debug messages to track this process.
Fixes: 68daa9302f90 ("libcamera: device_enumerator: Don't stop if one device fails")
Reported-by: Andrey Konovalov <andrey.konovalov@linaro.org>
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>
|
|
This is a partial revert of commit 0028536d70c7, removing a change that
was incorrectly squashed.
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
Acked-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
|