summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2021-01-18libcamera: camera_sensor: Provide fall-back for sensor propertiesJacopo Mondi
Support for the V4L2 selection API is currently optional in the CameraSensor class. Properties registered by using values read through that API are defaulted in several different places (the Android camera HAL or the CameraSensor class). In the future support for the selection API will be made mandatory, but to give time to sensor drivers in all test platforms to be updated, use sensor resolution as fallback values for sensor pixel array properties and cache them as class member variables. 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>
2021-01-18libcamera: camera_sensor: Validate driver supportJacopo Mondi
The CameraSensor class requires the sensor driver to report information through V4L2 controls and through the V4L2 selection API, and uses that information to register Camera properties and to construct CameraSensorInfo class instances to provide them to the IPA. Currently, validation of the kernel support happens each time a feature is requested, with slighly similar debug/error messages output to the user in case a feature is not supported. Rationalize this by validating the sensor driver requirements in a single function Reviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Paul Elder <paul.elder@ideasonboard.com> Signed-off-by: Jacopo Mondi <jacopo@jmondi.org>
2021-01-18libcamera: Document sensor driver requirementsJacopo Mondi
Document the feature an image sensor driver has to provide to be fully libcamera-compliant. 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>
2021-01-13libcamera: sysfs: Fix directory exists checkNiklas Söderlund
The scope of File::exists() was changed to only validate that a file exists and is therefore not usable to check if a directory exists. This breaks the persistent name generation for DT based systems as it uses File::exists() to check for directories, fix this by using stat() directly. On Scarlet the persistent names of the cameras are impacted by this and where incorrectly reported as: $ cam -l Available cameras: 1: Internal front camera (platform/ff160000.i2c/i2c-7/7-003c ov2685) 2: Internal front camera (platform/ff160000.i2c/i2c-7/7-0036 ov5695 While the expected ones are restored with this fix: $ cam -l Available cameras: 1: Internal front camera (/base/i2c@ff160000/camera@3c) 2: Internal front camera (/base/i2c@ff160000/camera@36) Fixes: 8f4e16f014c820a0 ("test: file: Check that directories are not treated as files") 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>
2021-01-12libcamera: pipelines: ipu3: Simplify error bail out path on start()Umang Jain
On the bail out path, always ensure that ImgU and CIO2 are stopped before freeing the buffers. V4L2VideoDevice class guarantees that calling stop() without having to call start() is harmless, hence use this guarantee to simplify error paths. 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>
2021-01-12libcamera: v4l2_videodevice: Track streaming stateKieran Bingham
Track the state of streamon/streamoff calls to simplify error paths. Ensuring that streamOff() can be called on non-streaming streams facilitates simpler error code paths, where a set of devices can all call streamOff regardless of their initialisation state. Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com> 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: Kieran Bingham <kieran.bingham@ideasonboard.com>
2021-01-05libcamera: camera: Fix-typoSebastian Fricke
s/chance/change/ Signed-off-by: Sebastian Fricke <sebastian.fricke.linux@gmail.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>
2021-01-04android: camera_device: Only advertise RAW support if RAW16 is availableNiklas Söderlund
The Android camera2 API defines a RAW capture capability ([1]) for devices that support "outputting RAW buffers and metadata for interpreting them". This capability requires the camera device to support RAW_SENSOR ([2]) as an output format. Despite what its name may sound like, the RAW_SENSOR format is defined as a 16 bits RAW format, not an opaque implementation-dependent format (which is instead called RAW_PRIVATE). Devices may additionally support the RAW10 and RAW12 formats, but that isn't enough to claim RAW capture capability. To comply with the API requirements, only report the ANDROID_REQUEST_AVAILABLE_CAPABILITIES_RAW capability when 16-bit RAW is supported. [1] https://developer.android.com/reference/android/hardware/camera2/CameraMetadata#REQUEST_AVAILABLE_CAPABILITIES_RAW [2] https://developer.android.com/reference/android/graphics/ImageFormat#RAW_SENSOR Suggested-by: Jacopo Mondi <jacopo@jmondi.org> Signed-off-by: Niklas Söderlund <niklas.soderlund@ragnatech.se> Tested-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2020-12-30src: meson: Simplify v4l2 enablementKieran Bingham
Simplify the src level meson file by moving the declaration of the v4l2 subdir to match the other invocations, making use of 'subdir_done()' to break out if the adaptation layer is not enabled. Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com> Reviewed-by: Jacopo Mondi <jacopo@jmondi.org> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2020-12-30src: meson: Re-order subdir layoutKieran Bingham
Move the android subdir below the configuration options to keep all subdirs together. Add a comment explaining why android must come first, and some padding to group the libcamera and ipa components, applications, and remaining adaptation layers. Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com> Reviewed-by: Jacopo Mondi <jacopo@jmondi.org> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2020-12-30meson: test: Simplify top level mesonKieran Bingham
Utilise the subdir_done() functionality as is used with other optional components to simplify the top level meson file. Suggested-by: Jacopo Mondi <jacopo@jmondi.org> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
2020-12-30libcamera: file: Check files exist()Kieran Bingham
Ensure that when we check for existence with File() it will only return if the path leads to a file, and not a directory. Device nodes which could still be opened by this class are still supported. Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se> Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
2020-12-30test: file: Check that directories are not treated as filesKieran Bingham
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-30android: camera_device: Simplify properties.get()Jacopo Mondi
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-30android: camera_device: Report ColorFilterArrangementJacopo Mondi
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-30libcamera: camera_sensor: Register ColorFilterArrangementJacopo Mondi
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-30libcamera: bayer_format: Add support for mbus codesJacopo Mondi
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-30libcamera: properties: ColorFilterArrangement draft propertyJacopo Mondi
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-29utils: checkstyle.py: Drop astyle supportLaurent Pinchart
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-29utils: checkstyle.py: Add header add checkerLaurent Pinchart
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 b3383da79f1d --------------------------------------------------------------------------------- b3383da79f1d513b0d76db220a7104e1c1035e30 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-29utils: checkstyle.py: Add commit checkersLaurent Pinchart
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-29utils: checkstyle.py: Move diff parsing to Commit classLaurent Pinchart
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-29utils: checkstyle.py: Add ability to filter files by status in a commitLaurent Pinchart
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-29utils: checkstyle.py: Make title and files properties of commit classLaurent Pinchart
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-29utils: checkstyle.py: Move commit handling to a separate sectionLaurent Pinchart
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-29utils: checkstyle.py: Factor out automatic class registryLaurent Pinchart
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-29utils: checkstyle.py: Drop arguments to super() when possibleLaurent Pinchart
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-28libcamera: pipeline_handler: Remove Camera pointer from CameraDataNiklas Söderlund
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-28libcamera: pipeline_handler: Remove Camera argument from request handlingNiklas Söderlund
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-27Documentation: Fix Doxygen exclusion of details namespacesLaurent Pinchart
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-27Documentation: Restore alphabetical order of sources in meson.buildLaurent Pinchart
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-27Documentation: Add descriptions for environment variablesSebastian Fricke
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-27libcamera: pipeline: simple: Remove the unused configs_ variablePhi-Bang Nguyen
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-27libcamera: bound_method: Fix enumerators documentationLaurent Pinchart
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-27Documentation: Drop deprecated Doxygen COLS_IN_ALPHA_INDEX optionLaurent Pinchart
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-27libcamera: Add missing internal include headers to meson.buildLaurent Pinchart
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-27utils: gen-controls: Fix enumerators documentationLaurent Pinchart
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-20ipa: raspberrypi: Add digital gain to libcamera metadataDavid Plowman
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-20libcamera: controls: Add DigitalGain controlDavid Plowman
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-18libcamera: pipeline: simple: Remove non-implemented methodsJacopo Mondi
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-18android: camera_device: Report number of out streamsJacopo Mondi
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-18android: camera_device: Report pipeline depthJacopo Mondi
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-16ipa: raspberrypi: Only validate ISP and sensor control during configureNaushir Patuck
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-16ipa: raspberrypi: Rename unicamCtrls_ to sensorCtrls_Naushir Patuck
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-14libcamera: pipeline: Manage resources with std::unique_ptr<>Laurent Pinchart
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-14libcamera: pipeline: vimc: Use V4L2*::fromEntityName() where possibleLaurent Pinchart
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-14libcamera: pipeline: raspberrypi: Don't leak RPiCameraData::sensor_Laurent Pinchart
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: 740fd1b62f67 ("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-14libcamera: Replace ARRAY_SIZE() with std::size()Laurent Pinchart
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-14android: camera_device: Replace auto with explicit typeLaurent Pinchart
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-14android: camera_device: Temporary fix sensor propertiesJacopo Mondi
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 1889cdc2e91c ("android: camera_device: Initialize pixel array properties") Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Jacopo Mondi <jacopo@jmondi.org>