Index | Thread | Search

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

Download raw body.

Thread
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.

Don't you think that this is enough to for the bus?

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

-- 
wbr, Kirill