Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

media: v4l: Set line based metadata flag in V4L2 core

Set (and unset) the V4L2_FMT_FLAG_META_LINE_BASED flag in struct
v4l2_fmtdesc based on the format after returning the driver callback for
enumerating formats. This way the drivers don't need to care about the
flag.

Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>

authored by

Sakari Ailus and committed by
Hans Verkuil
21828609 89345c2a

+20
+16
drivers/media/v4l2-core/v4l2-ioctl.c
··· 1538 1538 } 1539 1539 } 1540 1540 1541 + if (fmt->type == V4L2_BUF_TYPE_META_CAPTURE) { 1542 + switch (fmt->pixelformat) { 1543 + case V4L2_META_FMT_GENERIC_8: 1544 + case V4L2_META_FMT_GENERIC_CSI2_10: 1545 + case V4L2_META_FMT_GENERIC_CSI2_12: 1546 + case V4L2_META_FMT_GENERIC_CSI2_14: 1547 + case V4L2_META_FMT_GENERIC_CSI2_16: 1548 + case V4L2_META_FMT_GENERIC_CSI2_20: 1549 + case V4L2_META_FMT_GENERIC_CSI2_24: 1550 + fmt->flags |= V4L2_FMT_FLAG_META_LINE_BASED; 1551 + break; 1552 + default: 1553 + fmt->flags &= ~V4L2_FMT_FLAG_META_LINE_BASED; 1554 + } 1555 + } 1556 + 1541 1557 if (descr) 1542 1558 WARN_ON(strscpy(fmt->description, descr, sz) < 0); 1543 1559 fmt->flags |= flags;
+4
include/uapi/linux/videodev2.h
··· 839 839 #define V4L2_META_FMT_RK_ISP1_PARAMS v4l2_fourcc('R', 'K', '1', 'P') /* Rockchip ISP1 3A Parameters */ 840 840 #define V4L2_META_FMT_RK_ISP1_STAT_3A v4l2_fourcc('R', 'K', '1', 'S') /* Rockchip ISP1 3A Statistics */ 841 841 842 + /* 843 + * Line-based metadata formats. Remember to update v4l_fill_fmtdesc() when 844 + * adding new ones! 845 + */ 842 846 #define V4L2_META_FMT_GENERIC_8 v4l2_fourcc('M', 'E', 'T', '8') /* Generic 8-bit metadata */ 843 847 #define V4L2_META_FMT_GENERIC_CSI2_10 v4l2_fourcc('M', 'C', '1', 'A') /* 10-bit CSI-2 packed 8-bit metadata */ 844 848 #define V4L2_META_FMT_GENERIC_CSI2_12 v4l2_fourcc('M', 'C', '1', 'C') /* 12-bit CSI-2 packed 8-bit metadata */