diff --git a/src/config/config.lua b/src/config/config.lua index a54bafea56b0379ac886a155015d12fb44237b90..274250f60225c4b0be776b6a30e295de350c6a08 100644 --- a/src/config/config.lua +++ b/src/config/config.lua @@ -57,9 +57,6 @@ load_module("si-standard-link") -- -- load_pw_module ("spa-node-factory") --- Video4Linux2 device management via udev -load_monitor("v4l2") - -- Automatically suspends idle nodes after 3 seconds load_script("suspend-node.lua") diff --git a/src/config/config.lua.d/30-v4l2-monitor.lua b/src/config/config.lua.d/30-v4l2-monitor.lua new file mode 100644 index 0000000000000000000000000000000000000000..45db9e36f54f1c94936a82a021b878d4f435c9b6 --- /dev/null +++ b/src/config/config.lua.d/30-v4l2-monitor.lua @@ -0,0 +1,47 @@ +-- V4L2 monitor config file -- + +local properties = { } + +local rules = { + -- An array of matches/actions to evaluate. + { + -- Rules for matching a device or node. It is an array of + -- properties that all need to match the regexp. If any of the + -- matches work, the actions are executed for the object. + matches = { + { + -- This matches all cards. + { "device.name", "matches", "v4l2_device.*" }, + }, + }, + -- Apply properties on the matched object. + apply_properties = { + -- ["device.nick"] = "My Device", + }, + }, + { + matches = { + { + -- Matches all sources. + { "node.name", "matches", "v4l2_input.*" }, + }, + { + -- Matches all sinks. + { "node.name", "matches", "v4l2_output.*" }, + }, + }, + apply_properties = { + --["node.nick"] = "My Node", + --["priority.driver"] = 100, + --["priority.session"] = 100, + --["node.pause-on-idle"] = false, + }, + }, +} + +function enable_v4l2() + load_monitor("v4l2", { + properties = properties, + rules = rules, + }) +end diff --git a/src/config/config.lua.d/90-enable-video.lua b/src/config/config.lua.d/90-enable-video.lua new file mode 100644 index 0000000000000000000000000000000000000000..ed90465527fec5f3ce50ca1163597fe475bcc7a3 --- /dev/null +++ b/src/config/config.lua.d/90-enable-video.lua @@ -0,0 +1 @@ +enable_v4l2()