diff options
author | Paul Elder <paul.elder@ideasonboard.com> | 2018-08-28 02:45:46 -0400 |
---|---|---|
committer | Paul Elder <paul.elder@ideasonboard.com> | 2019-02-06 01:49:34 -0500 |
commit | c4f79214e425ae26ec9c27cc0995122321631b87 (patch) | |
tree | fc724ca8ba68d073d69259a8e5e31a4894268058 | |
parent | bde4deb8803026ec69e11cd380d77bf5d33ee623 (diff) |
uvc: reply with max frame rate in response to UVC_GET_MAX
Previously, the interval rate that would be selected and replied to the
host in response to UVC_GET_MAX, UVC_GET_MIN, and UVC_GET_DEF were all
the same and were the first interval rate. Assuming the interval rates
are sorted in ascending order, this means that UVC_GET_MAX would always
yield the minimum interval rate.
Modify the call to uvc_fill_streaming_control such that UVC_GET_MAX will
yield the maximum interval rate.
Signed-off-by: Paul Elder <paul.elder@ideasonboard.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
-rw-r--r-- | lib/uvc.c | 7 |
1 files changed, 5 insertions, 2 deletions
@@ -8,6 +8,7 @@ */ #include <errno.h> +#include <limits.h> #include <linux/usb/ch9.h> #include <linux/usb/g_uvc.h> #include <linux/usb/video.h> @@ -176,8 +177,10 @@ uvc_events_process_streaming(struct uvc_device *dev, uint8_t req, uint8_t cs, case UVC_GET_MIN: case UVC_GET_MAX: case UVC_GET_DEF: - uvc_fill_streaming_control(dev, ctrl, req == UVC_GET_MAX ? -1 : 1, - req == UVC_GET_MAX ? -1 : 1, 0); + if (req == UVC_GET_MAX) + uvc_fill_streaming_control(dev, ctrl, -1, -1, UINT_MAX); + else + uvc_fill_streaming_control(dev, ctrl, 1, 1, 0); break; case UVC_GET_RES: |