summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2022-08-03libcamera: formats: Merge V4L2 single and multi formatsJacopo Mondi
To each libcamera PixelFormat two V4L2 formats are associated, the 'single' and 'multi' format variants. The two versions list plane contiguous and non-contiguous format variants, and an optional argument to V4L2PixelFormat::fromPixelFormat() was used to select which one to pick. In order to prepare to remove V4L2PixelFormat::fromPixelFormat(), and considering that no caller in the codebase uses the non-contiguous format variant, merge the two formats vectors in a single one and default the selection to the first available one, which is functionally equivalent to what is currently implemented. Signed-off-by: Jacopo Mondi <jacopo@jmondi.org> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Tested-by: Paul Elder <paul.elder@ideasonboard.com>
2022-08-03libcamera: formats: Reimplement V4L2 PixelFormatInfo::info()Jacopo Mondi
The PixelFormatInfo::info(const V4L2PixelFormat &format) function returns the PixelFormatInfo associated with a V4L2 pixel format. As the pixelFormatInfo map is indexed using PixelFormat and a V4L2 format can easily be converted to a PixelFormat, simply return the info() function overload instead of maintaining two similar implementations of the same function. Signed-off-by: Jacopo Mondi <jacopo@jmondi.org> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Tested-by: Paul Elder <paul.elder@ideasonboard.com>
2022-08-03utils: raspberrypi: ctt: dng_load_image: Work with DNG files from Picamera2William Vinnicombe
The DNG specification is based on the TIFF file format and recommends storing the raw image data in a SubIFD and the Exif tags in an Exif IFD. Other options are allowed, even if not recommended, such as storing both the raw image data and the Exif data in IFD0, as done by the TIFF/EP specification. libcamera-apps use pyexiv2 to produce DNG files, following the DNG recommendation, while applications based on picamera2 use PiDNG, which adopts the TIFF/EP structure. Why it does so is not currently clear (see https://github.com/schoolpost/PiDNG/issues/65 for discussions on this topic), but as files based on the DNG and TIFF/EP variants exist in the wild, both need to be supported by ctt. Add code to identify which tags are being used, and then load the metadata from the correct tags. Signed-off-by: William Vinnicombe <william.vinnicombe@raspberrypi.com> Reviewed-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>
2022-08-02utils: raspberrypi: ctt: Add alsc_only methodWilliam Vinnicombe
The ctt would not work if only passed alsc images. Add alsc_only.py to run alsc calibration only, and modify check_imgs to allow for no macbeth chart images. Example usage would be ./alsc_only.py -i tuning-images/ -o sensor.json with the same optional arguments as the original ctt. Signed-off-by: William Vinnicombe <william.vinnicombe@raspberrypi.com> Reviewed-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>
2022-08-02ipa: raspberrypi: Reset embedded data parser on configureDavid Plowman
When we switch camera mode following a pipeline reconfiguration, the embedded data parser should be "reset" to discard any data that it may have cached and that might now be invalid. 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>
2022-08-01test: yaml-parser: Test YamlObject::get(const T &defaultValue)Laurent Pinchart
When the YamlObject::get() function override that returns a std::optional got introduced, all tests were moved to it, leaving no tests for the override that takes a default value. Reintroduce those tests. Reported-by: Florian Sylvestre <fsylvestre@baylibre.com> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Jacopo Mondi <jacopo@jmondi.org> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
2022-07-29ipa: raspberry: awb: Include <functional>Jacopo Mondi
Building on gcc8 on Debian 10 fails with asyncThread_ = std::thread(std::bind(&Awb::asyncFunc, this)); ../src/ipa/raspberrypi/controller/rpi/awb.cpp:177:34: note: ‘std::bind’ is defined in header ‘<functional>’; did you forget to ‘#include <functional>’? Fix that by including <functional> in awb.cpp. Fixes: c1597f989654 ("ipa: raspberrypi: Use YamlParser to replace dependency on boost") Reported-by: https://buildbot.libcamera.org/#/builders/6/builds/414 Signed-off-by: Jacopo Mondi <jacopo@jmondi.org> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Umang Jain <umang.jain@ideasonboard.com>
2022-07-28ipa: raspberrypi: Add functional include to pwl.hEric Curtin
The Pwl class uses std::function, defined in <functional>, without including the header directly. This results in a compilation error with the Fedora 36 compiler toolchain (gcc 12.1.1): In file included from ../src/ipa/raspberrypi/controller/rpi/awb.h:14, from ../src/ipa/raspberrypi/controller/rpi/awb.cpp:14: ../src/ipa/raspberrypi/controller/rpi/../pwl.h:97:18: error: 'std::function' has not been declared 97 | void map(std::function<void(double x, double y)> f) const; | ^~~ Fix it by including <functional>. Fixes: c1597f989654 ("ipa: raspberrypi: Use YamlParser to replace dependency on boost") Signed-off-by: Eric Curtin <ecurtin@redhat.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2022-07-28libcamera: Drop unnecessary typename keyword used with std::enable_if_tLaurent Pinchart
Usage of the std::enable_if_t type doesn't need to be prefixed by typename. Drop the unnecessary keyword. Reported-by: Jacopo Mondi <jacopo@jmondi.org> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Umang Jain <umang.jain@ideasonboard.com> Reviewed-by: Jacopo Mondi <jacopo@jmondi.org>
2022-07-28ipa: raspberrypi: Remove unused Controller constructorNaushir Patuck
The Controller(char const *jsonFilename) is not valid anymore since Controller::read() can now return an error on a failure. Additionally, this constructor is not actually used, so remove it. 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>
2022-07-28ipa: rkisp1: Add support of ColorProcessing controlFlorian Sylvestre
Add ColorProcessing algorithm that is in charge to manage brightness, contrast and saturation controls. These controls are currently based on user controls. Signed-off-by: Florian Sylvestre <fsylvestre@baylibre.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2022-07-28ipa: rkisp1: Add support of Filter controlFlorian Sylvestre
Denoise and Sharpness filters will be applied by RkISP1 during the demosaicing step. The denoise filter is responsible for removing noise from the image, while the sharpness filter will enhance its acutance. Add filter algorithm with denoise and sharpness values based on user controls. Signed-off-by: Florian Sylvestre <fsylvestre@baylibre.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2022-07-28ipa: rkisp1: Add support of Defect Pixel Cluster Correction controlFlorian Sylvestre
The Defect Pixel Cluster Correction algorithm is responsible to minimize the impact of defective pixels. The on-the-fly method is actually used, based on coefficient provided by the tuning file. Signed-off-by: Florian Sylvestre <fsylvestre@baylibre.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2022-07-28ipa: rkisp1: Add support of Lens Shading Correction controlFlorian Sylvestre
The Lens Shading Correction algorithm applies multipliers to all pixels to compensate for the lens shading effect. The coefficients are specified in a downscaled table in the YAML tuning file. Signed-off-by: Florian Sylvestre <fsylvestre@baylibre.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2022-07-28ipa: rkisp1: Add support of Gamma Sensor Linearization controlFlorian Sylvestre
The GammaSensorLinearization algorithm linearizes the sensor output to compensate the sensor non-linearities by applying piecewise linear functions to the red, green and blue channels. Signed-off-by: Florian Sylvestre <fsylvestre@baylibre.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Paul Elder <paul.elder@ideasonboard.com> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2022-07-28include: linux: Update rkisp1 kernel header for DPCC configurationFlorian Sylvestre
To improve the kernel interface, a proposal has been made to the linux-kernel [1] to improve the configuration of the Defective Pixel Cluster Correction (DPCC). [1] https://lore.kernel.org/linux-media/20220616160456.21549-1-laurent.pinchart@ideasonboard.com/ Update the local copy of the rkisp1-config.h to match the proposal. Signed-off-by: Florian Sylvestre <fsylvestre@baylibre.com> Acked-by: Paul Elder <paul.elder@ideasonboard.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2022-07-28libcamera: base: utils: Provide defopt to simplify std::optional::value_or() ↵Laurent Pinchart
usage The std::optional<T>::value_or(U &&default_value) function returns the contained value if available, or default_value if the std::optional has no value. If the desired default value is a default-constructed T, the obvious option is to call std::optional<T>::value_or(T{}). This approach has two drawbacks: - The \a default_value T{} is constructed even if the std::optional instance has a value, which impacts efficiency. - The T{} default constructor needs to be spelled out explicitly in the value_or() call, leading to long lines if the type is complex. Introduce a defopt variable that solves these issues by providing a value that can be passed to std::optional<T>::value_or() and get implicitly converted to a default-constructed T. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Umang Jain <umang.jain@ideasonboard.com> Reviewed-by: Jacopo Mondi <jacopo@jmondi.org>
2022-07-28cam: sdl_sink: Pass a Span<const uint8_t> to SDLTexture::update()Laurent Pinchart
The SDLTexture::update() function isn't meant to modify the data it receives. Make the Span type const to ensure this at compile time. While at it, pass the Span by value instead of reference, as a Span is only a pointer and size, which will fit in registers and will avoid pointer dereferences in the callee. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Jacopo Mondi <jacopo@jmondi.org>
2022-07-28cam: sdl_sink: Use libjpeg over SDL2_imageEric Curtin
We were using the libjpeg functionality of SDL2_image only, instead just use libjpeg directly to reduce our dependancy count, it is a more commonly available library. Signed-off-by: Eric Curtin <ecurtin@redhat.com> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Jacopo Mondi <jacopo@jmondi.org>
2022-07-28ipa: raspberrypi: agc: Use YamlObject::getList()Laurent Pinchart
Replace the manual implementation of the readList() functions with YamlObject::getList(). Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Naushir Patuck <naush@raspberrypi.com> Tested-by: Naushir Patuck <naush@raspberrypi.com>
2022-07-28libcamera: yaml_parser: Add getList() functionFlorian Sylvestre
Allow to retrieve a YAML list of any already supported types in a std::vector. Signed-off-by: Florian Sylvestre <fsylvestre@baylibre.com> Tested-by: Naushir Patuck <naush@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>
2022-07-28ipa: raspberrypi: Convert existing cameara tuning files to version 2.0Naushir Patuck
Use the convert_tuning.py script to convert all existing tuning files to version 2.0. Signed-off-by: Naushir Patuck <naush@raspberrypi.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Tested-by: Naushir Patuck <naush@raspberrypi.com>
2022-07-28utils: raspberrypi: Add tuning file conversion scriptNaushir Patuck
Add a script to convert the Raspberry Pi camera tuning file format from version 1.0 to 2.0. This script also adds a root level version key set to 2.0 to the config file, allowing the controller to distinguish between the two formats. Signed-off-by: Naushir Patuck <naush@raspberrypi.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Tested-by: Naushir Patuck <naush@raspberrypi.com>
2022-07-28utils: raspberrypi: ctt: Output version 2.0 format tuning filesNaushir Patuck
Update the ctt_pretty_print_json.py script to generate the new version 2.0 format camera tuning file. This script can be called through the command line to prettify an existing JSON file, or programatically by the CTT to format a new JSON config dictionary. Update the CTT to produce a version 2.0 format json structure and use ctt_pretty_print_json.pretty_print to prettify the output. Signed-off-by: Naushir Patuck <naush@raspberrypi.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Tested-by: Naushir Patuck <naush@raspberrypi.com>
2022-07-28ipa: raspberrypi: Introduce version 2.0 format for the camera tuning fileNaushir Patuck
The existing tuning file format (version 1.0) requires the controller algorithms to run in the same order as listed in the JSON structure. The JSON specification does not mandate any such ordering, but the Boost JSON parser would maintain this order. In order to remove this reliance on the parser to provide ordering, introduce a new version 2.0 format for the camera tuning file. In this version, the algorithms are specified in a top level list node ("algorithms"), which does require strict ordering of the elements. A "version" node is added to distinguish between the version 1.0 and 2.0 formats. The absence of the "version" node implies version 1.0. A "target" node is also added to specify the target platform for this configuration. Update the controller to support either version of the tuning file by looking at the version node. CreateAlgorithm member function to now load and configure each algorithm. Additionally, make CreateAlgorithm a private member, it does not get called externally. If a version 1.0 format tuning file is used, throw a warning message indicating it will be soon deprecated. Signed-off-by: Naushir Patuck <naush@raspberrypi.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Tested-by: Naushir Patuck <naush@raspberrypi.com> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2022-07-28ipa: raspberrypi: Use YamlParser to replace dependency on boostLaurent Pinchart
The Raspberry Pi IPA module depends on boost only to parse the JSON tuning data files. As libcamera depends on libyaml, use the YamlParser class to parse those files and drop the dependency on boost. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Tested-by: Naushir Patuck <naush@raspberrypi.com> Reviewed-by: Naushir Patuck <naush@raspberrypi.com>
2022-07-28ipa: raspberrypi: Replace Fatal log by error propagationLaurent Pinchart
Replace the Fatal log messages that cause an abort during tuning data read with Error messages and proper error propagation to the caller. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Naushir Patuck <naush@raspberrypi.com> Tested-by: Naushir Patuck <naush@raspberrypi.com>
2022-07-28ipa: raspberrypi: Propagate errors from AGC metering tuning data readLaurent Pinchart
Update the AGC metering functions that deal with reading tuning data to propagate errors to the caller, using std::tie and std::tuple to group the error code and return value. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Naushir Patuck <naush@raspberrypi.com> Tested-by: Naushir Patuck <naush@raspberrypi.com>
2022-07-28ipa: raspberrypi: Return an error code from Algorithm::read()Laurent Pinchart
When encountering errors, the Algorithm::read() function either uses LOG(Fatal) or throws exceptions from the boost property_tree functions. To prepare for replacing boost JSON parse with the YamlParser class, give the Algorithm::read() function the ability to return an error code, and propagate it all the way to the IPA module init() function. All algorithm classes return a hardcoded 0 value for now, subsequent commits will change that. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Naushir Patuck <naush@raspberrypi.com> Tested-by: Naushir Patuck <naush@raspberrypi.com>
2022-07-28ipa: raspberrypi: Replace tabs with spaces in tuning data filesLaurent Pinchart
Tuning data files mostly use spaces for indentation, with occasional stray tabs. Use spaces consistently. This allows parsing the tuning files with libyaml, preparing to replace the dependency on boost. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Naushir Patuck <naush@raspberrypi.com> Tested-by: Naushir Patuck <naush@raspberrypi.com>
2022-07-28libcamera: yaml_parser: Preserve order of items in dictionaryLaurent Pinchart
The std::map container used to store dictionary items in YamlObject doesn't preserve the YAML data order, as maps are ordered by key, not by insertion order. While this is compliant with the YAML specification which doesn't guarantee ordering of mappings, the Raspberry Pi IPA relies on elements being ordered as in the YAML data. To replace the dependency on boost with the YamlParser class, we thus need to guarantee that the order is preserved. Preserve the order by storing items in list_ unconditionally. Turn the list_ vector from storing YamlObject unique pointers to storing key-value pairs, with the key being absent when the object is a list, not a dictionary. The YamlObject implementation is updated to preserve the existing API, with the only difference being that YamlObject::memberNames() now returns member names in the same order as in the YAML file. The ordering is an implementation detail, so changing it doesn't violate the YAML specification. The documentation is not updated to reflect this, as we don't want any new user to rely on a particular ordering. This commit could be reverted if desired when the Raspberry Pi IPA updates to a new tuning data format and drops support for the old format. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Naushir Patuck <naush@raspberrypi.com> Tested-by: Naushir Patuck <naush@raspberrypi.com>
2022-07-28test: yaml-parser: Test dictionary items orderingLaurent Pinchart
While YAML specifies that mappings are unordered, the Raspberry Pi IPA relies on elements being ordered as in the YAML data. To replace the dependency on boost with the YamlParser class, we thus need to guarantee that the order is preserved. Update the corresponding unit test to ensure this. The test currently fails at the YamlParser doesn't correctly preserve the order, this will be fixed by the next commit. This commit should be reverted when the Raspberry Pi IPA updates to a new tuning data format and drops support for the old format. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Naushir Patuck <naush@raspberrypi.com> Tested-by: Naushir Patuck <naush@raspberrypi.com>
2022-07-28libcamera: yaml_parser: Replace ok flag to get() with std::optionalLaurent Pinchart
The YamlObject::get() function takes a default value and an optional bool ok flag to handle parsing errors. This ad-hoc mechanism complicates error handling in callers. A better API is possible by dropping the default value and ok flag and returning an std::optional. Not only does it simplify the calls, it also lets callers handle errors through the standard std::optional class instead of the current ad-hoc mechanism. Provide a get() wrapper around std::optional::value_or() to further simplify callers that don't need any specific error handling. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Naushir Patuck <naush@raspberrypi.com> Tested-by: Naushir Patuck <naush@raspberrypi.com> Reviewed-by: Jacopo Mondi <jacopo@jmondi.org>
2022-07-27ipa: raspberrypi: agc: Fix log message prefixesNaushir Patuck
Remove "Agc:" as that gets prefixed by the logging system. s/AgcConfig/AgcMeteringMode/ and s/AgcConfig/AgcMeteringMode where appropriate. Signed-off-by: Naushir Patuck <naush@raspberrypi.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2022-07-27ipa: raspberrypi: Remove #define constantsNaushir Patuck
Replace all #define constant values with equivalent constexpr definitions. As a drive-by, remove the CAMERA_MODE_NAME_LEN constant as it is unused. Signed-off-by: Naushir Patuck <naush@raspberrypi.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2022-07-27ipa: raspberryip: Remove all exception throw statementsNaushir Patuck
Replace all exception throw statements with LOG(RPi*, Fatal) error messages. Signed-off-by: Naushir Patuck <naush@raspberrypi.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2022-07-27raspberrypi: Update Copyright statement in all Raspberry Pi source filesNaushir Patuck
s/Raspberry Pi (Trading) Limited/Raspberry Pi Ltd/ to reflect the new Raspberry Pi entity name. Signed-off-by: Naushir Patuck <naush@raspberrypi.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2022-07-27ipa: raspberrypi: Rename header files from *.hpp to *.hNaushir Patuck
As per the libcamera coding guidelines, rename all .hpp header files to .h. Signed-off-by: Naushir Patuck <naush@raspberrypi.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2022-07-27ipa: raspberrypi: Remove extern "C" declarationsNaushir Patuck
Since the controller header files are now C++ specific, remove the extern "C" declarations. Signed-off-by: Naushir Patuck <naush@raspberrypi.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2022-07-27ipa: raspberrypi: Change to C style code commentsNaushir Patuck
As part of the on-going refactor efforts for the source files in src/ipa/raspberrypi/, switch all C++ style comments to C style comments. Signed-off-by: Naushir Patuck <naush@raspberrypi.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2022-07-27ipa: raspberrypi: Code refactoring to match style guidelinesNaushir Patuck
Refactor all the source files in src/ipa/raspberrypi/ to match the recommended formatting guidelines for the libcamera project. The vast majority of changes in this commit comprise of switching from snake_case to CamelCase, and starting class member functions with a lower case character. Signed-off-by: Naushir Patuck <naush@raspberrypi.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2022-07-27libcamera: camera: Fix documentation typoUmang Jain
Signed-off-by: Umang Jain <umang.jain@ideasonboard.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2022-07-26libcamera: Correctly report enabled ipa modulesQuentin Schulz
"ipa_modules" stores the value of the ipas meson build option. IPAs are enabled if and only if there is an enabled pipeline for an IPA listed in "ipa_modules" array. It is basically the intersection of pipelines and ipa_modules array. In order to correctly report which IPAs get enabled, let's create a new array storing this intersection. Cc: Quentin Schulz <foss+libcamera@0leil.net> Reported-by: Daniel Semkowicz <dse@thaumatec.com> Signed-off-by: Quentin Schulz <quentin.schulz@theobroma-systems.com> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com> Reviewed-by: Jacopo Mondi <jacopo@jmondi.org> Signed-off-by: Jacopo Mondi <jacopo@jmondi.org>
2022-07-25android: camera_capabilities: Adjust minimum frame duration to match FPSHan-Lin Chen
CTS calculates FPS with a rounding formula: See Camera2SurfaceViewTestCase.java:getSuitableFpsRangeForDuration() fps = floor(1e9 / minFrameDuration + 0.05f) The android adapter reports it as the AE target FPS. The patch adjusts the reported minimum frame duration to match the reported FPS. Signed-off-by: Han-Lin Chen <hanlinchen@chromium.org> Reviewed-by: Jacopo Mondi <jacopo@jmondi.org> Reviewed-by: Umang Jain <umang.jain@ideasonboard.com> Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
2022-07-25android: camera_capabilities: Add (1600x1200) and (1280x960) resolutionsHan-Lin Chen
Although resolutions (1600x1200) and (1280x960) are not mandatory to be supported by the Android Camera3 specification, they are commonly used by Android devices as viewfinder streams for 4:3 still capture. Add them into stream resolution candidates. Signed-off-by: Han-Lin Chen <hanlinchen@chromium.org> Reviewed-by: Jacopo Mondi <jacopo@jmondi.org> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com> Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
2022-07-24android: exif: Fix thumbnail buffer lifetimeCheng-Hao Yang
Previously the thumbnail buffer is destructed before even being used in Exif. This patch moves the buffer into class Exif, so that the developer won't need to worry about its lifetime. Signed-off-by: Harvey Yang <chenghaoyang@chromium.org> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Umang Jain <umang.jain@ideasonboard.com> Signed-off-by: Umang Jain <umang.jain@ideasonboard.com>
2022-07-24test: gstreamer: Check availability of cameras before runningUmang Jain
Move the logic for checking the availability of cameras from multi_stream_test to gstreamer test base class. Since single_stream_class always assumes that a camera is available on the system (which is not always the case for e.g. RPi in CI/CD environments) it makes sense to have the availability check in the base class. If no cameras are available, the behaviour should be to skip instead of a failure. We currently have 2 tests for gstreamer differing based on number of streams supported by the camera. Hence, the camera availability is checked in conjunction with the number of the streams required by the derived class. Signed-off-by: Umang Jain <umang.jain@ideasonboard.com> Reviewed-by: Jacopo Mondi <jacopo@jmondi.org> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2022-07-24test: gstreamer: Drop internal header from base classUmang Jain
The internal header isn't needed. The needed function libcameraBuildPath() is exposed by libcamera/base/utils.h header. At the same time, move the utils header to .cpp instead of including it in the base class header itself. Signed-off-by: Umang Jain <umang.jain@ideasonboard.com> Reviewed-by: Jacopo Mondi <jacopo@jmondi.org> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2022-07-22qcam: assets: shader: bayer_8.frag: Add precisionKunal Agarwal
The OpenGL ES shading language has no default precision declared implicitly for floats in fragment shaders. The lack of an explicit default precision results in shader compilation errors. Specify a default precision of mediump for floats. This matches the other fragment shaders, and is guaranteed by the OpenGL ES shader language specification to be supported by all devices, while the higher precision highp is optional. Signed-off-by: Kunal Agarwal <kunalagarwal1072002@gmail.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2022-07-22ipa: rkisp1: Transfer queueRequest() call to each algorithmFlorian Sylvestre
Implement rkisp1 queueRequest() function to update each algorithm with user controls. Signed-off-by: Florian Sylvestre <fsylvestre@baylibre.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Paul Elder <paul.elder@ideasonboard.com> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>