summaryrefslogtreecommitdiff
path: root/src/libcamera
AgeCommit message (Collapse)Author
2020-04-14ipa: Add start() and stop() operationsNiklas Söderlund
Add two new operations to the IPA interface to start and stop it. The intention is that these functions shall be used by the IPA to perform actions when the camera is started and stopped. Signed-off-by: Niklas Söderlund <niklas.soderlund@ragnatech.se> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2020-04-04libcamera: pixelformats: Replace set of modifiers with single valueKaaira Gupta
DRM fourccs look like they have a per-plane modifier, but in fact each of them should be same. Hence instead of passing a set of modifiers for each fourcc in PixelFormat class, we can pass just a single modifier. So, replace the set with a single value. Signed-off-by: Kaaira Gupta <kgupta@es.iitr.ac.in> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> [Fix compilation error in src/libcamera/pipeline/ipu3/ipu3.cpp] Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2020-03-29libcamera: pipeline: ipu3: Fix compilation on gcc 5 and 6Laurent Pinchart
Commit 5e7c5d64a67f ("libcamera: ipu3: Do not unconditionally queue buffers to CIO2") introduced usage of the std::queue default constructor by using copy-list-initialization from {}. The default constructor was explicit in C++11, which was fixed retroactively with a defect report (http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p0935r0.html). gcc 5 and 6 are unfortunately affected, requiring explicit usage of the constructor. Fixes: 5e7c5d64a67f ("libcamera: ipu3: Do not unconditionally queue buffers to CIO2") Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
2020-03-27libcamera: ipu3: Add support for a RAW still capture streamNiklas Söderlund
Allow the RAW buffer cycling between CIO2 and IMGU to be memory copied to a new FrameBuffer in a new RAW stream. This allows users to capture the raw Bayer format coming from the sensor. As the RAW frame is memory copied queueing requests with the StillCaptureRaw stream might impact performance. Signed-off-by: Niklas Söderlund <niklas.soderlund@ragnatech.se> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2020-03-27libcamera: ipu3: Do not unconditionally queue buffers to CIO2Niklas Söderlund
Instead of unconditionally cycling buffers between the CIO2 and IMGU pick a buffer when a request is queued to the pipeline. This is needed if operations are to be applied to the buffer coming from CIO2 with parameters coming from a Request. The approach to pick a CIO2 buffer when a request is queued is similar to other pipelines, where parameters and statistic buffers are picked this way. Signed-off-by: Niklas Söderlund <niklas.soderlund@ragnatech.se> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2020-03-27libcamera: FrameBuffer: Add a setRequest() interfaceNiklas Söderlund
Add the ability to set the Request a buffer is associated with. This is needed for buffers that live inside a pipeline handler and is temporarily associated with a request as it's being processed inside the pipeline. While we are at it delete a stray semicolon. Signed-off-by: Niklas Söderlund <niklas.soderlund@ragnatech.se> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2020-03-27libcamera: FrameBuffer: Add a method to copy buffer contentNiklas Söderlund
This method may be used to memory copy a whole FrameBuffer content from another buffer. The operation is not fast and should not be used without great care by pipelines. The intended use-case is to have an option to copy out RAW buffers from the middle of a pipeline. Signed-off-by: Niklas Söderlund <niklas.soderlund@ragnatech.se> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2020-03-27libcamera: stream: Add StillCaptureRaw roleNiklas Söderlund
Add a role for capturing high resolution, low frame rate, still images in RAW format. 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-03-27libcamera: v4l2PixelFormat: Replace hex with fourCCKaaira Gupta
Print fourCC characters instead of the hex value in toString() as they are more informative. Also, write the tests for this in formats.cpp Signed-off-by: Kaaira Gupta <kgupta@es.iitr.ac.in> 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-03-25libcamera: Make pipeline handlers selectable at compile timeLaurent Pinchart
Add a 'pipelines' project option that specifies which pipeline handlers to compile in. The corresponding IPA modules are automatically selected. The default is to compile all pipeline handlers. 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-03-25libcamera: pipeline: Move uvcvideo and vimc to subdirectoriesLaurent Pinchart
Give a subdirectory to all pipeline handlers to make the structure of the source tree more consistent. This will also simplify the implementation of pipeline handlers selection at build time. 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-03-24libcamera: v4l2_videodevice: Add support for all 32-bit ARGB formatsLaurent Pinchart
The V4L2VideoDevice class implements conversion between PixelFormat and V4L2PixelFormat for a single flavour of the 32-bit ARGB formats. Add the three missing ones. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se> Reviewed-by: Jacopo Mondi <jacopo@jmondi.org>
2020-03-23libcamera: v4l2_device: Enable enumeration of U8 controlsJacopo Mondi
Enable the enumeration of V4L2 array controls with V4L2_CTRL_TYPE_U8 type. Signed-off-by: Jacopo Mondi <jacopo@jmondi.org> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2020-03-23libcamera: v4l2_controls: Support U8 array controlsJacopo Mondi
Add support for array controls of type V4L2_CTRL_TYPE_U8. Signed-off-by: Jacopo Mondi <jacopo@jmondi.org> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2020-03-23libcamera: v4l2_device: Support reading U8 array controlsJacopo Mondi
Add support to retrieve the value of array controls of type V4L2_CTRL_TYPE_U8. Signed-off-by: Jacopo Mondi <jacopo@jmondi.org> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Jacopo Mondi <jacopo@jmondi.org>
2020-03-23libcamera: v4l2_device: Support writing array U8 controlsJacopo Mondi
Add support to write array controls of type V4L2_CTRL_TYPE_U8. Signed-off-by: Jacopo Mondi <jacopo@jmondi.org> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Jacopo Mondi <jacopo@jmondi.org>
2020-03-23libcamera: v4l2_controls: Cache query control informationJacopo Mondi
Cache the V4L2 control info retrieved with VIDIOC_QUERY_EXT_CTRL at control listing time for later use. Signed-off-by: Jacopo Mondi <jacopo@jmondi.org> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Jacopo Mondi <jacopo@jmondi.org>
2020-03-23libcamera: controls: Add zero-copy set API for ControlValueLaurent Pinchart
Extend the ControlValue class with a reserve() function to set the value without actually copying data, and a non-const data() function that allows writing data directly to the ControlValue storage. This allows allocating memory directly in ControlValue, potentially removing a data copy. Note that this change was implemented before ByteStreamBuffer gained the zero-copy read() variant, and doesn't actually save a copy in the control serializer. It however still simplifies ControlSerializer::loadControlValue(). Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Jacopo Mondi <jacopo@jmondi.org>
2020-03-23libcamera: device_enumerator: Convey device ownership through unique_ptrLaurent Pinchart
Replace usage of shared_ptr with unique_ptr to convey media device ownership internally in the enumerators when creating the media device. Once a media device has all its dependencies met, it is converted to a shared_ptr to keep the external API unchanged. 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-03-23libcamera: device_enumerator_udev: Update pending list in addUdevDeviceLaurent Pinchart
Media devices that have unmet dependencies are added to the pending list in populateMediaDevice(). Move the code to the caller, addUdevDevice(), as it logically belongs there. 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-03-23libcamera: thread: Order headers alphabeticallyLaurent Pinchart
No code change. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
2020-03-23libcamera: device_enumerator_udev: Don't add media device twiceLaurent Pinchart
Commit 68daa9302f90 ("libcamera: device_enumerator: Don't stop if one device fails") introduced a bug in device enumeration. Previously, a media device would only be added when all its dependencies were present, as indicated by populateMediaDevice() returning 0. The commit changed the logic to propagate the populateMediaDevice() return code up, but mistakenly added the media device to the enumerator even when dependencies were missing. This causes media devices enumerated with missing dependencies to be added twice, once when enumerating the media device itself, and a second time when all the dependencies are found. Fix it by deferring addition of the media device when dependencies are missing, and add debug messages to track this process. Fixes: 68daa9302f90 ("libcamera: device_enumerator: Don't stop if one device fails") Reported-by: Andrey Konovalov <andrey.konovalov@linaro.org> 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-03-23Revert "libcamera: controls: Don't over-optimize ControlValue layout"Laurent Pinchart
This is a partial revert of commit 0028536d70c7, removing a change that was incorrectly squashed. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se> Acked-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
2020-03-21libcamera: device_enumerator: Remove '\todo' as it is completedKaaira Gupta
There is a todo written in the doxygen documentation of device_enumerator which is already completed, hence remove it from the documentation. Signed-off-by: Kaaira Gupta <kgupta@es.iitr.ac.in> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2020-03-20libcamera: controls: Don't over-optimize ControlValue layoutLaurent Pinchart
The ControlValue class size should be minimized to save space, as it can be instantiated in large numbers. The current implementation does so by specifying several members as bitfields, but does so too aggressively, resulting in fields being packed in an inefficient to access way on some platforms. For instance, on 32-bit x86, the numElements_ field is offset by 7 bits in a 32-bit word. This additionally causes a static assert that checks the size of the class to fail. Relax the constraints on the isArray_ and numElements_ fields to avoid inefficient access, and to ensure that the class size is identical across all platforms. This will need to be revisited anyway when stabilizing the ABI, so add a \todo comment as a reminder. Fixes: 1fa4b43402a0 ("libcamera: controls: Support array controls in ControlValue") Reported-by: Jan Engelhardt <jengelh@inai.de> 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-03-20libcamera: controls: Move ControlValue size check to controls.cppLaurent Pinchart
The size of the ControlValue class is checked by a static_assert() to avoid accidental ABI breakages. There's no need to perform the check every time controls.h is included, move it to controls.cpp. 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-03-20libcamera: controls: Add support for string controlsLaurent Pinchart
String controls are stored internally as an array of char, but the ControlValue constructor, get() and set() functions operate on an std::string for convenience. Array of strings are thus not supported. Unlike for other control types, the ControlInfo range reports the minimum and maximum allowed lengths of the string (the minimum will usually be 0), not the minimum and maximum value of each element. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Jacopo Mondi <jacopo@jmondi.org>
2020-03-20libcamera: controls: Rename ControlRange to ControlInfoLaurent Pinchart
To prepare for storage of additional information in the ControlRange structure, rename it to ControlInfo. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Jacopo Mondi <jacopo@jmondi.org>
2020-03-20libcamera: controls: Name all ControlInfoMap instance variables infoMapLaurent Pinchart
To prepare for the rename of ControlRange to ControlInfo, rename all the ControlInfoMap instance variables currently named info to infoMap. This will help avoiding namespace clashes. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Jacopo Mondi <jacopo@jmondi.org>
2020-03-20libcamera: v4l2_controls: Fix usage of strerror()Jacopo Mondi
On failure, the return code from V4L2Device::ioctl() is the negative error code set by the failed ::ioctl() system call. When the return code of V4L2Device::ioctl() is provided to strerror() it has to be negated again to obtain the positive error code. Fix a few wrong usages of the return code which provided to the strerror() function a negative error code. Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Jacopo Mondi <jacopo@jmondi.org>
2020-03-20libcamera: pipeline: rkisp1: Don't enable immutable linkHelen Koike
Link between resizer and capture is immutable and doesn't need to be enabled. Signed-off-by: Helen Koike <helen.koike@collabora.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
2020-03-20libcamera: pipeline: rkisp1: Use correct buffer count when importing buffersNiklas Söderlund
When folding buffer management with start/stop the wrong variable was passed to importBuffers() resulting in only one buffer being imported for the video node making capture impossible. Fix this by first renaming the confusingly named variable 'count' to 'ipaBufferId'. And then reusing the 'count' name for the buffer count. While at it remove the loop to find the maximum value of buffers from the single stream used by the pipeline. Once we add more stream this needs to be reworked anyhow so keep it simple for now. Fixes: 33fedea818e2b6a9 ("libcamera: pipeline_handler: Fold buffer management with start/stop") Signed-off-by: Niklas Söderlund <niklas.soderlund@ragnatech.se> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2020-03-19libcamera: utils: Adapt libcameraPath to match use casesKaaira Gupta
The two callers of functions libcameraPath() and isLibcameraInstalled() end up using the same process and finally use the path with libcamera.so. Hence write a function libcameraBuildPath() which combines their functions and returns the root of the build sources when the library has not been installed, but is running from the build tree, thereby making call sites simpler. When the library is installed, libcameraBuildPath() will return an empty string. Make changes in the call sites accordingly. Signed-off-by: Kaaira Gupta <kgupta@es.iitr.ac.in> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2020-03-19libcamera: v4l2_videodevice: Make V4L2PixelFormat constructor explicitLaurent Pinchart
To achieve the goal of preventing unwanted conversion between a DRM and a V4L2 FourCC, make the V4L2PixelFormat constructor that takes an integer value explicit. All users of V4L2 pixel formats flagged by the compiler are fixed. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se> Reviewed-by: Jacopo Mondi <jacopo@jmondi.org>
2020-03-19libcamera: v4l2_videodevice: Rename toV4L2Fourcc to toV4L2PixelFormatLaurent Pinchart
Now that the functions return a V4L2PixelFormat, adapt their name accordingly. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Jacopo Mondi <jacopo@jmondi.org>
2020-03-19libcamera: v4l2_videodevice: Add V4L2PixelFormat classLaurent Pinchart
The V4L2PixelFormat class describes the pixel format of a V4L2 buffer. It wraps the V4L2 numerical FourCC, and shall be used in all APIs that deal with V4L2 pixel formats. Its purpose is to prevent unintentional confusion of V4L2 and DRM FourCCs in code by catching implicit conversion attempts at compile time. The constructor taking a V4L2 FourCC integer value will be made explicit in a further commit to minimize the size of this change and keep it reviewable. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se> Reviewed-by: Jacopo Mondi <jacopo@jmondi.org>
2020-03-19libcamera: geometry: Construct SizeRange from SizeLaurent Pinchart
The SizeRange constructors take minimum and maximum width and height values as separate arguments. We have a Size class to convey size information, use it in the constructors, and update the callers. 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-03-18libcamera: framebuffer_allocator: Lift camera restrictions on allocatorLaurent Pinchart
The Camera class currently requires the allocator to have no allocated buffer before the camera is reconfigured, and the allocator to be destroyed before the camera is released. There's no basis for these restrictions anymore, remove them. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
2020-03-18libcamera: pipeline_handler: Fold buffer management with start/stopLaurent Pinchart
There's no need anymore to have the Camera object control how and when pipeline handlers allocate and free the buffers for the application-facing video devices. Fold those operations, currently performed by importFrameBuffers() and freeFrameBuffers(), into the start() and stop() functions. This simplifies the pipeline handler API, its implementation, and the implementation of the Camera class. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
2020-03-18libcamera: pipeline_handler: Decouple buffer import and exportLaurent Pinchart
Use the V4L2 buffer orphaning feature, exposed through V4L2VideoDevice::exportBuffers(), to decouple buffer import and export. The PipelineHandler::importFrameBuffers() function is now called for all streams regardless of whether exportFrameBuffers() has been called or not. This simplifies the Camera implementation slightly, and opens the door to additional simplifications. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
2020-03-18libcamera: camera: Propagate error value from importFrameBufferLaurent Pinchart
The PipelineHandler::importFrameBuffer() function, called by Camera::start() may return an error, but its return value is ignored. Propagate it to the caller to fix this. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
2020-03-18libcamera: v4l2_videodevice: Add standalone buffer export supportLaurent Pinchart
Add a new exportBuffers() function that only performs buffer allocation and export, but leaves the V4L2 buffer queue unallocated on return. This function will be used to simplify buffer allocation for pipeline handlers. This is made possible by the V4L2 buffer orphaning feature introduced in Linux v5.0, so add a version check to catch and report issues early. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
2020-03-18libcamera: v4l2_videodevice: Refactor allocateBuffers()Laurent Pinchart
Move the buffer creation code out of allocateBuffers() to a createBuffers() function. This prepare for the rework of buffer export and will avoid code duplication. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
2020-03-18libcamera: v4l2_videodevice: Pass memory type to reqbufs()Laurent Pinchart
To prepare for the rework of buffer export, pass the memory type explicitly to the V4L2VideoDevice::reqbufs() function. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
2020-03-18libcamera: v4l2_videodevice: Rename exportBuffers() to allocateBuffers()Laurent Pinchart
To prepare for the rework of buffer allocation that will differentiate export and allocation, rename exportBuffers() to allocateBuffers(). Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
2020-03-18libcamera: PixelFormat: Mark all function arguments of type PixelFormat as ↵Niklas Söderlund
const reference PixelFormat was previously an alias for unsigned int but is now a class. Make all functions taking PixelFormat do so as a const reference. Signed-off-by: Niklas Söderlund <niklas.soderlund@ragnatech.se> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2020-03-18libcamera: PixelFormat: Make constructor explicitLaurent Pinchart
To achieve the goal of preventing unwanted conversion between a DRM and a V4L2 FourCC, make the PixelFormat constructor that takes an integer value explicit. All users of pixel formats flagged by the compiler are fixed. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se> Signed-off-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
2020-03-18libcamera: PixelFormat: Turn into a classNiklas Söderlund
Create a class to represent a pixel format. This is done to add support for modifiers for the formats. So far no modifiers are added by any pipeline handler, all plumbing to deal with them is however in place. Signed-off-by: Niklas Söderlund <niklas.soderlund@ragnatech.se> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2020-03-18libcamera: pipeline: uvcvideo: Translate from V4L2 to DRM pixel formatsNiklas Söderlund
When generating a camera configuration, pixel formats from the video device are used directly. They however contain V4L2 pixel format FourCCs, not DRM pixel format FourCCs. Translate the pixel formats to DRM before using them in the camera configuration. Signed-off-by: Niklas Söderlund <niklas.soderlund@ragnatech.se> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2020-03-18libcamera: pipeline: vimc: Remove internal usage of ImageFormatsNiklas Söderlund
There is no need to use the ImageFormats helper to generate a map of PixelFormat to sizes, use std::map directly. Signed-off-by: Niklas Söderlund <niklas.soderlund@ragnatech.se> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>