scripts: monitors: log warning if spa devices were not created successfully

Can happen if the user does not have the specific spa pluging installed.
This commit is contained in:
Julian Bouzas
2022-01-11 11:27:33 -05:00
committed by George Kiagiadakis
parent 07a0a5b404
commit 40b16974cf
4 changed files with 28 additions and 11 deletions

View File

@@ -125,9 +125,13 @@ function createDevice(parent, id, type, factory, properties)
-- create the device
local device = SpaDevice(factory, properties)
device:connect("create-object", createNode)
device:activate(Feature.SpaDevice.ENABLED | Feature.Proxy.BOUND)
parent:store_managed_object(id, device)
if device then
device:connect("create-object", createNode)
device:activate(Feature.SpaDevice.ENABLED | Feature.Proxy.BOUND)
parent:store_managed_object(id, device)
else
Log.warning ("Failed to create '" .. factory .. "' device")
end
end
monitor = SpaDevice("api.libcamera.enum.manager", config.properties or {})