Commit graph

2121 commits

Author SHA1 Message Date
Kieran Bingham
8f4e16f014 test: file: Check that directories are not treated as files
Directories can not be opened as a file, so the exists() check should
not return true for a path which points to a directory.

Directories are not handled by the File class.

Reviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
2020-12-30 13:03:54 +00:00
Jacopo Mondi
0ed0532457 android: camera_device: Simplify properties.get()
When accessing the value of a property by reading the properties
ControlList content with ControlList::get<>() it is not necessary to
specify the template type as it is already conveyed by the Control
instance provided as first argument.

Reviewed-by: Paul Elder <paul.elder@ideasonboard.com>
Reviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Jacopo Mondi <jacopo@jmondi.org>
2020-12-30 11:22:53 +01:00
Jacopo Mondi
cb35ed23f3 android: camera_device: Report ColorFilterArrangement
Conditionally report the ANDROID_SENSOR_INFO_COLOR_FILTER_ARRANGEMENT
property inspecting the draft property reported by the libcamera Camera.

Reviewed-by: Paul Elder <paul.elder@ideasonboard.com>
Reviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Jacopo Mondi <jacopo@jmondi.org>
2020-12-30 11:22:52 +01:00
Jacopo Mondi
0a0264da8d libcamera: camera_sensor: Register ColorFilterArrangement
Inspect the list of media bus codes supported by the camera sensor
in order to deduce the color filter arrangement and register the
ColorFilterArrangement draft property.

Reviewed-by: Paul Elder <paul.elder@ideasonboard.com>
Reviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Jacopo Mondi <jacopo@jmondi.org>
2020-12-30 11:22:52 +01:00
Jacopo Mondi
1c0096d751 libcamera: bayer_format: Add support for mbus codes
The existing implementation of the BayerFormat class supports
converting a V4L2PixelFormat to a BayerFormat and vice-versa.

Expand the class by adding support for converting a media bus code
to a BayerFormat instance, by providing a conversion table and a
dedicated static methods.

Do not provide support for converting a BayerFormat to a media bus code
as there's no 1-to-1 mapping between the two.

Reviewed-by: Paul Elder <paul.elder@ideasonboard.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
Signed-off-by: Jacopo Mondi <jacopo@jmondi.org>
2020-12-30 11:22:52 +01:00
Jacopo Mondi
5d3d0dcedb libcamera: properties: ColorFilterArrangement draft property
Define the 'ColorFilterArrangement' draft property. The property is
currently identical to ANDROID_SENSOR_INFO_COLOR_FILTER_ARRANGEMENT.

Reviewed-by: Paul Elder <paul.elder@ideasonboard.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Jacopo Mondi <jacopo@jmondi.org>
2020-12-30 11:22:52 +01:00
Laurent Pinchart
b7704820f4 utils: checkstyle.py: Drop astyle support
Formatting code using astyle doesn't lead to results as good as with
clang-format, and doesn't receive much test coverage as most developers
use clang-format. The code is thus bitrotting. Drop it.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
Reviewed-by: Paul Elder <paul.elder@ideasonboard.com>
2020-12-29 16:45:36 +02:00
Laurent Pinchart
8fffab46b8 utils: checkstyle.py: Add header add checker
Add a commit checker that ensures that all header files added to the
libcamera includes (public or internal) are accompanied by a
corresponding update of the meson.build file in the same directory.

Here's the output of the new checker when run against a commit that
forgot to update meson.build.

    $ ./utils/checkstyle.py b3383da79f
    ---------------------------------------------------------------------------------
    b3383da79f libcamera: buffer: Create a MappedBuffer
    ---------------------------------------------------------------------------------
    Header include/libcamera/internal/buffer.h added without corresponding update to include/libcamera/internal/meson.build
    ---
    1 potential issue detected, please review

In theory we could extend the checker to cover .cpp files too, but the
issue will be quite noticeable as meson won't build the file if
meson.build isn't updated. Header files are more tricky as problems
would only occur at when installing the headers (for public headers), or
would result in race conditions in the build. Both of those issues are
harder to catch.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
2020-12-29 16:45:35 +02:00
Laurent Pinchart
bf7981f2bc utils: checkstyle.py: Add commit checkers
Add a new category of checkers that operate on a whole commit.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
2020-12-29 16:45:35 +02:00
Laurent Pinchart
ba3278a749 utils: checkstyle.py: Move diff parsing to Commit class
To avoid duplicating diff parsing in commit checkers, move it to the
Commit class.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
2020-12-29 16:45:33 +02:00
Laurent Pinchart
fc91951250 utils: checkstyle.py: Add ability to filter files by status in a commit
A commit can perform different operations on a file. Record the file
status (added, modified, renamed, deleted, ...) and add the ability to
filter files by status when listing the files touched by a commit.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
2020-12-29 16:45:32 +02:00
Laurent Pinchart
4f5d17f3a4 utils: checkstyle.py: Make title and files properties of commit class
Make the API of the Commit class more explicit by exposing the title and
files as properties instead of through a get_info() method.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
Reviewed-by: Paul Elder <paul.elder@ideasonboard.com>
2020-12-29 16:45:31 +02:00
Laurent Pinchart
097720840a utils: checkstyle.py: Move commit handling to a separate section
To prepare for checkers that operate directly on commits, move the
related classes to a separate section. No functional change is included.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
Reviewed-by: Paul Elder <paul.elder@ideasonboard.com>
2020-12-29 16:45:30 +02:00
Laurent Pinchart
86efa9c7e9 utils: checkstyle.py: Factor out automatic class registry
The style checkers and formatters duplicate automatic class registry
code. Factor it out to a common ClassRegistry helper class. The list of
subclasses is moved to a class member variable of the auto-registered
base class type.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
2020-12-29 16:45:28 +02:00
Laurent Pinchart
b402734e5a utils: checkstyle.py: Drop arguments to super() when possible
The super() call is a shortcut syntax for super(__class__, <first arg>).
Drop the arguments when they match the default.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
Reviewed-by: Paul Elder <paul.elder@ideasonboard.com>
2020-12-29 16:45:28 +02:00
Niklas Söderlund
6ef7eddfd4 libcamera: pipeline_handler: Remove Camera pointer from CameraData
There are no users left of this field, drop it.

Signed-off-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Jacopo Mondi <jacopo@jmondi.org>
2020-12-28 14:02:13 +01:00
Niklas Söderlund
8992b3ffbb libcamera: pipeline_handler: Remove Camera argument from request handling
There is no need to pass the Camera pointer to queueRequest(),
completeBuffer() and completeRequest() as the Request also passed
contains the same information. Remove the Camera argument to avoid
situations where the information in the Request and the argument differ.

There is no functional change and no public API change as the interface
is only used between the Camera and PipelineHandler.

Signed-off-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
Reviewed-by: Jacopo Mondi <jacopo@jmondi.org>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2020-12-28 14:02:13 +01:00
Laurent Pinchart
67bf6bc459 Documentation: Fix Doxygen exclusion of details namespaces
The details namespaces in libcamera are used to hide implementation
details, and should thus be excluded from documentation generation. This
is done incorrectly by specifying the exclusion pattern "*::details::*"
which will ignore all namespaces and types in any details namespace, but
won't ignore functions. Fix it by removing the trailing "::*", causing
Doxygen to ignore the namespace itself, and thus all its contents.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
2020-12-27 12:29:26 +02:00
Laurent Pinchart
dd1473d763 Documentation: Restore alphabetical order of sources in meson.build
Sort the docs_sources variable in Documentation/meson.build to ease
maintenance.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
2020-12-27 12:29:12 +02:00
Sebastian Fricke
3fde82d849 Documentation: Add descriptions for environment variables
Describe the environment variables used in libcamera, excluded
variables are `LIBCAMERA_IPA_FORCE_C_API` and `LIBCAMERA_IPA_PROXY_PATH`,
the former because it is likely to be removed and the later because
it has no current use-case.

Add a brief explanation for the IPA configuration and IPA modules.
List all the available Log levels and categories and add a short guide
on how to use them for debugging.

Signed-off-by: Sebastian Fricke <sebastian.fricke.linux@gmail.com>
Reviewed-by: Jacopo Mondi <jacopo@jmondi.org>
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-12-27 12:29:05 +02:00
Phi-Bang Nguyen
d769cbb834 libcamera: pipeline: simple: Remove the unused configs_ variable
Remove the unused configs_ member variable in SimpleCameraData.

Signed-off-by: Phi-Bang Nguyen <pnguyen@baylibre.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
2020-12-27 12:28:45 +02:00
Laurent Pinchart
0d70289bc3 libcamera: bound_method: Fix enumerators documentation
The Doxygen documentation for enumerators of the ConnectionType
enumeration prefixes the enumerator name with the enumeration name. For
unscoped enumerations, this is incorrect. Drop the scope. This fixes
warnings produced by Doxygen when multiple enumerators with identical
names are defined in different scopes.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
2020-12-27 12:28:34 +02:00
Laurent Pinchart
489a861f17 Documentation: Drop deprecated Doxygen COLS_IN_ALPHA_INDEX option
The Doxygen COLS_IN_ALPHA_INDEX option is deprecated, and generates a
warning with the Doxygen's master branch. Drop it.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Tested-by: Umang Jain <email@uajain.com>
Reviewed-by: Umang Jain <email@uajain.com>
Reviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
2020-12-27 12:28:24 +02:00
Laurent Pinchart
d96e6cbf1a libcamera: Add missing internal include headers to meson.build
include/libcamera/internal/meson.build is missing two internal headers.
Fix it.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Umang Jain <email@uajain.com>
Reviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
2020-12-27 12:28:10 +02:00
Laurent Pinchart
9c89de6617 utils: gen-controls: Fix enumerators documentation
The Doxygen documentation for enumerators prefixes the enumerator name
with the enumeration name. For unscoped enumerations, this is incorrect.
Drop the scope. This fixes warnings produced by Doxygen when multiple
enumerators with identical names are defined in different scopes.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Tested-by: Jacopo Mondi <jacopo@jmondi.org>
Reviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
2020-12-27 12:28:00 +02:00
David Plowman
50ec902aa8 ipa: raspberrypi: Add digital gain to libcamera metadata
The digital gain reported by the AGC algorithm is reported in the
metadata that is included in completed requests.

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-12-20 05:04:05 +02:00
David Plowman
b4d21c62d1 libcamera: controls: Add DigitalGain control
This control reports the global digital gain applied by the pipeline
as a whole, after capturing a raw image from the sensor.

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-12-20 05:00:00 +02:00
Jacopo Mondi
bcbd9fed8f libcamera: pipeline: simple: Remove non-implemented methods
The initLinks() and createCamera() methods are declared but never
defined. Remove them.

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: Jacopo Mondi <jacopo@jmondi.org>
2020-12-18 18:05:20 +01:00
Jacopo Mondi
eec6c54134 android: camera_device: Report number of out streams
Report the number of supported output streams through the
ANDROID_REQUEST_MAX_NUM_OUTPUT_STREAMS static metadata.

The camera HAL currently supports:
- 1 optional RAW stream
- 2 YUV streams
- 1 JPEG stream

Reviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
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-12-18 17:48:49 +01:00
Jacopo Mondi
3535e0c104 android: camera_device: Report pipeline depth
Report the pipeline depth in the capture results if the pipeline
reports it.

Reviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
Signed-off-by: Jacopo Mondi <jacopo@jmondi.org>
2020-12-18 17:48:31 +01:00
Naushir Patuck
f5e80e609c ipa: raspberrypi: Only validate ISP and sensor control during configure
There is no need to validate all the ISP and sensor V4L2 control on
every use. Simply validate them once during the IPA configuration, and
fail if a required control is not available.

Signed-off-by: Naushir Patuck <naush@raspberrypi.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-12-16 03:46:00 +02:00
Naushir Patuck
fdedaaf902 ipa: raspberrypi: Rename unicamCtrls_ to sensorCtrls_
These specific controls are part of the sensor device, so rename them
appropriately.

Signed-off-by: Naushir Patuck <naush@raspberrypi.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-12-16 03:45:15 +02:00
Laurent Pinchart
3129fcae43 libcamera: pipeline: Manage resources with std::unique_ptr<>
Replace manual resource destruction with std::unique_ptr<> where
applicable. This removes the need for several destructors.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Paul Elder <paul.elder@ideasonboard.com>
2020-12-14 15:46:04 +02:00
Laurent Pinchart
1c2b54a017 libcamera: pipeline: vimc: Use V4L2*::fromEntityName() where possible
Replace manual construction of V4L2VideoDevice and V4L2Subdevide with
the fromEntityName() helper where possible. The returned pointer is
managed as a std::unique_ptr<>, which simplifies the VimcCameraData
destructor.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Paul Elder <paul.elder@ideasonboard.com>
2020-12-14 15:46:03 +02:00
Laurent Pinchart
cd4636c14f libcamera: pipeline: raspberrypi: Don't leak RPiCameraData::sensor_
The CameraSensor instance stored in RPiCameraData::sensor_ is allocated
dynamically and never deleted. Fix the memory leak by storing it in a
std::unique_ptr<>.

Fixes: 740fd1b62f ("libcamera: pipeline: Raspberry Pi pipeline handler")
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Naushir Patuck <naush@raspberrypi.com>
Reviewed-by: Paul Elder <paul.elder@ideasonboard.com>
2020-12-14 15:45:58 +02:00
Laurent Pinchart
5cfbbcd207 libcamera: Replace ARRAY_SIZE() with std::size()
C++17 has a std::size() function that returns the size of a C-style
array. Use it instead of the custom ARRAY_SIZE macro.

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: Jacopo Mondi <jacopo@jmondi.org>
2020-12-14 15:35:24 +02:00
Laurent Pinchart
bd4894d259 android: camera_device: Replace auto with explicit type
The auto keyword facilitates writing code. It avoids typing out very
long types, which can make the code more readable, but it can also have
a negative impact on readability as it requires the reader (including
reviewers) to look up the type of the variable.

Replace one occurrence of auto with the explicit type where doing so
doesn't require a long type name.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Hirokazu Honda <hiroh@chromium.org>
Reviewed-by: Jacopo Mondi <jacopo@jmondi.org>
2020-12-14 15:35:03 +02:00
Jacopo Mondi
008f2a55d1 android: camera_device: Temporary fix sensor properties
The ChromeOS camera service, which is the current main user of the
Android Camera HAL, fails to start if the pixel array properties are
not registered.

As the sensor driver for the Soraka test device have not yet been
updated to report their pixel array properties through the V4L2
selection API, temporary fix the gap by re-establishing the default
properties values removed by commit 1889cdc2e9 ("android: camera_device:
Initialize pixel array properties")

Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Jacopo Mondi <jacopo@jmondi.org>
2020-12-14 08:39:03 +01:00
David Plowman
aaeee427b0 ipa: raspberrypi: Move initial frame drop decision to AGC/AWB
Previously the CamHelper was returning the number of frames to drop
(on account of AGC/AWB converging). This wasn't really appropriate,
it's better for the algorithms to do it as they know how many frames
they might need.

The CamHelper::HideFramesStartup method should now just be returning
the number of frames to hide because they're bad/invalid in some way,
not worrying about the AGC/AWB. For many sensors, the correct value
for this is zero. But the ov5647 needs updating as it must return 2.

Signed-off-by: David Plowman <david.plowman@raspberrypi.com>
Reviewed-by: Naushir Patuck <naush@raspberrypi.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2020-12-11 23:31:27 +02:00
David Plowman
4cd283acd0 ipa: raspberrypi: Estimate the colour temerature if starting with fixed colour gains
When the AWB is started from "cold" with fixed colour gains, we try to
estimate the colour temperature this corresponds to (if a calibrated
CT curve was supplied). When fixed colour gains are set after the AWB
has been running, we leave the CT estimate alone, as the one we have
is probably sensible.

This estimated colour is passed out in the metadata for other
algorithms - notably ALSC - to use.

Signed-off-by: David Plowman <david.plowman@raspberrypi.com>
Reviewed-by: Naushir Patuck <naush@raspberrypi.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2020-12-11 23:31:25 +02:00
David Plowman
1a6a7d4a8e ipa: raspberrypi: Compute inverse of piecewise linear function
Add a method to the piecewise linear function (Pwl) class to compute
the inverse of a given Pwl. If the input function is non-monotonic we
can only produce a best effort "pseudo" inverse, and we signal this to
the caller.

Signed-off-by: David Plowman <david.plowman@raspberrypi.com>
Reviewed-by: Naushir Patuck <naush@raspberrypi.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2020-12-11 23:31:23 +02:00
David Plowman
dbcf4d8247 ipa: raspberrypi: awb: Add GetConvergenceFrames method to AWB base class
We add a GetConvergenceFrames method to the AwbAlgorithm class which
can be called when the AWB is started from scratch. It suggests how
many frames should be dropped before displaying any (while the AWB
converges).

The Raspberry Pi specific implementation makes this customisable from
the tuning file.

Signed-off-by: David Plowman <david.plowman@raspberrypi.com>
Reviewed-by: Naushir Patuck <naush@raspberrypi.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2020-12-11 23:31:21 +02:00
David Plowman
748f48a006 ipa: raspberrypi: agc: Add GetConvergenceFrames method to AGC base class
We add a GetConvergenceFrames method to the AgcAlgorithm class which
can be called when the AGC is started from scratch. It suggests how
many frames should be dropped before displaying any (while the AGC
converges).

The Raspberry Pi specific implementation makes this customisable from
the tuning file.

Signed-off-by: David Plowman <david.plowman@raspberrypi.com>
Reviewed-by: Naushir Patuck <naush@raspberrypi.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2020-12-11 23:31:19 +02:00
David Plowman
10bcc51ca3 libcamera: pipeline: raspberrypi: Pass the drop frame count in start, not configure
The number of frames to drop (not display) is passed back now from the
start method, not configure. This means applications have a chance to
set fixed exposure/gain before starting the camera and this can affect
the frame drop count that is returned.

Note how we need to be able to tell the very first time we start the
camera from subsequent restarts, hence addition of the "firstStart_"
flag.

Both the IPA implementation file and the pipeline handler need
matching modifications.

Signed-off-by: David Plowman <david.plowman@raspberrypi.com>
Reviewed-by: Naushir Patuck <naush@raspberrypi.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2020-12-11 23:31:13 +02:00
David Plowman
a93775cab6 libcamera: pipeline: raspberrypi: Allow ScalerCrop to work when passed in Camera::start
The ScalerCrop control is handled by the pipeline handler, not the
IPA, so must be handled explicitly in the Camera::start method. The
ScalerCrop code used when processing requests has been factored out to
make it easy to reuse.

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-12-11 23:31:10 +02:00
Hirokazu Honda
26d90af082 android: camera_device: Reorder configurations before requesting
This reorders Camera3Configs before executing
CameraConfiguration::validate() to make it easier for the Camera
to satisfy the Android framework request.

Signed-off-by: Hirokazu Honda <hiroh@chromium.org>
Reviewed-by: Jacopo Mondi <jacopo@jmondi.org>
Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
Reviewed-by: Umang Jain <email@uajain.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>

Add blank line and fix compilation on gcc 7.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2020-12-11 15:10:49 +02:00
Hirokazu Honda
2bc6ba2e1f android: camera_device: Use Camera3StreamConfig in configureStreams()
Use the newly introduced Camera3StreamConfig to associate the
Android requested streams with the associated StreamConfiguration
in a vector of configurations.

This change prepares to sort the vector of configuration before using
it to configure the Camera and populate the streams_ vector.

No functional changes intended.

Signed-off-by: Hirokazu Honda <hiroh@chromium.org>
Reviewed-by: Jacopo Mondi <jacopo@jmondi.org>
Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
Reviewed-by: Umang Jain <email@uajain.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2020-12-11 14:13:38 +02:00
Hirokazu Honda
c2df74364f android: camera_device: Introduce Camera3StreamConfig
Camera3StreamConfig is a new class to store camera3_stream and
types with associated StreamConfiguration.

Signed-off-by: Hirokazu Honda <hiroh@chromium.org>
Reviewed-by: Jacopo Mondi <jacopo@jmondi.org>
Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
Reviewed-by: Umang Jain <email@uajain.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2020-12-11 14:12:35 +02:00
Laurent Pinchart
e638ffde53 libcamera: v4l2_device: Return a unique pointer from fromEntityName()
The fromEntityName() function returns a pointer to a newly allocated
V4L2Device instance, which must be deleted by the caller. This opens the
door to memory leaks. Return a unique pointer instead, which conveys the
API semantics better than a sentence in the documentation.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
Reviewed-by: Jacopo Mondi <jacopo@jmondi.org>
2020-12-09 11:26:25 +02:00
Laurent Pinchart
ff2ee0174c libcamera: v4l2_subdevice: Return a unique pointer from fromEntityName()
The fromEntityName() function returns a pointer to a newly allocated
V4L2Subdevice instance, which must be deleted by the caller. This opens
the door to memory leaks. Return a unique pointer instead, which conveys
the API semantics better than a sentence in the documentation.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
Reviewed-by: Jacopo Mondi <jacopo@jmondi.org>
2020-12-09 11:26:13 +02:00