Age | Commit message (Collapse) | Author |
|
Verify that the sensor model matches the expected value. The whole model
extraction heuristic isn't fully tested as that would require being able
to inject different entity names. It is still useful as an initial step.
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>
|
|
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>
|
|
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>
|
|
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>
|
|
Two tests use the brightness, contrast and saturation controls with
integer failures. They were not updated by commit eff4b1aa01c1 which
turned those controls into floats. This doesn't cause test failures as
the control API converts the value types. For correctness, update the
tests to use float values.
Fixes: eff4b1aa01c1 ("libcamera: controls: Reorder and update description of existing controls")
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Jacopo Mondi <jacopo@jmondi.org>
|
|
Pointed out by Coverity DefectId=297074
Signed-off-by: Umang Jain <email@uajain.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
|
|
Add a utils::join() function to join elements of a container into a
string, with a separator and an optional conversion function if the
elements are not implicitly convertible to std::string.
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 IPAModuleInfo license field isn't needed anymore now that modules
are cryptographically signed. Remove it.
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
|
|
Add tests for the File class API.
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
|
|
Add two new operations to the IPA interface to start and stop it. The
intention is that these functions shall be used by the IPA to perform
actions when the camera is started and stopped.
Signed-off-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
|
|
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>
|
|
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>
|
|
Add test cases for the string control type. As strings are implemented
as char arrays, arrays of strings are not supported.
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Jacopo Mondi <jacopo@jmondi.org>
|
|
To prepare for storage of additional information in the ControlRange
structure, rename it to ControlInfo.
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Jacopo Mondi <jacopo@jmondi.org>
|
|
To prepare for the rename of ControlRange to ControlInfo, rename all the
ControlInfoMap instance variables currently named info to infoMap. This
will help avoiding namespace clashes.
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Jacopo Mondi <jacopo@jmondi.org>
|
|
To achieve the goal of preventing unwanted conversion between a DRM and
a V4L2 FourCC, make the V4L2PixelFormat constructor that takes an
integer value explicit. All users of V4L2 pixel formats flagged by the
compiler are fixed.
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>
|
|
Now that the functions return a V4L2PixelFormat, adapt their name
accordingly.
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Jacopo Mondi <jacopo@jmondi.org>
|
|
The SizeRange constructors take minimum and maximum width and height
values as separate arguments. We have a Size class to convey size
information, use it in the constructors, and update the callers.
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>
|
|
The Camera class currently requires the allocator to have no allocated
buffer before the camera is reconfigured, and the allocator to be
destroyed before the camera is released. There's no basis for these
restrictions anymore, remove them.
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
|
|
To prepare for the rework of buffer allocation that will differentiate
export and allocation, rename exportBuffers() to allocateBuffers().
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
|
|
There's no need to keep the video device open after allocating buffers,
as V4L2 supports buffer orphaning and the exported buffers will still be
usable. Close the device right after allocation to avoid the need for
delayed cleanups.
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
|
|
To achieve the goal of preventing unwanted conversion between a DRM and
a V4L2 FourCC, make the PixelFormat constructor that takes an integer
value explicit. All users of pixel formats flagged by the compiler
are fixed.
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
Signed-off-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
|
|
The pixel format used in the stream configuration is from V4L2 but
should be from DRM, fix it.
Signed-off-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
|
|
The tests declare a hard-coded LIBCAMERA_IPA_PROXY_PATH to allow tests
to run from tests-suite.
Now that the proxy path is determined at runtime, we can remove the
redundant setting of LIBCAMERA_IPA_PROXY_PATH for tests.
Signed-off-by: Kaaira Gupta <kgupta@es.iitr.ac.in>
Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
|
|
O_TMPFILE is not defined by all libc implementations. libcamera has an
internal definition in utils.h to work around this. Include utils.h in
the test to fix the compilation error.
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
|
|
Add test to test the different modes and situations the V4L2BufferCache
can be put in. The tests verify that a FrameBuffer used with the cache
results in a V4L2 video device index, and that the cache implementation
is capable of keeping buffers in a hot state.
Signed-off-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
|
|
The BufferSource class can be used by other tests other then the camera
buffer importer test, move it to libtest. The only changes to
BufferSource is for it to be allowed to be split in a header and source
file.
This change makes it necessary for libtest to have access to internal
libcamera headers. As the internal headers already are accessible to all
test cases this does not increase the exposure of libcamera internals to
the test cases.
Signed-off-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
|
|
The error message for when a device name can't be resolved to a video
device is wrong and applies to the next operation below it. Move it to
its correct location and add a new error message to highlight the
resolution failure.
Signed-off-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
|
|
Add tests to ControlValueTest to cover array controls of all supported
types.
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
|
|
The ControlValueTest hasn't been updated for a long time and is
outdated. Improve it to support all control types, and test the type(),
isArray() and toString() methods.
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
|
|
Add a compile-only test that exercises the whole Span API, as template
functions are not fully compile-tested when the file is parsed.
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
|
|
The tests declare a hard-coded LIBCAMERA_IPA_MODULE_PATH to allow tests
to run from the test-suite.
This requires tests to be run only from the root of the build directory,
otherwise (for example, by running in their local directory) they will
not be able to correctly locate the IPA modules.
Now that the build path for the IPA manager is determined at runtime we
can remove the redundant setting of the LIBCAMERA_IPA_MODULE_PATH for
tests.
Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
|
|
Provide a std::string based implementation which conforms to the
behaviour of the dirname() fucntion defined by POSIX.
Tests are added to cover expected corner cases of the implementation.
Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
|
|
The <random> header isn't needed since commit 6e1e847753fd ("test:
camera: buffer_import: Update to FrameBuffer restrictions"). Don't
include it.
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 that Thread::wait() on a thread that hasn't been started, or on a
thread that is known to have completed, returns without a timeout.
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
|
|
Add a test case to wait with a timeout, testing both a too short and a
long enough duration.
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>
|
|
The test constructs a string by joining substrings, splits it, and
verifies that the original and resulting substrings match.
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
|
|
Add two tests that exercise the Signal::disconnect(Object *) and
Signal::disconnect() methods, to verify that they correctly remove the
signal from the connected object's list of signals. This triggers an
issue that was detected through manual code inspection, and is expected
to crash or at least generate valgrind warnings.
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>
|
|
ConnectionTypeBlocking always invokes the method through inter-thread
message passing, which results in deadlocks if the sender and receiver
live in the same thread. The deadlock can easily be avoided by turning
the invocation into a direct call in this case. Do so to make
ConnectionTypeBlocking easier to use when some of the senders live in
the same thread as the receiver while the other senders don't.
Extend the object-invoke test to cover this usage.
While at it reformat the documentation to avoid long \brief lines.
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 BufferSource::allocate() return value isn't propagated correctly,
resulting in a test failure when the test should be skipped due to a
missing vivid device. Fix it.
While at it, return valid status codes from BufferSource::allocate() in
all error cases, with proper diagnostic messages.
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>
|
|
Now that we're using C++-14, drop utils::make_unique for
std::make_unique.
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 an initial simple test tool for the rkisp1 pipeline based upon the
IPU3 pipeline test.
Signed-off-by: Show Liu <show.liu@linaro.org>
Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
|
|
With the FrameBuffer rework completed there is no reason to keep the
camera prepared state around as buffer allocations are now decoupled
from the camera state. Remove the camera state simplifying the API.
Signed-off-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
|
|
The Buffer interface is no longer in use and can be removed. While doing
so clean up the two odd names (dequeueFrameBuffer() and
queuedFrameBuffers_) that had to be used when adding the FrameBuffer
interface.
Signed-off-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
|
|
Switch to the FrameBuffer interface where all buffers are treated as
external buffers and are allocated outside the camera. Applications
allocating buffers using libcamera are switched to use the
FrameBufferAllocator helper.
Follow-up changes to this one will finalize the transition to the new
FrameBuffer interface by removing code that is left unused after this
change.
Signed-off-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
|
|
With the FrameBuffer interface the V4L2 buffer indexes are not visible
outside the V4L2VideoDevice so it's not possible to to test that the
expected indexes are used when using external buffers (allocated
directly from a V4L2 video device) with a Camera. Rewrite the test to
this limitation.
The idea of the test stays the same, test that buffers allocated from a
V4L2 video device (vivid) can be imported and used on a Camera (vimc).
As an added bonus the rewrite makes use of the FrameBuffer interface for
the allocation of buffers at the source (vivid) and imports them to the
Camera which still uses the Buffer interface internally.
Signed-off-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
|
|
The V4L2VideoDevice class can now operate using a FrameBuffer interface,
switch all test cases to use it.
Signed-off-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
|
|
Move the metadata retrieved when dequeuing a V4L2 buffer into a
FrameMetadata object. This is done as a step to migrate to the
FrameBuffer interface as the functions added to Buffer around
FrameMetadata match the ones in FrameBuffer.
Signed-off-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
|