Changes to the string control handling

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Eduardo,

On Saturday 25 July 2009 16:41:27 Eduardo Valentin wrote:
> On Sat, Jul 25, 2009 at 04:39:18PM +0200, ext Hans Verkuil wrote:
> > If the string must be exactly 8 x n long, then I think that it is a good idea
> > to start using the 'step' value of v4l2_queryctrl: this can be used to tell
> > the application that string lengths should be a multiple of the step value.
> > I've toyed with that idea before but I couldn't think of a good use case,
> > but this might be it.
> 
> I think that would be good. It is a way to report to user land what can be
> done in these cases which strings can be chopped in small pieces. Of course,
> documenting this part it is appreciated.

Ok, I've implemented this. While doing this I realized that I had to change
a few things:

1) the 'length' field in v4l2_ext_control has been renamed to 'size'. The
name 'length' was too easy to confuse with 'string length' while in reality
it referred to the memory size of the control payload. 'size' is more
appropriate.

2) the 'minimum' and 'maximum' fields of v4l2_queryctrl now return the min
and max string lengths, i.e. *without* terminating zero. I realized that what
VIDIOC_QUERYCTRL returns has nothing to do with how much memory to reserve
for the string control. It is about the properties of the string itself
and it is not normal to include the terminating zero when talking about a
string length.

I've incorporated everything in my v4l-dvb-strctrl tree. I apologize for the
fact that you have to make yet another series of patches, but these changes
are typical when you start implementing and documenting a new feature for
the first time.

Regards,

	Hans

-- 
Hans Verkuil - video4linux developer - sponsored by TANDBERG Telecom
--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Input]     [Video for Linux]     [Gstreamer Embedded]     [Mplayer Users]     [Linux USB Devel]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]
  Powered by Linux