Re: [PATCHv4 0/5] media: uvcvideo: implement UVC 1.5 ROI

From: Hans Verkuil
Date: Fri Apr 30 2021 - 08:49:30 EST


Hi Sergey,

On 30/04/2021 13:26, Sergey Senozhatsky wrote:
> Hello,
>
> This patch set implements UVC 1.5 ROI using v4l2_selection API.

Is the selection API the right approach for this? Wouldn't it make
sense to use controls instead? That would interface easily with the Request
API allowing per-frame changes to the ROI, and with dynamic array controls (1)
it allows you to provide multiple ROIs as well.

The only missing piece would be MIN/MAX for compound controls, but that can
easily be added to the control framework.

If this was discussed before, then can you give a me pointer to that discussion?
I couldn't find anything for that, but I didn't look very long for it :-)

In any case, it doesn't really feel like it is the right API for this job.
I really need to review this series when I have a bit more time :-(

Regards,

Hans

(1) https://patchwork.linuxtv.org/project/linux-media/cover/20210428101841.696059-1-hverkuil-cisco@xxxxxxxxx/

>
> v4:
> -- split ROI rect selection API and auto-controls
> -- handle very large ROI rectangles: limit to frame dimensions
>
> Sergey Senozhatsky (5):
> media: v4l UAPI: add ROI selection targets
> media: v4l UAPI: document ROI selection targets
> media: uvcvideo: add ROI auto controls
> media: v4l UAPI: document ROI auto_controls
> media: uvcvideo: add UVC 1.5 ROI control
>
> .../media/v4l/ext-ctrls-camera.rst | 23 +++
> .../media/v4l/selection-api-configuration.rst | 22 +++
> .../media/v4l/selection-api-examples.rst | 27 +++
> .../media/v4l/v4l2-selection-targets.rst | 24 +++
> drivers/media/usb/uvc/uvc_ctrl.c | 19 ++
> drivers/media/usb/uvc/uvc_v4l2.c | 185 +++++++++++++++++-
> include/uapi/linux/usb/video.h | 1 +
> include/uapi/linux/v4l2-common.h | 8 +
> include/uapi/linux/v4l2-controls.h | 9 +
> 9 files changed, 315 insertions(+), 3 deletions(-)
>