summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorLaurent Pinchart <laurent.pinchart@ideasonboard.com>2024-02-26 04:50:15 +0200
committerLaurent Pinchart <laurent.pinchart@ideasonboard.com>2024-03-15 12:54:56 +0200
commitd60fb232588efe9f9aee001faaab35bf5f46bec1 (patch)
tree671aa796d077bc16662cdf465de05db6b77ce96d /include
parent1a1cf4a2c13a04f23593419ce93e97f9a5bb22d1 (diff)
libcamera: v4l2_subdevice: Expose media bus format info as internal API
The V4L2SubdeviceFormatInfo structure, internal to the v4l2_subdevice.cpp compilation unit, contains information about media bus formats that will be useful in other parts of libcamera. To prepare for this, expose the structure in the v4l2_subdevice.h header and turn it into a class with a similar design as PixelFormatInfo. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
Diffstat (limited to 'include')
-rw-r--r--include/libcamera/internal/v4l2_subdevice.h13
1 files changed, 13 insertions, 0 deletions
diff --git a/include/libcamera/internal/v4l2_subdevice.h b/include/libcamera/internal/v4l2_subdevice.h
index 17db311b..a4df9ddf 100644
--- a/include/libcamera/internal/v4l2_subdevice.h
+++ b/include/libcamera/internal/v4l2_subdevice.h
@@ -29,6 +29,19 @@ namespace libcamera {
class MediaDevice;
+class MediaBusFormatInfo
+{
+public:
+ bool isValid() const { return code != 0; }
+
+ static const MediaBusFormatInfo &info(uint32_t code);
+
+ const char *name;
+ uint32_t code;
+ unsigned int bitsPerPixel;
+ PixelFormatInfo::ColourEncoding colourEncoding;
+};
+
struct V4L2SubdeviceCapability final : v4l2_subdev_capability {
bool isReadOnly() const
{