[vlc-commits] Add undocumented automatic brightness and band-stop V4L2 controls

Rémi Denis-Courmont git at videolan.org
Mon Oct 3 17:45:28 CEST 2011


vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Mon Oct  3 18:45:09 2011 +0300| [4ad0710cbf5f2bed5cee14dcecc607abf3668df1] | committer: Rémi Denis-Courmont

Add undocumented automatic brightness and band-stop V4L2 controls

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=4ad0710cbf5f2bed5cee14dcecc607abf3668df1
---

 modules/access/v4l2/controls.c |    4 +++-
 modules/access/v4l2/video.c    |   13 ++++++++++++-
 2 files changed, 15 insertions(+), 2 deletions(-)

diff --git a/modules/access/v4l2/controls.c b/modules/access/v4l2/controls.c
index f7af231..d163629 100644
--- a/modules/access/v4l2/controls.c
+++ b/modules/access/v4l2/controls.c
@@ -72,12 +72,14 @@ static const vlc_v4l2_ctrl_name_t controls[] =
     { "rotate", V4L2_CID_ROTATE },
     { "bg-color", V4L2_CID_BG_COLOR }, // NOTE: output only
     { "chroma-gain", V4L2_CID_CHROMA_GAIN },
+    { "brightness-auto", V4L2_CID_AUTOBRIGHTNESS },
+    { "band-stop-filter", V4L2_CID_BAND_STOP_FILTER },
 
     { "illuminators-1", V4L2_CID_ILLUMINATORS_1 }, // NOTE: don't care?
     { "illuminators-2", V4L2_CID_ILLUMINATORS_2 },
 #define CTRL_CID_KNOWN(cid) \
     ((((uint32_t)cid) - V4L2_CID_BRIGHTNESS) \
-        <= (V4L2_CID_VCENTER - V4L2_CID_BRIGHTNESS))
+        <= (V4L2_CID_BAND_STOP_FILTER - V4L2_CID_BRIGHTNESS))
 };
 
 struct vlc_v4l2_ctrl
diff --git a/modules/access/v4l2/video.c b/modules/access/v4l2/video.c
index 1071133..10ffee4 100644
--- a/modules/access/v4l2/video.c
+++ b/modules/access/v4l2/video.c
@@ -92,6 +92,9 @@
 #define CTRL_RESET_LONGTEXT N_( "Reset controls to defaults." )
 #define BRIGHTNESS_TEXT N_( "Brightness" )
 #define BRIGHTNESS_LONGTEXT N_( "Picture brightness or black level." )
+#define BRIGHTNESS_AUTO_TEXT N_( "Automatic brightness" )
+#define BRIGHTNESS_AUTO_LONGTEXT N_( \
+    "Automatically adjust the picture brightness." )
 #define CONTRAST_TEXT N_( "Contrast" )
 #define CONTRAST_LONGTEXT N_( "Picture contrast or luma gain." )
 #define SATURATION_TEXT N_( "Saturation" )
@@ -146,6 +149,9 @@ static const char *const power_freq_user[] = { N_("Unspecified"),
 };
 #define BKLT_COMPENSATE_TEXT N_( "Backlight compensation" )
 #define BKLT_COMPENSATE_LONGTEXT N_( "Backlight compensation." )
+#define BAND_STOP_FILTER_TEXT N_( "Band-stop filter" )
+#define BAND_STOP_FILTER_LONGTEXT N_(  \
+    "Cut a light band induced by fluorescent lighting (unit undocumented)." )
 #define HFLIP_TEXT N_( "Horizontal flip" )
 #define HFLIP_LONGTEXT N_( \
     "Flip the picture horizontally." )
@@ -359,13 +365,16 @@ vlc_module_begin ()
         change_safe()
     add_integer( CFG_PREFIX "brightness", -1, BRIGHTNESS_TEXT,
                  BRIGHTNESS_LONGTEXT, true )
+    add_integer( CFG_PREFIX "brightness-auto", -1,
+                 BRIGHTNESS_AUTO_TEXT, BRIGHTNESS_AUTO_LONGTEXT, true )
+        change_integer_list( tristate_vlc, tristate_user )
     add_integer( CFG_PREFIX "contrast", -1, CONTRAST_TEXT,
                  CONTRAST_LONGTEXT, true )
     add_integer( CFG_PREFIX "saturation", -1, SATURATION_TEXT,
                  SATURATION_LONGTEXT, true )
     add_integer( CFG_PREFIX "hue", -1, HUE_TEXT,
                  HUE_LONGTEXT, true )
-    add_integer( CFG_PREFIX "auto-hue", -1,
+    add_integer( CFG_PREFIX "hue-auto", -1,
                  HUE_AUTO_TEXT, HUE_AUTO_LONGTEXT, true )
         change_integer_list( tristate_vlc, tristate_user )
     add_obsolete_integer( CFG_PREFIX "black-level" ) /* since Linux 2.6.26 */
@@ -401,6 +410,8 @@ vlc_module_begin ()
         change_integer_list( power_freq_vlc, power_freq_user )
     add_integer( CFG_PREFIX"backlight-compensation", -1,
                  BKLT_COMPENSATE_TEXT, BKLT_COMPENSATE_LONGTEXT, true )
+    add_integer( CFG_PREFIX "band-stop-filter", -1,
+                 BAND_STOP_FILTER_TEXT, BAND_STOP_FILTER_LONGTEXT, true )
     add_bool( CFG_PREFIX "hflip", false, HFLIP_TEXT, HFLIP_LONGTEXT, true )
     add_bool( CFG_PREFIX "vflip", false, VFLIP_TEXT, VFLIP_LONGTEXT, true )
     add_integer( CFG_PREFIX "rotate", -1, ROTATE_TEXT, ROTATE_LONGTEXT, true )



More information about the vlc-commits mailing list