Commit graph

884 commits

Author SHA1 Message Date
Laurent Pinchart
d9dac46e6f test: message: Add slow receiver test
There's a race in the message delivery against object deletion. Add a
test that triggers it reliably. This test is expected to fail with an
assertion error.

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>
2019-11-27 19:30:48 +02:00
Laurent Pinchart
1f6342f46b test: message: Fix message handling in MessageReceiver
Forward messages that we don't handle to the base Object class, to avoid
both blocking the ThreadMove message and mistaking it as the test
message.

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>
2019-11-27 19:30:48 +02:00
Laurent Pinchart
f88e756cea libcamera: thread: Fix locking when moving object
When moving an Object to a Thread, messages posted for the object are
move to the target thread's message queue. This requires locking the
message queues of the current and target threads, as the target thread
may (and is usually) running. The implementation is faulty as it locks
the thread data instead of the message queue. This creates a race
condition with a tiny but exploitable time window.

The issue was noticed by the event-thread test rarely but reproducibly
failing with the following assertion error:

[1:39:33.850878042]FATAL default thread.cpp:440 assertion "data_ == receiver->thread()->data_" failed

The issue only occurred when libcamera was compiled in release mode,
further hinting of a race condition.

Fixes: 01b930964a ("libcamera: thread: Add a messaging passing API")
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
2019-11-27 19:30:44 +02:00
Laurent Pinchart
442f516c62 libcamera: Print backtrace on fatal errors
When a fatal error occurs the program aborts, and all the logger
provides is the location of the line that caused the error. Extend this
with a full backtrace to help debugging.

The backtrace is generated using the backtrace() call, a GNU extension
to the C library. It is available in glibc and uClibc but not in musl.
Test for availability of the function to condition compilation of the
backtrace printing. Implementing backtrace support with musl is an
exercise left to the reader if desired.

The LogOutput class is extended to support writing string messages
directly to the output. Strings written directly will be considered as
LogDebug messages when written to the Syslog.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Tested-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
2019-11-26 18:47:15 +02:00
Laurent Pinchart
a1225b838f cam: options: Fix unitialized variable warning
gcc 8 and 9 complain about the OptionValue::integer_ member being
possibly used initialized when compiled in release mode. I haven't been
able to find where this could be the case, and the compiler error
message isn't helpful:

In file included from ../../src/cam/options.cpp:14:
../../src/cam/options.h: In member function ‘bool OptionsBase<T>::parseValue(const T&, const Option&, const char*) [with T = std::__cxx11::basic_string<char>]’:
../../src/cam/options.h:84:7: error: ‘<anonymous>.OptionValue::integer_’ may be used uninitialized in this function [-Werror=maybe-uninitialized]
 class OptionValue
       ^~~~~~~~~~~
../../src/cam/options.h: In member function ‘bool OptionsBase<T>::parseValue(const T&, const Option&, const char*) [with T = int]’:
../../src/cam/options.h:84:7: error: ‘<anonymous>.OptionValue::integer_’ may be used uninitialized in this function [-Werror=maybe-uninitialized]
 class OptionValue
       ^~~~~~~~~~~

Furthermore valgrind doesn't report any issue. This is likely a false
positive, but fix it nonetheless as the fix is cheap.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Jacopo Mondi <jacopo@jmondi.org>
Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
2019-11-26 18:47:15 +02:00
Jacopo Mondi
a2a0e46576 test: controls: control_list: Add status check
Since commit fac471e812 ("test: Extract CameraTest class out of camera
tests to libtest") the control_list is a subclass of CameraTest, and the
status returned by the base class init() operation should be inspected
to avoid accessing uninitialized fields during the run() operation
execution.

If the VIMC test module is not loaded, executing the test results in a
segfault. Fix this by adding the init() operation where to status_ flag
is checked for errors.

Fixes: fac471e812 ("test: Extract CameraTest class out of camera tests to libtest")
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Jacopo Mondi <jacopo@jmondi.org>
2019-11-25 09:54:41 +01:00
Laurent Pinchart
a8d0312903 meson: Really define _FORTIFY_SOURCE for optimised builds
Commit 965c5bf7fb ("meson: Define _FORTIFY_SOURCE for optimised
builds") tried to define _FORTIFY_SOURCE for optimised builds with
clang, but updated the common_arguments after it was used. This resulted
in the _FORTIFY_SOURCE option not being applied. Fix it.

Fixes: 965c5bf7fb ("meson: Define _FORTIFY_SOURCE for optimised builds")
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>
2019-11-21 11:42:22 +02:00
Laurent Pinchart
1516ef3ce6 libcamera: Fix typo related to serialization
Oxford English spells "serialize", not "serialise". Fix it.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
2019-11-20 21:48:10 +02:00
Laurent Pinchart
870f2d3b1f test: ipa: Add IPA wrappers test
Wrap an IPAInterface in an IPAInterfaceWrapper in an IPAContextWrapper,
and verify that the translation between C and C++ APIs work correctly.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
2019-11-20 21:48:06 +02:00
Laurent Pinchart
d7e0985ce1 ipa: Allow short-circuiting the ipa_context_ops
When an IPA module is loaded without isolation and implements the
IPAInterface internally, going through ipa_context_ops is a waste of
time. Add an operation to retrieve the IPAInterface, and use it directly
in the IPAContextWrapper.

For debugging purpose, make it possible to forcing usage of the C API by
defining the LIBCAMERA_IPA_FORCE_C_API environment variable.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Jacopo Mondi <jacopo@jmondi.org>
Reviewed-by: Jacopo Mondi <jacopo@jmondi.org>
Reviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
2019-11-20 21:48:05 +02:00
Laurent Pinchart
8162ac1647 ipa: Declare the ipaCreate() function prototype
IPA modules have to implement a public ipaCreate() function, but its
prototype isn't declared in any header file. This allows for modules to
get the prototype wrong without being warned by the compiler. Fix it.

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>
2019-11-20 21:48:04 +02:00
Jacopo Mondi
132d99bc8f ipa: Switch to the plain C API
Switch IPA communication to the plain C API. As the IPAInterface class
is easier to use for pipeline handlers than a plain C API, retain it and
add an IPAContextWrapper that translate between the C++ and the C APIs.

On the IPA module side usage of IPAInterface may be desired for IPAs
implemented in C++ that want to link to libcamera. For those IPAs, a new
IPAInterfaceWrapper helper class is introduced to wrap the IPAInterface
implemented internally by the IPA module into an ipa_context,
ipa_context_ops and ipa_callback_ops.

Signed-off-by: Jacopo Mondi <jacopo@jmondi.org>
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
2019-11-20 21:48:00 +02:00
Laurent Pinchart
bc9527de45 ipa: Define a plain C API
The C++ objects that are expected to convey data through the IPA API
will have associated methods that would require IPAs to link to
libcamera. Even though the libcamera license allows this, suppliers of
closed-source IPAs may have a different interpretation. To ease their
mind and clearly separate vendor code and libcamera code, define a plain
C IPA API. The corresponding C objects are stored in plain C structures
or have their binary format documented, removing the need for linking to
libcamera code on the IPA side.

The C API adds three new C structures, ipa_context, ipa_context_ops and
ipa_callback_ops. The ipa_context_ops and ipa_callback_ops contain
function pointers for all the IPA interface methods and signals,
respectively. The ipa_context represents a context of operation for the
IPA, and is passed to the IPA oparations. The IPAInterface class is
retained as it is easier to use than a plain C API for pipeline
handlers, and wrappers will be developed to translate between the C and
C++ APIs.

Switching to the C API internally will be done in a second step.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Jacopo Mondi <jacopo@jmondi.org>
Reviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
2019-11-20 21:47:59 +02:00
Laurent Pinchart
5f90d52d6e ipa: Pass ControlInfoMap references to IPAInterface::configure()
The IPAInterface::configure() operation receives a map of ControlInfoMap
instances. Pass const references instead to avoid copies when not
required (the callee can still make manual copies), and to allow for the
future serialization layer to keep references to the original object.

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>
2019-11-20 21:47:58 +02:00
Jacopo Mondi
c0b437fd6c test: Add control serialization test
Add a test that exercises the ControlSerializer to serialize and
deserialize ControlInfoMap and ControlList.

Signed-off-by: Jacopo Mondi <jacopo@jmondi.org>
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
2019-11-20 21:47:54 +02:00
Laurent Pinchart
2c5f0ad23a libcamera: Add controls serializer
Add a new ControlSerializer helper to serialize and deserialize
ControlInfoMap and ControlList instances. This will be used to implement
the C IPA protocol and the communication with IPA through IPC.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
2019-11-20 21:47:50 +02:00
Laurent Pinchart
56c9a978d6 test: Add ByteStreamBuffer test
The test exercises the API of the ByteStreamBuffer class in both read
and write modes, including carve out buffers.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
2019-11-20 21:47:50 +02:00
Jacopo Mondi
69bb53aca1 libcamera: Add ByteStreamBuffer
The ByteStreamBuffer class wraps a memory area, expected to be allocated
by the user of the class and provides operations to perform sequential
access in read and write modes.

Signed-off-by: Jacopo Mondi <jacopo@jmondi.org>
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2019-11-20 21:47:49 +02:00
Jacopo Mondi
4e5e352f3b ipa: Define serialized controls
Define data structures to be used during interaction between IPA modules
and pipeline handlers to serialize control lists and control info maps.

Signed-off-by: Jacopo Mondi <jacopo@jmondi.org>
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>
2019-11-20 21:47:44 +02:00
Laurent Pinchart
b44cb6b5f8 libcamera: buffer: Add const accessor to Buffer planes
In order to inspect planes of a const Buffer, add a const accessor.

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>
2019-11-20 21:47:43 +02:00
Laurent Pinchart
6a1ff2615b libcamera: v4l2_controls: Fix control range construction for bool
V4L2 controls of type V4L2_CTRL_TYPE_BOOLEAN are incorrectly described
with a ControlRange of int32_t values. Fix it.

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>
Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
2019-11-20 21:47:43 +02:00
Laurent Pinchart
7cbd88fec7 libcamera: controls: Catch type mismatch in ControlInfoMap
ControlInfoMap requires the ControlId and ControlRange of each entry to
have identical types. Check for this and log an error if a mismatch is
detected.

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>
2019-11-20 21:47:42 +02:00
Jacopo Mondi
cdc68bf7f7 libcamera: controls: Store reference to the InfoMap
Store a reference to the ControlInfoMap used to create a ControlList and
provide an operation to retrieve it. This will be used to implement
serialization of ControlList.

Signed-off-by: Jacopo Mondi <jacopo@jmondi.org>
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
2019-11-20 21:47:41 +02:00
Laurent Pinchart
113cfb1e08 libcamera: controls: Make ControList constructor public
We need to construct empty ControlList objects to serialization. Make
the constructor public.

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>
2019-11-20 21:47:40 +02:00
Jacopo Mondi
81493f36e1 libcamera: controls: Make ControlId constructor public
In order to be able to create a ControlId from serialized data, make its
constructor public.

Signed-off-by: Jacopo Mondi <jacopo@jmondi.org>
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
2019-11-20 21:47:39 +02:00
Laurent Pinchart
6d492c2d75 libcamera: controls: Add move constructor to ControlInfoMap
The ControlInfoMap class has a move assignment operator from a plain
map, but no corresponding move constructor. Add one.

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>
Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
2019-11-20 21:47:35 +02:00
Laurent Pinchart
e89c2b2295 libcamera: controls: Index ControlList by unsigned int
In preparation for serialization, index the ControlList by unsigned int.
This will allow deserializing a ControlList without requiring external
information.

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>
2019-11-20 21:47:33 +02:00
Laurent Pinchart
c27b7c103a libcamera: controls: Add operator== and operator!= to ControlRange
Allow comparision of control ranges by adding the required operators.

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>
2019-11-20 21:47:29 +02:00
Laurent Pinchart
76b9923e55 libcamera: controls: Avoid exception in ControlInfoMap count() and find()
The ControlInfoMap count() and find() methods use at() to lookup the
control numerical ID in the idmap_. This causes an exception to be
thrown if the ID doesn't exist in the map. Fix it by using the find()
method instead in find(), and rely on idmap_.count() in count().

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>
2019-11-20 21:47:26 +02:00
Laurent Pinchart
4034e45f0a test: controls: Add ControlInfoMap test
Add a test to exercise the ControlInfoMap API. This currently tests
at(), count(), find() and end().

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Jacopo Mondi <jacopo@jmondi.org>
Niklas Söderlund <niklas.soderlund@ragnatech.se>
2019-11-20 21:47:22 +02:00
Laurent Pinchart
fac471e812 test: Extract CameraTest class out of camera tests to libtest
Many tests other than the camera/ tests use a camera. To increase code
sharing, move the base CameraTest class to the test library. The class
becomes a helper that doesn't inherit from Test anymore (to avoid
diamond inheritance issues when more such helpers will exist).

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
2019-11-20 21:47:20 +02:00
Niklas Söderlund
6b3308ba1b libcamera: pipeline: Drop forward declaration of BufferPool
There is no need to forward declare BufferPool, drop it.

Signed-off-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
Reviewed-by: Jacopo Mondi <jacopo@jmondi.org>
Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2019-11-20 17:19:58 +01:00
Niklas Söderlund
1d32f21136 cam: Store camera as shared pointer everywhere
Do not store the camera raw pointer in the capture class, this will
prevent forwarding the shared pointer in the future.

Signed-off-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
Reviewed-by: Jacopo Mondi <jacopo@jmondi.org>
Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
2019-11-20 17:19:58 +01:00
Niklas Söderlund
bcf4299453 libcamera: pipeline_handler: Do not use argument as local variable
In completeRequest() the request argument is used as a local variable,
this is confusing. Add a separate local variable instead of reusing the
argument.

Signed-off-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
Reviewed-by: Jacopo Mondi <jacopo@jmondi.org>
Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2019-11-20 00:36:27 +01:00
Niklas Söderlund
c360857c5d libcamera: v4l2_videodevice: Simplify error checking for requestBuffers()
There is no point in explicitly checking the same error in the only call
sites for the internal function, centralize the check and simplify the
code.

Signed-off-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
Reviewed-by: Jacopo Mondi <jacopo@jmondi.org>
Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2019-11-20 00:35:00 +01:00
Niklas Söderlund
c1a287d4b4 cam: BufferWriter: Use the libcamera namespace
Other parts of the cam utility uses the libcamera namespace, do the same
in the buffer writer.

Signed-off-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
Reviewed-by: Jacopo Mondi <jacopo@jmondi.org>
Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2019-11-20 00:33:41 +01:00
Niklas Söderlund
f7ddfd4517 libcamera: camera: Remove explicit stream to buffer map in requestCompleted signal
The stream to buffer map in the requestCompleted signal is taken
directly from the request which is part of the same signal. Remove the
map as it can be fetched directly from the request.

Signed-off-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
Reviewed-by: Jacopo Mondi <jacopo@jmondi.org>
Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2019-11-19 18:30:26 +01:00
Niklas Söderlund
40888cfdce libcamera: buffer: Drop friend statement
The Buffer class do not need to friend PipelineHandler, drop it.

Signed-off-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
Reviewed-by: Jacopo Mondi <jacopo@jmondi.org>
Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2019-11-19 17:52:31 +01:00
Niklas Söderlund
5e1cd213b3 libcamera: buffer: Plane: Drop friend statement
The Plane class do not need to friend Stream, drop it.

Signed-off-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
Reviewed-by: Jacopo Mondi <jacopo@jmondi.org>
Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2019-11-19 17:49:44 +01:00
Niklas Söderlund
1de2e4bbdd libcamera: buffer: Drop forward declaration of BufferPool
There is no need to forward declare BufferPool, drop it.

Signed-off-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
Reviewed-by: Jacopo Mondi <jacopo@jmondi.org>
Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2019-11-19 17:48:20 +01:00
Laurent Pinchart
b465ecb3e3 libcamera: Fix compilation with uClibc and uClibc-ng
Neither uClibc nor uClibc-ng support O_TMPFILE. Define it in utils.h if
not defined.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
2019-11-18 02:33:53 +02:00
Ezequiel Garcia
97a5855f37 README: Simplify a bit the build instructions
Less typing for the same result.

Signed-off-by: Ezequiel Garcia <ezequiel@collabora.com>
Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2019-11-18 02:28:55 +02:00
Laurent Pinchart
918bfb3c3d libcamera: Remove space between empty curly brackets
Remove spaces between empty curly brackets (replacing { } with {}) to
comply with the coding style. Fix one other coding style violation on
the lines touched by those fixes.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
2019-11-18 02:27:48 +02:00
Laurent Pinchart
d312d0ba10 libcamera: Remove unneeded semicolons
Comply with the coding style by removing lots of unneeded semicolons.
Fix a few other coding style violations on the lines touched by those
fixes.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
2019-11-08 20:37:47 +02:00
Jacopo Mondi
53eab99680 android: Replace ThreadRPC with blocking method call
Use the newly introduced InvocationTypeBlocking message type to replace
the blocking message delivery implemented with the ThreadRPC class in the
Android camera HAL.

Signed-off-by: Jacopo Mondi <jacopo@jmondi.org>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
2019-10-30 02:37:37 +02:00
Jacopo Mondi
1f1d27cc14 test: object-invoke: Invoke method in blocking mode
Change the object-invoke test to perform the second method invocation
operation in blocking mode.

Signed-off-by: Jacopo Mondi <jacopo@jmondi.org>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
2019-10-29 18:46:33 +02:00
Jacopo Mondi
fb1a5c0416 libcamera: object: Add connection type parameter to invokeMethod()
Allow specifying a different connection type than ConnectionTypeQueued
for Object::invokeMethod().

Signed-off-by: Jacopo Mondi <jacopo@jmondi.org>
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
2019-10-29 16:44:46 +02:00
Laurent Pinchart
06008b9156 libcamera: object: Use bound method activePack() for invokeMethod()
The BoundMethodBase::activatePack() and the internal
Object::invokeMethod() are duplicate implementation of the same
mechanism. Use the former to replace the latter.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
2019-10-29 16:44:45 +02:00
Laurent Pinchart
8524e62611 libcamera: signal: Specify connection type for signals
Add a connection type parameter to the Signal::connect() method to
control signal delivery.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
2019-10-29 16:44:43 +02:00
Laurent Pinchart
3d75cc1bd2 libcamera: bound_method: Support connection types
Support all connection types in the BoundMethodBase::activePack()
method. To support this, add a semaphore to the InvokeMessage to signal
delivery.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
2019-10-29 16:41:54 +02:00