monitors: enable libcamera by default and set priority on all camera nodes
Currently v4l2 nodes will get higher priority than libcamera ones. The default can be changed, of course, with wpctl. Things are still not great if a camera is enumerated by both monitors. The first node to be linked will grab the device and the second one from the other subsystem will fail to negotiate.
This commit is contained in:
@@ -86,6 +86,20 @@ function createNode(parent, id, type, factory, properties)
|
||||
-- sanitize description, replace ':' with ' '
|
||||
properties["node.description"] = desc:gsub("(:)", " ")
|
||||
|
||||
-- set priority
|
||||
if not properties["priority.session"] then
|
||||
local location = properties["api.libcamera.location"]
|
||||
local priority = 700
|
||||
if location == "front" then
|
||||
priority = priority + 150
|
||||
elseif location == "external" then
|
||||
priority = priority + 100
|
||||
elseif location == "back" then
|
||||
priority = priority + 50
|
||||
end
|
||||
properties["priority.session"] = priority
|
||||
end
|
||||
|
||||
-- apply properties from config.rules
|
||||
rulesApplyProperties(properties)
|
||||
|
||||
|
Reference in New Issue
Block a user