summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
4 dayslibcamera: pipeline: vivid: Set request timestampHEADvividKieran Bingham
Provide the request SensorTimestamp as the buffer completion time. This is fake, as there is no SensorTimestamp on the VIVID pipeline as it's a virtual video device, but it provides a suitable data point. Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
4 dayslibcamera: pipeline: vivid: Print diagnostic on configuration failureLaurent Pinchart
In case the setFormat() call on the video device fails to match the configuration, print both the requested and actual configurations to ease debugging. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com> Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
4 dayslibcamera: pipeline: vivid: Set camera propertiesLaurent Pinchart
Initialize the CameraData properties with Location and Model. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com> Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
4 dayslibcamera: pipeline: vivid: Handle controlsKieran Bingham
When constructing the camera, we parse the available controls on the video capture device, and map supported controls to libcamera controls, and initialise the defaults. The controls are handled during queueRequestDevice for each request and applied to the device through the capture node. Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
4 dayslibcamera: pipeline: vivid: Initialise key controlsKieran Bingham
The VIVID pipeline handler retains state globally of it's controls. Ensure that when we configure this specific pipeline we set initial parameters on the device that suit our (specific) needs. This introduces how controls can be set directly on a device, however under normal circumstances controls should usually be set from libcamera controls as part of a request. These are VIVID specific only. Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
4 dayslibcamera: pipeline: vivid: Queue requestsKieran Bingham
When a request is given to a pipeline handler, it must parse the request and identify what actions the pipeline handler should take to enact on hardware. In the case of the VIVID pipeline handler, we identify the buffer from the only supported stream, and queue it to the video capture device. Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
4 dayslibcamera: pipeline: vivid: Buffer handling and stream controlKieran Bingham
We can now add buffer management, and connect up our bufferReady signal to a callback. Note that we provide the ability to export buffers from our capture device (data->video_) using the exportBuffers() functionality from the V4L2VideoDevice which allows a FrameBufferAllocater to obtain buffers from this device. When buffers are obtained through the exportFrameBuffers API, they are orphaned and left unassociated with the device, and must be reimported at start() time anyway. This allows the same interface to be used whether internal buffers, or external buffers are used for the stream. When a buffer completes, we call the buffer completion handler on the pipeline handler, and because we have only a single stream, we can also immediately complete the request. Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
4 dayslibcamera: pipeline: vivid: Configure the deviceKieran Bingham
When the configurations have been generated and validated, they can be applied to a device. Vivid supports only a single stream, so it directly obtains the first StreamConfiguration from the CameraConfiguration. The VIVID catpure device is a V4L2Video device, so we generate a V4L2DeviceFormat to apply directly to the capture device node. Note that we convert the libcamera Format stored in cfg.pixelFormat to a V4L2PixelFormat using V4L2PixelFormat helper. This currently defaults to the single-planar formats, and should be extended to support the Multiplanar configuration from the V4L2Device. [todo Repair the link between the multiplanar configuration of the V4L2VideoDevice and the pixel format selection] Following the call to set the format using the Kernel API, if the format has been adjusted in any way by the kernel driver, then we have failed to correctly handle the validation stages, and thus the configure operation is idendified has having failed. Finally stream specific data can be directly stored and set as reflecting the state of the stream. [NOTE: the cfg.setStream() call here associates the stream to the StreamConfiguration however that should quite likely be done as part of the validation process. TBD] Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
4 dayslibcamera: pipeline: vivid: Generate and validate StreamConfigurationsKieran Bingham
Implement the support for Generating and Validating the streams the Camera can provide. Vivid is a simple case with only a single stream. Test the configurations can be generated and reported with cam -I: """ LIBCAMERA_LOG_LEVELS=Pipeline,VIVID:0 ./src/cam/cam -c 1 -I [232:02:09.633067174] [2882911] INFO IPAManager ipa_manager.cpp:136 libcamera is not installed. Adding '/home//libcamera/build-vivid/src/ipa' to the IPA search path [232:02:09.633332451] [2882911] WARN IPAManager ipa_manager.cpp:147 No IPA found in '/usr/local/lib/x86_64-linux-gnu/libcamera' [232:02:09.633373414] [2882911] INFO Camera camera_manager.cpp:283 libcamera v0.0.11+714-d1ebd889-dirty Using camera vivid 0: 1280x720-BGR888 * Pixelformat: NV21 (320x180)-(3840x2160)/(+0,+0) - 320x180 - 640x360 - 640x480 - 1280x720 - 1920x1080 - 3840x2160 * Pixelformat: NV12 (320x180)-(3840x2160)/(+0,+0) - 320x180 - 640x360 - 640x480 - 1280x720 - 1920x1080 - 3840x2160 * Pixelformat: BGRA8888 (320x180)-(3840x2160)/(+0,+0) - 320x180 - 640x360 - 640x480 - 1280x720 - 1920x1080 - 3840x2160 * Pixelformat: RGBA8888 (320x180)-(3840x2160)/(+0,+0) - 320x180 - 640x360 - 640x480 - 1280x720 - 1920x1080 - 3840x2160 """ Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
4 dayslibcamera: pipeline: vivid: Create a CameraKieran Bingham
Create a VividCameraData inheriting from the CameraData to handle camera specific data, and use it to create and register the camera with the CameraManager. This can now be tested to see that the camera becomes available to applications: """ LIBCAMERA_LOG_LEVELS=Pipeline,VIVID:0 ./src/cam/cam -l [231:44:49.325333712] [2880028] INFO IPAManager ipa_manager.cpp:136 libcamera is not installed. Adding '/home/libcamera/build-vivid/src/ipa' to the IPA search path [231:44:49.325428449] [2880028] WARN IPAManager ipa_manager.cpp:147 No IPA found in '/usr/local/lib/x86_64-linux-gnu/libcamera' [231:44:49.325446253] [2880028] INFO Camera camera_manager.cpp:283 libcamera v0.0.11+713-d175334d-dirty Available cameras: 1: vivid """ Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
4 dayslibcamera: pipeline: vivid: Match deviceKieran Bingham
Verify that we can match on our expected device(s). Use a temporary debug print to check that the pipeline finds our device: """ LIBCAMERA_LOG_LEVELS=Pipeline,VIVID:0 ./src/cam/cam -l <snipped> [230:51:10.670503423] [2872877] DEBUG VIVID vivid.cpp:81 Obtained Vivid Device """ Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
4 daysDocumentationUseOnly: Force enable VividKieran Bingham
To make sure we always build the Vivid pipeline in this branch, explicitly add it to the pipelines build targets. This is not any kind of best practice for pipeline handlers, but is here to ensure that this pipeline is always compiled on this branch who's sole purpose is to use and demonstrate the vivid pipeline handler.
4 daysDocumentationUseOnly: Disable compiler warningKieran Bingham
Explicitly disable the unused-parameter warning in this pipeline handler. Parameters are left unused while they are introduced incrementally, so for documentation purposes only we disable this warning so that we can compile each commit independently without breaking the flow of the development additions. This is not recommended practice within libcamera, please listen to your compiler warnings. Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
4 dayslibcamera: pipeline: Introduce skeleton Vivid PipelineKieran Bingham
Provide all of the skeleton stubs to succesfully compile and register a new Pipeline Handler for the Vivid test device. Meson must be reconfigured to ensure that this pipeline handler is included in the selected pipelines configuration, and after building, we can test that the PipelineHandler is successfully registered by listing the cameras on the system with LIBCAMERA_LOG_LEVELS enabled: """ LIBCAMERA_LOG_LEVELS=Pipeline:0 ./build-vivid/src/cam/cam -l [230:30:03.624102821] [2867886] DEBUG Pipeline pipeline_handler.cpp:680 Registered pipeline handler "PipelineHandlerVivid" Available cameras: """ Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
4 dayslibcamera: camera_manager: Add environment variable to order pipelines matchJulien Vuillaumier
To match the enumerated media devices, each registered pipeline handler is used in no specific order. It is a limitation when several pipelines can match the devices, and user has to select a specific pipeline. For this purpose, environment variable LIBCAMERA_PIPELINES_MATCH_LIST is created to give the option to define an ordered list of pipelines to match on. LIBCAMERA_PIPELINES_MATCH_LIST="<name1>[,<name2>[,<name3>...]]]" Example: LIBCAMERA_PIPELINES_MATCH_LIST="rkisp1,simple" Signed-off-by: Julien Vuillaumier <julien.vuillaumier@nxp.com> Reviewed-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com> Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
4 dayslibcamera: pipeline: Add a get factory by name helperJulien Vuillaumier
Add a static helper to the PipelineHandlerFactoryBase class to allow retrieving a pipeline by name. Signed-off-by: Julien Vuillaumier <julien.vuillaumier@nxp.com> Reviewed-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com> Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
4 dayslibcamera: pipeline: Rename pipelines to a shorter nameJulien Vuillaumier
The PipelineHandlerFactoryBase class has a name that is propagated to the PipelineHandler instance it creates. In present implementation, this name comes from the REGISTER_PIPELINE_HANDLER registration macro. It corresponds to the stringified name of the PipelineHandler derived class. Therefore, PipelineHandler factories and instances names can be quite long such as "PipelineHandlerRkISP1". A libcamera user may have to explicitly refer to a PipelineHandler name for configuration purpose: one usage of the name can be to define a pipeline handlers match list and their priorities. It is desired, for user convenience, to use a short name to designate a pipeline handler. Reusing the short pipeline names already defined in the meson option files is an existing and consistent way of naming pipelines. This change adds an explicit name parameter to the REGISTER_PIPELINE_HANDLER registration macro. That parameter is used to define the name of a pipeline handler factory, instead of the current pipeline handler class name. Each pipeline registration is updated accordingly. The short name assigned corresponds to the pipeline directory name in the source tree. It is consistent with pipelines names used in meson. Changing the pipeline name has an impact on the IPA modules: each module defines a IPAModuleInfo structure. This structure has a pipelineName member defining the pipeline handler name it shall match with. Therefore, each internal IPA module definition has to be changed to have its IPAModuleInfo pipelineName name updated with the short pipeline handler name. In addition to this pipelineName member, the IPAModuleInfo structure also has a name member, associated to the IPA module name. Having renamed the pipelines to a short name, the pipeline name and the IPA module names of the IPAModuleInfo structure are the same: for in-tree IPA, they correspond to the respective pipeline and IPA subdirectories in the source tree. However the IPA name could be different, for instance with a close source IPA implementation built out-of-tree. Thus, it makes sense to keep the IPA name in that structure, as the 2 definitions may not always be redundant. Signed-off-by: Julien Vuillaumier <julien.vuillaumier@nxp.com> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com> [Kieran: Adjust for clang-format style fix, reformat commitmsg] Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
5 daysgstreamer: Use copied camera nameBarnabás Pőcze
The camera name is copied in gst_libcamera_src_open() as we can't hold the lock protecting the name while calling GST_ELEMENT_ERROR(). The GST_ELEMENT_ERROR() macro sends a message on the bus, taking more locks and possibly causing issues. However, the current code makes the copy, but does not actually use it. So fix that. Fixes: 58feb69f852289 ("gst: libcamerasrc: Implement selection and acquisition") Signed-off-by: Barnabás Pőcze <pobrn@protonmail.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Nicolas Dufresne <nicolas.dufresne@collabora.com> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
5 daysgstreamer: Fix string memory leakBarnabás Pőcze
The string returned by `gst_video_colorimetry_to_string()` has to be freed, this was missing. Fixes: fc9783acc6083a ("gstreamer: Provide colorimetry <> ColorSpace mappings") Signed-off-by: Barnabás Pőcze <pobrn@protonmail.com> Reviewed-by: Nicolas Dufresne <nicolas.dufresne@collabora.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
5 daysDocumentation: Add option to treat Doxygen warnings as errorsLaurent Pinchart
A new Doxygen warning introduced in a recent commit went unnoticed, both in manual tests and in CI. Unlike C/C++ warnings that are treated as errors, we don't fail the build with Doxygen warnings. This is due to the fact that the libcamera documentation compiles cleanly only with quite recent versions of Doxygen. Enabling the WARN_AS_ERROR Doxygen option unconditionally could bother many users. To improve the situation, add a meson option to treat Doxygen warnings as errors. The option is disabled by default, preserving the current behaviour, and will be enabled in CI builds. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
6 daystest: gstreamer: Simplify single stream testNicolas Dufresne
The single stream test for the GStreamer component has a simple pipeline construction using only a fakesink. The implementation currently supports connecting to a more complex stream construction defined by the streamDescription, but this is over engineered for the simple need to start a stream to capture and discard the frames. Convert the use of gst_parse_bin_from_description_full() which uses only a single element 'fakesink' to construct the fakesink directly and link it to the libcamerasrc. Signed-off-by: Nicolas Dufresne <nicolas.dufresne@collabora.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>
6 daysipa: libipa: histogram: Fix documentation of constructorLaurent Pinchart
Commit 1dc01bc9e6c3 ("ipa: libipa: histogram: Add transform parameter to constructor") added a new constructor for the Histogram class. The implementation is inline in the header file, and the documentation was added in the corresponding .cpp file, but it missed the \fn directive. This causes Doxygen to complain: src/ipa/libipa/histogram.h:31: warning: Member Histogram(Span< const uint32_t > data, Transform transform) (function) of class libcamera::ipa::Histogram is not documented. src/ipa/libipa/histogram.cpp:59: warning: libcamera::ipa::Histogram::bins has @param documentation sections but no arguments Fix it. Fixes: 1dc01bc9e6c3 ("ipa: libipa: histogram: Add transform parameter to constructor") Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Umang Jain <umang.jain@ideasonboard.com> Reviewed-by: Stefan Klug <stefan.klug@ideasonboard.com>
10 dayslibcamera: Drop remaining file name from header comment blocksLaurent Pinchart
Source files in libcamera start by a comment block header, which includes the file name and a one-line description of the file contents. While the latter is useful to get a quick overview of the file contents at a glance, the former is mostly a source of inconvenience. The name in the comments can easily get out of sync with the file name when files are renamed, and copy & paste during development have often lead to incorrect names being used to start with. Readers of the source code are expected to know which file they're looking it. Drop the file name from the header comment blocks in all remaining locations that were not caught by the automated script as they are out of sync with the file name. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Daniel Scally <dan.scally@ideasonboard.com>
10 dayslibcamera: Drop file name from header comment blocks in templatesLaurent Pinchart
Source files in libcamera start by a comment block header, which includes the file name and a one-line description of the file contents. While the latter is useful to get a quick overview of the file contents at a glance, the former is mostly a source of inconvenience. The name in the comments can easily get out of sync with the file name when files are renamed, and copy & paste during development have often lead to incorrect names being used to start with. Readers of the source code are expected to know which file they're looking it. Drop the file name from the header comment blocks in template files and templates embedded in generator scripts. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Daniel Scally <dan.scally@ideasonboard.com>
10 daysipa: rkisp1: agc: Fix histogram constructionPaul Elder
This histogram reported by the rkisp1 hardware is 20 bits, where the upper 16 bits are meaningful integer data and the lower 4 bits are fractional and meant to be discarded. Remove these 4 bits when construction the histogram. Signed-off-by: Paul Elder <paul.elder@ideasonboard.com> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com> Reviewed-by: Daniel Scally <dan.scally@ideasonboard.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
10 daysipa: rpi: Fix for incorrectly reported max shutter speedNaushir Patuck
The maximum shutter speed calculation in the cam-helper relied on the frame duration limits being correctly set in the cam-helper's mode structure. This was not the case on first startup, so the maximum shutter speed reported back via the ControlInfo was incorrect. Fix this by setting up the camera mode in the cam-helper before querying for the max shutter value. Signed-off-by: Naushir Patuck <naush@raspberrypi.com> Reviewed-by: David Plowman <david.plowman@raspberrypi.com> Acked-by: Kieran Bingham <kieran.bingham@ideasonboard.com> Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
10 dayspipeline: rpi: Avoid duplicating size range for the same pixel formatDavid Plowman
Some V4L2 formats translate to the same pixel format, e.g. YU12 and YM12 both produce YUV420. In this case our ISP driver advertises the same size range for both, but we must not record the same thing twice for the same pixel format (which will cause a failure later on). Instead, ignore the V4l2 format if the pixel format has already been seen. Signed-off-by: David Plowman <david.plowman@raspberrypi.com> Reviewed-by: Naushir Patuck <naush@raspberrypi.com> Reviewed-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
10 daysipa: libipa: histogram: Add transform parameter to constructorPaul Elder
Add a parameter to the histogram constructor that takes a transformation function to apply to all the bins upon construction. This is necessary notably for the rkisp1, as the values reported from the hardware are 20 bits where the upper 16-bits are meaningful integer values and the lower 4 bits are fractional and meant to be discarded. As adding a right-shift parameter is probably too specialized, a generic function is added as a parameter instead. While at it, optimize the existing constructor to avoid push_back() into a vector with a known final size. Signed-off-by: Paul Elder <paul.elder@ideasonboard.com> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com> Reviewed-by: Daniel Scally <dan.scally@ideasonboard.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
11 dayslibcamera: Drop file name from header comment blocksLaurent Pinchart
Source files in libcamera start by a comment block header, which includes the file name and a one-line description of the file contents. While the latter is useful to get a quick overview of the file contents at a glance, the former is mostly a source of inconvenience. The name in the comments can easily get out of sync with the file name when files are renamed, and copy & paste during development have often lead to incorrect names being used to start with. Readers of the source code are expected to know which file they're looking it. Drop the file name from the header comment block. The change was generated with the following script: ---------------------------------------- dirs="include/libcamera src test utils" declare -rA patterns=( ['c']=' \* ' ['cpp']=' \* ' ['h']=' \* ' ['py']='# ' ['sh']='# ' ) for ext in ${!patterns[@]} ; do files=$(for dir in $dirs ; do find $dir -name "*.${ext}" ; done) pattern=${patterns[${ext}]} for file in $files ; do name=$(basename ${file}) sed -i "s/^\(${pattern}\)${name} - /\1/" "$file" done done ---------------------------------------- This misses several files that are out of sync with the comment block header. Those will be addressed separately and manually. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Daniel Scally <dan.scally@ideasonboard.com>
11 daysipa: rkisp1: Remove bespoke Agc functionsDaniel Scally
Now that the rkisp1 Agc algorithm is a derivation of MeanLuminanceAgc we can remove the bespoke functions from the IPA's class. Reviewed-by: Stefan Klug <stefan.klug@ideasonboard.com> Reviewed-by: Paul Elder <paul.elder@ideasonboard.com> Reviewed-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com> Signed-off-by: Daniel Scally <dan.scally@ideasonboard.com> Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
11 daysipa: rkisp1: Derive rkisp1::algorithms::Agc from AgcMeanLuminanceDaniel Scally
Now that we have a AgcMeanLuminance class that centralises our AEGC algorithm, derive the RkISP1's Agc class from it and plumb in the necessary framework to enable it to be used. For simplicities sake this commit switches the algorithm to use the derived class, but does not remove the bespoke functions at this time. Reviewed-by: Stefan Klug <stefan.klug@ideasonboard.com> Reviewed-by: Paul Elder <paul.elder@ideasonboard.com> Signed-off-by: Daniel Scally <dan.scally@ideasonboard.com> Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
11 daysipa: ipu3: Remove bespoke AGC functions from IPU3Daniel Scally
Now that the IPU3's Agc is derived from MeanLuminanceAgc we can delete all the unecessary bespoke functions. Reviewed-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com> Reviewed-by: Stefan Klug <stefan.klug@ideasonboard.com> Signed-off-by: Daniel Scally <dan.scally@ideasonboard.com> Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
11 daysipa: ipu3: Derive ipu3::algorithms::Agc from AgcMeanLuminanceDaniel Scally
In preparation for switching to a derivation of AgcMeanLuminance, add a function to parse and store the statistics for easy retrieval in an overriding estimateLuminance() function. Now that we have a MeanLuminanceAgc class that centralises our AEGC algorithm, derive the IPU3's Agc class from it and plumb in the necessary framework to enable it to be used. For simplicity's sake this commit switches the algorithm to use the derived class, but does not remove the bespoke functions at this time. Reviewed-by: Stefan Klug <stefan.klug@ideasonboard.com> Signed-off-by: Daniel Scally <dan.scally@ideasonboard.com> Reviewed-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com> Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
11 daysipa: libipa: Add AgcMeanLuminance base classDaniel Scally
The Agc algorithms for the RkIsp1 and IPU3 IPAs do the same thing in very large part; following the Rpi IPA's algorithm in spirit with a few tunable values in that IPA being hardcoded in the libipa ones. Add a new base class for AgcMeanLuminance which implements the same algorithm and additionally parses yaml tuning files to inform an IPA module's Agc algorithm about valid constraint and exposure modes and their associated bounds. Reviewed-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com> Reviewed-by: Stefan Klug <stefan.klug@ideasonboard.com> Reviewed-by: Paul Elder <paul.elder@ideasonboard.com> Signed-off-by: Daniel Scally <dan.scally@ideasonboard.com> Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
11 daysipa: libipa: Add ExposureModeHelperPaul Elder
Add a helper for managing exposure modes and splitting exposure times into shutter and gain values. Reviewed-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com> Reviewed-by: Paul Elder <paul.elder@ideasonboard.com> Signed-off-by: Paul Elder <paul.elder@ideasonboard.com> Signed-off-by: Daniel Scally <dan.scally@ideasonboard.com> Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
11 dayslibcamera: controls: Generate enum value-name mapsDaniel Scally
Generate maps for each control enum which associate strings that represent the enum values with the values themselves. This change will allow us to refer to enumerated control values using the string. For example if we want to pass variables to an algorithm for use when a control has a particular value we can embed within tuning files a dictionary that uses the control values as keys. Reviewed-by: Stefan Klug <stefan.klug@ideasonboard.com> Reviewed-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com> Reviewed-by: Paul Elder <paul.elder@ideasonboard.com> Signed-off-by: Daniel Scally <dan.scally@ideasonboard.com> Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
11 daysipa: libipa: Allow creation of empty HistogramDaniel Scally
For convenience's sake allow the creation of empty Histograms so they can be embedded within other Classes and filled out with data at some later point in time. Reviewed-by: Stefan Klug <stefan.klug@ideasonboard.com> Reviewed-by: Paul Elder <paul.elder@ideasonboard.com> Signed-off-by: Daniel Scally <dan.scally@ideasonboard.com> Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
12 daysRevert "meson: Deprecate bitwise operations between different enumeration type"Laurent Pinchart
Enabling -Wdeprecated-enum-enum-conversion by default turned out to be a too hasty decision. It causes compilation failures with Qt headers prior to Qt v5.15.8. As the previous LTS versions of Debian and Ubuntu ship older Qt versions, those errors cause real inconvenience to users. This reverts commit bf4695266bfca8cc21bcf10a3281e874ebce0d27. The original goal of avoiding C++20 compilation regressions is still handled through a test in CI. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
12 daystest: Don't add current build directory to include pathLaurent Pinchart
Meson adds the current source and build directory to the include path by default. This causes a namespace clash in tests when using C++20, as the Span class test is compiled into a binary named 'span', which then gets included by source code through indirect '#include <span>' directives. Unsurprisingly, the compiler doesn't react happily when fed binary data. We could work around the problem by renaming the test executable, but disabling the implicit inclusion of the local directory is a more generic solution that will avoid similar issues in the future. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com> Reviewed-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com>
2024-05-03meson: Deprecate bitwise operations between different enumeration typeLaurent Pinchart
C++20 deprecates bitwise operations between different enumeration types. This is a bad practice even in C++17, so enable the deprecation warning. Doing so ensures no such operations will be added. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Umang Jain <umang.jain@ideasonboard.com> Reviewed-by: Stefan Klug <stefan.klug@ideasonboard.com>
2024-05-03apps: qcam: Use standard key sequence for quit actionLaurent Pinchart
Replace the manual CTRL+Q key sequence with QKeySequence::Quit. This automatically maps to the native shortcut for the quit action, regardless of the platform. Even though we don't expect qcam to run on non-Linux platform, using a QKeySequence is still a good practice when one exists. This doesn't change qcam's behaviour, as the native quit key sequence is CTRL+Q on Linux systems. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Umang Jain <umang.jain@ideasonboard.com> Reviewed-by: Stefan Klug <stefan.klug@ideasonboard.com>
2024-05-03libcamera: shared_mem_object: Fix compilation with uClibcLaurent Pinchart
uClibc doesn't provide a memfd_create() implementation. Fix it by using a direct syscall when the function isn't available. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Umang Jain <umang.jain@ideasonboard.com> Reviewed-by: Stefan Klug <stefan.klug@ideasonboard.com>
2024-05-03libcamera: utils: Avoid infinite recursion with strtod()Laurent Pinchart
When the C library doesn't provide local object support, the utils::strtod() function simply calls strtod() from the C library. The current implementation does so incorrectly, and calls utils::strtod() instead, resulting in infinite recursion. Fix it with a proper namespace qualifier. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Umang Jain <umang.jain@ideasonboard.com> Reviewed-by: Stefan Klug <stefan.klug@ideasonboard.com>
2024-05-03libcamera: libipa: camera_sensor: Add Sony IMX415 sensor propertiesAlexander Stein
Provide the Sony IMX415 camera sensor properties and registration with libipa for the gain code helpers. The test patterns exposed by the IMX415 do not map well to the current set of test pattern controls supplied by libcamera. These are left intentionally unimplemented. Signed-off-by: Alexander Stein <alexander.stein@ew.tq-group.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Daniel Scally <dan.scally@ideasonboard.com> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2024-05-03apps: cam: Fix C++20 deprecation warningBarnabás Pőcze
C++20 deprecated implicit capture of `this` via `[=]`. Fix that by explicitly capturing the necessary variables. Signed-off-by: Barnabás Pőcze <pobrn@protonmail.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Umang Jain <umang.jain@ideasonboard.com> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2024-05-03libcamera: libipa: camera_sensor: Add Sony IMX335 sensor propertiesKieran Bingham
Provide the Sony IMX335 camera sensor properties and registration with libipa for the gain code helpers. The test patterns exposed by the IMX335 do not map well to the current set of test pattern controls supplied by libcamera. These are left intentionally unimplemented. Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com> Signed-off-by: Umang Jain <umang.jain@ideasonboard.com> Reviewed-by: Stefan Klug <stefan.klug@ideasonboard.com> Reviewed-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2024-05-03libcamera: libipa: camera_sensor: Add Sony IMX283 sensor propertiesKieran Bingham
Provide the IMX283 camera sensor properties and registration with libipa for the gain code helpers. The test patterns exposed by the IMX283 do not map well to the current set of test pattern controls supplied by libcamera. These are left intentionally unimplemented. Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Umang Jain <umang.jain@ideasonboard.com> Reviewed-by: Stefan Klug <stefan.klug@ideasonboard.com> Reviewed-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com>
2024-04-20android: camera_device: Always clear descriptors_ in stop()Anle Pan
When flush() is called and then a new stream configuration is set, the descriptors_ queue might have a chance to be not cleared in stop(), as the Camera is already in Stopped state. This will prevent further requests from being completed in sendCaptureResults() as the descriptors_ queue is not empty. To fix the issue, clear the descriptors_ even if the Camera State is Stopped. As a drawback the libcamera::Camera::stop() function might be called twice, but this is allowed by the Camera state machine, and the second call is guaranteed to be a nop. Signed-off-by: Anle Pan <anle.pan@nxp.com> Signed-off-by: Fang Hui <hui.fang@nxp.com> Tested-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com> Reviewed-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com> Reviewed-by: Umang Jain <umang.jain@ideasonboard.com> Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
2024-04-20libcamera: Fix output spelling errorUmang Jain
There are two places where "output" is spelled as "ouput". Fix it. Signed-off-by: Umang Jain <umang.jain@ideasonboard.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>
2024-04-20libcamera: device_enumerator: Fix spell errorUmang Jain
In the description of DeviceMatch, the word 'appropriate' is spelled incorrectly as 'appropriare'. Fix it. Signed-off-by: Umang Jain <umang.jain@ideasonboard.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>