libexplain  1.4.D001
libexplain/buffer/v4l2_control_id.c
Go to the documentation of this file.
00001 /*
00002  * libexplain - a library of system-call-specific strerror replacements
00003  * Copyright (C) 2011, 2013 Peter Miller
00004  *
00005  * This program is free software; you can redistribute it and/or modify
00006  * it under the terms of the GNU Lesser General Public License as
00007  * published by the Free Software Foundation; either version 3 of the
00008  * License, or (at your option) any later version.
00009  *
00010  * This program is distributed in the hope that it will be useful,
00011  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00012  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00013  * Lesser General Public License for more details.
00014  *
00015  * You should have received a copy of the GNU Lesser General Public License
00016  * along with this program. If not, see <http://www.gnu.org/licenses/>.
00017  */
00018 
00019 #include <libexplain/ac/errno.h>
00020 #include <libexplain/ac/string.h>
00021 #include <libexplain/ac/linux/videodev2.h>
00022 #include <libexplain/ac/sys/ioctl.h>
00023 
00024 #include <libexplain/buffer/v4l2_control_id.h>
00025 #include <libexplain/parse_bits.h>
00026 
00027 
00028 #ifdef HAVE_LINUX_VIDEODEV2_H
00029 
00030 /*
00031  * awk '/#define.V4L2_CID_.*BASE/{
00032  *     print "#ifdef " 42
00033  *     print "        { \"" $2 "\", " $2 " },"
00034  *     print "#endif"
00035  * }
00036  * ' /usr/include/linux/videodev2.h
00037  */
00038 static const explain_parse_bits_table_t table[] =
00039 {
00040 #ifdef V4L2_CID_BRIGHTNESS
00041     { "V4L2_CID_BRIGHTNESS", V4L2_CID_BRIGHTNESS },
00042 #endif
00043 #ifdef V4L2_CID_CONTRAST
00044     { "V4L2_CID_CONTRAST", V4L2_CID_CONTRAST },
00045 #endif
00046 #ifdef V4L2_CID_SATURATION
00047     { "V4L2_CID_SATURATION", V4L2_CID_SATURATION },
00048 #endif
00049 #ifdef V4L2_CID_HUE
00050     { "V4L2_CID_HUE", V4L2_CID_HUE },
00051 #endif
00052 #ifdef V4L2_CID_AUDIO_VOLUME
00053     { "V4L2_CID_AUDIO_VOLUME", V4L2_CID_AUDIO_VOLUME },
00054 #endif
00055 #ifdef V4L2_CID_AUDIO_BALANCE
00056     { "V4L2_CID_AUDIO_BALANCE", V4L2_CID_AUDIO_BALANCE },
00057 #endif
00058 #ifdef V4L2_CID_AUDIO_BASS
00059     { "V4L2_CID_AUDIO_BASS", V4L2_CID_AUDIO_BASS },
00060 #endif
00061 #ifdef V4L2_CID_AUDIO_TREBLE
00062     { "V4L2_CID_AUDIO_TREBLE", V4L2_CID_AUDIO_TREBLE },
00063 #endif
00064 #ifdef V4L2_CID_AUDIO_MUTE
00065     { "V4L2_CID_AUDIO_MUTE", V4L2_CID_AUDIO_MUTE },
00066 #endif
00067 #ifdef V4L2_CID_AUDIO_LOUDNESS
00068     { "V4L2_CID_AUDIO_LOUDNESS", V4L2_CID_AUDIO_LOUDNESS },
00069 #endif
00070 #ifdef V4L2_CID_BLACK_LEVEL
00071     { "V4L2_CID_BLACK_LEVEL", V4L2_CID_BLACK_LEVEL },
00072 #endif
00073 #ifdef V4L2_CID_AUTO_WHITE_BALANCE
00074     { "V4L2_CID_AUTO_WHITE_BALANCE", V4L2_CID_AUTO_WHITE_BALANCE },
00075 #endif
00076 #ifdef V4L2_CID_DO_WHITE_BALANCE
00077     { "V4L2_CID_DO_WHITE_BALANCE", V4L2_CID_DO_WHITE_BALANCE },
00078 #endif
00079 #ifdef V4L2_CID_RED_BALANCE
00080     { "V4L2_CID_RED_BALANCE", V4L2_CID_RED_BALANCE },
00081 #endif
00082 #ifdef V4L2_CID_BLUE_BALANCE
00083     { "V4L2_CID_BLUE_BALANCE", V4L2_CID_BLUE_BALANCE },
00084 #endif
00085 #ifdef V4L2_CID_GAMMA
00086     { "V4L2_CID_GAMMA", V4L2_CID_GAMMA },
00087 #endif
00088 #ifdef V4L2_CID_EXPOSURE
00089     { "V4L2_CID_EXPOSURE", V4L2_CID_EXPOSURE },
00090 #endif
00091 #ifdef V4L2_CID_AUTOGAIN
00092     { "V4L2_CID_AUTOGAIN", V4L2_CID_AUTOGAIN },
00093 #endif
00094 #ifdef V4L2_CID_GAIN
00095     { "V4L2_CID_GAIN", V4L2_CID_GAIN },
00096 #endif
00097 #ifdef V4L2_CID_HFLIP
00098     { "V4L2_CID_HFLIP", V4L2_CID_HFLIP },
00099 #endif
00100 #ifdef V4L2_CID_VFLIP
00101     { "V4L2_CID_VFLIP", V4L2_CID_VFLIP },
00102 #endif
00103 #ifdef V4L2_CID_HCENTER
00104     { "V4L2_CID_HCENTER", V4L2_CID_HCENTER },
00105 #endif
00106 #ifdef V4L2_CID_VCENTER
00107     { "V4L2_CID_VCENTER", V4L2_CID_VCENTER },
00108 #endif
00109 #ifdef V4L2_CID_POWER_LINE_FREQUENCY
00110     { "V4L2_CID_POWER_LINE_FREQUENCY", V4L2_CID_POWER_LINE_FREQUENCY },
00111 #endif
00112 #ifdef V4L2_CID_HUE_AUTO
00113     { "V4L2_CID_HUE_AUTO", V4L2_CID_HUE_AUTO },
00114 #endif
00115 #ifdef V4L2_CID_WHITE_BALANCE_TEMPERATURE
00116     { "V4L2_CID_WHITE_BALANCE_TEMPERATURE",
00117         V4L2_CID_WHITE_BALANCE_TEMPERATURE },
00118 #endif
00119 #ifdef V4L2_CID_SHARPNESS
00120     { "V4L2_CID_SHARPNESS", V4L2_CID_SHARPNESS },
00121 #endif
00122 #ifdef V4L2_CID_BACKLIGHT_COMPENSATION
00123     { "V4L2_CID_BACKLIGHT_COMPENSATION", V4L2_CID_BACKLIGHT_COMPENSATION },
00124 #endif
00125 #ifdef V4L2_CID_CHROMA_AGC
00126     { "V4L2_CID_CHROMA_AGC", V4L2_CID_CHROMA_AGC },
00127 #endif
00128 #ifdef V4L2_CID_COLOR_KILLER
00129     { "V4L2_CID_COLOR_KILLER", V4L2_CID_COLOR_KILLER },
00130 #endif
00131 #ifdef V4L2_CID_COLORFX
00132     { "V4L2_CID_COLORFX", V4L2_CID_COLORFX },
00133 #endif
00134 #ifdef V4L2_CID_AUTOBRIGHTNESS
00135     { "V4L2_CID_AUTOBRIGHTNESS", V4L2_CID_AUTOBRIGHTNESS },
00136 #endif
00137 #ifdef V4L2_CID_BAND_STOP_FILTER
00138     { "V4L2_CID_BAND_STOP_FILTER", V4L2_CID_BAND_STOP_FILTER },
00139 #endif
00140 #ifdef V4L2_CID_ROTATE
00141     { "V4L2_CID_ROTATE", V4L2_CID_ROTATE },
00142 #endif
00143 #ifdef V4L2_CID_BG_COLOR
00144     { "V4L2_CID_BG_COLOR", V4L2_CID_BG_COLOR },
00145 #endif
00146 #ifdef V4L2_CID_CHROMA_GAIN
00147     { "V4L2_CID_CHROMA_GAIN", V4L2_CID_CHROMA_GAIN },
00148 #endif
00149 #ifdef V4L2_CID_ILLUMINATORS_1
00150     { "V4L2_CID_ILLUMINATORS_1", V4L2_CID_ILLUMINATORS_1 },
00151 #endif
00152 #ifdef V4L2_CID_ILLUMINATORS_2
00153     { "V4L2_CID_ILLUMINATORS_2", V4L2_CID_ILLUMINATORS_2 },
00154 #endif
00155 #ifdef V4L2_CID_LASTP1
00156     { "V4L2_CID_LASTP1", V4L2_CID_LASTP1 },
00157 #endif
00158 #ifdef V4L2_CID_MPEG_STREAM_TYPE
00159     { "V4L2_CID_MPEG_STREAM_TYPE", V4L2_CID_MPEG_STREAM_TYPE },
00160 #endif
00161 #ifdef V4L2_CID_MPEG_STREAM_PID_PMT
00162     { "V4L2_CID_MPEG_STREAM_PID_PMT", V4L2_CID_MPEG_STREAM_PID_PMT },
00163 #endif
00164 #ifdef V4L2_CID_MPEG_STREAM_PID_AUDIO
00165     { "V4L2_CID_MPEG_STREAM_PID_AUDIO", V4L2_CID_MPEG_STREAM_PID_AUDIO },
00166 #endif
00167 #ifdef V4L2_CID_MPEG_STREAM_PID_VIDEO
00168     { "V4L2_CID_MPEG_STREAM_PID_VIDEO", V4L2_CID_MPEG_STREAM_PID_VIDEO },
00169 #endif
00170 #ifdef V4L2_CID_MPEG_STREAM_PID_PCR
00171     { "V4L2_CID_MPEG_STREAM_PID_PCR", V4L2_CID_MPEG_STREAM_PID_PCR },
00172 #endif
00173 #ifdef V4L2_CID_MPEG_STREAM_PES_ID_AUDIO
00174     { "V4L2_CID_MPEG_STREAM_PES_ID_AUDIO", V4L2_CID_MPEG_STREAM_PES_ID_AUDIO },
00175 #endif
00176 #ifdef V4L2_CID_MPEG_STREAM_PES_ID_VIDEO
00177     { "V4L2_CID_MPEG_STREAM_PES_ID_VIDEO", V4L2_CID_MPEG_STREAM_PES_ID_VIDEO },
00178 #endif
00179 #ifdef V4L2_CID_MPEG_STREAM_VBI_FMT
00180     { "V4L2_CID_MPEG_STREAM_VBI_FMT", V4L2_CID_MPEG_STREAM_VBI_FMT },
00181 #endif
00182 #ifdef V4L2_CID_MPEG_AUDIO_SAMPLING_FREQ
00183     { "V4L2_CID_MPEG_AUDIO_SAMPLING_FREQ", V4L2_CID_MPEG_AUDIO_SAMPLING_FREQ },
00184 #endif
00185 #ifdef V4L2_CID_MPEG_AUDIO_ENCODING
00186     { "V4L2_CID_MPEG_AUDIO_ENCODING", V4L2_CID_MPEG_AUDIO_ENCODING },
00187 #endif
00188 #ifdef V4L2_CID_MPEG_AUDIO_L1_BITRATE
00189     { "V4L2_CID_MPEG_AUDIO_L1_BITRATE", V4L2_CID_MPEG_AUDIO_L1_BITRATE },
00190 #endif
00191 #ifdef V4L2_CID_MPEG_AUDIO_L2_BITRATE
00192     { "V4L2_CID_MPEG_AUDIO_L2_BITRATE", V4L2_CID_MPEG_AUDIO_L2_BITRATE },
00193 #endif
00194 #ifdef V4L2_CID_MPEG_AUDIO_L3_BITRATE
00195     { "V4L2_CID_MPEG_AUDIO_L3_BITRATE", V4L2_CID_MPEG_AUDIO_L3_BITRATE },
00196 #endif
00197 #ifdef V4L2_CID_MPEG_AUDIO_MODE
00198     { "V4L2_CID_MPEG_AUDIO_MODE", V4L2_CID_MPEG_AUDIO_MODE },
00199 #endif
00200 #ifdef V4L2_CID_MPEG_AUDIO_MODE_EXTENSION
00201     { "V4L2_CID_MPEG_AUDIO_MODE_EXTENSION",
00202         V4L2_CID_MPEG_AUDIO_MODE_EXTENSION },
00203 #endif
00204 #ifdef V4L2_CID_MPEG_AUDIO_EMPHASIS
00205     { "V4L2_CID_MPEG_AUDIO_EMPHASIS", V4L2_CID_MPEG_AUDIO_EMPHASIS },
00206 #endif
00207 #ifdef V4L2_CID_MPEG_AUDIO_CRC
00208     { "V4L2_CID_MPEG_AUDIO_CRC", V4L2_CID_MPEG_AUDIO_CRC },
00209 #endif
00210 #ifdef V4L2_CID_MPEG_AUDIO_MUTE
00211     { "V4L2_CID_MPEG_AUDIO_MUTE", V4L2_CID_MPEG_AUDIO_MUTE },
00212 #endif
00213 #ifdef V4L2_CID_MPEG_AUDIO_AAC_BITRATE
00214     { "V4L2_CID_MPEG_AUDIO_AAC_BITRATE", V4L2_CID_MPEG_AUDIO_AAC_BITRATE },
00215 #endif
00216 #ifdef V4L2_CID_MPEG_AUDIO_AC3_BITRATE
00217     { "V4L2_CID_MPEG_AUDIO_AC3_BITRATE", V4L2_CID_MPEG_AUDIO_AC3_BITRATE },
00218 #endif
00219 #ifdef V4L2_CID_MPEG_VIDEO_ENCODING
00220     { "V4L2_CID_MPEG_VIDEO_ENCODING", V4L2_CID_MPEG_VIDEO_ENCODING },
00221 #endif
00222 #ifdef V4L2_CID_MPEG_VIDEO_ASPECT
00223     { "V4L2_CID_MPEG_VIDEO_ASPECT", V4L2_CID_MPEG_VIDEO_ASPECT },
00224 #endif
00225 #ifdef V4L2_CID_MPEG_VIDEO_B_FRAMES
00226     { "V4L2_CID_MPEG_VIDEO_B_FRAMES", V4L2_CID_MPEG_VIDEO_B_FRAMES },
00227 #endif
00228 #ifdef V4L2_CID_MPEG_VIDEO_GOP_SIZE
00229     { "V4L2_CID_MPEG_VIDEO_GOP_SIZE", V4L2_CID_MPEG_VIDEO_GOP_SIZE },
00230 #endif
00231 #ifdef V4L2_CID_MPEG_VIDEO_GOP_CLOSURE
00232     { "V4L2_CID_MPEG_VIDEO_GOP_CLOSURE", V4L2_CID_MPEG_VIDEO_GOP_CLOSURE },
00233 #endif
00234 #ifdef V4L2_CID_MPEG_VIDEO_PULLDOWN
00235     { "V4L2_CID_MPEG_VIDEO_PULLDOWN", V4L2_CID_MPEG_VIDEO_PULLDOWN },
00236 #endif
00237 #ifdef V4L2_CID_MPEG_VIDEO_BITRATE_MODE
00238     { "V4L2_CID_MPEG_VIDEO_BITRATE_MODE", V4L2_CID_MPEG_VIDEO_BITRATE_MODE },
00239 #endif
00240 #ifdef V4L2_CID_MPEG_VIDEO_BITRATE
00241     { "V4L2_CID_MPEG_VIDEO_BITRATE", V4L2_CID_MPEG_VIDEO_BITRATE },
00242 #endif
00243 #ifdef V4L2_CID_MPEG_VIDEO_BITRATE_PEAK
00244     { "V4L2_CID_MPEG_VIDEO_BITRATE_PEAK", V4L2_CID_MPEG_VIDEO_BITRATE_PEAK },
00245 #endif
00246 #ifdef V4L2_CID_MPEG_VIDEO_TEMPORAL_DECIMATION
00247     { "V4L2_CID_MPEG_VIDEO_TEMPORAL_DECIMATION",
00248         V4L2_CID_MPEG_VIDEO_TEMPORAL_DECIMATION },
00249 #endif
00250 #ifdef V4L2_CID_MPEG_VIDEO_MUTE
00251     { "V4L2_CID_MPEG_VIDEO_MUTE", V4L2_CID_MPEG_VIDEO_MUTE },
00252 #endif
00253 #ifdef V4L2_CID_MPEG_VIDEO_MUTE_YUV
00254     { "V4L2_CID_MPEG_VIDEO_MUTE_YUV", V4L2_CID_MPEG_VIDEO_MUTE_YUV },
00255 #endif
00256 #ifdef V4L2_CID_MPEG_CX2341X_VIDEO_SPATIAL_FILTER_MODE
00257     { "V4L2_CID_MPEG_CX2341X_VIDEO_SPATIAL_FILTER_MODE",
00258         V4L2_CID_MPEG_CX2341X_VIDEO_SPATIAL_FILTER_MODE },
00259 #endif
00260 #ifdef V4L2_CID_MPEG_CX2341X_VIDEO_SPATIAL_FILTER
00261     { "V4L2_CID_MPEG_CX2341X_VIDEO_SPATIAL_FILTER",
00262         V4L2_CID_MPEG_CX2341X_VIDEO_SPATIAL_FILTER },
00263 #endif
00264 #ifdef V4L2_CID_MPEG_CX2341X_VIDEO_LUMA_SPATIAL_FILTER_TYPE
00265     { "V4L2_CID_MPEG_CX2341X_VIDEO_LUMA_SPATIAL_FILTER_TYPE",
00266         V4L2_CID_MPEG_CX2341X_VIDEO_LUMA_SPATIAL_FILTER_TYPE },
00267 #endif
00268 #ifdef V4L2_CID_MPEG_CX2341X_VIDEO_CHROMA_SPATIAL_FILTER_TYPE
00269     { "V4L2_CID_MPEG_CX2341X_VIDEO_CHROMA_SPATIAL_FILTER_TYPE",
00270         V4L2_CID_MPEG_CX2341X_VIDEO_CHROMA_SPATIAL_FILTER_TYPE },
00271 #endif
00272 #ifdef V4L2_CID_MPEG_CX2341X_VIDEO_TEMPORAL_FILTER_MODE
00273     { "V4L2_CID_MPEG_CX2341X_VIDEO_TEMPORAL_FILTER_MODE",
00274         V4L2_CID_MPEG_CX2341X_VIDEO_TEMPORAL_FILTER_MODE },
00275 #endif
00276 #ifdef V4L2_CID_MPEG_CX2341X_VIDEO_TEMPORAL_FILTER
00277     { "V4L2_CID_MPEG_CX2341X_VIDEO_TEMPORAL_FILTER",
00278         V4L2_CID_MPEG_CX2341X_VIDEO_TEMPORAL_FILTER },
00279 #endif
00280 #ifdef V4L2_CID_MPEG_CX2341X_VIDEO_MEDIAN_FILTER_TYPE
00281     { "V4L2_CID_MPEG_CX2341X_VIDEO_MEDIAN_FILTER_TYPE",
00282         V4L2_CID_MPEG_CX2341X_VIDEO_MEDIAN_FILTER_TYPE },
00283 #endif
00284 #ifdef V4L2_CID_MPEG_CX2341X_VIDEO_LUMA_MEDIAN_FILTER_BOTTOM
00285     { "V4L2_CID_MPEG_CX2341X_VIDEO_LUMA_MEDIAN_FILTER_BOTTOM",
00286         V4L2_CID_MPEG_CX2341X_VIDEO_LUMA_MEDIAN_FILTER_BOTTOM },
00287 #endif
00288 #ifdef V4L2_CID_MPEG_CX2341X_VIDEO_LUMA_MEDIAN_FILTER_TOP
00289     { "V4L2_CID_MPEG_CX2341X_VIDEO_LUMA_MEDIAN_FILTER_TOP",
00290         V4L2_CID_MPEG_CX2341X_VIDEO_LUMA_MEDIAN_FILTER_TOP },
00291 #endif
00292 #ifdef V4L2_CID_MPEG_CX2341X_VIDEO_CHROMA_MEDIAN_FILTER_BOTTOM
00293     { "V4L2_CID_MPEG_CX2341X_VIDEO_CHROMA_MEDIAN_FILTER_BOTTOM",
00294         V4L2_CID_MPEG_CX2341X_VIDEO_CHROMA_MEDIAN_FILTER_BOTTOM },
00295 #endif
00296 #ifdef V4L2_CID_MPEG_CX2341X_VIDEO_CHROMA_MEDIAN_FILTER_TOP
00297     { "V4L2_CID_MPEG_CX2341X_VIDEO_CHROMA_MEDIAN_FILTER_TOP",
00298         V4L2_CID_MPEG_CX2341X_VIDEO_CHROMA_MEDIAN_FILTER_TOP },
00299 #endif
00300 #ifdef V4L2_CID_MPEG_CX2341X_STREAM_INSERT_NAV_PACKETS
00301     { "V4L2_CID_MPEG_CX2341X_STREAM_INSERT_NAV_PACKETS",
00302         V4L2_CID_MPEG_CX2341X_STREAM_INSERT_NAV_PACKETS },
00303 #endif
00304 #ifdef V4L2_CID_EXPOSURE_AUTO
00305     { "V4L2_CID_EXPOSURE_AUTO", V4L2_CID_EXPOSURE_AUTO },
00306 #endif
00307 #ifdef V4L2_CID_EXPOSURE_ABSOLUTE
00308     { "V4L2_CID_EXPOSURE_ABSOLUTE", V4L2_CID_EXPOSURE_ABSOLUTE },
00309 #endif
00310 #ifdef V4L2_CID_EXPOSURE_AUTO_PRIORITY
00311     { "V4L2_CID_EXPOSURE_AUTO_PRIORITY", V4L2_CID_EXPOSURE_AUTO_PRIORITY },
00312 #endif
00313 #ifdef V4L2_CID_PAN_RELATIVE
00314     { "V4L2_CID_PAN_RELATIVE", V4L2_CID_PAN_RELATIVE },
00315 #endif
00316 #ifdef V4L2_CID_TILT_RELATIVE
00317     { "V4L2_CID_TILT_RELATIVE", V4L2_CID_TILT_RELATIVE },
00318 #endif
00319 #ifdef V4L2_CID_PAN_RESET
00320     { "V4L2_CID_PAN_RESET", V4L2_CID_PAN_RESET },
00321 #endif
00322 #ifdef V4L2_CID_TILT_RESET
00323     { "V4L2_CID_TILT_RESET", V4L2_CID_TILT_RESET },
00324 #endif
00325 #ifdef V4L2_CID_PAN_ABSOLUTE
00326     { "V4L2_CID_PAN_ABSOLUTE", V4L2_CID_PAN_ABSOLUTE },
00327 #endif
00328 #ifdef V4L2_CID_TILT_ABSOLUTE
00329     { "V4L2_CID_TILT_ABSOLUTE", V4L2_CID_TILT_ABSOLUTE },
00330 #endif
00331 #ifdef V4L2_CID_FOCUS_ABSOLUTE
00332     { "V4L2_CID_FOCUS_ABSOLUTE", V4L2_CID_FOCUS_ABSOLUTE },
00333 #endif
00334 #ifdef V4L2_CID_FOCUS_RELATIVE
00335     { "V4L2_CID_FOCUS_RELATIVE", V4L2_CID_FOCUS_RELATIVE },
00336 #endif
00337 #ifdef V4L2_CID_FOCUS_AUTO
00338     { "V4L2_CID_FOCUS_AUTO", V4L2_CID_FOCUS_AUTO },
00339 #endif
00340 #ifdef V4L2_CID_ZOOM_ABSOLUTE
00341     { "V4L2_CID_ZOOM_ABSOLUTE", V4L2_CID_ZOOM_ABSOLUTE },
00342 #endif
00343 #ifdef V4L2_CID_ZOOM_RELATIVE
00344     { "V4L2_CID_ZOOM_RELATIVE", V4L2_CID_ZOOM_RELATIVE },
00345 #endif
00346 #ifdef V4L2_CID_ZOOM_CONTINUOUS
00347     { "V4L2_CID_ZOOM_CONTINUOUS", V4L2_CID_ZOOM_CONTINUOUS },
00348 #endif
00349 #ifdef V4L2_CID_PRIVACY
00350     { "V4L2_CID_PRIVACY", V4L2_CID_PRIVACY },
00351 #endif
00352 #ifdef V4L2_CID_IRIS_ABSOLUTE
00353     { "V4L2_CID_IRIS_ABSOLUTE", V4L2_CID_IRIS_ABSOLUTE },
00354 #endif
00355 #ifdef V4L2_CID_IRIS_RELATIVE
00356     { "V4L2_CID_IRIS_RELATIVE", V4L2_CID_IRIS_RELATIVE },
00357 #endif
00358 #ifdef V4L2_CID_RDS_TX_DEVIATION
00359     { "V4L2_CID_RDS_TX_DEVIATION", V4L2_CID_RDS_TX_DEVIATION },
00360 #endif
00361 #ifdef V4L2_CID_RDS_TX_PI
00362     { "V4L2_CID_RDS_TX_PI", V4L2_CID_RDS_TX_PI },
00363 #endif
00364 #ifdef V4L2_CID_RDS_TX_PTY
00365     { "V4L2_CID_RDS_TX_PTY", V4L2_CID_RDS_TX_PTY },
00366 #endif
00367 #ifdef V4L2_CID_RDS_TX_PS_NAME
00368     { "V4L2_CID_RDS_TX_PS_NAME", V4L2_CID_RDS_TX_PS_NAME },
00369 #endif
00370 #ifdef V4L2_CID_RDS_TX_RADIO_TEXT
00371     { "V4L2_CID_RDS_TX_RADIO_TEXT", V4L2_CID_RDS_TX_RADIO_TEXT },
00372 #endif
00373 #ifdef V4L2_CID_AUDIO_LIMITER_ENABLED
00374     { "V4L2_CID_AUDIO_LIMITER_ENABLED", V4L2_CID_AUDIO_LIMITER_ENABLED },
00375 #endif
00376 #ifdef V4L2_CID_AUDIO_LIMITER_RELEASE_TIME
00377     { "V4L2_CID_AUDIO_LIMITER_RELEASE_TIME",
00378         V4L2_CID_AUDIO_LIMITER_RELEASE_TIME },
00379 #endif
00380 #ifdef V4L2_CID_AUDIO_LIMITER_DEVIATION
00381     { "V4L2_CID_AUDIO_LIMITER_DEVIATION", V4L2_CID_AUDIO_LIMITER_DEVIATION },
00382 #endif
00383 #ifdef V4L2_CID_AUDIO_COMPRESSION_ENABLED
00384     { "V4L2_CID_AUDIO_COMPRESSION_ENABLED",
00385         V4L2_CID_AUDIO_COMPRESSION_ENABLED },
00386 #endif
00387 #ifdef V4L2_CID_AUDIO_COMPRESSION_GAIN
00388     { "V4L2_CID_AUDIO_COMPRESSION_GAIN", V4L2_CID_AUDIO_COMPRESSION_GAIN },
00389 #endif
00390 #ifdef V4L2_CID_AUDIO_COMPRESSION_THRESHOLD
00391     { "V4L2_CID_AUDIO_COMPRESSION_THRESHOLD",
00392         V4L2_CID_AUDIO_COMPRESSION_THRESHOLD },
00393 #endif
00394 #ifdef V4L2_CID_AUDIO_COMPRESSION_ATTACK_TIME
00395     { "V4L2_CID_AUDIO_COMPRESSION_ATTACK_TIME",
00396         V4L2_CID_AUDIO_COMPRESSION_ATTACK_TIME },
00397 #endif
00398 #ifdef V4L2_CID_AUDIO_COMPRESSION_RELEASE_TIME
00399     { "V4L2_CID_AUDIO_COMPRESSION_RELEASE_TIME",
00400         V4L2_CID_AUDIO_COMPRESSION_RELEASE_TIME },
00401 #endif
00402 #ifdef V4L2_CID_PILOT_TONE_ENABLED
00403     { "V4L2_CID_PILOT_TONE_ENABLED", V4L2_CID_PILOT_TONE_ENABLED },
00404 #endif
00405 #ifdef V4L2_CID_PILOT_TONE_DEVIATION
00406     { "V4L2_CID_PILOT_TONE_DEVIATION", V4L2_CID_PILOT_TONE_DEVIATION },
00407 #endif
00408 #ifdef V4L2_CID_PILOT_TONE_FREQUENCY
00409     { "V4L2_CID_PILOT_TONE_FREQUENCY", V4L2_CID_PILOT_TONE_FREQUENCY },
00410 #endif
00411 #ifdef V4L2_CID_TUNE_PREEMPHASIS
00412     { "V4L2_CID_TUNE_PREEMPHASIS", V4L2_CID_TUNE_PREEMPHASIS },
00413 #endif
00414 #ifdef V4L2_CID_TUNE_POWER_LEVEL
00415     { "V4L2_CID_TUNE_POWER_LEVEL", V4L2_CID_TUNE_POWER_LEVEL },
00416 #endif
00417 #ifdef V4L2_CID_TUNE_ANTENNA_CAPACITOR
00418     { "V4L2_CID_TUNE_ANTENNA_CAPACITOR", V4L2_CID_TUNE_ANTENNA_CAPACITOR },
00419 #endif
00420 };
00421 
00422 
00423 void
00424 explain_buffer_v4l2_control_id(explain_string_buffer_t *sb, int value)
00425 {
00426     if (value & V4L2_CTRL_FLAG_NEXT_CTRL)
00427     {
00428         explain_string_buffer_puts(sb, "V4L2_CTRL_FLAG_NEXT_CTRL | ");
00429         value &= ~V4L2_CTRL_FLAG_NEXT_CTRL;
00430     }
00431     explain_parse_bits_print_single(sb, value, table, SIZEOF(table));
00432 }
00433 
00434 
00435 enum explain_v4l2_control_id_check_t
00436 explain_v4l2_control_id_check(int fildes, int data)
00437 {
00438     struct v4l2_queryctrl dummy;
00439 
00440     memset(&dummy, 0, sizeof(dummy));
00441     dummy.id = data & ~V4L2_CTRL_FLAG_NEXT_CTRL;
00442     if (ioctl(fildes, VIDIOC_QUERYCTRL, &dummy) >= 0)
00443         return explain_v4l2_control_id_check_ok;
00444     switch (errno)
00445     {
00446     case EIO:
00447     case EINVAL:
00448         if (explain_parse_bits_find_by_value(data, table, SIZEOF(table)))
00449             return explain_v4l2_control_id_check_notsup;
00450         return explain_v4l2_control_id_check_nosuch;
00451 
00452     default:
00453         if (explain_parse_bits_find_by_value(data, table, SIZEOF(table)))
00454             return explain_v4l2_control_id_check_notsup;
00455         return explain_v4l2_control_id_check_no_idea;
00456     }
00457 }
00458 
00459 #endif
00460 
00461 
00462 /* vim: set ts=8 sw=4 et : */