/Documentation/DocBook/v4l/controls.xml
XML | 2099 lines | 2000 code | 92 blank | 7 comment | 0 complexity | 793536c995640f117796a1ae12ad9ca0 MD5 | raw file
Possible License(s): GPL-2.0, LGPL-2.0, AGPL-1.0
Large files files are truncated, but you can click here to view the full file
- <section id="control">
- <title>User Controls</title>
- <para>Devices typically have a number of user-settable controls
- such as brightness, saturation and so on, which would be presented to
- the user on a graphical user interface. But, different devices
- will have different controls available, and furthermore, the range of
- possible values, and the default value will vary from device to
- device. The control ioctls provide the information and a mechanism to
- create a nice user interface for these controls that will work
- correctly with any device.</para>
- <para>All controls are accessed using an ID value. V4L2 defines
- several IDs for specific purposes. Drivers can also implement their
- own custom controls using <constant>V4L2_CID_PRIVATE_BASE</constant>
- and higher values. The pre-defined control IDs have the prefix
- <constant>V4L2_CID_</constant>, and are listed in <xref
- linkend="control-id" />. The ID is used when querying the attributes of
- a control, and when getting or setting the current value.</para>
- <para>Generally applications should present controls to the user
- without assumptions about their purpose. Each control comes with a
- name string the user is supposed to understand. When the purpose is
- non-intuitive the driver writer should provide a user manual, a user
- interface plug-in or a driver specific panel application. Predefined
- IDs were introduced to change a few controls programmatically, for
- example to mute a device during a channel switch.</para>
- <para>Drivers may enumerate different controls after switching
- the current video input or output, tuner or modulator, or audio input
- or output. Different in the sense of other bounds, another default and
- current value, step size or other menu items. A control with a certain
- <emphasis>custom</emphasis> ID can also change name and
- type.<footnote>
- <para>It will be more convenient for applications if drivers
- make use of the <constant>V4L2_CTRL_FLAG_DISABLED</constant> flag, but
- that was never required.</para>
- </footnote> Control values are stored globally, they do not
- change when switching except to stay within the reported bounds. They
- also do not change ⪚ when the device is opened or closed, when the
- tuner radio frequency is changed or generally never without
- application request. Since V4L2 specifies no event mechanism, panel
- applications intended to cooperate with other panel applications (be
- they built into a larger application, as a TV viewer) may need to
- regularly poll control values to update their user
- interface.<footnote>
- <para>Applications could call an ioctl to request events.
- After another process called &VIDIOC-S-CTRL; or another ioctl changing
- shared properties the &func-select; function would indicate
- readability until any ioctl (querying the properties) is
- called.</para>
- </footnote></para>
- <table pgwide="1" frame="none" id="control-id">
- <title>Control IDs</title>
- <tgroup cols="3">
- &cs-def;
- <thead>
- <row>
- <entry>ID</entry>
- <entry>Type</entry>
- <entry>Description</entry>
- </row>
- </thead>
- <tbody valign="top">
- <row>
- <entry><constant>V4L2_CID_BASE</constant></entry>
- <entry></entry>
- <entry>First predefined ID, equal to
- <constant>V4L2_CID_BRIGHTNESS</constant>.</entry>
- </row>
- <row>
- <entry><constant>V4L2_CID_USER_BASE</constant></entry>
- <entry></entry>
- <entry>Synonym of <constant>V4L2_CID_BASE</constant>.</entry>
- </row>
- <row>
- <entry><constant>V4L2_CID_BRIGHTNESS</constant></entry>
- <entry>integer</entry>
- <entry>Picture brightness, or more precisely, the black
- level.</entry>
- </row>
- <row>
- <entry><constant>V4L2_CID_CONTRAST</constant></entry>
- <entry>integer</entry>
- <entry>Picture contrast or luma gain.</entry>
- </row>
- <row>
- <entry><constant>V4L2_CID_SATURATION</constant></entry>
- <entry>integer</entry>
- <entry>Picture color saturation or chroma gain.</entry>
- </row>
- <row>
- <entry><constant>V4L2_CID_HUE</constant></entry>
- <entry>integer</entry>
- <entry>Hue or color balance.</entry>
- </row>
- <row>
- <entry><constant>V4L2_CID_AUDIO_VOLUME</constant></entry>
- <entry>integer</entry>
- <entry>Overall audio volume. Note some drivers also
- provide an OSS or ALSA mixer interface.</entry>
- </row>
- <row>
- <entry><constant>V4L2_CID_AUDIO_BALANCE</constant></entry>
- <entry>integer</entry>
- <entry>Audio stereo balance. Minimum corresponds to all
- the way left, maximum to right.</entry>
- </row>
- <row>
- <entry><constant>V4L2_CID_AUDIO_BASS</constant></entry>
- <entry>integer</entry>
- <entry>Audio bass adjustment.</entry>
- </row>
- <row>
- <entry><constant>V4L2_CID_AUDIO_TREBLE</constant></entry>
- <entry>integer</entry>
- <entry>Audio treble adjustment.</entry>
- </row>
- <row>
- <entry><constant>V4L2_CID_AUDIO_MUTE</constant></entry>
- <entry>boolean</entry>
- <entry>Mute audio, &ie; set the volume to zero, however
- without affecting <constant>V4L2_CID_AUDIO_VOLUME</constant>. Like
- ALSA drivers, V4L2 drivers must mute at load time to avoid excessive
- noise. Actually the entire device should be reset to a low power
- consumption state.</entry>
- </row>
- <row>
- <entry><constant>V4L2_CID_AUDIO_LOUDNESS</constant></entry>
- <entry>boolean</entry>
- <entry>Loudness mode (bass boost).</entry>
- </row>
- <row>
- <entry><constant>V4L2_CID_BLACK_LEVEL</constant></entry>
- <entry>integer</entry>
- <entry>Another name for brightness (not a synonym of
- <constant>V4L2_CID_BRIGHTNESS</constant>). This control is deprecated
- and should not be used in new drivers and applications.</entry>
- </row>
- <row>
- <entry><constant>V4L2_CID_AUTO_WHITE_BALANCE</constant></entry>
- <entry>boolean</entry>
- <entry>Automatic white balance (cameras).</entry>
- </row>
- <row>
- <entry><constant>V4L2_CID_DO_WHITE_BALANCE</constant></entry>
- <entry>button</entry>
- <entry>This is an action control. When set (the value is
- ignored), the device will do a white balance and then hold the current
- setting. Contrast this with the boolean
- <constant>V4L2_CID_AUTO_WHITE_BALANCE</constant>, which, when
- activated, keeps adjusting the white balance.</entry>
- </row>
- <row>
- <entry><constant>V4L2_CID_RED_BALANCE</constant></entry>
- <entry>integer</entry>
- <entry>Red chroma balance.</entry>
- </row>
- <row>
- <entry><constant>V4L2_CID_BLUE_BALANCE</constant></entry>
- <entry>integer</entry>
- <entry>Blue chroma balance.</entry>
- </row>
- <row>
- <entry><constant>V4L2_CID_GAMMA</constant></entry>
- <entry>integer</entry>
- <entry>Gamma adjust.</entry>
- </row>
- <row>
- <entry><constant>V4L2_CID_WHITENESS</constant></entry>
- <entry>integer</entry>
- <entry>Whiteness for grey-scale devices. This is a synonym
- for <constant>V4L2_CID_GAMMA</constant>. This control is deprecated
- and should not be used in new drivers and applications.</entry>
- </row>
- <row>
- <entry><constant>V4L2_CID_EXPOSURE</constant></entry>
- <entry>integer</entry>
- <entry>Exposure (cameras). [Unit?]</entry>
- </row>
- <row>
- <entry><constant>V4L2_CID_AUTOGAIN</constant></entry>
- <entry>boolean</entry>
- <entry>Automatic gain/exposure control.</entry>
- </row>
- <row>
- <entry><constant>V4L2_CID_GAIN</constant></entry>
- <entry>integer</entry>
- <entry>Gain control.</entry>
- </row>
- <row>
- <entry><constant>V4L2_CID_HFLIP</constant></entry>
- <entry>boolean</entry>
- <entry>Mirror the picture horizontally.</entry>
- </row>
- <row>
- <entry><constant>V4L2_CID_VFLIP</constant></entry>
- <entry>boolean</entry>
- <entry>Mirror the picture vertically.</entry>
- </row>
- <row>
- <entry><constant>V4L2_CID_HCENTER_DEPRECATED</constant> (formerly <constant>V4L2_CID_HCENTER</constant>)</entry>
- <entry>integer</entry>
- <entry>Horizontal image centering. This control is
- deprecated. New drivers and applications should use the <link
- linkend="camera-controls">Camera class controls</link>
- <constant>V4L2_CID_PAN_ABSOLUTE</constant>,
- <constant>V4L2_CID_PAN_RELATIVE</constant> and
- <constant>V4L2_CID_PAN_RESET</constant> instead.</entry>
- </row>
- <row>
- <entry><constant>V4L2_CID_VCENTER_DEPRECATED</constant>
- (formerly <constant>V4L2_CID_VCENTER</constant>)</entry>
- <entry>integer</entry>
- <entry>Vertical image centering. Centering is intended to
- <emphasis>physically</emphasis> adjust cameras. For image cropping see
- <xref linkend="crop" />, for clipping <xref linkend="overlay" />. This
- control is deprecated. New drivers and applications should use the
- <link linkend="camera-controls">Camera class controls</link>
- <constant>V4L2_CID_TILT_ABSOLUTE</constant>,
- <constant>V4L2_CID_TILT_RELATIVE</constant> and
- <constant>V4L2_CID_TILT_RESET</constant> instead.</entry>
- </row>
- <row id="v4l2-power-line-frequency">
- <entry><constant>V4L2_CID_POWER_LINE_FREQUENCY</constant></entry>
- <entry>enum</entry>
- <entry>Enables a power line frequency filter to avoid
- flicker. Possible values for <constant>enum v4l2_power_line_frequency</constant> are:
- <constant>V4L2_CID_POWER_LINE_FREQUENCY_DISABLED</constant> (0),
- <constant>V4L2_CID_POWER_LINE_FREQUENCY_50HZ</constant> (1) and
- <constant>V4L2_CID_POWER_LINE_FREQUENCY_60HZ</constant> (2).</entry>
- </row>
- <row>
- <entry><constant>V4L2_CID_HUE_AUTO</constant></entry>
- <entry>boolean</entry>
- <entry>Enables automatic hue control by the device. The
- effect of setting <constant>V4L2_CID_HUE</constant> while automatic
- hue control is enabled is undefined, drivers should ignore such
- request.</entry>
- </row>
- <row>
- <entry><constant>V4L2_CID_WHITE_BALANCE_TEMPERATURE</constant></entry>
- <entry>integer</entry>
- <entry>This control specifies the white balance settings
- as a color temperature in Kelvin. A driver should have a minimum of
- 2800 (incandescent) to 6500 (daylight). For more information about