Commit graph

200 commits

Author SHA1 Message Date
Umang Jain
035ee23910 android: camera_device: Initialize 'id_' field in constructor
A 'id' is passed when a new CameraDevice is constructed in order for
unique identification. Failing to initialize it,  will lead to the
issue of garbage return value via CameraDevice::id().

Signed-off-by: Umang Jain <email@uajain.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
2020-08-06 12:57:06 +01:00
Niklas Söderlund
2e7c80a4f9 libcamera: camera: Rename name() to id()
Rename Camera::name() to camera::id() to better describe what it
represents, a unique and stable ID for the camera. While at it improve
the documentation for the camera ID to describe it needs to be stable
for a camera between resets of the system.

Signed-off-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2020-08-05 20:07:13 +02:00
Jacopo Mondi
09b1d0fced android: camera_device: Fix preview template
Add 5 controls to the generate preview template to comply with the
camera3 specification.

This change fixes CTS 9.0.r12 test:
android.hardware.camera2.cts.CameraDeviceTest#testCameraDevicePreviewTemplate

Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Jacopo Mondi <jacopo@jmondi.org>
2020-08-05 14:36:44 +02:00
Jacopo Mondi
8a02d4451c android: camera_device: Break-out request template
Currently the request template returned from
CameraDevice::constructDefaultRequestSettings() is the same for all
the supported template types.

To prepare to adjust the template depending on the use case, break out
the template generation to a dedicated function that supports the
PREVIEW use case. All the other template types use the
requestTemplatePreview() function and just update the capture intent
property.

Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Jacopo Mondi <jacopo@jmondi.org>
2020-08-05 14:33:52 +02:00
Niklas Söderlund
7876d631d9 android: camera_device: Report RAW capability if supported
Probe the libcamera Camera for RAW support and if supported report RAW
capability in the static metadata reported to Android.

Signed-off-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
Reviewed-by: Jacopo Mondi <jacopo@jmondi.org>
2020-08-03 23:44:09 +02:00
Niklas Söderlund
d4de037a8a android: camera_device: Map HAL RAW to libcamera RAW formats
Add a mapping from HAL RAW formats to the direct equivalent of libcamera
formats. With this change it is possible to capture RAW images as long
as the hardware can deliver frames in a format that is native to the
HAL.

More work is needed to deal with unpacked 8, 10 and 12 RAW formats as
they don't directly map to a native HAL format. Nor do they belong in
the RAW_OPAQUE category as the content format is generic and not
uncommonly supported by hardware.

Signed-off-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
Reviewed-by: Jacopo Mondi <jacopo@jmondi.org>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2020-08-03 23:44:09 +02:00
Niklas Söderlund
8c1fedcb78 android: camera_device: Prepare for non-mandatory formats
When probing what formats a libcamera Camera supports we want to allow
to probe for non-mandatory formats. Add a new flag to indicate if a
format in camera3FormatsMap is mandatory or not.

All current defined formats are mandatory.

Signed-off-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
Reviewed-by: Jacopo Mondi <jacopo@jmondi.org>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2020-08-03 23:44:09 +02:00
Niklas Söderlund
a2a6f95bff android: camera_device: Add ANDROID_REQUEST_MAX_NUM_INPUT_STREAMS
Define the ANDROID_REQUEST_MAX_NUM_INPUT_STREAMS to zero to inform users
the HAL does not support any reprocessing.

Signed-off-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
Reviewed-by: Jacopo Mondi <jacopo@jmondi.org>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2020-07-24 19:03:52 +02:00
Niklas Söderlund
3312af649a android: camera_device: Remove scaler format information from Camera3Format
The scaler format information was only used for the
ANDROID_SCALER_AVAILABLE_FORMATS tag which is deprecated and removed. As
it has no other users remove it.

Signed-off-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
Reviewed-by: Jacopo Mondi <jacopo@jmondi.org>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2020-07-24 19:03:52 +02:00
Niklas Söderlund
142a9ee3f8 android: camera_device: Use HAL_PIXEL_FORMAT_* defines for formats
The documentation says the HAL_PIXEL_FORMAT_* defines shall be used for
formats instead of ANDROID_SCALER_AVAILABLE_FORMATS_* for the
ANDROID_SCALER_AVAILABLE_STREAM_CONFIGURATIONS and
ANDROID_SCALER_AVAILABLE_MIN_FRAME_DURATIONS tags.

This have worked in the past as the numerical value of the two sets are
the same for the formats supported.

Signed-off-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
Reviewed-by: Jacopo Mondi <jacopo@jmondi.org>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2020-07-24 19:03:52 +02:00
Niklas Söderlund
3530614fbf android: camera_device: Remove ANDROID_SCALER_AVAILABLE_FORMATS
According to the documentation the tag
ANDROID_SCALER_AVAILABLE_STREAM_CONFIGURATIONS deprecates the
ANDROID_SCALER_AVAILABLE_FORMATS tag. As the HAL implements both tags
remove the deprecated one.

Signed-off-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
Reviewed-by: Jacopo Mondi <jacopo@jmondi.org>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2020-07-24 19:03:52 +02:00
Kieran Bingham
61f4296ac7 android: camera_device: Remove single buffer restriction.
A capture request is no longer limited to a single output buffer.
Remove the limitation, but (for now) keep the check to ensure that
at least one buffer is always provided.

Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
Reviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Jacopo Mondi <jacopo@jmondi.org>
2020-07-07 11:50:51 +01:00
Kieran Bingham
0cfdf737dc android: camera_device: Add buffers for each stream to Requests
Construct a FrameBuffer for every buffer given in the camera3Request
and add it to the libcamera Request on the appropriate stream.

The correct stream is obtained from the private data of the camera3_stream
associated with the camera3_buffer.

Comments regarding supporting only one buffer are now removed, and
FrameBuffers have their lifetime tracked in the Camera3RequestDescriptor
to ensure they are released when the Request is completed.

Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
Reviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Jacopo Mondi <jacopo@jmondi.org>
2020-07-07 11:50:51 +01:00
Kieran Bingham
2f34f5ef06 android: camera_device: Maintain a vector of CameraStream
Introduce a vector storing a CameraStream to track and maintain
state between an Android stream (camera3_stream_t) and a libcamera
Stream.

Only the index of the libcamera stream is stored, to facilitate identifying
the correct index for both the StreamConfiguration and Stream vectors.

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>
Reviewed-by: Jacopo Mondi <jacopo@jmondi.org>
2020-07-06 23:58:42 +01:00
Kieran Bingham
eac0542c5e android: camera_device: Create the Request and Camera3RequestDescriptor together
Move the construction of the Request higher in the code flow so that
multiple buffers and streams can be added where required.

Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
Reviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Jacopo Mondi <jacopo@jmondi.org>
2020-07-06 23:58:42 +01:00
Kieran Bingham
74ab442dcf android: camera_device: Simplify FrameBuffer construction from a buffer_handle_t
Move the code which constructs a FrameBuffer from the Android buffer handle
to it's own function to simplify the code flow and readability.

Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Jacopo Mondi <jacopo@jmondi.org>
2020-07-06 23:58:42 +01:00
Kieran Bingham
0a9244ed37 android: camera_device: Support multiple stream configurations
Create an initial Camera Configuration using an empty role set, and
populate the StreamConfigurations manually from each of the streams
given by the Android camera3_stream_configuration_t stream_list.

Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
Reviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Jacopo Mondi <jacopo@jmondi.org>
2020-07-06 23:58:42 +01:00
Kieran Bingham
43e3b8002b android: camera_device: Provide a toPixelFormat helper
Rather than converting pixelformats through the map, and then
dereferencing the iterator later, create a helper to explicitly return a
PixelFormat type.

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>
Reviewed-by: Jacopo Mondi <jacopo@jmondi.org>
2020-07-06 23:58:42 +01:00
Laurent Pinchart
8b7e073e6e libcamera: Replace explicit DRM FourCCs with libcamera formats
Use the new pixel format constants to replace usage of macros from
drm_fourcc.h.

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>
2020-06-18 13:26:58 +03:00
Laurent Pinchart
7a88b212e0 android: camera_device: Use std::make_tuple()
Until N4387 (https://wg21.link/N4387, applied as a defect report for
C++11), a function could not return a tuple using
copy-list-initialization. This affects gcc-5 that was released before
N4387 was integrated, and causes a compilation error:

../../src/android/camera_device.cpp: In member function ‘std::tuple<unsigned int, unsigned int> CameraDevice::calculateStaticMetadataSize()’:
../../src/android/camera_device.cpp:391:32: error: converting to ‘std::tuple<unsigned int, unsigned int>’ from initializer list would use explicit constructor ‘constexpr std::tuple<_T1, _T2>::tuple(_U1&&, _U2&&) [with _U1 = unsigned int&; _U2 = unsigned int&; <template-parameter-2-3> = void; _T1 = unsigned int; _T2 = unsigned int]’
  return { numEntries, byteSize };

Fix it by using std::make_tuple().

Fixes: a80d38109f ("android: camera_device: Calculate metadata size")
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Acked-by: Jacopo Mondi <jacopo@jmondi.org>
Reviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
2020-06-10 16:48:08 +03:00
Jacopo Mondi
82d9331efd android: camera_device: Translate Android format
Translate the Android format code to the libcamera format code
at stream configuration time, using the translation map built at
camera device initialization time.

Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Jacopo Mondi <jacopo@jmondi.org>
2020-06-08 23:01:55 +02:00
Jacopo Mondi
bde7b98cac android: camera_device: Replace hardcoded stream configuration
Replace the hardcoded stream configuration map with the information
collected at CameraDevice initialization time.

Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Jacopo Mondi <jacopo@jmondi.org>
2020-06-08 23:01:54 +02:00
Jacopo Mondi
a80d38109f android: camera_device: Calculate metadata size
As we move to have more and more dynamically generated static metadata
entries, the size of the metadata buffer has to be calculated
dynamically inspecting the information collected from the camera.

Provide a method to perform metadata buffers size calculation and
use it when generating camera static metadata.

Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Jacopo Mondi <jacopo@jmondi.org>
2020-06-08 23:01:54 +02:00
Jacopo Mondi
117588b371 android: camera_device: Initialize stream configuration
Initialize the stream configuration map by applying the Android Camera3
requested resolutions and formats to the libcamera Camera device.

For each required format test a list of required and optional
resolutions, construct a map to translate from Android format to the
libcamera formats and store the available stream configuration to
be provided to the Android framework through static metadata.

Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Jacopo Mondi <jacopo@jmondi.org>
2020-06-08 23:01:54 +02:00
Jacopo Mondi
64f4f667ed android: hal_manager: Do not hardcode properties
The CameraHalManager::getCameraInfo() method hardcodes the camera facing
side and orientation (which corresponds, confusingly, to libcamera's
location and rotation properties).

Instead of hard-coding the values based on the camera id, inspect the
libcamera properties that report the camera location and rotation in a
new initialize() method, and use them to report the android camera info
and to populate the static metadata buffer.

Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Jacopo Mondi <jacopo@jmondi.org>
2020-06-04 09:58:02 +02:00
Jacopo Mondi
a7b9277e45 android: camera_device: Provide log prefix
Make the CameraDevice a Loggable subclass and provide a logPrefix()
method to identify which camera the log output refers to.

Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Jacopo Mondi <jacopo@jmondi.org>
2020-06-04 09:50:52 +02:00
Laurent Pinchart
93e72b695e libcamera: Move internal headers to include/libcamera/internal/
The libcamera internal headers are located in src/libcamera/include/.
The directory is added to the compiler headers search path with a meson
include_directories() directive, and internal headers are included with
(e.g. for the internal semaphore.h header)

  #include "semaphore.h"

All was well, until libcxx decided to implement the C++20
synchronization library. The __threading_support header gained a

  #include <semaphore.h>

to include the pthread's semaphore support. As include_directories()
adds src/libcamera/include/ to the compiler search path with -I, the
internal semaphore.h is included instead of the pthread version.
Needless to say, the compiler isn't happy.

Three options have been considered to fix this issue:

- Use -iquote instead of -I. The -iquote option instructs gcc to only
  consider the header search path for headers included with the ""
  version. Meson unfortunately doesn't support this option.

- Rename the internal semaphore.h header. This was deemed to be the
  beginning of a long whack-a-mole game, where namespace clashes with
  system libraries would appear over time (possibly dependent on
  particular system configurations) and would need to be constantly
  fixed.

- Move the internal headers to another directory to create a unique
  namespace through path components. This causes lots of churn in all
  the existing source files through the all project.

The first option would be best, but isn't available to us due to missing
support in meson. Even if -iquote support was added, we would need to
fix the problem before a new version of meson containing the required
support would be released.

The third option is thus the only practical solution available. Bite the
bullet, and do it, moving headers to include/libcamera/internal/.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Acked-by: Jacopo Mondi <jacopo@jmondi.org>
2020-05-16 03:38:11 +03:00
Jacopo Mondi
857a216fd5 android: camera_device: Use Camera properties for static Metadata
Construct two example static metadata to be reported to the Android
framework using the properties reported by the Camera.

Reviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Jacopo Mondi <jacopo@jmondi.org>
2020-02-14 16:27:42 +01:00
Laurent Pinchart
da3f50ee9c android: Remove internal thread
Now that libcamera creates threads internally and doesn't rely on an
application-provided event loop, remove the thread from the Android
Camera HAL layer. The CameraProxy class becomes meaningless, remove it
and communicate directly from the CameraHalManager to the CameraDevice.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Acked-by: Jacopo Mondi <jacopo@jmondi.org>
2020-02-13 13:23:23 +02:00
Laurent Pinchart
acf18e4265 libcamera: Switch from utils::make_unique to std::make_unique
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>
2020-01-14 19:06:40 +02:00
Niklas Söderlund
a1c5450be5 libcamera: camera: Remove the prepared state
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>
2020-01-12 16:10:38 +01:00
Niklas Söderlund
164fbf17ff libcamera: Remove dead code after switch to FrameBuffer
Delete all dead code after switching to the FrameBuffer interface.

Signed-off-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2020-01-12 16:10:38 +01:00
Niklas Söderlund
9217f274f6 libcamera: Switch to FrameBuffer interface
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>
2020-01-12 16:10:38 +01:00
Niklas Söderlund
5967363c0b libcamera: buffer: Move captured metadata to FrameMetadata
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>
2020-01-12 16:10:37 +01:00
Niklas Söderlund
dea689e1f2 libcamera: request: In addBuffer() do not fetch stream from Buffer
In the FrameBuffer interface the stream will not be available from the
buffer object as the buffer might be allocated externally. The
application needs to explicitly state which stream the buffer is being
added for to the request.

Extend the addBuffer() function to get this information explicitly from
the caller.

Signed-off-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
Reviewed-by: Jacopo Mondi <jacopo@jmondi.org>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2020-01-12 16:10:37 +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
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
Laurent Pinchart
f391048a7b libcamera: utils: Add hex stream output helper
Add a utils::hex() function that simplifies writing hexadecimal values
to an ostream. The function handles the '0x' prefix, the field width and
the fill character automatically. Use it through the libcamera code
base, and add a test.

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-10-15 16:49:55 +03:00
Jacopo Mondi
19f85f43ff android: camera_device: Report available keys
Report the list of available static metadata tags (characteristicKeys),
of supported controls (requestKeys) and produced metadata (resultKeys)
in the static metadata pack.

Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Jacopo Mondi <jacopo@jmondi.org>
2019-09-05 23:29:22 +02:00
Jacopo Mondi
fcd5a4f335 android: camera_device: Fix handling of request template
According to the Android camera HALv3 documentation, the request
template metadata pack should not be modified after it is returned to
the camera stack from the HAL.

Currently, the same metadata pack is used for all types of template
request, without updating the capture intent there contained to match
the requested template type, as correctly reported by the
cros_camera_test test application.

In order to avoid modifying the single request template already returned
to the camera stack in order to update the capture intent it contains,
create a map that associates a dedicated template to each supported
capture type.

Signed-off-by: Jacopo Mondi <jacopo@jmondi.org>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2019-09-05 23:27:36 +02:00
Laurent Pinchart
3986009cf1 android: camera_device: Use the new CameraMetadata helper class
Simplify the implementation of metadata handling in the CameraDevice
class by using the new CameraMetadata helper class.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Jacopo Mondi <jacopo@jmondi.org>
2019-09-05 23:27:34 +02:00
Jacopo Mondi
637034742f android: camera_device: Use precise sizes for request template
Use more opportune sizes, manually calculated, for the generated request
template.

Signed-off-by: Jacopo Mondi <jacopo@jmondi.org>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2019-09-05 23:07:53 +02:00
Jacopo Mondi
9b361dc4bc android: camera_device: Add missing tags in request template
Add two missing tags from the request template generated by the HAL.
The tags are reported as missing by the cros_camera_test tool.

Signed-off-by: Jacopo Mondi <jacopo@jmondi.org>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2019-09-05 23:07:53 +02:00
Jacopo Mondi
31f784c47b android: camera_device: Remove tags from request template
Remove metadata tags wrongly added to the request template constructed
by the libcamera HAL.

Signed-off-by: Jacopo Mondi <jacopo@jmondi.org>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2019-09-05 23:07:53 +02:00
Jacopo Mondi
48504ba143 android: camera_device: Use correct sizes for static metadata
Use more opportune sizes for the static metadata pack, and for the
dynamic metadata sizes which where wrongly set to use the ones defined
for the static pack.

Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Jacopo Mondi <jacopo@jmondi.org>
2019-09-05 23:07:53 +02:00
Jacopo Mondi
b4893fce68 android: camera_device: Add missing static metadata
Add all the static metadata keys part of the BC (backward compatible)
metadata group, which represent the minimum requirement for devices
supporting the LIMITED hardware level.

Reviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Jacopo Mondi <jacopo@jmondi.org>
2019-09-05 23:07:53 +02: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
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
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
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