summaryrefslogtreecommitdiff
path: root/src/libcamera/v4l2_pixelformat.cpp
AgeCommit message (Collapse)Author
2021-07-16libcamera: Fix the V4L2 pixel format for formats::XBGR8888Vedant Paranjape
This patch fixes V4L2 pixel format for formats::XBGR8888 by updating the existing matching to V4L2_PIX_FMT_RGBX32 Fixes: 4fd6bb33 ("libcamera: Add support for XRGB8888 and XBGR8888") Signed-off-by: Vedant Paranjape <vedantparanjape160201@gmail.com> Reviewed-by: Paul Elder <paul.elder@ideasonboard.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2021-06-25libcamera/base: Move extended base functionalityKieran Bingham
Move the functionality for the following components to the new base support library: - BoundMethod - EventDispatcher - EventDispatcherPoll - Log - Message - Object - Signal - Semaphore - Thread - Timer While it would be preferable to see these split to move one component per commit, these components are all interdependent upon each other, which leaves us with one big change performing the move for all of them. Reviewed-by: Hirokazu Honda <hiroh@chromium.org> Reviewed-by: Paul Elder <paul.elder@ideasonboard.com> Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
2021-02-01libcamera: formats: Add RGB565_BE formatLaurent Pinchart
This new format corresponds to the V4L2 V4L2_PIX_FMT_RGB565X format, and is the big-endian version of the DRM_FORMAT_RGB565 format. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Jacopo Mondi <jacopo@jmondi.org> Reviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
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-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-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-07-27libcamera: Add support for 16-bit Bayer formatsNiklas Söderlund
Add support for 16-bit Bayer formats. Signed-off-by: Niklas Söderlund <niklas.soderlund@ragnatech.se> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2020-07-21libcamera: Add support for RGB565 formatNiklas Söderlund
Add support for RGB565 format. 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-07-21libcamera: Add support for planar YVU420 formatNiklas Söderlund
Add support for planar YVU420. 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-06-23libcamera: Add support for planar YUV422 and YUV420 formatsDavid Plowman
These formats can be helpful when downstream applications or libraries support them natively (avoiding a costly conversion). Signed-off-by: David Plowman <david.plowman@raspberrypi.com> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: David Plowman <david.plowman@raspberrypi.com> Tested-by: David Plowman <david.plowman@raspberrypi.com> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
2020-06-18libcamera: Replace explicit DRM FourCCs with libcamera formatsLaurent Pinchart
Use the new pixel format constants to replace usage of macros from drm_fourcc.h. 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-06-06libcamera: Rename pixelformats.{cpp,h} to pixel_format.{cpp,h}Laurent Pinchart
The libcamera source files are named after class names, using snake_case. pixelformats.h and pixelformats.cpp don't comply with that rule. Fix them. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
2020-05-16libcamera: Move internal headers to include/libcamera/internal/Laurent Pinchart
The libcamera internal headers are located in src/libcamera/include/. The directory is added to the compiler headers search path with a meson include_directories() directive, and internal headers are included with (e.g. for the internal semaphore.h header) #include "semaphore.h" All was well, until libcxx decided to implement the C++20 synchronization library. The __threading_support header gained a #include <semaphore.h> to include the pthread's semaphore support. As include_directories() adds src/libcamera/include/ to the compiler search path with -I, the internal semaphore.h is included instead of the pthread version. Needless to say, the compiler isn't happy. Three options have been considered to fix this issue: - Use -iquote instead of -I. The -iquote option instructs gcc to only consider the header search path for headers included with the "" version. Meson unfortunately doesn't support this option. - Rename the internal semaphore.h header. This was deemed to be the beginning of a long whack-a-mole game, where namespace clashes with system libraries would appear over time (possibly dependent on particular system configurations) and would need to be constantly fixed. - Move the internal headers to another directory to create a unique namespace through path components. This causes lots of churn in all the existing source files through the all project. The first option would be best, but isn't available to us due to missing support in meson. Even if -iquote support was added, we would need to fix the problem before a new version of meson containing the required support would be released. The third option is thus the only practical solution available. Bite the bullet, and do it, moving headers to include/libcamera/internal/. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Acked-by: Jacopo Mondi <jacopo@jmondi.org>
2020-04-30libcamera: v4l2_pixelformat: Fix V4L2_PIX_FMT_SBGGR10P formatLaurent Pinchart
The V4L2_PIX_FMT_SBGGR10P format was misspecified as V4L2_PIX_FMT_SBGGR10. Fix it. Fixes: 00d639d951e7 ("libcamera: formats: Add support for 8-, 10- and 12-bit Bayer formats") Reported-by: Niklas Söderlund <niklas.soderlund@ragnatech.se> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Tested-by: Niklas Söderlund <niklas.soderlund@ragnatech.se> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
2020-04-30libcamera: formats: Add support for 8-, 10- and 12-bit Bayer formatsLaurent Pinchart
Add the 8-, 10- and 12-but Bayer formats, in both unpacked and MIPI-packed variants, to the format tables in PixelFormatInfo and V4L2PixelFormat. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
2020-04-30libcamera: formats: Expose PixelFormatInfo as an internal APILaurent Pinchart
To prepare for storing more information about pixel formats in PixelFormatInfo, move the class to formats.cpp and document it. The pixel formats database is moved to the same file, and a new static function is added to PixelFormatInfo to retrieve a PixelFormatInfo for a PixelFormat. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
2020-04-30libcamera: v4l2_pixelformat: Use maps to convert between DRM and V4L2Laurent Pinchart
Replace the two big manual switch...case with maps. This should not just improve efficiency when we will have a larger number of formats, but also paves the way to storing more format information to create additional helpers. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
2020-04-30libcamera: v4l2_pixelformat: Move DRM/V4L2 format conversionLaurent Pinchart
Move the DRM/V4L2 format conversion code from V4L2VideoDevice to V4L2PixelFormat. This is a more natural home for the code. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
2020-04-30libcamera: v4l2_pixelformat: Move V4L2PixelFormat to a new fileLaurent Pinchart
Move the V4L2PixelFormat class to a new file to prepare for additional changes that will make it grow. No functional modification is included. 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>