[PATCHv5,0/5] media: uvcvideo: implement UVC 1.5 ROI

Message ID 20210501082001.100533-1-senozhatsky@chromium.org (mailing list archive)
Headers
Series media: uvcvideo: implement UVC 1.5 ROI |

Message

Sergey Senozhatsky May 1, 2021, 8:19 a.m. UTC
  Hello,

	This patch set implements UVC 1.5 ROI using v4l2_selection API.

v5:
-- fixed UAPI typo: STABILIXATION
-- moved V4L2_CID_REGION_OF_INTEREST_AUTO to V4L2_CID_CAMERA_CLASS_BASE+36
-- added more comments (Ricardo)
-- added V4L2_CID_REGION_OF_INTEREST_AUTO to v4l2_ctrl_get_name() (Ricardo)

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              | 189 +++++++++++++++++-
 drivers/media/v4l2-core/v4l2-ctrls.c          |   1 +
 include/uapi/linux/usb/video.h                |   1 +
 include/uapi/linux/v4l2-common.h              |   8 +
 include/uapi/linux/v4l2-controls.h            |  10 +
 10 files changed, 321 insertions(+), 3 deletions(-)
  

Comments

Hans Verkuil May 26, 2021, 10:38 a.m. UTC | #1
Hi Sergey,

On 01/05/2021 10:19, Sergey Senozhatsky wrote:
> Hello,
> 
> 	This patch set implements UVC 1.5 ROI using v4l2_selection API.
> 
> v5:
> -- fixed UAPI typo: STABILIXATION
> -- moved V4L2_CID_REGION_OF_INTEREST_AUTO to V4L2_CID_CAMERA_CLASS_BASE+36
> -- added more comments (Ricardo)
> -- added V4L2_CID_REGION_OF_INTEREST_AUTO to v4l2_ctrl_get_name() (Ricardo)
> 
> Sergey Senozhatsky (5):
>   media: v4l UAPI: add ROI selection targets

As mentioned in my reply to v4 0/5, I am quite strongly opposed to using the
Selection API for this as opposed to using controls. Unless someone can provide
strong arguments for using the Selection API, I am inclined to reject this.

Sorry about that, I probably should have been reviewing this series sooner.

Regards,

	Hans

>   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              | 189 +++++++++++++++++-
>  drivers/media/v4l2-core/v4l2-ctrls.c          |   1 +
>  include/uapi/linux/usb/video.h                |   1 +
>  include/uapi/linux/v4l2-common.h              |   8 +
>  include/uapi/linux/v4l2-controls.h            |  10 +
>  10 files changed, 321 insertions(+), 3 deletions(-)
>
  
Sergey Senozhatsky June 1, 2021, 8:46 a.m. UTC | #2
On (21/05/26 12:38), Hans Verkuil wrote:
> Hi Sergey,
> 
> On 01/05/2021 10:19, Sergey Senozhatsky wrote:
> > Hello,
> > 
> > 	This patch set implements UVC 1.5 ROI using v4l2_selection API.
> > 
> > v5:
> > -- fixed UAPI typo: STABILIXATION
> > -- moved V4L2_CID_REGION_OF_INTEREST_AUTO to V4L2_CID_CAMERA_CLASS_BASE+36
> > -- added more comments (Ricardo)
> > -- added V4L2_CID_REGION_OF_INTEREST_AUTO to v4l2_ctrl_get_name() (Ricardo)
> > 
> > Sergey Senozhatsky (5):
> >   media: v4l UAPI: add ROI selection targets
> 
> As mentioned in my reply to v4 0/5, I am quite strongly opposed to using the
> Selection API for this as opposed to using controls. Unless someone can provide
> strong arguments for using the Selection API, I am inclined to reject this.
> 
> Sorry about that, I probably should have been reviewing this series sooner.

Hans, any suggestions regarding the UVCs GET_CUR, GET_DEF, GET_MIN/MAX
requests handling?
  
Hans Verkuil June 1, 2021, 8:52 a.m. UTC | #3
On 01/06/2021 10:46, Sergey Senozhatsky wrote:
> On (21/05/26 12:38), Hans Verkuil wrote:
>> Hi Sergey,
>>
>> On 01/05/2021 10:19, Sergey Senozhatsky wrote:
>>> Hello,
>>>
>>> 	This patch set implements UVC 1.5 ROI using v4l2_selection API.
>>>
>>> v5:
>>> -- fixed UAPI typo: STABILIXATION
>>> -- moved V4L2_CID_REGION_OF_INTEREST_AUTO to V4L2_CID_CAMERA_CLASS_BASE+36
>>> -- added more comments (Ricardo)
>>> -- added V4L2_CID_REGION_OF_INTEREST_AUTO to v4l2_ctrl_get_name() (Ricardo)
>>>
>>> Sergey Senozhatsky (5):
>>>   media: v4l UAPI: add ROI selection targets
>>
>> As mentioned in my reply to v4 0/5, I am quite strongly opposed to using the
>> Selection API for this as opposed to using controls. Unless someone can provide
>> strong arguments for using the Selection API, I am inclined to reject this.
>>
>> Sorry about that, I probably should have been reviewing this series sooner.
> 
> Hans, any suggestions regarding the UVCs GET_CUR, GET_DEF, GET_MIN/MAX
> requests handling?
> 

Support for current value and default value is already present in the control
framework (V4L2_CTRL_WHICH_CUR_VAL and V4L2_CTRL_WHICH_DEF_VAL). MIN/MAX support
would have to be added by creating V4L2_CTRL_WHICH_MIN/MAX_VAL defines and
implementing this in the control framework, pretty much along the same lines
as the DEF_VAL support. Should be quite easy.

Regards,

	Hans