mirror of
https://github.com/openwrt/openwrt.git
synced 2026-10-12 06:57:57 +04:00
The rule placed every video4linux and media node in video-capture, but most are not capture devices: on an rk3588 board five of the six V4L2 nodes are the RGA blitter and the Hantro and rkvdec stateless codecs, and only the HDMI receiver captures anything. A media player then had to join video-capture to reach a decoder, which also granted it every camera on the box. Put the DRM and media nodes in video, and add v4l-id, which runs VIDIOC_QUERYCAP and prefers device_caps over capabilities so that what it describes is the node. Given a device alone it prints one boolean per V4L2_CAP_ flag as JSON. Given a rule string as well, a list of CAP[,CAP...]:GROUP separated by semicolons in which * matches any node, it puts the node into the group of the first rule which matches it. The rule string is parsed in full before the device is opened, so a capability name the kernel does not define is reported whichever rule it appears in, and no node is touched. A V4L2 node is created with no group and v4l-id assigns one, since exec is queued by procd and may not run at all; holding the node at root until the driver answers keeps a camera out of video. Signed-off-by: Daniel Golle <daniel@makrotopia.org>