create-item: handle all kinds of Audio/Video & Stream nodes

And be careful not to handle nodes created by si-audio-endpoint,
by using a specific property for that.

Also, use Audio/{Source,Sink}/Virtual as the media class of null sinks
created by si-audio-endpoint, it sounds more appropriate.

Fixes #34
This commit is contained in:
George Kiagiadakis
2021-06-10 16:38:34 +03:00
parent 558ab50367
commit 950c358180
2 changed files with 19 additions and 7 deletions

View File

@@ -30,12 +30,21 @@ function addItem (node, item_type)
end)
end
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 = ObjectManager {
Interest {
type = "node",
Constraint { "media.class", "#", "Stream/*", type = "pw-global" },
},
Interest {
type = "node",
Constraint { "media.class", "#", "Video/*", type = "pw-global" },
},
Interest {
type = "node",
Constraint { "media.class", "#", "Audio/*", type = "pw-global" },
Constraint { "wireplumber.is-endpoint", "-", type = "pw" },
},
}
nodes_om:connect("object-added", function (om, node)
local media_class = node.properties['media.class']