Skip to content
Snippets Groups Projects
Commit cc51bdb7 authored by Julian Bouzas's avatar Julian Bouzas
Browse files

create-item.lua: only create items for client and device nodes

parent f0960a38
No related branches found
No related tags found
No related merge requests found
...@@ -28,16 +28,15 @@ function addItem (node, item_type) ...@@ -28,16 +28,15 @@ function addItem (node, item_type)
end) end)
end end
nodes_om = ObjectManager { Interest { type = "node" } } nodes_om = ObjectManager { Interest { type = "node",
Constraint { "media.class", "c",
"Stream/Input/Audio", "Stream/Output/Audio", "Stream/Input/Video",
"Audio/Source", "Audio/Sink", "Video/Source",
type = "pw-global" },
} }
nodes_om:connect("object-added", function (om, node) nodes_om:connect("object-added", function (om, node)
local media_class = node.properties['media.class'] local media_class = node.properties['media.class']
-- skip nodes without media class
if media_class == nil then
return
end
if string.find (media_class, "Audio") then if string.find (media_class, "Audio") then
addItem (node, "si-audio-adapter") addItem (node, "si-audio-adapter")
else else
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment