Index | Thread | Search

From:
Marcus Glocker <marcus@nazgul.ch>
Subject:
Re: sys/uvideo: fill v4l2_capability the right way
To:
"Kirill A. Korinsky" <kirill@korins.ky>
Cc:
tech@openbsd.org
Date:
Sat, 28 Dec 2024 20:05:36 +0100

Download raw body.

Thread
On Sat, Dec 28, 2024 at 06:46:05PM GMT, Kirill A. Korinsky wrote:

> On Sat, 28 Dec 2024 18:32:06 +0100,
> Marcus Glocker <marcus@nazgul.ch> wrote:
> > 
> > On Sat, Dec 28, 2024 at 04:18:57PM GMT, Kirill A. Korinsky wrote:
> > 
> > >  	strlcpy(caps->card, sc->sc_udev->product, sizeof(caps->card));
> > > -	strlcpy(caps->bus_info, "usb", sizeof(caps->bus_info));
> > > +	strlcpy(caps->bus_info, DEVNAME(sc), sizeof(caps->bus_info));
> > 
> > For this change I'm not 100% convinced yet.  "video0" for example isn't
> > a bus per se.  The videoio.h comment gives an example:
> > 
> > 	* @bus_info:     name of the bus (e.g. "PCI:" + pci_name(pci_dev) )
> > 
> > Do you know how libwebrtc is parsing this field exactly?  Would
> > something like "video0@usb" work as well?  To at least keep the bus
> > information in this field?
> >
> 
> We're inside uvideo.c and DEVNAME(sc) returns uvideo0, not video0.

Yes sorry typo, I meant "uvideo0@usb".
 
> Don't you think that this is enough to for the bus?

Well, maybe, it's more a question about what one considers a bus
information.  I'm considering "uvideo0" to be a device indentifier, not
necessarily a bus information.

> About libwebrtc: it assumes that caps->bus_info is unique, and uses strncmp.

OK.  Just to understand, since I don't know how libwebrtc operates;
With what will it compare the caps->bus_info string (lets say it's
"uvideo0") with to make a decision?