Age | Commit message (Collapse) | Author |
|
The config_ pointer is reset in all error paths of the
CameraDevice::configureStreams() function, except when
Camera::configure() fails. Fix it by using a local unique pointer to
store the configuration until the end of the function, to avoid similar
issues in the future.
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Hirokazu Honda <hiroh@chromium.org>
Reviewed-by: Umang Jain <umang.jain@ideasonboard.com>
|
|
Add supported test pattern modes of IMX258 in CameraSensorProperties.
Signed-off-by: Hirokazu Honda <hiroh@chromium.org>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
|
|
If LIBCAMERA_BASE_PRIVATE is ever exposed on the libcamera public dependencies,
then the private.h header protection will be circumvented.
Provide a test which will fail (at compile time) if the LIBCAMERA_BASE_PRIVATE
define ever leaks to the public dependencies.
Reviewed-by: Paul Elder <paul.elder@ideasonboard.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
|
|
Now that we have a libcamera_private, make the public only dependency
libcamera_public so that it is clear which interface is being linked.
Reviewed-by: Paul Elder <paul.elder@ideasonboard.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
|
|
The libcamera_generated_ipa_headers are only a dependency to internal
components, and should not form part of the public API.
Now that we have a private dependency, move the generated headers there.
Reviewed-by: Paul Elder <paul.elder@ideasonboard.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
|
|
Headers which must not be exposed as part of the public libcamera API
should include base/private.h.
Any interface which includes the private.h header will only be able to
build if the libcamera_private dependency is used (or the
libcamera_base_private dependency directly).
Build targets which are intended to use the private API's will use the
libcamera_private to handle the automatic definition of the inclusion
guard.
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
|
|
Move span, and adjust the Doxygen exclusion as well.
Reviewed-by: Paul Elder <paul.elder@ideasonboard.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
|
|
Move the event notifier, and associated header updates.
Reviewed-by: Hirokazu Honda <hiroh@chromium.org>
Reviewed-by: Paul Elder <paul.elder@ideasonboard.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
|
|
The File abstraction is a base helper and not part of the libcamera
API. Move it to to allow usage by users of the base library.
Reviewed-by: Hirokazu Honda <hiroh@chromium.org>
Reviewed-by: Paul Elder <paul.elder@ideasonboard.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
|
|
Move the functionality for the following components to the new
base support library:
- BoundMethod
- EventDispatcher
- EventDispatcherPoll
- Log
- Message
- Object
- Signal
- Semaphore
- Thread
- Timer
While it would be preferable to see these split to move one component
per commit, these components are all interdependent upon each other,
which leaves us with one big change performing the move for all of them.
Reviewed-by: Hirokazu Honda <hiroh@chromium.org>
Reviewed-by: Paul Elder <paul.elder@ideasonboard.com>
Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
|
|
Move the class support infrastructure to the base library.
Reviewed-by: Paul Elder <paul.elder@ideasonboard.com>
Reviewed-by: Hirokazu Honda <hiroh@chromium.org>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
|
|
Move the utils functionality to the libcamera/base library.
Reviewed-by: Hirokazu Honda <hiroh@chromium.org>
Reviewed-by: Paul Elder <paul.elder@ideasonboard.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
|
|
The libcamera-base.so will feature internal support functionality
that is utilised by libcamera, and can be shared in other places.
This new library provides a layer beneath libcamera which provides
common abstractions to internal objects.
A pkg-config file is generated and named libcamera-base.pc which allows
components such as external IPA modules to link directly to this library
if they need. Normal applications will reference this library through
the Requires: statement provided by the libcamera.pc package
configuration, and linkage will be handled automatically through the
pkg-config mechanisms.
No code is moved to this library yet, this patch only introduces the
framework, construction and linkage.
Reviewed-by: Paul Elder <paul.elder@ideasonboard.com>
Reviewed-by: Hirokazu Honda <hiroh@chromium.org>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
|
|
The libcameraSourcePath and libcameraBuildPath helper functions are
internal and specific to libcamera needs while operating with the meson
build system.
In preparation for the upcoming move of utils to a common library, move
these helpers out of utils and into their own build unit.
Reviewed-by: Paul Elder <paul.elder@ideasonboard.com>
Reviewed-by: Hirokazu Honda<hiroh@chromium.org>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
|
|
The libcamera library is moved to the first positional argument of the
pkg-config generator to automatically populate the name and filebase
values for the package.
As part of this, the shared library name is adjusted to the full library
name 'libcamera', without relying upon the automatic 'lib' prefix which
better represents the component and naming of the library.
As a result of this, the pkgconfig file is now named 'libcamera.pc' as
opposed to 'camera.pc', and applications desiring to reference libcamera
will need to search for 'libcamera' as a dependency rather than
'camera'.
The library itself is still created and installed as 'libcamera.so'.
An example meson.build file would need to be adjusted as the following:
- dependency('camera', required : true),
+ dependency('libcamera', required : true),
Reviewed-by: Paul Elder <paul.elder@ideasonboard.com>
Reviewed-by: Hirokazu Honda <hiroh@chromium.org>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
|
|
The pkg-config file for the main libcamera.so is generated
at the top level meson.build.
Move this to the actual core libcamera build structure to be
consistent and keep it next to the library construction.
Reviewed-by: Paul Elder <paul.elder@ideasonboard.com>
Reviewed-by: Hirokazu Honda <hiroh@chromium.org>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
|
|
The ChromeOS specific Android HAL support was overly-complex to support
linking an additional library, and then passing the built object into
the libcamera.so build.
Now that it has its own distinct libcamera-hal.so, simplify the CrOS
integration to build directly into that library.
The removal of the -Wno-shadow here is intentional, as it is not
required for compilation of the camera3_hal.o object.
Reviewed-by: Hirokazu Honda <hiroh@chromium.org>
Reviewed-by: Paul Elder <paul.elder@ideasonboard.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
|
|
The libcamera Android HAL implementation should not be an integral part
of libcamera, but a support library that utilises the libcamera public
API.
Move the implementation to its own distinct library.
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Hirokazu Honda <hiroh@chromium.org>
Reviewed-by: Umang Jain <umang.jain@ideasonboard.com>
Reviewed-by: Paul Elder <paul.elder@ideasonboard.com>
Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
|
|
This patch adds support for using request pads in libcamerasrc Gst
Element. It allows a user to request multiple streams if the platform
supports multistream output using libcamera.
This was tested on Raspberry Pi 4B+ with a camera connected to CSI port.
It can be tested by running the following command
gst-launch-1.0 libcamerasrc camera-name="<camera-name-here>" name=src src.src ! queue ! videoconvert ! autovideosink src.src_0 ! queue ! videoconvert ! autovideosink
Signed-off-by: Vedant Paranjape <vedantparanjape160201@gmail.com>
Reviewed-by: Nicolas Dufresne <nicolas.dufresne@collabora.com>
Reviewed-by: Paul Elder <paul.elder@ideasonboard.com>
Signed-off-by: Paul Elder <paul.elder@ideasonboard.com>
|
|
CameraBuffer::plane() should be accessed in zero based index.
Fix the wrong indexing in CameraBuffer::plane() in
cros_camera_buffer.cpp.
Signed-off-by: Hirokazu Honda <hiroh@chromium.org>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Paul Elder <paul.elder@ideasonboard.com>
Signed-off-by: Paul Elder <paul.elder@ideasonboard.com>
|
|
std::chrono::Duration is provided quite conveniently by
libcamera::utils::Duration wrapper. Port IPAIPU3 to use that
for duration-type entities (such as exposure time), such that
it becomes consistent with rest of the codebase.
The commit doesn't introduce any functional changes.
Reviewed-by: Jean-Michel Hautbois <jeanmichel.hautbois@ideasonboard.com>
Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
Signed-off-by: Umang Jain <umang.jain@ideasonboard.com>
|
|
With the addition of FrameBuffer::cancel(), the logic to clear and return
pending requests can be simplified by not having to queue all the request
buffers to the device before calling streamOff().
Signed-off-by: Naushir Patuck <naush@raspberrypi.com>
Tested-by: David Plowman <david.plowman@raspberrypi.com>
Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
Reviewed-by: Jacopo Mondi <jacopo@jmondi.org>
Signed-off-by: Jacopo Mondi <jacopo@jmondi.org>
|
|
The camera_device.cpp has grown a little too much, and it has quickly
become hard to maintain. Break out the handling of the static
information collected at camera initialization time to a new
CameraCapabilities class.
Break out from the camera_device.cpp file all the functions related to:
- Initialization of supported stream configurations
- Initialization of static metadata
- Initialization of request templates
Signed-off-by: Jacopo Mondi <jacopo@jmondi.org>
Acked-by: Paul Elder <paul.elder@ideasonboard.com>
Tested-by: Paul Elder <paul.elder@ideasonboard.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Hirokazu Honda <hiroh@chromium.org>
|
|
Sort the list of the Android HAL source file alphabetically.
Signed-off-by: Jacopo Mondi <jacopo@jmondi.org>
Reviewed-by: Paul Elder <paul.elder@ideasonboard.com>
Reviewed-by: Hirokazu Honda <hiroh@chromium.org>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
|
|
Brief specifications available at
https://cdn.sparkfun.com/datasheets/Dev/RaspberryPi/ov5647_full.pdf
> pixel size: 1.4 μm x 1.4 μm
Change in this patch is referenced from Page 5: key specifications
section of the above linked pdf
Signed-off-by: Vedant Paranjape <vedantparanjape160201@gmail.com>
Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
Reviewed-by: Paul Elder <paul.elder@ideasonboard.com>
Signed-off-by: Paul Elder <paul.elder@ideasonboard.com>
|
|
The SMIA metadata parser could possibly read one byte past the end of the
buffer as the buffer size test ran after the read operation. Fix this.
Signed-off-by: Naushir Patuck <naush@raspberrypi.com>
Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
Reviewed-by: David Plowman <david.plowman@raspberrypi.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
|
|
Android provides neither secure_getenv() nor issetugid(). Enable
compilation on that platform by using a plain getenv(), as that seems to
be the best we can do.
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Hirokazu Honda <hiroh@chromium.org>
Reviewed-by: Umang Jain <umang.jain@ideasonboard.com>
Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
|
|
Commit 922833f774f6 ("libcamera: simple: Report sensor timestamp")
unconditionally tries to access the request through the capture buffer
to store the capture timestamp in the metadata. This causes a null
pointer dereference when using a converter, as the capture buffers are
free-wheeling in that case, and not associated with a request.
Fix this by getting the request from the user-facing buffer, which can
be the capture buffer when no converter is used.
Fixes: 922833f774f6 ("libcamera: simple: Report sensor timestamp")
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>
|
|
There were some CameraMetadata calls that were left in the old version.
Update them.
Signed-off-by: Paul Elder <paul.elder@ideasonboard.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Hirokazu Honda <hiroh@chromium.org>
|
|
The IPA is required for VIMC so fail early if it can't be loaded.
Reviewed-by: Umang Jain <umang.jain@ideasonboard.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
|
|
If the IPA fails to configure, this can now be caught by the pipeline handler
but the cause may not be clear.
If the IPA is isolated, then reports from that IPA will not be visible
in the libcamera logs directly.
Print the return error value to help identify any issue that has arisen.
Reviewed-by: Hirokazu Honda <hiroh@chromium.org>
Reviewed-by: Paul Elder <paul.elder@ideasonboard.com>
Reviewed-by: Umang Jain <umang.jain@ideasonboard.com>
Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
|
|
The IPAs are loaded from a defined location set as IPA_MODULE_DIR.
Furthermore, configuration files for both libcamera and IPAs are loaded
from paths defined during the meson configuration.
To make it easy to identify these locations for a given configuration,
present them as a 'paths' section in the meson summary.
This adds a summary section to meson in the form:
Paths
LIBCAMERA_DATA_DIR : "/usr/share/libcamera"
LIBCAMERA_SYSCONF_DIR : "/etc/camera/libcamera"
IPA_PROXY_DIR : "/usr/libexec/libcamera"
IPA_CONFIG_DIR : "/etc/camera/libcamera/ipa:/usr/share/libcamera/ipa"
IPA_MODULE_DIR : "/usr/lib/x86_64-linux-gnu/libcamera"
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Umang Jain <umang.jain@ideasonboard.com>
Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
|
|
HAL_PIXEL_FORMAT_RAW_OPAQUE is requested only for
Zero-Shutter-Lag (ZSL). ZSL requires RAW and YUV reprocessing.
Since either of them is not supported by libcamera, supporting
RAW_OPAQUE format doesn't make sense. Drop the format from the
supported format list.
Signed-off-by: Hirokazu Honda <hiroh@chromium.org>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Jacopo Mondi <jacopo@jmondi.org>
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
|
|
Adjust source formatting to closer match libcamera guidelines:
- Remove unused header files.
- Switch to C style comments.
- Adjust whitespace for readability.
- Remove retcode local variable usage.
There are no functional changes in this commit.
Signed-off-by: Naushir Patuck <naush@raspberrypi.com>
Reviewed-by: David Plowman <david.plowman@raspberrypi.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
|
|
The file implements the MdParserSmia class, so change the file name to reflect
this.
Signed-off-by: Naushir Patuck <naush@raspberrypi.com>
Reviewed-by: David Plowman <david.plowman@raspberrypi.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
|
|
Set some sensible default values for member variables of the MdParser
class.
Remove buffer_size_bytes_ along with some related asserts as this class
now uses libcamera::Span for buffer handling, and buffer_size_bytes_ is
unused.
Signed-off-by: Naushir Patuck <naush@raspberrypi.com>
Reviewed-by: David Plowman <david.plowman@raspberrypi.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
|
|
Adjust source formatting to closer match libcamera guidelines:
- Switch to C style comments.
- Add whitespace for readability.
There are no functional changes in this commit.
Signed-off-by: Naushir Patuck <naush@raspberrypi.com>
Reviewed-by: David Plowman <david.plowman@raspberrypi.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
|
|
The LogCategory instances are constructed on first use as static
variables in accessor functions, following the Meyers singleton pattern.
As a result, their destruction order is not guaranteed. This can cause
issues as the global Logger object, constructed in a similar fashion, is
accessed from the LogCategory destructor and may be destroyed first.
To fix this, keep the same singleton pattern, but allocate the
LogCategory instances dynamically. As they get registered with the
global Logger instance, we can destroy them in the Logger destructor.
This only avoids destruction order issues between LogCategory and
Logger, and doesn't address yet the fact that LOG() calls from
destructors of global objects may access an already destroyed Logger.
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Hirokazu Honda <hiroh@chormium.org>
Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
|
|
Report to the Android camera stack the list of supported test
pattern modes constructed by inspecting the values reported
by libcamera through the controls::draft::TestPatternMode control.
Signed-off-by: Hirokazu Honda <hiroh@chromium.org>
Reviewed-by: Jacopo Mondi <jacopo@jmondi.org>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Jacopo Mondi <jacopo@jmondi.org>
|
|
PipelineHandlerIPU3 gets available test pattern modes of the
sensor device and reports them to a client.
Signed-off-by: Hirokazu Honda <hiroh@chromium.org>
Reviewed-by: Jacopo Mondi <jacopo@jmondi.org>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Jacopo Mondi <jacopo@jmondi.org>
|
|
This enables retrieving supported test pattern modes through
CameraSensorInfo.
Signed-off-by: Hirokazu Honda <hiroh@chromium.org>
Reviewed-by: Jacopo Mondi <jacopo@jmondi.org>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Jacopo Mondi <jacopo@jmondi.org>
|
|
The V4L2 specification defines the sensor test pattern modes
through a menu control, where a numerical index is associated to
a string that describes the test pattern. The index-to-pattern
mapping is driver specific and requires a corresponding representation
in the library.
Add to the static list of CameraSensorProperties a map of indexes to
libcamera::controls::TestPatternModes values to be able to map the
indexes returned by the driver to the corresponding test pattern mode.
Signed-off-by: Hirokazu Honda <hiroh@chromium.org>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Jacopo Mondi <jacopo@jmondi.org>
Signed-off-by: Jacopo Mondi <jacopo@jmondi.org>
|
|
This adds a support of v4l2 menu. The control info for v4l2 menu
contains indices without names and 64bit values of querymenu.
Signed-off-by: Hirokazu Honda <hiroh@chromium.org>
Reviewed-by: Jacopo Mondi <jacopo@jmondi.org>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Jacopo Mondi <jacopo@jmondi.org>
|
|
The control is used to report available sensor test pattern modes
and also specify the mode to sensor.
Signed-off-by: Hirokazu Honda <hiroh@chromium.org>
Reviewed-by: Jacopo Mondi <jacopo@jmondi.org>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Jacopo Mondi <jacopo@jmondi.org>
|
|
Implement the flush() camera operation in the CameraDevice class
and make it available to the camera framework by implementing the
operation wrapper in camera_ops.cpp.
Introduce a new camera state State::Flushing to handle concurrent
flush() and process_capture_request() calls.
As flush() can race with processCaptureRequest() protect it
by introducing a new State::Flushing state that
processCaptureRequest() inspects before queuing the Request to the
Camera. If flush() is in progress while processCaptureRequest() is
called, return the current Request immediately in error state. If
flush() has completed and a new call to processCaptureRequest() is
made just after, start the camera again before queuing the request.
Signed-off-by: Jacopo Mondi <jacopo@jmondi.org>
Reviewed-by: Hirokazu Honda <hiroh@chromium.org>
Reviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
|
|
With the introduction of an additional mutex class member, the name of
the existing one is too generic.
Rename CameraDevice::mutex_ in CameraDevice::descriptorsMutex_ and use the
libcamera provided libcamera::Mutex type to align the style with the
rest of the code base.
Signed-off-by: Jacopo Mondi <jacopo@jmondi.org>
Reviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
Reviewed-by: Hirokazu Honda <hiroh@chromium.org>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
|
|
Guard access to the camera state and the start/stop sequences
with a mutex.
Currently only stop() and the first call to processCaptureRequest()
start and stop the camera, and they're not meant to race with each
other. With the introduction of flush() the camera can be stopped
concurrently to a processCaptureRequest() call, hence access to the
camera state will need to be protected.
Prepare for that by guarding the existing paths with a mutex.
Signed-off-by: Jacopo Mondi <jacopo@jmondi.org>
Reviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
Reviewed-by: Hirokazu Honda <hiroh@chromium.org>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
|
|
The CameraDevice class uses std::scoped_lock<> to guard access to the
class' descriptors_ member.
std::scoped_lock<> provides a set of features that guarantees safety
when locking multiple mutexes in a critical section, while for single
locks happening in a scoped block it does not provides benefits compared
to the simplest std::unique_lock<> which libcamera provides the
MutexLocker type for.
Replace usage of std::scoped_lock<> with libcamera::MutexLocker to make
the implementation consistent with the rest of the code base.
Signed-off-by: Jacopo Mondi <jacopo@jmondi.org>
Reviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
Reviewed-by: Hirokazu Honda <hiroh@chromium.org>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
|
|
The CameraDevice class maintains the camera state in the 'running_'
boolean flag to check if the camera has to be started at the first
received process_capture_request() call which happens after the camera
had been stopped.
So far this was correct, as the operations that change the camera
could only start or stop the camera, so a simple boolean flag
was enough.
To prepare to handle the flush() operation that will introduce a new
'flushing' state, replace the simple plain boolean flag with an
enumeration of values that define the CameraState.
Signed-off-by: Jacopo Mondi <jacopo@jmondi.org>
Reviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
Reviewed-by: Hirokazu Honda <hiroh@chromium.org>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
|
|
Capture requests are queued by the PipelineHandler base class to each
pipeline handler implementation using the virtual queueRequestDevice()
function.
However, if the pipeline handler fails to queue the request to the
hardware, the request gets silently deleted from the list of queued
ones, without notifying application of the error.
Reporting to applications that a Request has failed to queue by
cancelling and then completing it allows applications to maintain their
request-tracking mechanism consistent with the one internal to the library.
Signed-off-by: Jacopo Mondi <jacopo@jmondi.org>
Reviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
|