summaryrefslogtreecommitdiff
path: root/src/libcamera/include
diff options
context:
space:
mode:
authorJacopo Mondi <jacopo@jmondi.org>2019-10-25 13:00:43 +0200
committerLaurent Pinchart <laurent.pinchart@ideasonboard.com>2019-10-28 17:04:01 +0200
commit2a8bf04227811b29bc94b942e78f1567afd8874b (patch)
tree31f3897a6fe2dbf56c5634d8519337166072a20d /src/libcamera/include
parentc53f8fbbab29385c584f9229c9ee57107b954225 (diff)
libcamera: v4l2_videodevice: Add PixelFormat conversion
In preparation for switching PixelFormat to DRM pixel formats, add helper methods to the V4L2VideoDevice class to translate between DRM pixel formats and V4L2 pixel formats. More work is needed to properly support the V4L2 multi-planar (NV[0-9]*M) formats. Signed-off-by: Jacopo Mondi <jacopo@jmondi.org> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
Diffstat (limited to 'src/libcamera/include')
-rw-r--r--src/libcamera/include/v4l2_videodevice.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/libcamera/include/v4l2_videodevice.h b/src/libcamera/include/v4l2_videodevice.h
index 4b8cf939..fdf11b3a 100644
--- a/src/libcamera/include/v4l2_videodevice.h
+++ b/src/libcamera/include/v4l2_videodevice.h
@@ -13,6 +13,7 @@
#include <linux/videodev2.h>
#include <libcamera/geometry.h>
+#include <libcamera/pixelformats.h>
#include <libcamera/signal.h>
#include "formats.h"
@@ -155,6 +156,10 @@ public:
static V4L2VideoDevice *fromEntityName(const MediaDevice *media,
const std::string &entity);
+ static PixelFormat toPixelFormat(uint32_t v4l2Fourcc);
+ uint32_t toV4L2Fourcc(PixelFormat pixelFormat);
+ static uint32_t toV4L2Fourcc(PixelFormat pixelFormat, bool multiplanar);
+
protected:
std::string logPrefix() const;