v4l2: Normalise control names in the same way as v4l2-ctl
authorWilliam Manley <will@williammanley.net>
Tue, 4 Mar 2014 01:15:49 +0000 (01:15 +0000)
committerNicolas Dufresne <nicolas.dufresne@collabora.co.uk>
Sun, 9 Mar 2014 00:27:54 +0000 (19:27 -0500)
commitd3bd3ecc3ebadf5f4871a34b9c268b1ac791cf06
tree42caf5193dc74e2856f9f906096add30ca8365eb
parentac839610334a1ad34177f419bd22a2481e9b5d89
v4l2: Normalise control names in the same way as v4l2-ctl

V4L2 kernel drivers allow configuration of the hardware settings via a
mechanism called controls.  These can be referred to by name such as
"Brightness" and "White Balance Temperature".  The user-space command line
client for setting these controls (v4l2-ctl) normalises these names such
that they only contain lower case alphanumeric characters and the
underscore '_'.  e.g:

    Kernel                     v4l2-ctl
    ----------------------------------------------------
    Brightness                 brightness
    White Balance Temperature  white_balance_temperature
    Focus (absolute)           focus_absolute

GStreamer seems to want to follow this pattern but failed for controls with
more than one consecutive non-alphanum character.  e.g. GStreamer would
produce "focus__absolute_" rather than "focus_absolute".

This commit fixes that issue.  Backwards compatibility is preserved by
normalising all control names before comparison.

https://bugzilla.gnome.org/show_bug.cgi?id=725632
sys/v4l2/v4l2_calls.c