* [PATCH] media: vivid: always allow meta output streaming
@ 2026-07-01 14:25 Hans Verkuil
0 siblings, 0 replies; only message in thread
From: Hans Verkuil @ 2026-07-01 14:25 UTC (permalink / raw)
To: Linux Media Mailing List
The vivid metadata output emulation only works if the
video input is configured for a webcam. That makes no sense,
and it is in fact a copy-and-paste from the metadata capture
support.
Always allow metadata output, just make sure that when the
metadata is processed it only sets the brightness/saturation/
hue/contrast controls if they have been defined: if vivid was
instantiation without video capture support, then those controls
are missing.
This change ensures that the test-media regression script correctly
tests metadata output streaming.
Signed-off-by: Hans Verkuil <hverkuil+cisco@kernel.org>
---
.../media/test-drivers/vivid/vivid-meta-out.c | 23 +++++--------------
1 file changed, 6 insertions(+), 17 deletions(-)
diff --git a/drivers/media/test-drivers/vivid/vivid-meta-out.c b/drivers/media/test-drivers/vivid/vivid-meta-out.c
index 55e5e5dec2f2..ca913b808225 100644
--- a/drivers/media/test-drivers/vivid/vivid-meta-out.c
+++ b/drivers/media/test-drivers/vivid/vivid-meta-out.c
@@ -17,12 +17,8 @@ static int meta_out_queue_setup(struct vb2_queue *vq, unsigned int *nbuffers,
unsigned int *nplanes, unsigned int sizes[],
struct device *alloc_devs[])
{
- struct vivid_dev *dev = vb2_get_drv_priv(vq);
unsigned int size = sizeof(struct vivid_meta_out_buf);
- if (!vivid_is_webcam(dev))
- return -EINVAL;
-
if (*nplanes) {
if (sizes[0] < size)
return -EINVAL;
@@ -127,11 +123,6 @@ const struct vb2_ops vivid_meta_out_qops = {
int vidioc_enum_fmt_meta_out(struct file *file, void *priv,
struct v4l2_fmtdesc *f)
{
- struct vivid_dev *dev = video_drvdata(file);
-
- if (!vivid_is_webcam(dev))
- return -EINVAL;
-
if (f->index > 0)
return -EINVAL;
@@ -143,12 +134,8 @@ int vidioc_enum_fmt_meta_out(struct file *file, void *priv,
int vidioc_g_fmt_meta_out(struct file *file, void *priv,
struct v4l2_format *f)
{
- struct vivid_dev *dev = video_drvdata(file);
struct v4l2_meta_format *meta = &f->fmt.meta;
- if (!vivid_is_webcam(dev) || !dev->has_meta_out)
- return -EINVAL;
-
meta->dataformat = V4L2_META_FMT_VIVID;
meta->buffersize = sizeof(struct vivid_meta_out_buf);
return 0;
@@ -159,10 +146,12 @@ void vivid_meta_out_process(struct vivid_dev *dev,
{
struct vivid_meta_out_buf *meta = vb2_plane_vaddr(&buf->vb.vb2_buf, 0);
- v4l2_ctrl_s_ctrl(dev->brightness, meta->brightness);
- v4l2_ctrl_s_ctrl(dev->contrast, meta->contrast);
- v4l2_ctrl_s_ctrl(dev->saturation, meta->saturation);
- v4l2_ctrl_s_ctrl(dev->hue, meta->hue);
+ if (dev->brightness) {
+ v4l2_ctrl_s_ctrl(dev->brightness, meta->brightness);
+ v4l2_ctrl_s_ctrl(dev->contrast, meta->contrast);
+ v4l2_ctrl_s_ctrl(dev->saturation, meta->saturation);
+ v4l2_ctrl_s_ctrl(dev->hue, meta->hue);
+ }
dprintk(dev, 2, " %s brightness %u contrast %u saturation %u hue %d\n",
__func__, meta->brightness, meta->contrast,
--
2.53.0
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2026-07-01 14:25 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-07-01 14:25 [PATCH] media: vivid: always allow meta output streaming Hans Verkuil
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.