libcamera: v4l2_subdevice: Add colorSpace field to V4L2SubdeviceFormat

This adds a ColorSpace field to the V4L2SubdeviceFormat so that we can
set and request particular color spaces from V4L2.

This commit simply adds the field and fixes some occurrences of brace
initializers that would otherwise be broken. A subsequent commit will
pass and retrieve the value correctly to/from V4l2 itself.

Signed-off-by: David Plowman <david.plowman@raspberrypi.com>
Reviewed-by: Jacopo Mondi <jacopo@jmondi.org>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
This commit is contained in:
David Plowman 2021-12-10 14:44:21 +00:00 committed by Laurent Pinchart
parent 3e520cadf1
commit c8a4b52e3a
5 changed files with 28 additions and 6 deletions

View file

@ -8,12 +8,14 @@
#pragma once
#include <memory>
#include <optional>
#include <string>
#include <vector>
#include <libcamera/base/class.h>
#include <libcamera/base/log.h>
#include <libcamera/color_space.h>
#include <libcamera/geometry.h>
#include "libcamera/internal/formats.h"
@ -27,6 +29,7 @@ class MediaDevice;
struct V4L2SubdeviceFormat {
uint32_t mbus_code;
Size size;
std::optional<ColorSpace> colorSpace;
const std::string toString() const;
uint8_t bitsPerPixel() const;