Add wireplumber-config-agl bbappend
[AGL/meta-agl-demo.git] / recipes-multimedia / wireplumber / files / 30-v4l2-monitor.lua
1 -- V4L2 monitor config file; with selecting by default USB camera --
2
3 v4l2_monitor = {}
4 v4l2_monitor.properties = {}
5
6 v4l2_monitor.rules = {
7   -- An array of matches/actions to evaluate.
8   {
9     -- Rules for matching a device or node. It is an array of
10     -- properties that all need to match the regexp. If any of the
11     -- matches work, the actions are executed for the object.
12     matches = {
13       {
14         -- This matches all cards.
15         { "device.name", "matches", "v4l2_device.*" },
16       },
17     },
18     -- Apply properties on the matched object.
19     apply_properties = {
20       -- ["device.nick"] = "My Device",
21     },
22   },
23   {
24     matches = {
25       {
26         -- Matches all sources.
27         { "node.name", "matches", "v4l2_input.*" },
28       },
29       {
30         -- Matches all sinks.
31         { "node.name", "matches", "v4l2_output.*" },
32       },
33     },
34     apply_properties = {
35       --["node.nick"] = "My Node",
36       --["priority.driver"] = 100,
37       --["priority.session"] = 100,
38       --["node.pause-on-idle"] = false,
39     },
40   },
41   {
42   matches = {
43     {
44       { "node.name", "matches", "v4l2_input*usb*" },
45     },
46   },
47   apply_properties = {
48     ["priority.driver"]        = 1300,
49     ["priority.session"]       = 1300,
50   },
51   },
52 }
53
54 function v4l2_monitor.enable()
55   load_monitor("v4l2", {
56     properties = v4l2_monitor.properties,
57     rules = v4l2_monitor.rules,
58   })
59 end