aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDafna Hirschfeld <dafna.hirschfeld@collabora.com>2020-07-03 20:02:38 +0200
committerHans Verkuil <hverkuil-cisco@xs4all.nl>2020-09-26 12:20:38 +0200
commit8658f963e020b3420ada91d28791f64714adb7fa (patch)
treec1725f735382e1c05ee09876424c306bd581c196
parentdffe31c303450f7ad03f7d208850d3ddd19aec0a (diff)
v4l2-ctl: subdev: Add support for the CSC API in the subdevices
The CSC API allows userspace to configure the colorspace, quantization, (ycbcr/hsv)_enc and xfer_func fields when setting the formats, so those fields are not read only in userspace. This patch adds support for this API in subevices. Signed-off-by: Dafna Hirschfeld <dafna.hirschfeld@collabora.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
-rw-r--r--utils/v4l2-ctl/v4l2-ctl-subdev.cpp16
1 files changed, 12 insertions, 4 deletions
diff --git a/utils/v4l2-ctl/v4l2-ctl-subdev.cpp b/utils/v4l2-ctl/v4l2-ctl-subdev.cpp
index 08ead125..1ef6e1a8 100644
--- a/utils/v4l2-ctl/v4l2-ctl-subdev.cpp
+++ b/utils/v4l2-ctl/v4l2-ctl-subdev.cpp
@@ -407,14 +407,22 @@ void subdev_set(cv4l_fd &_fd)
fmt.format.code = ffmt.code;
if (set_fmt & FmtField)
fmt.format.field = ffmt.field;
- if (set_fmt & FmtColorspace)
+ if (set_fmt & FmtColorspace) {
fmt.format.colorspace = ffmt.colorspace;
- if (set_fmt & FmtXferFunc)
+ fmt.format.flags |= V4L2_MBUS_FRAMEFMT_SET_CSC;
+ }
+ if (set_fmt & FmtXferFunc) {
fmt.format.xfer_func = ffmt.xfer_func;
- if (set_fmt & FmtYCbCr)
+ fmt.format.flags |= V4L2_MBUS_FRAMEFMT_SET_CSC;
+ }
+ if (set_fmt & FmtYCbCr) {
fmt.format.ycbcr_enc = ffmt.ycbcr_enc;
- if (set_fmt & FmtQuantization)
+ fmt.format.flags |= V4L2_MBUS_FRAMEFMT_SET_CSC;
+ }
+ if (set_fmt & FmtQuantization) {
fmt.format.quantization = ffmt.quantization;
+ fmt.format.flags |= V4L2_MBUS_FRAMEFMT_SET_CSC;
+ }
if (options[OptSetSubDevFormat])
printf("Note: --set-subdev-fmt is only for testing.\n"

Privacy Policy