Commit graph

1699 commits

Author SHA1 Message Date
Umang Jain
f0421988dc android: jpeg: Introduce a simple image thumbnailer
Add a basic image Thumbnailer class for the frames being captured.
Currently, the thumbnailer can scale NV12 frames. It shall be used
to generate a thumbnail image for EXIF metadata, in the subsequent
commit.

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-10-28 15:52:51 +00:00
Umang Jain
25202dbb7e android: jpeg: encoder_libjpeg: Allow encoding raw frame bytes
Allow encoding frames which are directly handed over to the encoder
via a span or vector i.e. a raw frame bytes. Introduce an overloaded
EncoderLibJpeg::encode() with libcamera::Span source parameter to
achieve this functionality. This makes the libjpeg-encoder a bit
flexible for use case such as compressing a thumbnail generated for
Exif.

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-10-28 15:52:51 +00:00
Hirokazu Honda
c1ae9055f9 android: camera_device: Mark toPixelFormat() a const function
CameraDevice::toPixelFormat() doesn't change the state of the
CameraDevice. Marks it a const function so that it can be called
in const functions.

Signed-off-by: Hirokazu Honda <hiroh@chromium.org>
Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
Reviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
2020-10-28 15:52:51 +00:00
Hirokazu Honda
3a777d8cc1 android: camera_device: Fix crash of accessing a missing map element
std::map::at() searches std::map by the given key. The commit
e1f9fdb8a5 ("android: camera_device: Remove shadowing FrameBuffer
usage") uses it with 0 to intend to accessing the first element of the
map, but actually access the element whose key is nullptr. This causes
the crash because the map doesn't have the element with nullptr. This
fixes the issue by replacing the std::map::at() operation by
std::map::begin().

Signed-off-by: Hirokazu Honda <hiroh@chromium.org>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
[Kieran: Updated commit message]
Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
2020-10-28 15:52:51 +00:00
Niklas Söderlund
bfd588d1d8 libcamera: v4l2_device: Remove unused set of ret
The last assignment of the ret variable in getControls() is not consumed
so it's unnecessary to set it. This likely originates from a similar
code flow in setControls() where the ret variable is later consumed.

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>
2020-10-28 15:49:21 +01:00
Laurent Pinchart
b86356feee libcamera: camera_manager: Make CameraManager::Private::mutex_ mutable
The mutex_ stored in the CameraManager::Private class is used to protect
members that may need to be accessed from const functions. Make it
mutable to allow this.

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>
Reviewed-by: Paul Elder <paul.elder@ideasonboard.com>
2020-10-28 04:10:18 +02:00
Kieran Bingham
7adf3a0698 libcamera: pipeline: simple: Only connect created converters
If converter_->open() fails, the code deletes the converter_ but then
happily goes on, and at the very next lines will use converter_ to
connect the bufferReady signal.

Ensure the converter is only connected when successfully opened by
extending the conditional and connecting in an else scope instead.

Reported-by: Tomi Valkeinen <tomi.valkeinen@iki.fi>
Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2020-10-27 14:48:46 +00:00
Tomi Valkeinen
7973efcbc0 pipeline: raspberrypi: return an error if setFormat() fails
The method calls setFormat(), stores the return value, but then does not
do anything with the return value. I presume it is meant to fail and
return the error.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@iki.fi>
Reviewed-by: Naushir Patuck <naush@raspberrypi.com>
Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
2020-10-27 14:48:17 +00:00
David Plowman
4a748394e5 libcamera: pipeline: raspberrypi: Implementation of digital zoom
During configure() we update the ScalerCropMaximum to the correct
value for this camera mode and work out the minimum crop size allowed
by the ISP.

Whenever a new ScalerCrop request is received we check it's valid and
apply it to the ISP V4L2 device. When the IPA returns its metadata to
us we add the ScalerCrop information, rescaled to sensor native
pixels.

Signed-off-by: David Plowman <david.plowman@raspberrypi.com>
Reviewed-by: Jacopo Mondi <jacopo@jmondi.org>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2020-10-27 14:09:47 +02:00
David Plowman
63624bc85a libcamera: Add geometry helper functions
These functions are aimed at making it easier to calculate cropping
rectangles, particularly in order to implement digital zoom.

Signed-off-by: David Plowman <david.plowman@raspberrypi.com>
Reviewed-by: Jacopo Mondi <jacopo@jmondi.org>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2020-10-27 00:51:59 +02:00
David Plowman
a16edeb384 libcamera: raspberrypi: Initialise the SensorCropMaximum property
Initialise it to show we support its use, however, set it to all
zeroes to indicate that it's not meaningful yet.

Signed-off-by: David Plowman <david.plowman@raspberrypi.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2020-10-27 00:42:40 +02:00
David Plowman
40c670626f libcamera: Add SensorCropMaximum property
The SensorCropMaximum camera property reports the location of that
part of the image sensor array that can be scaled to produce the
output images, given in native sensor pixels. It will normally change
when a new camera mode is selected, and can be used to implement
digital zoom.

Signed-off-by: David Plowman <david.plowman@raspberrypi.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Jacopo Mondi <jacopo@jmondi.org>
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2020-10-27 00:40:23 +02:00
David Plowman
c1fe17d73e libcamera: Add ScalerCrop control
The ScalerCrop control selects how much of the sensor's active pixel
array will be scaled to form the final output image. It can be used to
implement digital zoom.

Signed-off-by: David Plowman <david.plowman@raspberrypi.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2020-10-27 00:39:00 +02:00
Jacopo Mondi
2c61850e12 android: camera_device: Handle LENS_SHADING_MAP_MODES
Register the ANDROID_STATISTICS_INFO_AVAILABLE_LENS_SHADING_MAP_MODES
static metadata property inspecting the values retuned by the pipeline
handler.

Add one entry and reserve in static metadata pack enough space to
support all the 2 available lens shading map modes Android defines.

Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
Signed-off-by: Jacopo Mondi <jacopo@jmondi.org>
2020-10-26 17:51:56 +01:00
Jacopo Mondi
63336863c9 android: camera_device: Handle COLOR_CORRECTION_ABERRATION_MODE
Register the ANDROID_COLOR_CORRECTION_AVAILABLE_ABERRATION_MODES
static metadata property inspecting the values retuned by the pipeline
handler.

Reserve in the static metadata pack enough space to support all the 3
available color correction aberration modes Android defines.

Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
Signed-off-by: Jacopo Mondi <jacopo@jmondi.org>
2020-10-26 17:51:56 +01:00
Jacopo Mondi
0b5fecc746 android: camera_device: Handle NOISE_REDUCTION_MODES
Register the ANDROID_NOISE_REDUCTION_AVAILABLE_NOISE_REDUCTION_MODES
static metadata property inspecting the values retuned by the pipeline
handler.

Reserve in the static metadata pack enough space to support all the 5
available noise reduction modes Android defines.

Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
Signed-off-by: Jacopo Mondi <jacopo@jmondi.org>
2020-10-26 17:51:56 +01:00
Jacopo Mondi
5d91c8da5c android: camera_device: Report PIPELINE_MAX_DEPTH
Register the ANDROID_REQUEST_PIPELINE_MAX_DEPTH static property
inspecting the value reported by the pipeline handler.

If the Camera does not report any suitable value, default the
static property to 2.

Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
Signed-off-by: Jacopo Mondi <jacopo@jmondi.org>
2020-10-26 17:51:55 +01:00
Jacopo Mondi
4ddaddfc83 libcamera: ipu3: Register camera controls
Register controls for the IPU3 pipeline handler. The only supported
Camera control is currently the pipeline depth control.

Report the minimum and maximum values the pipeline handler supports for
the pipeline processing stages and report for each request the pipeline
depth describing the number of processing steps the frames went through.

Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
Signed-off-by: Jacopo Mondi <jacopo@jmondi.org>
2020-10-26 17:51:55 +01:00
Jacopo Mondi
25a870dbd3 libcamera: control_ids: Remove max values in enumerations
The libcamera control definition schema includes a placeholder
maximum value for each enumeration of supported values.

As it is now possible to create ControlInfo from the list of enumerated
values, it is not necessary to generate the placeholder value anymore.

Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
Signed-off-by: Jacopo Mondi <jacopo@jmondi.org>
2020-10-26 17:51:55 +01:00
Jacopo Mondi
ef7a07dd8a libcamera: controls: Generate an array of valid values
For each Control that supports enumerated values generate an array
of ControlValue which contains the full list of valid values.

At the expense of a slight increase in memory occupation this change
allows the construction of the ControlInfo associated with a Control
from the values list, defaulting the minimum and maximum values
reported by the ControlInfo.

Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
Signed-off-by: Jacopo Mondi <jacopo@jmondi.org>
2020-10-26 17:51:55 +01:00
Jacopo Mondi
6377817f9f libcamera: controls: Construct from valid values
Add a new constructor to the ControlInfo class that allows creating
a class instance from the list of the control valid values with
an optional default one.

Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Jacopo Mondi <jacopo@jmondi.org>
2020-10-26 17:51:54 +01:00
Jacopo Mondi
84e79bd8b5 libcamera: control_ids: Define draft controls
libcamera is in the process of defining its own set of controls
to enable applications to control the image capture process and
return information on the captured frames.

To temporarily close the gap in the Android camera HAL and support all
controls required in the LIMITED hardware level, define a set of Draft
controls whose values are taken from their Android definition, in order
to allow pipeline handlers to support Android.

Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
Signed-off-by: Jacopo Mondi <jacopo@jmondi.org>
2020-10-26 17:51:54 +01:00
Kieran Bingham
89916a486c libcamera: Support draft controls and properties
Extend the control and property framework to support exposing draft
controls and properties in a scoped namespace.

The controls/properties themselves will retain the same ordering in the
relevant enum/id maps - but the access to any draft control will require
explicitly referencing through its' draft:: namespace prefix.

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>
[Added missing hunk in control_ids.cpp.in and changed subject]
Signed-off-by: Jacopo Mondi <jacopo@jmondi.org>
2020-10-26 17:51:54 +01:00
Umang Jain
c430d39d20 android: jpeg: encoder: Use pass-by-value for Exif parameter
Following the reasoning of pass-by-value for libcamera::Span
parameters from 90c193f2a700("android: Modify Encoder interface") i.e.
they are easy to copy/move/construct, align the Exif parameter passing
to the encoder interface in this consistent way.

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: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2020-10-23 22:53:17 +03:00
Umang Jain
f9e7f55f3b android: jpeg: Drop "libcamera::" namespace from functions' arguments
Drop "libcamera::" from functions' arguments for *.cpp files as they
have

	using namespace libcamera;

directive in the beginning.

Signed-off-by: Umang Jain <email@uajain.com>
Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2020-10-23 22:53:17 +03:00
Laurent Pinchart
c77d894a8b libcamera: Declare empty virtual destructors as defaulted
The base class of polymorphic classes is required to declare a
destructor. Several of these are empty, and can thus be declared as
defaulted.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Umang Jain <email@uajain.com>
Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
2020-10-23 22:53:13 +03:00
Laurent Pinchart
ef10997b4a libcamera: media_object: Remove unneeded destructors
The MediaEntity, MediaLink and MediaPad classes don't need custom
destructors. For MediaEntity and MediaPad, the destructors clear a
vector embedded in the classes, which will be done by the default
destructor. For MediaLink, the destructor is already empty. Remove them.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Umang Jain <email@uajain.com>
Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
2020-10-23 22:48:08 +03:00
Laurent Pinchart
d0e665c3ed libcamera: pipeline: simple: Set camera properties
Initialize the CameraData properties with the properties exposed by the
sensor.

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>
Tested-by: Andrey Konovalov <andrey.konovalov@linaro.org>
2020-10-21 22:09:50 +03:00
Laurent Pinchart
8ddaa824ab libcamera: pipeline: Fail match() when no camera is registered
The rkisp1 and simple pipeline handlers can fail to register any camera,
if initialization of all the detected cameras fail. In that case, they
still return success from their match function. As no camera gets
registered, the pipeline handler is immediately destroyed, releasing the
acquired media devices, and the camera manager immediately tries to
match the same pipeline handler with the same media device, causing an
endless loop.

Fix it by returning false from the match function if no camera gets
registered.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Paul Elder <paul.elder@ideasonboard.com>
Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
Reviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
Tested-by: Andrey Konovalov <andrey.konovalov@linaro.org>
Reviewed-by: Jacopo Mondi <jacopo@jmondi.org>
2020-10-21 22:09:50 +03:00
Kieran Bingham
2babedf2b3 qcam: main_window: Explicitly name raw buffer
The buffer obtained for queuing to a raw stream shadows the buffer
passed in for the main view finder stream.

Prevent shadowing, and explicitly name the buffer as a separate variable.

Suggested-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
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>
2020-10-21 17:18:48 +01:00
Kieran Bingham
732ea045f5 cam: options: Rename optional arg to prevent shadowing
The parseValue function is given the optarg directly from the getopt
library, but the function retains the same name.

This causes an shadowed variable of the global optarg variable to be
present in the parseValue function. While this is not harmful, rename it
to work towards disabling shadowed variables.

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>
2020-10-21 17:18:48 +01:00
Kieran Bingham
32d78a7bba v4l2: camera: Prevent shadowing within V4L2Camera::Buffer
Rename the internal member variables to use the post-fixed '_' member
variable naming style. This in turn ensures variable shadowing does not
occur in the member initializer list of the constructor.

Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2020-10-21 17:18:48 +01:00
Kieran Bingham
a3ed067996 android: metadata: Disable -Wshadow
Do not warn on shadowed variables inside the metadata library,
which is directly imported without modifications.

Suggested-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
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>
2020-10-21 17:18:48 +01:00
Kieran Bingham
e1f9fdb8a5 android: camera_device: Remove shadowing FrameBuffer usage
A FrameBuffer *buffer is used to obtain the 'first' buffer from a
request which is used purely to identify the timestamp from the
metadata in two locations.

Rather than keep the FrameBuffer instance around, which then causes
further usages of FrameBuffers to be shadowed, store the timestamp
locally.

Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2020-10-21 17:18:36 +01:00
Kieran Bingham
37c18c2eec android: camera_device: use member style on Camera3RequestDescriptor
Use the postfixed '_' member variable naming style for the
Camera3RequestDescriptor structure, which in turn ensures that variable
shadowing does not occur in the member initializer list of the
constructor.

Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2020-10-21 17:01:40 +01:00
Kieran Bingham
c7bcae02a0 android: camera_device: Use existing variable definitions
Prevent variable shadowing by removing the redeclaration of variables
with the same name (and type) where the existing variable can be reused.

Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2020-10-21 17:01:28 +01:00
Kieran Bingham
bf104042f9 ipa: raspberrypi: Re-use iterator variable
The function gauss_seidel2_SOR() makes use of a function scoped iterator
'i', for several loops, and has a precedence of re-using the function
scoped iterator declaration in the majority of cases, except the first
where it is declared in the loop scope before the function scope, and
later which aliases a new declaration.

Re-use the existing iterator variable for consistency, and to prevent
variable aliasing.

Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
Reviewed-by: David Plowman <david.plowman@raspberrypi.com>
Reviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
2020-10-21 16:15:41 +01:00
Kieran Bingham
1021b42823 libcamera: v4l2_videodevice: Prevent shadowing of V4L2BufferCache members
The members free, and lastUsed were not following the libcamera coding
style, and were producing a shadowed parameter on the construction.

Rename them to be marked as member variables with the _ postfix
accordingly.

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>
2020-10-21 16:15:41 +01:00
Kieran Bingham
d55f6a8037 libcamera: pipeline: rpi_stream: Explicitly name requestBuffer
The FrameBuffer used to track any addition to the request in an
under-run event was shadowed against the returned buffer, being placed
back on the availableBuffers_ queue.

Rename the shadowed variable to be more explicit that it is a separate
Buffer.

Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
Reviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
2020-10-21 16:15:41 +01:00
Kieran Bingham
4bd8d15f96 libcamera: pipeline: Use existing variable definitions
Prevent variable shadowing by removing the redeclaration of variables
with the same name (and type) where the existing variable can be reused.

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>
2020-10-21 16:15:40 +01:00
Kieran Bingham
d3f60c8458 libcamera: pipeline: Prevent variable shadowing
Remove variable shadowing within the pipeline handler implementations.

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>
2020-10-21 16:15:40 +01:00
Kieran Bingham
f4c234579b libcamera: thread: Prevent shadowing of signal name
The Thread::wait() function creates a boolean flag 'finished' which
shadows the internal member signal of the same name.

Rename the boolean flag to prevent confusion and shadowing of the signal.

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>
2020-10-21 16:15:40 +01:00
Hirokazu Honda
bb27fbf253 android: camera_stream: Make some member variables constant
CameraStream initializes several member variables in the
initializer list. Some of them are unchanged after. This makes
them constant. Especially, doing to |cameraDevice_| represents
CameraStream doesn't have the ownership of it.

Signed-off-by: Hirokazu Honda <hiroh@chromium.org>
Reviewed-by: Umang Jain <email@uajain.com>
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>
2020-10-21 11:18:12 +01:00
Hirokazu Honda
79bca4300b android: post_processor_jpeg: Make |cameraDevice_| constant
PostProcessorJpeg doesn't have the ownership of CameraDevice given
in the constructor. To clarify it, this makes the member variable
constant.

Signed-off-by: Hirokazu Honda <hiroh@chromium.org>
Reviewed-by: Umang Jain <email@uajain.com>
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>
2020-10-21 11:18:12 +01:00
Hirokazu Honda
90c193f2a7 android: Modify Encoder interface
In Encoder::encode(), the |source| argument doesn't have to be a
pointer. This replaces its type, const pointer, with const
reference as the latter is preferred to the former.
libcamera::Span is cheap to construct/copy/move. We should deal
with the type as pass-by-value parameter. Therefore this also
drops the const reference in the |destination| argument.

Signed-off-by: Hirokazu Honda <hiroh@chromium.org>
Reviewed-by: Umang Jain <email@uajain.com>
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>
2020-10-21 11:18:12 +01:00
Hirokazu Honda
b8dd5ce944 android: Modify PostProcessor interface
In PostProcessor::process(), the |source| argument doesn't have
to be a pointer. This replaces its type, const pointer, with
const reference as the latter is preferred to the former.
libcamera::Span is cheap to construct/copy/move. We should deal
with the type as pass-by-value parameter. Therefore this also
drops the const reference in the |destination| argument.

Signed-off-by: Hirokazu Honda <hiroh@chromium.org>
Reviewed-by: Umang Jain <email@uajain.com>
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>
2020-10-21 11:18:12 +01:00
Laurent Pinchart
88919c1e17 libcamera: Document the libcamera namespace
The libcamera namespace has been left undefined from the start. While
the documentation doesn't bring much added value, leaving it out
confuses the most recent doxygen master branch:

include/libcamera/transform.h:16: warning: Internal inconsistency: member Identity does not belong to any container!
include/libcamera/transform.h:17: warning: Internal inconsistency: member Rot0 does not belong to any container!
include/libcamera/transform.h:18: warning: Internal inconsistency: member HFlip does not belong to any container!
include/libcamera/transform.h:19: warning: Internal inconsistency: member VFlip does not belong to any container!
include/libcamera/transform.h:20: warning: Internal inconsistency: member HVFlip does not belong to any container!
include/libcamera/transform.h:21: warning: Internal inconsistency: member Rot180 does not belong to any container!
include/libcamera/transform.h:22: warning: Internal inconsistency: member Transpose does not belong to any container!
include/libcamera/transform.h:23: warning: Internal inconsistency: member Rot270 does not belong to any container!
include/libcamera/transform.h:24: warning: Internal inconsistency: member Rot90 does not belong to any container!
include/libcamera/transform.h:26: warning: Internal inconsistency: member Rot180Transpose does not belong to any container!

Document it.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Paul Elder <paul.elder@ideasonboard.com>
Reviewed-by: Umang Jain <email@uajain.com>
Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
2020-10-20 13:41:37 +03:00
Laurent Pinchart
7a671fb40b libcamera: Place doxygen \file block above namespace
Make the whole code base consistent by placing the doxygen \file block
above the libcamera namespace opening. There's a single offender, and
two locations in which a white line is missing.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Paul Elder <paul.elder@ideasonboard.com>
Reviewed-by: Umang Jain <email@uajain.com>
Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
2020-10-20 13:41:33 +03:00
Laurent Pinchart
00aa3ac82e ipa: Rename ipa_vimc.h to vimc.h
To be consistent with the other pipeline handlers that don't prefix
their IPA protocol header with ipa_, rename ipa_vimc.h to vimc.h.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Paul Elder <paul.elder@ideasonboard.com>
Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
2020-10-20 13:19:15 +03:00
Hirokazu Honda
766eae4532 ipa: Omit extra semicolon
There is the unnecessary semicolon after ipaCreate() in
raspberrypi.cpp. This removes it.

Signed-off-by: Hirokazu Honda <hiroh@chromium.org>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2020-10-20 13:15:55 +03:00