summaryrefslogtreecommitdiff
path: root/src/libcamera
AgeCommit message (Collapse)Author
2020-09-28libcamera: pipeline: rkisp1: Add format validation for self pathNiklas Söderlund
Extend the format validation to work with both main and self paths. The heuristics honors that the first stream in the configuration has the highest priority while still examining both streams for a best match. It is not possible to capture from the self path as the self stream is not yet exposed to applications. Signed-off-by: Niklas Söderlund <niklas.soderlund@ragnatech.se> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2020-09-28libcamera: pipeline: rkisp1: Track buffers for self pathNiklas Söderlund
In preparation of supporting both the main and self path extend RkISP1FrameInfo to track buffers from the self path stream. Signed-off-by: Niklas Söderlund <niklas.soderlund@ragnatech.se> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Jacopo Mondi <jacopo@jmondi.org>
2020-09-28libcamera: pipeline: rkisp1: Configure self pathNiklas Söderlund
Allow for both the main and self path streams to be configured. This change adds the self path as an internal stream to the pipeline handler. It is not exposed as a Camera stream so it can not yet be used. Signed-off-by: Niklas Söderlund <niklas.soderlund@ragnatech.se> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2020-09-28libcamera: pipeline: rkisp1: Add self path devicesNiklas Söderlund
Add the V4L2 device nodes needed to operate the self path. Signed-off-by: Niklas Söderlund <niklas.soderlund@ragnatech.se> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2020-09-28libcamera: pipeline: rkisp1: Prefix main path video and resizerNiklas Söderlund
In preparation of supporting both the main and self path prefix the main path specific variables with mainPath. Signed-off-by: Niklas Söderlund <niklas.soderlund@ragnatech.se> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2020-09-28libcamera: pipeline: rkisp1: Set the crop rectangleNiklas Söderlund
Changing resolutions back and forth can provoke the crop rectangle to go out of sync, set it as part of format configuration. Signed-off-by: Niklas Söderlund <niklas.soderlund@ragnatech.se> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Jacopo Mondi <jacopo@jmondi.org>
2020-09-28libcamera: pipeline: rkisp1: Export stream formats to applicationsNiklas Söderlund
The information about stream format is available but not exported to applications, fix this. Signed-off-by: Niklas Söderlund <niklas.soderlund@ragnatech.se> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Jacopo Mondi <jacopo@jmondi.org>
2020-09-28libcamera: pipeline: rkisp1: Create RkISP1Frames from camera dataNiklas Söderlund
Create RkISP1Frames from camera data instead of picking information out from it. This is done to prepare for multi stream support where more information from the camera data will be needed. 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-28libcamera: pipeline: rkisp1: Prepare buffer ready handlers for multiple streamsNiklas Söderlund
The buffer ready handlers are designed for a single application facing stream from the main path. To prepare for multiple application facing streams from main and/or self path the handlers need to be prepared. The data keeping track of the frame number and advancing the timeline can be moved from the application facing buffer ready handler to the statistics handler. For each request processed there will always be a statistic buffer and as the ISP is inline and is the source of both main, self and statistic paths there is no change in behavior. The application facing handler no longer needs a special case for cancelled frames and can be made simpler. With this change the handlers are ready to deal with any combinations of application facing streams. 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-28libcamera: pipeline: rkisp1: Setup links as part of configurationNiklas Söderlund
In preparation of supporting both the main and self path configure all the media graph links as a part of the configuration step. Before this change the link between ISP and DMA engine was setup at match time as the only supported path was the main path and only the link between sensor and ISP was updated at part of the configuration step. The main path is still the only path between ISP and DMA engine that is possible to enable. Signed-off-by: Niklas Söderlund <niklas.soderlund@ragnatech.se> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2020-09-28libcamera: pipeline: rkisp1: Breakout mainpath size and format constraintsNiklas Söderlund
Breakout the mainpath size and format constrains as it will be used in more places then just validate(). While at it use the new helpers to validate Size. Signed-off-by: Niklas Söderlund <niklas.soderlund@ragnatech.se> Reviewed-by: Jacopo Mondi <jacopo@jmondi.org> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2020-09-28libcamera: pipeline: rkisp1: Remove redundant check of buffer in RequestNiklas Söderlund
There is no need to check if Request contains a buffer belonging the RkISP1 Camera as this is already done in Camera::queueRequest(), remove the redundant check. Reported-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Niklas Söderlund <niklas.soderlund@ragnatech.se> Reviewed-by: Jacopo Mondi <jacopo@jmondi.org>
2020-09-28libcamera: pipeline: rkisp1: Set number of planes based on formatNiklas Söderlund
The RkISP1 pipeline originally only supported NV formats which have 2 planes. When support for YUV formats was added the plane count on the output format was not made to reflect this. Instead of hard coding the plane count to 2 fetch the number of planes from the format information. Reported-by: Jacopo Mondi <jacopo@jmondi.org> Fixes: 2b1a908b5222e263 ("libcamera: camera: Add a validation API to the CameraConfiguration class") Signed-off-by: Niklas Söderlund <niklas.soderlund@ragnatech.se> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2020-09-24libcamera: ipa: Move key generation to utilsKieran Bingham
Move the GPLv2 utilities used for generating public and private keys to the utilities subtree. Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Paul Elder <paul.elder@ideasonboard.com>
2020-09-24libcamera: Move Header generation utilities to utilsKieran Bingham
Move the GPL2 utilities which handle generation of controls, formats and the top level libcamera header to the utils subtree. Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Paul Elder <paul.elder@ideasonboard.com>
2020-09-22libcamera: buffer: Remove copyFrom()Niklas Söderlund
There are no user left of the copyFrom() operation, remove it. 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-09-21pipeline: ipa: raspberrypi: Handle any externally allocated FrameBufferNaushir Patuck
Handle the case where a FrameBuffer that has been externally allocated (i.e. not through the v4l2 video device) is passed into a Request. We must store the buffer pointer in the stream internal buffer list to identify when used. Signed-off-by: Naushir Patuck <naush@raspberrypi.com> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com> Reviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se> Signed-off-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
2020-09-21pipeline: raspberrypi: Use an unordered_set to store IPA buffer idsNaushir Patuck
By using a set container, we can easily insert/remove buffer ids that have been mmaped by the IPA. This will be required to track buffers allocated externally and passed to the pipeline handler through a Request. Move the IPA buffer mapping code into a function to remove duplicated code. Signed-off-by: Naushir Patuck <naush@raspberrypi.com> Reviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com> Signed-off-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
2020-09-21pipeline: raspberrypi: Use an unordered_map for the stream buffer listNaushir Patuck
By using a map container, we can easily insert/remove buffers from the buffer list. This will be required to track buffers allocated externally and passed to the pipeline handler through a Request. Replace the buffer index tracking with an id generated internally by the stream object. Signed-off-by: Naushir Patuck <naush@raspberrypi.com> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com> Reviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se> Signed-off-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
2020-09-21libcamera: pipeline: ipa: raspberrypi: Remove use of FrameBuffer cookieNaushir Patuck
The FrameBuffer cookie may be set by the application, so this cannot be set by the pipeline handler as well. Revert to using a simple index into the buffer list to identify buffers passing to and from the IPA. Signed-off-by: Naushir Patuck <naush@raspberrypi.com> Reviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com> Tested-by: David Plowman <david.plowman@raspberrypi.com> Signed-off-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
2020-09-21libcamera: pipeline: raspberrypi: Add more robust stream buffer logicNaushir Patuck
Add further queueing into the RPiStream object to ensure that we always follow the buffer ordering (be it internal or external) given by incoming Requests. This is essential, otherwise we risk dropping frames that are meant to be part of a Request, and can cause the pipeline to stall indefinitely. This also prevents any possibility of mismatched frame buffers going through the pipeline and out to the application. Signed-off-by: Naushir Patuck <naush@raspberrypi.com> Reviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com> Tested-by: David Plowman <david.plowman@raspberrypi.com> Signed-off-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
2020-09-21libcamera: pipeline: raspberrypi: Fix bug in passing configuration to IPANaushir Patuck
The counter was not incremented, so multiple streams would only pass the last stream config to the IPA. Signed-off-by: Naushir Patuck <naush@raspberrypi.com> Reviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Tested-by: David Plowman <david.plowman@raspberrypi.com> Signed-off-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
2020-09-21libcamera: pipeline: raspberrypi: Rework stream buffer logic for zero-copyNaushir Patuck
Stop using v4l2_videodevice::allocateBuffer() for internal buffers and instead export/import all buffers. This allows the pipeline to return any stream buffer requested by the application as zero-copy. Advertise the Unicam Image stream as the RAW capture stream now. The RPiStream object now maintains a new list of buffers that are available to queue into a device. This is needed to distinguish between FrameBuffers allocated for internal use vs externally provided buffers. When a Request comes in, if a buffer is not provided for an exported stream, we re-use a buffer from this list. Signed-off-by: Naushir Patuck <naush@raspberrypi.com> Reviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com> Tested-by: David Plowman <david.plowman@raspberrypi.com> Signed-off-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
2020-09-21libcamera: pipeline: raspberrypi: Remove const qualifier from RPiStreamNaushir Patuck
For the zero-copy RAW capture feature, the RPiStream will have to be modified. Remove the const qualifier in anticipation of the future commits for this feature. Signed-off-by: Naushir Patuck <naush@raspberrypi.com> Reviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Tested-by: David Plowman <david.plowman@raspberrypi.com> Signed-off-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
2020-09-21libcamera: pipeline: raspberrypi: Increase the number of RAW buffersNaushir Patuck
Increase the number of expected RAW buffers in the stream configuration to 2. This will avoid dropping Unicam frames when exporting RAW streams. Signed-off-by: Naushir Patuck <naush@raspberrypi.com> Reviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Tested-by: David Plowman <david.plowman@raspberrypi.com> Signed-off-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
2020-09-21libcamera: pipeline: raspberrypi: Add some debug loggingNaushir Patuck
No functional changes, only added some more trace points. Signed-off-by: Naushir Patuck <naush@raspberrypi.com> Reviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com> Tested-by: David Plowman <david.plowman@raspberrypi.com> Signed-off-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
2020-09-21libcamera: pipeline: ipa: raspberrypi: Rework drop frame signallingNaushir Patuck
The IPA now signals up front how many frames it wants the pipeline handler to drop. This makes it easier to handle up-coming changes to the buffer handling for import/export buffers. Signed-off-by: Naushir Patuck <naush@raspberrypi.com> Reviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Tested-by: David Plowman <david.plowman@raspberrypi.com> Signed-off-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
2020-09-21libcamera: pipeline: raspberrypi: Move RPiStream into a separate fileNaushir Patuck
Put RPiStream into the RPi namespace and add a new log category (RPISTREAM). Reorder methods into logical groups for readability. There are no functional changes in this commit. Signed-off-by: Naushir Patuck <naush@raspberrypi.com> Reviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Tested-by: David Plowman <david.plowman@raspberrypi.com> Signed-off-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
2020-09-21libcamera: Don't unnecessarily include event_notifier.hLaurent Pinchart
The ipc_unixsocket.h and process.h internal headers don't need to include event_notifier.h, the former because a forward declaration suffices, and the latter because it doesn't use event notifiers. Remove the unnecessary include, and include signal.h instead which is required and was included indirectly through event_notifier.h. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
2020-09-20libcamera: camera: Optimize camera deletionLaurent Pinchart
In most cases the last reference to a Camera instance will be the one held by the CameraManager. That reference gets released when the CameraManager thread cleans up, just before it stops. There's no need to delete the camera with deleteLater() in that case. To optimize this case, use deleteLater() only when the camera gets deleted from a different thread, and delete is synchronously otherwise. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Umang Jain <email@uajain.com>
2020-09-18libcamera: ipu3: Always use sensor full frame sizeJacopo Mondi
When calculating the pipeline configuration for the IPU3 platform, libcamera tries to be smart and select the smallest sensor frame resolution large enough to accommodate the stream sizes requested by the application. While this makes a lot of sense, in practice optimizing the selected sensor resolution makes the pipeline configuration calculation process fail in multiple occasions, or results in stalls during capture. As a trivial example, capturing with cam with the following command line results in a stall: $ cam -swidth=1280,height=720 -swidth=640,height=480 -c1 -C Likewise, the Android HAL supported format enumeration fails in reporting smaller resolutions as supported when used with the OV5670 sensor. 320x240: DEBUG IPU3 ipu3.cpp:192 CIO2 configuration: 648x486-SGRBG10_IPU3 ERROR IPU3 imgu.cpp:408 Failed to calculate pipe configuration ERROR IPU3 ipu3.cpp:299 Failed to calculate pipe configuration: unsupported resolutions. 640x480: DEBUG IPU3 ipu3.cpp:192 CIO2 configuration: 320x240-SGRBG10_IPU3 ERROR IPU3 imgu.cpp:408 Failed to calculate pipe configuration ERROR IPU3 ipu3.cpp:299 Failed to calculate pipe configuration: unsupported resolutions. Furthermore the reference xml files used for the IPU3 camera configuration on the ChromeOS platform restricts the number of sensor resolution to be used for the OV5670 sensor to 2 from the 6 supported by the driver [1]. The selection criteria of the correct CIO2 mode are not specified, and for the time being, as a workaround, always use the sensor maximum resolution at the expense of frame rate and bus bandwidth to allow the pipeline to successfully support smaller modes for the OV5670 sensor and solve pipeline stalls when capturing with both sensors. [1] See the <sensor_modes> enumeration in: https://chromium.googlesource.com/chromiumos/overlays/board-overlays/+/master/baseboard-poppy/media-libs/cros-camera-hal-configs-poppy/files/gcss/graph_settings_ov5670.xml Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se> Signed-off-by: Jacopo Mondi <jacopo@jmondi.org>
2020-09-16libcamera: Turn the android option into a featureLaurent Pinchart
Allow disabling compilation of the Android HAL adaptation layer automatically when a dependency is missing by turning the android option into a feature. The default value is set to 'disabled' to match the current behaviour. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com> Reviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
2020-09-14libcamera: pipeline: rkisp1: Fix line length typoNiklas Söderlund
The function declaration is unnecessarily broken on two lines as it fits on 80 characters, which makes reading the code nicer. Signed-off-by: Niklas Söderlund <niklas.soderlund@ragnatech.se> Reviewed-by: Jacopo Mondi <jacopo@jmondi.org> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
2020-09-06libcamera: buffer: Fix MappedBuffer::maps_ documentationUmang Jain
Complete the brief for MappedBuffer::maps_ documentation. Fixes: b3383da79f1d ("libcamera: buffer: Create a MappedBuffer") Signed-off-by: Umang Jain <email@uajain.com> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com> Reviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2020-08-29libcamera: media_object: Make MediaLink::setEnabled() account for existing flagsDan Scally
The MediaDevice::setupLink() function fails (ioctl returns EINVAL) when it passes only the MEDIA_LNK_FL_ENABLE flag to a link that is already flagged with MEDIA_LNK_FL_ENABLE and MEDIA_LNK_FL_IMMUTABLE. Contrast to media-ctl's equivalent media_setup_link() which ORs the new flags with the existing values. Fix this by preserving all flags but MEDIA_LNK_FL_ENABLED in MediaLink::setEnabled(). Signed-off-by: Dan Scally <djrscally@gmail.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-08-28libcamera: raspberrypi: Check dma heap allocatorJacopo Mondi
Check if the dmaHeap_ allocator is valid at match() time to fail earlier if its construction failed. Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com> Signed-off-by: Jacopo Mondi <jacopo@jmondi.org>
2020-08-28libcamera: raspberrypi: dmaheaps: Add isValid()Jacopo Mondi
Add isValid() method to verify the allocator device has been open correctly. Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com> Signed-off-by: Jacopo Mondi <jacopo@jmondi.org>
2020-08-28libcamera: raspberrypi: dmaheaps: Improve device openJacopo Mondi
Improve the device opening at class construction time by testing all the available device paths and printout the appropriate error message. While at it, initialize dmaHeapHandle_ to -1 and check for its value at destruction time. Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com> Signed-off-by: Jacopo Mondi <jacopo@jmondi.org>
2020-08-27pipeline: raspberrypi: Set sensor default orientation before configure()Naushir Patuck
The default sensor orientation must be set early on in match() to ensure generateConfiguration() and configure() return out the correct Bayer ordering to the application. This is particularly important for RAW capture streams. 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: Kieran Bingham <kieran.bingham@ideasonboard.com>
2020-08-26libcamera: pipeline: vimc: Fix configuration validationLaurent Pinchart
The sensor aligns the width and height to multiples of two pixels, and the scaler has a x3 hardcoded factor. The output size must thus be aligned to 6 pixels, not 3. Fix it. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Paul Elder <paul.elder@ideasonboard.com> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
2020-08-25meson: Remove -Wno-unused-parameterLaurent Pinchart
We build libcamera with -Wno-unused-parameter and this doesn't cause much issue internally. However, it prevents catching unused parameters in inline functions defined in public headers. This can lead to compilation warnings for applications compiled without -Wno-unused-parameter. To catch those issues, remove -Wno-unused-parameter and fix all the related warnings with [[maybe_unused]]. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com> Reviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
2020-08-25libcamera: Drop explicit construction of std::queueLaurent Pinchart
Now that libcamera is using C++17 and requires gcc 7 or newer, we can use the implicit std::queue constructor. Simplify the code accordingly. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com> Reviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
2020-08-25libcamera: Replace utils::clamp() with std::clamp()Laurent Pinchart
Now that libcamera uses C++17, the C++ standard library provides std::clamp(). Drop our custom utils::clamp() function. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com> Reviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
2020-08-25libcamera: pipeline: ipu3: Remove stray "imgu." fileLaurent Pinchart
Commit 15df621fb9a7 ("libcamera: ipu3: Configure ImgU with the computed parameters") added an empty "imgu." file by mistake. Remove it. Fixes: 15df621fb9a7 ("libcamera: ipu3: Configure ImgU with the computed parameters") Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com> Reviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
2020-08-24libcamera: object: Fix deleteLater() sample codeUmang Jain
Instead of using "delete obj" in the custom deleter of the shared object, we should have been using the "obj->deleteLater()" to explain how the deleteLater() API should be used in practice. Fixes: 9558886f7a85 ("libcamera: object: Add deleteLater() support) Signed-off-by: Umang Jain <email@uajain.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2020-08-23libcamera: pipeline: uvcvideo: Treat all UVC cameras as externalUmang Jain
We currently have no way to identify if the UVC device is external or internal(i.e. non-removable) to the system to set this property. Until we have a starting point to resolve this, treat all UVC cameras. Add a \todo explaining the situation for the same. Signed-off-by: Umang Jain <email@uajain.com> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2020-08-16libcamera: camera: Mark controls() and properties() as const operationsNiklas Söderlund
Reading the controls and properties does not modify the camera's state and can be marked as const operations. Signed-off-by: Niklas Söderlund <niklas.soderlund@ragnatech.se> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
2020-08-16libcamera: pipeline_handler: Mark controls() and properties() as const ↵Niklas Söderlund
operations Reading the controls and properties does not modify the pipeline's state and can be marked as const operations. Signed-off-by: Niklas Söderlund <niklas.soderlund@ragnatech.se> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
2020-08-16libcamera: pipeline_handler: Add const version of cameraData()Niklas Söderlund
Add a version of cameraData() that returns a const pointer and mark it as a const operation. The assert in the non-const version of the function already enforces that a std::map::at() operation would always succeed so there is no change in operation from the non-const version. Signed-off-by: Niklas Söderlund <niklas.soderlund@ragnatech.se> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
2020-08-14libcamera: request: Make Stream pointer constNiklas Söderlund
The Stream pointer just acts as a key in the Request object. There is no good use-case to modify a stream from a pointer retrieved from the Request, make it const. This allows pipeline handlers to better express that the Stream pointer is retrieved in a Request should just be treated as a key. Signed-off-by: Niklas Söderlund <niklas.soderlund@ragnatech.se> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>