Commit f887e99a authored by Laurent Pinchart's avatar Laurent Pinchart Committed by Mauro Carvalho Chehab

[media] uvcvideo: Set device_caps in VIDIOC_QUERYCAP

Set the capabilities field to global capabilities, and the device_caps
field to the video node capabilities.
This issue was found by the v4l2-compliance tool.
Signed-off-by: default avatarLaurent Pinchart <laurent.pinchart@ideasonboard.com>
Acked-by: default avatarHans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@redhat.com>
parent 815adc46
...@@ -1741,6 +1741,11 @@ static int uvc_register_video(struct uvc_device *dev, ...@@ -1741,6 +1741,11 @@ static int uvc_register_video(struct uvc_device *dev,
return ret; return ret;
} }
if (stream->type == V4L2_BUF_TYPE_VIDEO_CAPTURE)
stream->chain->caps |= V4L2_CAP_VIDEO_CAPTURE;
else
stream->chain->caps |= V4L2_CAP_VIDEO_OUTPUT;
atomic_inc(&dev->nstreams); atomic_inc(&dev->nstreams);
return 0; return 0;
} }
......
...@@ -565,12 +565,14 @@ static long uvc_v4l2_do_ioctl(struct file *file, unsigned int cmd, void *arg) ...@@ -565,12 +565,14 @@ static long uvc_v4l2_do_ioctl(struct file *file, unsigned int cmd, void *arg)
usb_make_path(stream->dev->udev, usb_make_path(stream->dev->udev,
cap->bus_info, sizeof(cap->bus_info)); cap->bus_info, sizeof(cap->bus_info));
cap->version = LINUX_VERSION_CODE; cap->version = LINUX_VERSION_CODE;
cap->capabilities = V4L2_CAP_DEVICE_CAPS | V4L2_CAP_STREAMING
| chain->caps;
if (stream->type == V4L2_BUF_TYPE_VIDEO_CAPTURE) if (stream->type == V4L2_BUF_TYPE_VIDEO_CAPTURE)
cap->capabilities = V4L2_CAP_VIDEO_CAPTURE cap->device_caps = V4L2_CAP_VIDEO_CAPTURE
| V4L2_CAP_STREAMING; | V4L2_CAP_STREAMING;
else else
cap->capabilities = V4L2_CAP_VIDEO_OUTPUT cap->device_caps = V4L2_CAP_VIDEO_OUTPUT
| V4L2_CAP_STREAMING; | V4L2_CAP_STREAMING;
break; break;
} }
......
...@@ -371,6 +371,8 @@ struct uvc_video_chain { ...@@ -371,6 +371,8 @@ struct uvc_video_chain {
struct uvc_entity *selector; /* Selector unit */ struct uvc_entity *selector; /* Selector unit */
struct mutex ctrl_mutex; /* Protects ctrl.info */ struct mutex ctrl_mutex; /* Protects ctrl.info */
u32 caps; /* V4L2 chain-wide caps */
}; };
struct uvc_stats_frame { struct uvc_stats_frame {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment