Re: [PATCH v2] V4L: uvcvideo: Add support for relative pan/tilt controls

Laurent Pinchart
2014-06-25T09:53:41Z

Hi Pawel,

On Wednesday 25 June 2014 11:46:24 Pawel Osciak wrote:
> On Tue, Jun 17, 2014 at 11:45 PM, Vincent Palatin wrote:
> > Map V4L2_CID_TILT_RELATIVE and V4L2_CID_PAN_RELATIVE to the standard UVC
> > CT_PANTILT_RELATIVE_CONTROL terminal control request.
> >
> > Tested by plugging a Logitech ConferenceCam C3000e USB camera
> > and controlling pan/tilt from the userspace using the VIDIOC_S_CTRL ioctl.
> > Verified that it can pan and tilt at the same time in both directions.
> >
> > Signed-off-by: Vincent Palatin <vpalatin@chromium.org>
> >
> > Change-Id: I7b70b228e5c0126683f5f0be34ffd2807f5783dc
> > ---
> >
> > Changes
> > v2: fix control request name in description.
>
> The patch looks good, but I have a more general comment for everyone to
> consider. This doesn't match the expected functionality of
> controls V4L2_CID_PAN/TILT_RELATIVE. This is basically an on/off switch for
> pan/tilt, which once enabled will keep going until turned off (or I'm
> guessing until the maximum pan/tilt is reached), while the controls are
> supposed to expose an ability to turn the camera by a specified amount.
> Here the amount will also be ignored...

I agree with you here, and this mismatch between the V4L and UVC controls is
the reason why I haven't implemented relative pan/tilt support.

> Given that this is a standard UVC control, perhaps we need new V4L2
> controls for it, as I'm assuming we can't change the meaning of existing
> controls?

We could extend the meaning of the controls to cover the UVC behaviour in a
device-specific fashion, but that would be confusing for applications, so new
controls might be a better idea.

--
Regards,

Laurent Pinchart