summaryrefslogtreecommitdiff
path: root/src/libcamera
AgeCommit message (Collapse)Author
2020-10-21libcamera: v4l2_videodevice: Prevent shadowing of V4L2BufferCache membersKieran Bingham
The members free, and lastUsed were not following the libcamera coding style, and were producing a shadowed parameter on the construction. Rename them to be marked as member variables with the _ postfix accordingly. Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com> Reviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2020-10-21libcamera: pipeline: rpi_stream: Explicitly name requestBufferKieran Bingham
The FrameBuffer used to track any addition to the request in an under-run event was shadowed against the returned buffer, being placed back on the availableBuffers_ queue. Rename the shadowed variable to be more explicit that it is a separate Buffer. Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com> Reviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
2020-10-21libcamera: pipeline: Use existing variable definitionsKieran Bingham
Prevent variable shadowing by removing the redeclaration of variables with the same name (and type) where the existing variable can be reused. Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com> Reviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2020-10-21libcamera: pipeline: Prevent variable shadowingKieran Bingham
Remove variable shadowing within the pipeline handler implementations. Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com> Reviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2020-10-21libcamera: thread: Prevent shadowing of signal nameKieran Bingham
The Thread::wait() function creates a boolean flag 'finished' which shadows the internal member signal of the same name. Rename the boolean flag to prevent confusion and shadowing of the signal. Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
2020-10-20libcamera: Document the libcamera namespaceLaurent Pinchart
The libcamera namespace has been left undefined from the start. While the documentation doesn't bring much added value, leaving it out confuses the most recent doxygen master branch: include/libcamera/transform.h:16: warning: Internal inconsistency: member Identity does not belong to any container! include/libcamera/transform.h:17: warning: Internal inconsistency: member Rot0 does not belong to any container! include/libcamera/transform.h:18: warning: Internal inconsistency: member HFlip does not belong to any container! include/libcamera/transform.h:19: warning: Internal inconsistency: member VFlip does not belong to any container! include/libcamera/transform.h:20: warning: Internal inconsistency: member HVFlip does not belong to any container! include/libcamera/transform.h:21: warning: Internal inconsistency: member Rot180 does not belong to any container! include/libcamera/transform.h:22: warning: Internal inconsistency: member Transpose does not belong to any container! include/libcamera/transform.h:23: warning: Internal inconsistency: member Rot270 does not belong to any container! include/libcamera/transform.h:24: warning: Internal inconsistency: member Rot90 does not belong to any container! include/libcamera/transform.h:26: warning: Internal inconsistency: member Rot180Transpose does not belong to any container! Document it. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Paul Elder <paul.elder@ideasonboard.com> Reviewed-by: Umang Jain <email@uajain.com> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
2020-10-20libcamera: Place doxygen \file block above namespaceLaurent Pinchart
Make the whole code base consistent by placing the doxygen \file block above the libcamera namespace opening. There's a single offender, and two locations in which a white line is missing. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Paul Elder <paul.elder@ideasonboard.com> Reviewed-by: Umang Jain <email@uajain.com> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
2020-10-20libcamera: Omit extra semicolonsHirokazu Honda
The end semicolons with LOG_DEFINE_CATEGORY, LOG_DECLARE_CATEGORY and REGISTER_PIPELINE_HANDLER are unnecessary. Signed-off-by: Hirokazu Honda <hiroh@chromium.org> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2020-10-14libcamera: controls: Define AwbLocked controlJacopo Mondi
Define a control to report the AWB algorithm locking state. The control definition is copied from the AeLocked one. Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com> Reviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se> Signed-off-by: Jacopo Mondi <jacopo@jmondi.org>
2020-10-12libcamera: pipeline: simple: enable qcom-camssAndrey Konovalov
qcom-camss driver supports MIPI CSI2 receivers on APQ8016 and APQ8096 Application processors from Qualcomm, which are used on e.g. DragonBoard 410c and DragonBoard 820c dev boards respectively. The simple pipeline handler provides basic support for these devices. Signed-off-by: Andrey Konovalov <andrey.konovalov@linaro.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-10-12libcamera, android, cam, gstreamer, qcam, v4l2: Reuse RequestPaul Elder
Allow reuse of the Request object by implementing reuse(). This means the applications now have the responsibility of freeing the Request objects, so make all libcamera users (cam, qcam, v4l2-compat, gstreamer, android) do so. Signed-off-by: Paul Elder <paul.elder@ideasonboard.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se> Reviewed-by: Jacopo Mondi <jacopo@jmondi.org>
2020-10-10libcamera: pipeline: simple: enable mplane devices using contiguous memoryAndrey Konovalov
The current simple pipeline handler refuses to work with capture devices which have V4L2_CAP_VIDEO_CAPTURE_MPLANE flag set in the device capabilities field. This is too restrictive, as devices supporting the multi-planar API can be using contiguous memory for semi-planar and planar formats, and this would just work without any changes to libcamera. Drop the guard against MPLANE devices, and replace it with the check of the number of planes in the format the simple pipeline handler is going to use for capture. This will let MPLANE devices which don't use non-contiguous memory for frame buffers to work with the simple pipeline handler. The following code in SimpleCameraData::init() filters out the pixel formats libcamera doesn't support: PixelFormat pixelFormat = videoFormat.first.toPixelFormat(); if (!pixelFormat) continue; So the check for the number of memory planes this patch adds would not trigger until non-contiguous planar formats becomes supported in libcamera, and video devices using these formats are enabled in the simple pipeline handler. Then this check will remind one to review the simple pipeline handler code. Signed-off-by: Andrey Konovalov <andrey.konovalov@linaro.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-10-07libcamera: PipelineHandler: Move printing pipeline names to CameraManagerPaul Elder
Since pipeline registration is done with declaring static factory objects, there is a risk that pipeline factories will be constructed before libcamera facilities are ready. For example, logging in the constructor of a pipeline handler factory may cause a segfault if threading isn't ready yet. Avoid this issue by moving printing the registration of the pipeline handler to the camera manager. Signed-off-by: Paul Elder <paul.elder@ideasonboard.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Jacopo Mondi <jacopo@jmondi.org>
2020-10-07libcamera: ProcessManager: make ProcessManager lifetime explicitly managedPaul Elder
If any Process instances are destroyed after the ProcessManager is destroyed, then a segfault will occur. Fix this by making the lifetime of the ProcessManager explicit, and make the CameraManager construct and deconstruct (automatically, via a member variable) the ProcessManager. Update the tests accordingly. Signed-off-by: Paul Elder <paul.elder@ideasonboard.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se> Reviewed-by: Jacopo Mondi <jacopo@jmondi.org>
2020-10-07libcamera: file_descriptor: Remove spurious 'is'Jacopo Mondi
Remove a spurious 'is' is a comment block. Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com> Reviewed-by: Umang Jain <email@uajain.com> Signed-off-by: Jacopo Mondi <jacopo@jmondi.org>
2020-10-07pipeline: ipa: raspberrypi: Switch to use C++17 features where possibleNaushir Patuck
With the recent change to use C++17, the following code changes can be made: - Use C++17 [[fallthough]] attribute instead of /* Fall through */. - Swap boost::any to std::any. 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-10-02pipeline: raspberrypi: Sensor flips should be applied unconditionallyNaushir Patuck
The code in pipeline_handler::start() that applies the flips were in a block that was conditional on the RPi::IPA_CONFIG_STAGGERED_WRITE return result. This should be applied unconditionally. Signed-off-by: Naushir Patuck <naush@raspberrypi.com> Reviewed-by: David Plowman <david.plowman@raspberrypi.com> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com> Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
2020-10-02libcamera: pipeline: uvcvideo: Set sensor model propertyNiklas Söderlund
Set the sensor model property from the model reported in the media graph. Signed-off-by: Niklas Söderlund <niklas.soderlund@ragnatech.se> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2020-10-02libcamera: pipeline: uvcvideo: Initialize CameraData from MediaDeviceNiklas Söderlund
The UVCCameraData::init() is the only consumer of the default entry in the media graph, move the lookup of it into the init() function and pass it the MediaDevice. This is done in preparation to extend the CameraData initialization to consume more information from the MediaDevice. Signed-off-by: Niklas Söderlund <niklas.soderlund@ragnatech.se> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
2020-10-02libcamera: camera_sensor: Set sensor model propertyNiklas Söderlund
Set the sensor model property. 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-10-02libcamera: utils: Add method to remove non-ASCII charactersNiklas Söderlund
Add method that removes non-ASCII characters from a string. 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: Umang Jain <email@uajain.com>
2020-10-02libcamera: properties: Add model propertyNiklas Söderlund
The model name must to the extent possible describe the sensor. For most devices this is the model name of the sensor. While for some devices the sensor model is unavailable as the sensor or the entire camera is part of a larger unit and exposed as a black-box to the system. In such cases the model name of the smallest component closest to the sensor must be used. Signed-off-by: Niklas Söderlund <niklas.soderlund@ragnatech.se> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2020-10-01libcamera: pipeline: rkisp1: Add support for XRGB8888Niklas Söderlund
The self path supports XRGB8888, list it as a supported format. Signed-off-by: Niklas Söderlund <niklas.soderlund@ragnatech.se> Reviewed-by: Paul Elder <paul.elder@ideasonboard.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2020-10-01libcamera: Add support for XRGB8888 and XBGR8888Niklas Söderlund
Add support for XRGB8888 and XBGR8888 formats. Signed-off-by: Niklas Söderlund <niklas.soderlund@ragnatech.se> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2020-10-01libcamera: pipeline: rkisp1: Add support for R8Niklas Söderlund
Both the main and self path support R8, list it as a supported format. Signed-off-by: Niklas Söderlund <niklas.soderlund@ragnatech.se> Reviewed-by: Paul Elder <paul.elder@ideasonboard.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2020-10-01libcamera: pipeline: rkisp1: Add support for RGB656Niklas Söderlund
The self path supports RGB565, list it as a supported format. Signed-off-by: Niklas Söderlund <niklas.soderlund@ragnatech.se> Reviewed-by: Paul Elder <paul.elder@ideasonboard.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2020-10-01libcamera: pipeline: rkisp1: Fix media bus propagation for NV{12,21}Niklas Söderlund
The upstream driver has changed how the link formats are validated when starting to stream [1]. This revealed that libcamera did not adjust the media bus format from the link between {main,self} resizer source pad and the capture video device as expected by the driver. The media bus code YUYV8_2X8 was hardcoded to MEDIA_BUS_FMT_YUYV8_2X8 for all pixel formats while it must be adjusted to YUYV8_1_5X8 for NV12 and NV21, fix this. 1. 6803a9e0e1e43e9e ("media: staging: rkisp1: cap: simplify link validation by comparing media bus code") Signed-off-by: Niklas Söderlund <niklas.soderlund@ragnatech.se> Reviewed-by: Paul Elder <paul.elder@ideasonboard.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2020-10-01libcamera: pipeline: rkisp1: Remove support for YVYU and VYUYNiklas Söderlund
The upstream driver has dropped support for YVYU and VYUY [1], remove support from the pipeline handler. 1. 3acb3e06baf64e28 ("media: staging: rkisp1: cap: remove unsupported formats") Signed-off-by: Niklas Söderlund <niklas.soderlund@ragnatech.se> Reviewed-by: Paul Elder <paul.elder@ideasonboard.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2020-09-30libcamera: pipeline: rkisp1: Use the media link to track if a path is enabledNiklas Söderlund
Instead of manually tracking if a path is enable or not use the media graph link status. There is no functional change. Signed-off-by: Niklas Söderlund <niklas.soderlund@ragnatech.se> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2020-09-30libcamera: pipeline: rkisp1: Move path link handling to RkISP1PathNiklas Söderlund
Move the path link handling to RkISP1Path, there is no functional change. Signed-off-by: Niklas Söderlund <niklas.soderlund@ragnatech.se> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2020-09-30libcamera: pipeline: rkisp1: Move start and stop of path to RkISP1PathNiklas Söderlund
Move the start and stop of a path to RkISP1Path. This allows the importing of buffers to be moved closer the path start/stop simplifying the code. Also by adding a simple running tracker the error logic in PipelineHandlerRkISP1 can be simplified as stop() can always be called. This also removes all external users of RkISP1Path::video_ so it can be made private. Signed-off-by: Niklas Söderlund <niklas.soderlund@ragnatech.se> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2020-09-30libcamera: pipeline: rkisp1: Add wrappers for accessing the path video deviceNiklas Söderlund
As a step to be able to make RkISP1Path::video_ private add simple wrappers for buffer handling. There is no functional change. Signed-off-by: Niklas Söderlund <niklas.soderlund@ragnatech.se> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2020-09-30libcamera: pipeline: rkisp1: Move path configuration generation and ↵Niklas Söderlund
validation to RkISP1Path Move the path configuration generation and validation to RkISP1Path. This is done to increase code reuse and to encapsulate the main and self path differences inside the RkISP1Path class. There is no functional change. Signed-off-by: Niklas Söderlund <niklas.soderlund@ragnatech.se> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2020-09-30libcamera: pipeline: rkisp1: Move path configuration to RkISP1PathNiklas Söderlund
Move the path configuration to RkISP1Path to increase code reuse and make the V4L2 subdevice resizer private to the path. There is no functional change. Signed-off-by: Niklas Söderlund <niklas.soderlund@ragnatech.se> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2020-09-30libcamera: pipeline: rkisp1: Breakout basic path handling to own classNiklas Söderlund
The self and main paths are very similar and the introduction of support for two simultaneous streams have made it clear their handling could be abstracted in a separate class. This is the first step to create such a class by breaking out the initialization and storage of the video and subdevices. There is no functional change in this patch. Signed-off-by: Niklas Söderlund <niklas.soderlund@ragnatech.se> Reviewed-by: Jacopo Mondi <jacopo@jmondi.org> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2020-09-30libcamera: stream: Rename StillCaptureRaw to RawNiklas Söderlund
With the buffer copy removed from all pipelines for raw capture rename StillCaptureRaw to Raw to better describe the role. Signed-off-by: Niklas Söderlund <niklas.soderlund@ragnatech.se> Reviewed-by: David Plowman <david.plowman@raspberrypi.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Paul Elder <paul.elder@ideasonboard.com>
2020-09-29libcamera: ipu3: Adjust comment on ImgU configurationJacopo Mondi
Be more precise in commenting why the ImgU shall not be configured if only the RAW stream is requested. As an example, if the ImgU gets unecessary configured: cam -srole=viewfinder -c2 -C -> WORKS cam -srole=stillraw -c2 -C -> WORKS cam -srole=viewfinder -c2 -C -> Failed to queue buffer 0: Invalid argument Since commit ("libcamera: ipu3: Fix RAW+YUV capture") the ImgU configuration procedure also correctly implements the assumption that at least one of the YUV output is being operated. If that's not the case, as in the RAW-only capture use case, the code tries to access a non-existing configuration. One more reason to exit early if no YUV stream is requested. 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-09-29libcamera: ipu3: Remove dead code checkJacopo Mondi
Since the re-implementation of the IPU3 pipeline handler configuration procedure, the main output is always assigned in case any YUV stream is requested. Remove a dead code block that checks for the main output to be valid. 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-09-29libcamera: ipu3: Fix RAW+YUV captureJacopo Mondi
When requesting one RAW stream and one YUV stream the StreamConfiguration assigned to the RAW stream is the first one added to the CameraConfiguration, while the YUV stream gets assigned to the main output. At configure() time the viewfinder output needs to be configured with the same format as the main output, but since the introduction of RAW capture support, the pipeline has not been updated and still assumes the main output configuration is the first one in the CameraConfiguration. This causes the viewfinder to be configured with the same format as the raw stream, breaking capture operations. Before this commit the following command fails and the ImgU does not produce frames: cam -srole=stillraw -srole=viewfinder -c2 -C 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-09-29ipa: raspberrypi: Tidy up variable names to be consistentNaushir Patuck
Change variable names to camel case to be consistent with the rest of the source files. Remove #define consts and replace with constexpr. Add some newlines to make the code more readable. There are no functional changes in this commit. Signed-off-by: Naushir Patuck <naush@raspberrypi.com> Reviewed-by: Jacopo Mondi <jacopo@jmondi.org> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com> Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> [Kieran: Rebase merge conflicts resolved] [Kieran: Fix checkstyle line under 80 chars] Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
2020-09-29ipa: raspberrypi: Move IPA parameters to the RPi namespaceNaushir Patuck
All IPA related types/params are now moved to the RPi namespace. There are no functional changes in this commit. Signed-off-by: Naushir Patuck <naush@raspberrypi.com> Reviewed-by: Jacopo Mondi <jacopo@jmondi.org> Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> [Kieran: Rebase merge conflicts fixed] Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
2020-09-29pipeline: raspberrypi: Rename RPi::RPiStream and RPi::RPiDeviceNaushir Patuck
Rename RPi::RPiStream -> RPi::Stream and RPi::RPiDevice -> RPi::Device. There are no functional changes in this commit. Signed-off-by: Naushir Patuck <naush@raspberrypi.com> Reviewed-by: Jacopo Mondi <jacopo@jmondi.org> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com> Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
2020-09-29libcamera: raspberrypi: Plumb user transform through to IPADavid Plowman
This commit plumbs the user transform from the Raspberry Pi pipeline handler through to the IPA. Note that the transform is actually handled in the sensor (by setting the h/v flip bits), so the IPAs need to understand the orientation of the image they receive. Once in the IPA we add it to the CameraMode description, so that it becomes automatically available to all the individual control algorithms. The IPA configure method has to be reordered just a little so as to fill in the transform in the camera mode before calling SwitchMode. Signed-off-by: David Plowman <david.plowman@raspberrypi.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com> Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
2020-09-29libcamera: raspberrypi: Set camera flips correctly from user transformDavid Plowman
The Raspberry Pi pipeline handler allows all transforms except those involving a transpose. The user transform is combined with any inherent rotation of the camera, and the camera's H and V flip bits are set accordingly. Note that the validate() method has to work out what the final Bayer order of any raw streams will be, before configure() actually applies the transform to the sensor. We make a note of the "native" (untransformed) Bayer order when the system starts, so that we can deduce transformed Bayer orders more easily. Signed-off-by: David Plowman <david.plowman@raspberrypi.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com> Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
2020-09-29libcamera: Add user Transform to CameraConfigurationDavid Plowman
Add a field to the CameraConfiguration (including the necessary documentation) to represent a 2D transform requested by the application. All pipeline handlers are amended to coerce this to the Identity, marking the configuration as "adjusted" if something different had been requested. Pipeline handlers that support Transforms can be amended subsequently. Signed-off-by: David Plowman <david.plowman@raspberrypi.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com> Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
2020-09-29libcamera: Add BayerFormat typeDavid Plowman
This type encodes BayerFormats in an explicit way, that makes them easier to use than some of the other more opaque type formats. This makes the BayerFormat useful for editing or manipulating Bayer types more easily. Signed-off-by: David Plowman <david.plowman@raspberrypi.com> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com> Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
2020-09-29libcamera: Add Transform enum to represent 2D plane transforms.David Plowman
We implement 2D transforms as an enum class with 8 elements, consisting of the usual 2D plane transformations (flips, rotations etc.). The transform is made up of 3 bits, indicating whether the transform includes: a transpose, a horizontal flip (mirror) and a vertical flip. Signed-off-by: David Plowman <david.plowman@raspberrypi.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com> Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
2020-09-29libcamera: Allow access to v4l2_query_ext_ctrl structure for a V4L2 controlDavid Plowman
The V4L2Device::controlInfo method simply returns a pointer to the v4l2_query_ext_ctrl structure for the given control, which has already been retrieved and stored. Signed-off-by: David Plowman <david.plowman@raspberrypi.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com> Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
2020-09-29libcamera: pipeline: raspberrypi: Revert "Set sensor default orientation ↵David Plowman
before configure()" This reverts commit 1e8c91b65695449c5246d17ba7dc439c8058b781. Now that we shall be implementing application-defined 2D transforms it's no longer possible to set the sensor orientation so early on. We have to wait until we have the CameraConfiguration object as that's where the application puts its choice of transform. Signed-off-by: David Plowman <david.plowman@raspberrypi.com> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
2020-09-28libcamera: pipeline: rkisp1: Expose self path streamNiklas Söderlund
Expose the self stream to applications and prefers it for the viewfinder and video roles as it can be extended to produce RGB. Keep preferring the main path for still capture as it could be extended to support RAW formats which makes most sense for still capture. With this change the self path becomes available to applications and a camera backed by this pipeline can produce two streams simultaneously. Signed-off-by: Niklas Söderlund <niklas.soderlund@ragnatech.se> Reviewed-by: Jacopo Mondi <jacopo@jmondi.org> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>