Commit graph

898 commits

Author SHA1 Message Date
Laurent Pinchart
af4304e497 libcamera: process: Properly ignore unused result with gcc
Casting the return value of a function to (void) doesn't ignore the
unused result warning with gcc. Use a #pragma to fix this properly, to
fix compilation with _FORTIFY_SOURCE.

Fixes: df23ab95f3 ("libcamera: process: fix compilation on Chromium OS")
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Paul Elder <paul.elder@ideasonboard.com>
2019-08-22 11:09:05 +03:00
Kieran Bingham
d209b2d4b4 libcamera: v4l2_videodevice: Support MPLANE M2M devices
M2M devices using MPLANE API will set the V4L2_CAP_VIDEO_M2M_MPLANE
capability flag.

Ensure that this is matched when checking for Multiplanar capabilities.

Fixes: 4f7625cca7 ("libcamera: v4l2_videodevice: Support M2M devices")
Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
2019-08-21 12:48:03 +01:00
Laurent Pinchart
82bdcc91fc android: camera_device: Store static metadata in cache
The CameraDevice class has a mechanism to cache static metadata, but
doesn't use it. Fix it.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Jacopo Mondi <jacopo@jmondi.org>
2019-08-19 19:08:08 +03:00
Laurent Pinchart
53704ac3f4 libcamera: camera_manager: Construct CameraManager instances manually
The CameraManager class is not supposed to be instantiated multiple
times, which led to a singleton implementation. This requires a global
instance of the CameraManager, which is destroyed when the global
destructors are executed.

Relying on global instances causes issues with cleanup, as the order in
which the global destructors are run can't be controlled. In particular,
the Android camera HAL implementation ends up destroying the
CameraHalManager after the CameraManager, which leads to use-after-free
problems.

To solve this, remove the CameraManager::instance() method and make the
CameraManager class instantiable directly. Multiple instances are still
not allowed, and this is enforced by storing the instance pointer
internally to be checked when an instance is created.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Jacopo Mondi <jacopo@jmondi.org>
2019-08-19 19:07:45 +03:00
Laurent Pinchart
3e4672f159 android: camera_hal_manager: Clean up resources when terminating
The CameraHalManager starts the libcamera CameraManager and creates
CameraProxy instances for each camera in the system. Clean up those
resources when the CameraHalManager terminates.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Jacopo Mondi <jacopo@jmondi.org>
2019-08-19 19:07:41 +03:00
Laurent Pinchart
dadd1fd8fe android: camera_hal_manager: Remove unused close() method
The CameraHalManager::close() method isn't used, remove it.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Jacopo Mondi <jacopo@jmondi.org>
2019-08-19 19:07:33 +03:00
Laurent Pinchart
06166a331c android: camera_hal_manager: Stop thread when destroying
The CameraHalManager starts a thread that is never stopped. This leads
to the thread being destroyed while running, which causes a crash. Fix
this by stopping the thread and waiting for it to finish in the
destructor of the CameraHalManager.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Jacopo Mondi <jacopo@jmondi.org>
2019-08-19 19:07:33 +03:00
Laurent Pinchart
0ed40d2cd4 android: Pass Camera shared pointer to CameraProxy by const reference
The CameraProxy is constructed with a Camera instance passed through a
shared pointer. It forwards it to the CameraDevice constructor, which
takes a reference used for the sole purpose of making an internal copy
of the shared pointer. Both constructors can thus take a const reference
instead of a value or a mutable reference. This optimises the
constructors slightly.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Jacopo Mondi <jacopo@jmondi.org>
2019-08-19 19:07:33 +03:00
Laurent Pinchart
5ce4bb62e7 test: camera: Use the CameraManager from the CameraTest base class
Make the camera manager a protected field of the CameraTest class, and
use it instead of CameraManager::instance() in the camera tests. This
prepares for the removal of CameraManager::instance().

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Jacopo Mondi <jacopo@jmondi.org>
2019-08-19 19:06:50 +03:00
Laurent Pinchart
fd0087b5d8 test: Get event dispatcher from current thread
For all tests that don't otherwise require access to the camera manager,
get the event dispatcher from the current thread instead of the camera
manager. This prepares for the removal of CameraManager::instance().

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Jacopo Mondi <jacopo@jmondi.org>
2019-08-19 19:06:37 +03:00
Laurent Pinchart
8c9deeb30f test: unixsocket: Fix typo in error message
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Jacopo Mondi <jacopo@jmondi.org>
2019-08-19 19:06:37 +03:00
Laurent Pinchart
57baad97b9 test: event-thread: Fix compilation on Chromium OS
Commit 92b4af98cd ("test: Add EventNotifier thread move test") causes
the build to fail in the Chromium OS build environment, because the
return values of the pipe() function marked with the
__warn_unused_result__ attribute is ignored. Fix this.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Paul Elder <paul.elder@ideasonboard.com>
Reviewed-by: Jacopo Mondi <jacopo@jmondi.org>
2019-08-19 19:06:37 +03:00
Laurent Pinchart
af49b18c81 qcam: Pass camera manager to MainWindow class
Pass the CameraManager instance from the main() function to the
MainWindow class instead of accessing it through
CameraManager::instance(). This prepares for the removal of the
CameraManager::instance() method.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Jacopo Mondi <jacopo@jmondi.org>
2019-08-19 19:06:23 +03:00
Laurent Pinchart
749dbd576f qcam: Remove double stop of the camera manager
The camera manager is stopped both in the destructor of the MainWindow
class and in the main() function. This double stop isn't needed, remove
the former and keep the latter as the manager is started in the main()
function.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Jacopo Mondi <jacopo@jmondi.org>
2019-08-19 18:07:40 +03:00
Laurent Pinchart
4403a66789 libcamera: proxy: Get event dispatcher from current thread
Get the event dispatcher from the current thread instead of the camera
manager. This prepares for the removal of CameraManager::instance().

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Jacopo Mondi <jacopo@jmondi.org>
2019-08-19 18:07:30 +03:00
Laurent Pinchart
d0cf816569 libcamera: device_enumerator: Print media device name in error message
The device enumerator logs an error message when a media device is
removed while still in use. Add the device name to the message to help
debugging.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Jacopo Mondi <jacopo@jmondi.org>
2019-08-19 18:07:29 +03:00
Laurent Pinchart
0c32433d8c android: Simplify thread RPC with Object::invokeMethod()
Replace the manual implementation of asynchronous method invocation
through a custom message with Object::invokeMethod(). This simplifies
the thread RPC implementation.

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-08-19 18:07:28 +03:00
Laurent Pinchart
778f6b1d70 test: Simplify tests with parent-child relationships
Create object instances with a parent to avoid the need for reparenting
objects manually.

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-08-17 18:47:17 +03:00
Laurent Pinchart
d7aded92d3 test: object: Extend object test to verify parent-child relationships
The test verifies correct behaviour of parent-child relationships in
relation to thread affinity.

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-08-17 18:47:17 +03:00
Laurent Pinchart
1554d0b6e6 libcamera: Add parent argument to constructors of Object-derived classes
Now that the Object class implements parent-child relationships, make it
possible to create EventNotifier and Timer instances with a parent by
adding a parent argument to their constructors.

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-08-17 18:47:17 +03:00
Laurent Pinchart
2b25819ec0 libcamera: object: Create parent-child relationships
Add a parent Object to Object instances, and track the parent-children
relationships. Children are bound to the same thread as their parent,
and moving an Object to a thread automatically moves all its children.

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-08-17 18:47:17 +03:00
Laurent Pinchart
4d9f1a0efc test: Add Timer thread move test
The test verifies correct behaviour of a running timer moved to a
different thread.

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-08-17 18:47:17 +03:00
Laurent Pinchart
92b4af98cd test: Add EventNotifier thread move test
The test verifies correct behaviour of an enabled event notifier moved
to a different thread.

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-08-17 18:46:54 +03:00
Laurent Pinchart
6ecf99a708 libcamera: timer: Bind timers to threads
The Timer instances are registered with the event dispatcher instance of
the CameraManager. This makes it impossible to use timers in other
threads.

Fix this by inheriting from Object, which allows binding instances to a
thread, and register them with the event dispatcher for the thread they
are bound to.

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-08-17 18:32:42 +03:00
Laurent Pinchart
0c3fd6eb14 libcamera: event_notifier: Bind event notifiers to threads
The EventNotifier instances are registered with the event dispatcher
instance of the CameraManager. This makes it impossible to use event
notifiers in other threads.

Fix this by inheriting from Object, which allows binding instances to a
thread, and register them with the event dispatcher for the thread they
are bound to.

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-08-17 18:32:38 +03:00
Laurent Pinchart
b566e97aac libcamera: camera_manager: Bind CameraManager to threads
The CameraManager class uses the event dispatcher of the current thread.
This makes the CameraManager::eventDispatcher() and
CameraManager::setEventDispatcher() methods inconsistent, as they access
different event dispatcher instances depending on the calling thread.

Fix this by inheriting from the Object class, which binds the
CameraManager to a thread, and use the event dispatcher of the bound
thread.

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-08-17 18:32:38 +03:00
Laurent Pinchart
980d1ee0c0 test: Add Object class thread affinity test
The test verifies thread affinity and thread move notifications.

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-08-17 18:32:37 +03:00
Laurent Pinchart
a991d5aac0 test: Add Object::invokeMethod() test
The test verifies correct behaviour of asynchronous method invocation
for Object instances.

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-08-17 18:32:36 +03:00
Laurent Pinchart
5a954cb8b5 libcamera: object: Notify objects of thread move
Send a synchronous message to objects just before they get moved to a
new thread. This allows the object to perform any required processing.
EventNotifier and Timer objects will use this mechanism to move
themselves to the new thread's event disaptcher.

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-08-17 18:32:30 +03:00
Laurent Pinchart
d5d7b71521 libcamera: object: Add an asynchronous method invocation method
Add a helper invokeMethod() to the Object class that allows asynchrnous
invocation of any method of an Object instance. Asynchronous invocation
occurs when control returns to the event dispatcher of the target
object's thread, in the context of that thread.

To support this, generalise the SignalMessage implementation to support
automatic deletion of the associated BoundMethod, and rename the message
to InvokeMessage to reflect the more generic purpose.

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-08-17 18:32:29 +03:00
Laurent Pinchart
f83820a5d1 libcamera: bound_method: Decouple from Signal implementation
To make the BoundMethod classes more generic, replace direct access to
private member from Signal classes with accessors or helper functions.
This allows removal of friend statements from the BoundMethod classes.

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-08-17 18:32:28 +03:00
Laurent Pinchart
0e65ed8145 libcamera: signal: Split Slot implementation to reusable classes
Move the Slot* classes to bound_method.{h,cpp} and rename them to
Bound*Method*. They will be reused to implement asynchronous method
invocation similar to cross-thread signal delivery.

This is only a move and rename, no functional changes are included.

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-08-17 18:32:28 +03:00
Laurent Pinchart
a66e5ca8c6 libcamera: thread: Support dispatching messages to main thread
Threads contain message queues and dispatch queued messages in their
event loop, in Thread::exec(). This mechanism prevents the main thread
from dispatching messages as it doesn't run Thread::exec().

Fix this by moving message dispatching from Thread::exec() to
EventDispatcher::processEvents().

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-08-17 18:32:27 +03:00
Laurent Pinchart
391b184fc5 libcamera: thread: Wake up target thread when moving objects
When moving an object to a different thread, messages posted for the
object are moved to the message queue of the new thread. Wake up the new
thread to ensure it processes the moved messages.

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-08-17 18:32:26 +03:00
Laurent Pinchart
f0ba6ab2a8 libcamera: object: Make message() method protected
The message() method shouldn't be called externally (except by a few
friend classes), make it protected.

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-08-17 18:32:23 +03:00
Kieran Bingham
a146cdbf20 readme: Provide build requirements
Provide an initial list of build dependancies for Debian based systems.
Other distributions will be added separately.

Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2019-08-16 08:51:28 +01:00
Kieran Bingham
2b3cb4f37b readme: Move index page content to README
Move the introduction content from the index.rst to the README.rst so
that it can also be found quickly from the top level.

Include the README.rst directly into the index.rst to continue serving
it as the front page material.

Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2019-08-16 08:51:28 +01:00
Kieran Bingham
abc63afca4 readme: Convert from Markdown to RST
The Documentation and top-level README both serve to provide information
to new developers and users of libcamera.

Currently our README.md is sparse, and should be expanded with more
useful information such as build requirements as well as compilation
directions.

Any information provided in the README also serves a purpose in the main
documentation and website and could be a cause of duplicated content.

To allow direct integration of the top level README document into our
sphinx documentation (and thus the libcamera.org website) convert the
README.md into ReSTructured text format.

Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2019-08-16 08:51:28 +01:00
Laurent Pinchart
a8b472598e hal: Fix comparison of unsigned integer < 0
The CameraHalManager::getCameraInfo() validates the camera id it
receives from the camera service, and in doing so generates a compiler
error with gcc as the id is an unsigned integer and can never be
negative:

../src/android/camera_hal_manager.cpp: In member function ‘CameraProxy* CameraHalManager::open(unsigned int, const hw_module_t*)’:
../src/android/camera_hal_manager.cpp:89:9: error: comparison of unsigned expression < 0 is always false [-Werror=type-limits]
  if (id < 0 || id >= numCameras()) {

Fix it by removing the unneeded comparison.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Jacopo Mondi <jacopo@jmondi.org>
2019-08-15 15:40:14 +03:00
Kieran Bingham
0268984c0d test: v4l2_device: Remove unused function
The 'exists()' call is not used within the code base.
Remove it.

Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Jacopo Mondi <jacopo@jmondi.org>
2019-08-13 15:36:04 +01:00
Kieran Bingham
093573db19 test: v4l2_videodevice: Add M2M device test
The V4L2M2MDevice requires two video devices to be configured. This
makes it unsuitable to reuse the existing V4L2DeviceTest test library in
its current form.

Implement a full test to run the two M2M pipelines through VIM2M.

Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Jacopo Mondi <jacopo@jmondi.org>
2019-08-13 15:36:04 +01:00
Kieran Bingham
4f7625cca7 libcamera: v4l2_videodevice: Support M2M devices
V4L2 M2M devices represent a V4L2Device with two queues: One output, and
one capture on a single device node.

Represent this by instantiating a V4L2VideoDevice for each queue type,
and preparing each device for its queue.

Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Jacopo Mondi <jacopo@jmondi.org>
2019-08-13 15:36:04 +01:00
Kieran Bingham
3a278eb460 libcamera: v4l2_videodevice: Fix ordering of debug statement
The "Opened device" statement occurs before the buffertype_ is set.

This causes all devices to report that they are [out] devices at open()
regardless of their type.

As the message operates in the past-tense, move the statement to the end
of the function when all work has been completed.

Fixes: 04d5be7f76 ("libcamera: v4l2_device: Inherit from Loggable to print device node name")
Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Jacopo Mondi <jacopo@jmondi.org>
2019-08-13 10:23:21 +01:00
Kieran Bingham
e0f35d6f57 libcamera: v4l2_device: Add setFd()
Provide a means for V4L2 device instances to set the fd_ explicitly.
This allows for V4L2Devices to operate when they must use an external
open() call.

Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Jacopo Mondi <jacopo@jmondi.org>
2019-08-13 10:23:21 +01:00
Laurent Pinchart
a6799dc5b9 hal: Fix comparison of integers of different signs
The CameraHalManager::getCameraInfo() validates the camera id it
receives from the camera service, and in doing so compares it with an
unsigned integer, generating a compiler error:

src/android/camera_hal_manager.cpp:121:9: error: comparison of integers of different signs: 'int' and 'unsigned int' [-Werror,-Wsign-compare]
        if (id >= numCameras() || id < 0) {
            ~~ ^  ~~~~~~~~~~~~

Fix this by turning the id into an unsigned int, as camera ids can't be
negative. If a negative id is received from the camera service it will
be converted to a large unsigned integer that will fail the comparison
with numCameras().

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-08-12 15:01:30 +03:00
Jacopo Mondi
667d8ea8fd android: hal: Add Camera3 HAL
Add libcamera Android Camera HALv3 implementation.

The initial camera HAL implementation supports the LIMITED hardware
level and uses statically defined metadata and camera characteristics.

Add a build option named 'android' and adjust the build system to
selectively compile the Android camera HAL and link it against the
required Android libraries.

Signed-off-by: Jacopo Mondi <jacopo@jmondi.org>
2019-08-12 11:55:46 +02:00
Jacopo Mondi
6bed34da16 android: metadata: Add SPDX tag
Add SPDX tag to the android metadata library files licensed under
Apache-2.0.

Signed-off-by: Jacopo Mondi <jacopo@jmondi.org>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2019-08-12 10:34:13 +02:00
Jacopo Mondi
552b5d16d7 android: Add camera metadata library
Import the Android camera metadata library from the ChromiumOS build
system.

The camera metadata library has been copied from
https://chromium.googlesource.com/chromiumos/platform2
at revision 9e65ddd2c496e712f005ada9715decd2ff8e4a03

The original path in the Cros platform2/ repository is:
camera/android/libcamera_metadata/src

Create a new build target for the camera metadata library to
create a static library to link against libcamera.

Signed-off-by: Jacopo Mondi <jacopo@jmondi.org>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2019-08-12 10:34:13 +02:00
Jacopo Mondi
190bebef08 include: android: Add SPDX tags
Add SPDX indentifier to Apache-2.0 licensed android headers.

Signed-off-by: Jacopo Mondi <jacopo@jmondi.org>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2019-08-12 10:34:13 +02:00
Jacopo Mondi
206a22a6e9 include: android: Add Android headers from Cros
Copy the Android Camera3 HAL headers from the ChromiumOS build system
and define a new inclusion directive in the meson build system for them.

The header files have been copied from:
https://chromium.googlesource.com/chromiumos/platform2
at revision 9e65ddd2c496e712f005ada9715decd2ff8e4a03
and provide:

1) Android CameraHAL3 HAL headers in include/android/hardware/
2) The Android system headers in include/android/system/
3) The Android camera metadata headers in include/android/metadata/

The original path in the Cros platform2/ repository is, respectively:
camera/android/header_files/include/hardware
camera/android/header_files/include/system
camera/android/libcamera_metadata/include/

Signed-off-by: Jacopo Mondi <jacopo@jmondi.org>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2019-08-12 10:34:13 +02:00