Web lists-archives.org

Re: [PATCH 1/2] V4L: add "function" sysfs attribute to v4l devices




Hi Laurent,

On Fri, Apr 18, 2008 at 09:33:21PM +0200, Laurent Pinchart wrote:
> On Thursday 17 April 2008, Kees Cook wrote:
> > +static const char *v4l2_function_type_names[] = {
> > +	[V4L2_FN_VIDEO_CAP]		= "vid-cap",
> > +	[V4L2_FN_VIDEO_OUT]		= "vid-out",
> > +	[V4L2_FN_MPEG_CAP]		= "mpeg-cap",
> > +	[V4L2_FN_MPEG_OUT]		= "mpeg-out",
> > +	[V4L2_FN_YUV_CAP]		= "yuv-cap",
> > +	[V4L2_FN_YUV_OUT]		= "yuv-out",
> 
> I don't like those. Video capture devices can encode pixels in a variety of 
> formats. MPEG and YUV are only two special cases. You will find devices 
> encoding in RGB, Bayer, MJPEG, ... as well as some proprietary formats.

If these devices have a variable encoding method, perhaps just use
"vid-cap" as the general rule.  (In the case that the output formats are
selectable from a given device node at runtime.)

> If I understand your problem correctly, you want to differentiate between 
> multiple v4l devices created by a single driver for a single hardware device. 
> Using the above functions might work for ivtv but rules out devices that 
> output multiple streams in the same format.
> 
> Wouldn't it be better to fix the ivtv driver to use a single device node for 
> both compressed and uncompressed streams ?

I'm not very familiar with the v4l code base, so I don't have a good
answer about if it's right or not.  The core problem does tend to boil
down to dealing with drivers that create multiple device nodes for the
same physical hardware (ivtv is not alone in this regard).

I don't know what the semantics are for device mode vs device node in
v4l, but it seems that since there are multiple nodes being created for
a given piece of hardware, something needs to be exported to sysfs to
distinguish them.

-Kees

-- 
Kees Cook                                            @outflux.net

--
video4linux-list mailing list
Unsubscribe mailto:video4linux-list-request@xxxxxxxxxx?subject=unsubscribe
https://www.redhat.com/mailman/listinfo/video4linux-list