Commit da7e73b
authored
fix(v4l2):: show bool controls and fix control name mismatch with Motion (#3391)
v4l2-ctl reports bool controls without min/max, so they were filtered
out before reaching the UI and never rendered as a checkbox. Capture
the control type from the parenthesized field and default bool
controls to min=0 and max=1.
Control values also often never reached the camera. Motion matches
video_params entries against the driver's raw control name, which
v4l2-ctl never prints: it collapses runs of non-alphanumeric
characters into underscores, so "White Balance, Automatic" is shown as
"white_balance_automatic". That substitution cannot be reversed, and
on a typical UVC webcam it breaks every control whose driver name is
more than one word -- half of them on the camera this was found on.
Write the control ID instead, in Motion's own "ID%08d" format, which
Motion builds and matches on in video_v4l2.c. IDs are stable UAPI
constants, whereas control names have changed between kernel versions.
Matching by ID also survives Motion upgrades: 5.x made name matching
case-sensitive, breaking even the single-word names that work on 4.6.
Existing configs with plain names are read back unchanged and migrate
to IDs on the next save.1 parent 2d62cce commit da7e73b
2 files changed
Lines changed: 35 additions & 8 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1120 | 1120 | | |
1121 | 1121 | | |
1122 | 1122 | | |
1123 | | - | |
1124 | | - | |
1125 | | - | |
1126 | | - | |
1127 | | - | |
1128 | | - | |
| 1123 | + | |
| 1124 | + | |
| 1125 | + | |
| 1126 | + | |
| 1127 | + | |
| 1128 | + | |
| 1129 | + | |
| 1130 | + | |
| 1131 | + | |
| 1132 | + | |
1129 | 1133 | | |
1130 | 1134 | | |
1131 | 1135 | | |
| |||
1682 | 1686 | | |
1683 | 1687 | | |
1684 | 1688 | | |
| 1689 | + | |
| 1690 | + | |
| 1691 | + | |
| 1692 | + | |
| 1693 | + | |
| 1694 | + | |
1685 | 1695 | | |
1686 | 1696 | | |
1687 | 1697 | | |
| |||
1701 | 1711 | | |
1702 | 1712 | | |
1703 | 1713 | | |
| 1714 | + | |
1704 | 1715 | | |
1705 | 1716 | | |
1706 | 1717 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
179 | 179 | | |
180 | 180 | | |
181 | 181 | | |
182 | | - | |
| 182 | + | |
183 | 183 | | |
184 | 184 | | |
185 | 185 | | |
186 | | - | |
| 186 | + | |
187 | 187 | | |
188 | 188 | | |
189 | 189 | | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
190 | 206 | | |
191 | 207 | | |
192 | 208 | | |
| |||
0 commit comments