vidioc-queryctrl.xml 25 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640
  1. <refentry id="vidioc-queryctrl">
  2. <refmeta>
  3. <refentrytitle>ioctl VIDIOC_QUERYCTRL, VIDIOC_QUERY_EXT_CTRL, VIDIOC_QUERYMENU</refentrytitle>
  4. &manvol;
  5. </refmeta>
  6. <refnamediv>
  7. <refname>VIDIOC_QUERYCTRL</refname>
  8. <refname>VIDIOC_QUERY_EXT_CTRL</refname>
  9. <refname>VIDIOC_QUERYMENU</refname>
  10. <refpurpose>Enumerate controls and menu control items</refpurpose>
  11. </refnamediv>
  12. <refsynopsisdiv>
  13. <funcsynopsis>
  14. <funcprototype>
  15. <funcdef>int <function>ioctl</function></funcdef>
  16. <paramdef>int <parameter>fd</parameter></paramdef>
  17. <paramdef>int <parameter>request</parameter></paramdef>
  18. <paramdef>struct v4l2_queryctrl *<parameter>argp</parameter></paramdef>
  19. </funcprototype>
  20. </funcsynopsis>
  21. <funcsynopsis>
  22. <funcprototype>
  23. <funcdef>int <function>ioctl</function></funcdef>
  24. <paramdef>int <parameter>fd</parameter></paramdef>
  25. <paramdef>int <parameter>request</parameter></paramdef>
  26. <paramdef>struct v4l2_query_ext_ctrl *<parameter>argp</parameter></paramdef>
  27. </funcprototype>
  28. </funcsynopsis>
  29. <funcsynopsis>
  30. <funcprototype>
  31. <funcdef>int <function>ioctl</function></funcdef>
  32. <paramdef>int <parameter>fd</parameter></paramdef>
  33. <paramdef>int <parameter>request</parameter></paramdef>
  34. <paramdef>struct v4l2_querymenu *<parameter>argp</parameter></paramdef>
  35. </funcprototype>
  36. </funcsynopsis>
  37. </refsynopsisdiv>
  38. <refsect1>
  39. <title>Arguments</title>
  40. <variablelist>
  41. <varlistentry>
  42. <term><parameter>fd</parameter></term>
  43. <listitem>
  44. <para>&fd;</para>
  45. </listitem>
  46. </varlistentry>
  47. <varlistentry>
  48. <term><parameter>request</parameter></term>
  49. <listitem>
  50. <para>VIDIOC_QUERYCTRL, VIDIOC_QUERY_EXT_CTRL, VIDIOC_QUERYMENU</para>
  51. </listitem>
  52. </varlistentry>
  53. <varlistentry>
  54. <term><parameter>argp</parameter></term>
  55. <listitem>
  56. <para></para>
  57. </listitem>
  58. </varlistentry>
  59. </variablelist>
  60. </refsect1>
  61. <refsect1>
  62. <title>Description</title>
  63. <para>To query the attributes of a control applications set the
  64. <structfield>id</structfield> field of a &v4l2-queryctrl; and call the
  65. <constant>VIDIOC_QUERYCTRL</constant> ioctl with a pointer to this
  66. structure. The driver fills the rest of the structure or returns an
  67. &EINVAL; when the <structfield>id</structfield> is invalid.</para>
  68. <para>It is possible to enumerate controls by calling
  69. <constant>VIDIOC_QUERYCTRL</constant> with successive
  70. <structfield>id</structfield> values starting from
  71. <constant>V4L2_CID_BASE</constant> up to and exclusive
  72. <constant>V4L2_CID_LASTP1</constant>. Drivers may return
  73. <errorcode>EINVAL</errorcode> if a control in this range is not
  74. supported. Further applications can enumerate private controls, which
  75. are not defined in this specification, by starting at
  76. <constant>V4L2_CID_PRIVATE_BASE</constant> and incrementing
  77. <structfield>id</structfield> until the driver returns
  78. <errorcode>EINVAL</errorcode>.</para>
  79. <para>In both cases, when the driver sets the
  80. <constant>V4L2_CTRL_FLAG_DISABLED</constant> flag in the
  81. <structfield>flags</structfield> field this control is permanently
  82. disabled and should be ignored by the application.<footnote>
  83. <para><constant>V4L2_CTRL_FLAG_DISABLED</constant> was
  84. intended for two purposes: Drivers can skip predefined controls not
  85. supported by the hardware (although returning EINVAL would do as
  86. well), or disable predefined and private controls after hardware
  87. detection without the trouble of reordering control arrays and indices
  88. (EINVAL cannot be used to skip private controls because it would
  89. prematurely end the enumeration).</para></footnote></para>
  90. <para>When the application ORs <structfield>id</structfield> with
  91. <constant>V4L2_CTRL_FLAG_NEXT_CTRL</constant> the driver returns the
  92. next supported non-compound control, or <errorcode>EINVAL</errorcode>
  93. if there is none. In addition, the <constant>V4L2_CTRL_FLAG_NEXT_COMPOUND</constant>
  94. flag can be specified to enumerate all compound controls (i.e. controls
  95. with type &ge; <constant>V4L2_CTRL_COMPOUND_TYPES</constant>). Specify both
  96. <constant>V4L2_CTRL_FLAG_NEXT_CTRL</constant> and
  97. <constant>V4L2_CTRL_FLAG_NEXT_COMPOUND</constant> in order to enumerate
  98. all controls, compound or not. Drivers which do not support these flags yet
  99. always return <errorcode>EINVAL</errorcode>.</para>
  100. <para>The <constant>VIDIOC_QUERY_EXT_CTRL</constant> ioctl was
  101. introduced in order to better support controls that can use compound
  102. types, and to expose additional control information that cannot be
  103. returned in &v4l2-queryctrl; since that structure is full.</para>
  104. <para><constant>VIDIOC_QUERY_EXT_CTRL</constant> is used in the
  105. same way as <constant>VIDIOC_QUERYCTRL</constant>, except that the
  106. <structfield>reserved</structfield> array must be zeroed as well.</para>
  107. <para>Additional information is required for menu controls: the
  108. names of the menu items. To query them applications set the
  109. <structfield>id</structfield> and <structfield>index</structfield>
  110. fields of &v4l2-querymenu; and call the
  111. <constant>VIDIOC_QUERYMENU</constant> ioctl with a pointer to this
  112. structure. The driver fills the rest of the structure or returns an
  113. &EINVAL; when the <structfield>id</structfield> or
  114. <structfield>index</structfield> is invalid. Menu items are enumerated
  115. by calling <constant>VIDIOC_QUERYMENU</constant> with successive
  116. <structfield>index</structfield> values from &v4l2-queryctrl;
  117. <structfield>minimum</structfield> to
  118. <structfield>maximum</structfield>, inclusive. Note that it is possible
  119. for <constant>VIDIOC_QUERYMENU</constant> to return an &EINVAL; for some
  120. indices between <structfield>minimum</structfield> and <structfield>maximum</structfield>.
  121. In that case that particular menu item is not supported by this driver. Also note that
  122. the <structfield>minimum</structfield> value is not necessarily 0.</para>
  123. <para>See also the examples in <xref linkend="control" />.</para>
  124. <table pgwide="1" frame="none" id="v4l2-queryctrl">
  125. <title>struct <structname>v4l2_queryctrl</structname></title>
  126. <tgroup cols="3">
  127. &cs-str;
  128. <tbody valign="top">
  129. <row>
  130. <entry>__u32</entry>
  131. <entry><structfield>id</structfield></entry>
  132. <entry>Identifies the control, set by the application. See
  133. <xref linkend="control-id" /> for predefined IDs. When the ID is ORed
  134. with V4L2_CTRL_FLAG_NEXT_CTRL the driver clears the flag and returns
  135. the first control with a higher ID. Drivers which do not support this
  136. flag yet always return an &EINVAL;.</entry>
  137. </row>
  138. <row>
  139. <entry>__u32</entry>
  140. <entry><structfield>type</structfield></entry>
  141. <entry>Type of control, see <xref
  142. linkend="v4l2-ctrl-type" />.</entry>
  143. </row>
  144. <row>
  145. <entry>__u8</entry>
  146. <entry><structfield>name</structfield>[32]</entry>
  147. <entry>Name of the control, a NUL-terminated ASCII
  148. string. This information is intended for the user.</entry>
  149. </row>
  150. <row>
  151. <entry>__s32</entry>
  152. <entry><structfield>minimum</structfield></entry>
  153. <entry>Minimum value, inclusive. This field gives a lower
  154. bound for the control. See &v4l2-ctrl-type; how the minimum value is to
  155. be used for each possible control type. Note that this a signed 32-bit value.</entry>
  156. </row>
  157. <row>
  158. <entry>__s32</entry>
  159. <entry><structfield>maximum</structfield></entry>
  160. <entry>Maximum value, inclusive. This field gives an upper
  161. bound for the control. See &v4l2-ctrl-type; how the maximum value is to
  162. be used for each possible control type. Note that this a signed 32-bit value.</entry>
  163. </row>
  164. <row>
  165. <entry>__s32</entry>
  166. <entry><structfield>step</structfield></entry>
  167. <entry><para>This field gives a step size for the control.
  168. See &v4l2-ctrl-type; how the step value is to be used for each possible
  169. control type. Note that this an unsigned 32-bit value.
  170. </para><para>Generally drivers should not scale hardware
  171. control values. It may be necessary for example when the
  172. <structfield>name</structfield> or <structfield>id</structfield> imply
  173. a particular unit and the hardware actually accepts only multiples of
  174. said unit. If so, drivers must take care values are properly rounded
  175. when scaling, such that errors will not accumulate on repeated
  176. read-write cycles.</para><para>This field gives the smallest change of
  177. an integer control actually affecting hardware. Often the information
  178. is needed when the user can change controls by keyboard or GUI
  179. buttons, rather than a slider. When for example a hardware register
  180. accepts values 0-511 and the driver reports 0-65535, step should be
  181. 128.</para><para>Note that although signed, the step value is supposed to
  182. be always positive.</para></entry>
  183. </row>
  184. <row>
  185. <entry>__s32</entry>
  186. <entry><structfield>default_value</structfield></entry>
  187. <entry>The default value of a
  188. <constant>V4L2_CTRL_TYPE_INTEGER</constant>,
  189. <constant>_BOOLEAN</constant>, <constant>_BITMASK</constant>,
  190. <constant>_MENU</constant> or <constant>_INTEGER_MENU</constant> control.
  191. Not valid for other types of controls.
  192. Note that drivers reset controls to their default value only when the
  193. driver is first loaded, never afterwards.</entry>
  194. </row>
  195. <row>
  196. <entry>__u32</entry>
  197. <entry><structfield>flags</structfield></entry>
  198. <entry>Control flags, see <xref
  199. linkend="control-flags" />.</entry>
  200. </row>
  201. <row>
  202. <entry>__u32</entry>
  203. <entry><structfield>reserved</structfield>[2]</entry>
  204. <entry>Reserved for future extensions. Drivers must set
  205. the array to zero.</entry>
  206. </row>
  207. </tbody>
  208. </tgroup>
  209. </table>
  210. <table pgwide="1" frame="none" id="v4l2-query-ext-ctrl">
  211. <title>struct <structname>v4l2_query_ext_ctrl</structname></title>
  212. <tgroup cols="3">
  213. &cs-str;
  214. <tbody valign="top">
  215. <row>
  216. <entry>__u32</entry>
  217. <entry><structfield>id</structfield></entry>
  218. <entry>Identifies the control, set by the application. See
  219. <xref linkend="control-id" /> for predefined IDs. When the ID is ORed
  220. with <constant>V4L2_CTRL_FLAG_NEXT_CTRL</constant> the driver clears the
  221. flag and returns the first non-compound control with a higher ID. When the
  222. ID is ORed with <constant>V4L2_CTRL_FLAG_NEXT_COMPOUND</constant> the driver
  223. clears the flag and returns the first compound control with a higher ID.
  224. Set both to get the first control (compound or not) with a higher ID.</entry>
  225. </row>
  226. <row>
  227. <entry>__u32</entry>
  228. <entry><structfield>type</structfield></entry>
  229. <entry>Type of control, see <xref
  230. linkend="v4l2-ctrl-type" />.</entry>
  231. </row>
  232. <row>
  233. <entry>char</entry>
  234. <entry><structfield>name</structfield>[32]</entry>
  235. <entry>Name of the control, a NUL-terminated ASCII
  236. string. This information is intended for the user.</entry>
  237. </row>
  238. <row>
  239. <entry>__s64</entry>
  240. <entry><structfield>minimum</structfield></entry>
  241. <entry>Minimum value, inclusive. This field gives a lower
  242. bound for the control. See &v4l2-ctrl-type; how the minimum value is to
  243. be used for each possible control type. Note that this a signed 64-bit value.</entry>
  244. </row>
  245. <row>
  246. <entry>__s64</entry>
  247. <entry><structfield>maximum</structfield></entry>
  248. <entry>Maximum value, inclusive. This field gives an upper
  249. bound for the control. See &v4l2-ctrl-type; how the maximum value is to
  250. be used for each possible control type. Note that this a signed 64-bit value.</entry>
  251. </row>
  252. <row>
  253. <entry>__u64</entry>
  254. <entry><structfield>step</structfield></entry>
  255. <entry><para>This field gives a step size for the control.
  256. See &v4l2-ctrl-type; how the step value is to be used for each possible
  257. control type. Note that this an unsigned 64-bit value.
  258. </para><para>Generally drivers should not scale hardware
  259. control values. It may be necessary for example when the
  260. <structfield>name</structfield> or <structfield>id</structfield> imply
  261. a particular unit and the hardware actually accepts only multiples of
  262. said unit. If so, drivers must take care values are properly rounded
  263. when scaling, such that errors will not accumulate on repeated
  264. read-write cycles.</para><para>This field gives the smallest change of
  265. an integer control actually affecting hardware. Often the information
  266. is needed when the user can change controls by keyboard or GUI
  267. buttons, rather than a slider. When for example a hardware register
  268. accepts values 0-511 and the driver reports 0-65535, step should be
  269. 128.</para></entry>
  270. </row>
  271. <row>
  272. <entry>__s64</entry>
  273. <entry><structfield>default_value</structfield></entry>
  274. <entry>The default value of a
  275. <constant>V4L2_CTRL_TYPE_INTEGER</constant>, <constant>_INTEGER64</constant>,
  276. <constant>_BOOLEAN</constant>, <constant>_BITMASK</constant>,
  277. <constant>_MENU</constant>, <constant>_INTEGER_MENU</constant>,
  278. <constant>_U8</constant> or <constant>_U16</constant> control.
  279. Not valid for other types of controls.
  280. Note that drivers reset controls to their default value only when the
  281. driver is first loaded, never afterwards.
  282. </entry>
  283. </row>
  284. <row>
  285. <entry>__u32</entry>
  286. <entry><structfield>flags</structfield></entry>
  287. <entry>Control flags, see <xref
  288. linkend="control-flags" />.</entry>
  289. </row>
  290. <row>
  291. <entry>__u32</entry>
  292. <entry><structfield>elem_size</structfield></entry>
  293. <entry>The size in bytes of a single element of the array.
  294. Given a char pointer <constant>p</constant> to a 3-dimensional array you can find the
  295. position of cell <constant>(z, y, x)</constant> as follows:
  296. <constant>p + ((z * dims[1] + y) * dims[0] + x) * elem_size</constant>. <structfield>elem_size</structfield>
  297. is always valid, also when the control isn't an array. For string controls
  298. <structfield>elem_size</structfield> is equal to <structfield>maximum + 1</structfield>.
  299. </entry>
  300. </row>
  301. <row>
  302. <entry>__u32</entry>
  303. <entry><structfield>elems</structfield></entry>
  304. <entry>The number of elements in the N-dimensional array. If this control
  305. is not an array, then <structfield>elems</structfield> is 1. The <structfield>elems</structfield>
  306. field can never be 0.</entry>
  307. </row>
  308. <row>
  309. <entry>__u32</entry>
  310. <entry><structfield>nr_of_dims</structfield></entry>
  311. <entry>The number of dimension in the N-dimensional array. If this control
  312. is not an array, then this field is 0.</entry>
  313. </row>
  314. <row>
  315. <entry>__u32</entry>
  316. <entry><structfield>dims[V4L2_CTRL_MAX_DIMS]</structfield></entry>
  317. <entry>The size of each dimension. The first <structfield>nr_of_dims</structfield>
  318. elements of this array must be non-zero, all remaining elements must be zero.</entry>
  319. </row>
  320. <row>
  321. <entry>__u32</entry>
  322. <entry><structfield>reserved</structfield>[32]</entry>
  323. <entry>Reserved for future extensions. Applications and drivers
  324. must set the array to zero.</entry>
  325. </row>
  326. </tbody>
  327. </tgroup>
  328. </table>
  329. <table pgwide="1" frame="none" id="v4l2-querymenu">
  330. <title>struct <structname>v4l2_querymenu</structname></title>
  331. <tgroup cols="4">
  332. &cs-str;
  333. <tbody valign="top">
  334. <row>
  335. <entry>__u32</entry>
  336. <entry></entry>
  337. <entry><structfield>id</structfield></entry>
  338. <entry>Identifies the control, set by the application
  339. from the respective &v4l2-queryctrl;
  340. <structfield>id</structfield>.</entry>
  341. </row>
  342. <row>
  343. <entry>__u32</entry>
  344. <entry></entry>
  345. <entry><structfield>index</structfield></entry>
  346. <entry>Index of the menu item, starting at zero, set by
  347. the application.</entry>
  348. </row>
  349. <row>
  350. <entry>union</entry>
  351. <entry></entry>
  352. <entry></entry>
  353. <entry></entry>
  354. </row>
  355. <row>
  356. <entry></entry>
  357. <entry>__u8</entry>
  358. <entry><structfield>name</structfield>[32]</entry>
  359. <entry>Name of the menu item, a NUL-terminated ASCII
  360. string. This information is intended for the user. This field is valid
  361. for <constant>V4L2_CTRL_FLAG_MENU</constant> type controls.</entry>
  362. </row>
  363. <row>
  364. <entry></entry>
  365. <entry>__s64</entry>
  366. <entry><structfield>value</structfield></entry>
  367. <entry>
  368. Value of the integer menu item. This field is valid for
  369. <constant>V4L2_CTRL_FLAG_INTEGER_MENU</constant> type
  370. controls.
  371. </entry>
  372. </row>
  373. <row>
  374. <entry>__u32</entry>
  375. <entry></entry>
  376. <entry><structfield>reserved</structfield></entry>
  377. <entry>Reserved for future extensions. Drivers must set
  378. the array to zero.</entry>
  379. </row>
  380. </tbody>
  381. </tgroup>
  382. </table>
  383. <table pgwide="1" frame="none" id="v4l2-ctrl-type">
  384. <title>enum v4l2_ctrl_type</title>
  385. <tgroup cols="5" align="left">
  386. <colspec colwidth="30*" />
  387. <colspec colwidth="5*" align="center" />
  388. <colspec colwidth="5*" align="center" />
  389. <colspec colwidth="5*" align="center" />
  390. <colspec colwidth="55*" />
  391. <thead>
  392. <row>
  393. <entry>Type</entry>
  394. <entry><structfield>minimum</structfield></entry>
  395. <entry><structfield>step</structfield></entry>
  396. <entry><structfield>maximum</structfield></entry>
  397. <entry>Description</entry>
  398. </row>
  399. </thead>
  400. <tbody valign="top">
  401. <row>
  402. <entry><constant>V4L2_CTRL_TYPE_INTEGER</constant></entry>
  403. <entry>any</entry>
  404. <entry>any</entry>
  405. <entry>any</entry>
  406. <entry>An integer-valued control ranging from minimum to
  407. maximum inclusive. The step value indicates the increment between
  408. values which are actually different on the hardware.</entry>
  409. </row>
  410. <row>
  411. <entry><constant>V4L2_CTRL_TYPE_BOOLEAN</constant></entry>
  412. <entry>0</entry>
  413. <entry>1</entry>
  414. <entry>1</entry>
  415. <entry>A boolean-valued control. Zero corresponds to
  416. "disabled", and one means "enabled".</entry>
  417. </row>
  418. <row>
  419. <entry><constant>V4L2_CTRL_TYPE_MENU</constant></entry>
  420. <entry>&ge; 0</entry>
  421. <entry>1</entry>
  422. <entry>N-1</entry>
  423. <entry>The control has a menu of N choices. The names of
  424. the menu items can be enumerated with the
  425. <constant>VIDIOC_QUERYMENU</constant> ioctl.</entry>
  426. </row>
  427. <row>
  428. <entry><constant>V4L2_CTRL_TYPE_INTEGER_MENU</constant></entry>
  429. <entry>&ge; 0</entry>
  430. <entry>1</entry>
  431. <entry>N-1</entry>
  432. <entry>
  433. The control has a menu of N choices. The values of the
  434. menu items can be enumerated with the
  435. <constant>VIDIOC_QUERYMENU</constant> ioctl. This is
  436. similar to <constant>V4L2_CTRL_TYPE_MENU</constant>
  437. except that instead of strings, the menu items are
  438. signed 64-bit integers.
  439. </entry>
  440. </row>
  441. <row>
  442. <entry><constant>V4L2_CTRL_TYPE_BITMASK</constant></entry>
  443. <entry>0</entry>
  444. <entry>n/a</entry>
  445. <entry>any</entry>
  446. <entry>A bitmask field. The maximum value is the set of bits that can
  447. be used, all other bits are to be 0. The maximum value is interpreted as a __u32,
  448. allowing the use of bit 31 in the bitmask.</entry>
  449. </row>
  450. <row>
  451. <entry><constant>V4L2_CTRL_TYPE_BUTTON</constant></entry>
  452. <entry>0</entry>
  453. <entry>0</entry>
  454. <entry>0</entry>
  455. <entry>A control which performs an action when set.
  456. Drivers must ignore the value passed with
  457. <constant>VIDIOC_S_CTRL</constant> and return an &EINVAL; on a
  458. <constant>VIDIOC_G_CTRL</constant> attempt.</entry>
  459. </row>
  460. <row>
  461. <entry><constant>V4L2_CTRL_TYPE_INTEGER64</constant></entry>
  462. <entry>any</entry>
  463. <entry>any</entry>
  464. <entry>any</entry>
  465. <entry>A 64-bit integer valued control. Minimum, maximum
  466. and step size cannot be queried using <constant>VIDIOC_QUERYCTRL</constant>.
  467. Only <constant>VIDIOC_QUERY_EXT_CTRL</constant> can retrieve the 64-bit
  468. min/max/step values, they should be interpreted as n/a when using
  469. <constant>VIDIOC_QUERYCTRL</constant>.</entry>
  470. </row>
  471. <row>
  472. <entry><constant>V4L2_CTRL_TYPE_STRING</constant></entry>
  473. <entry>&ge; 0</entry>
  474. <entry>&ge; 1</entry>
  475. <entry>&ge; 0</entry>
  476. <entry>The minimum and maximum string lengths. The step size
  477. means that the string must be (minimum + N * step) characters long for
  478. N &ge; 0. These lengths do not include the terminating zero, so in order to
  479. pass a string of length 8 to &VIDIOC-S-EXT-CTRLS; you need to set the
  480. <structfield>size</structfield> field of &v4l2-ext-control; to 9. For &VIDIOC-G-EXT-CTRLS; you can
  481. set the <structfield>size</structfield> field to <structfield>maximum</structfield> + 1.
  482. Which character encoding is used will depend on the string control itself and
  483. should be part of the control documentation.</entry>
  484. </row>
  485. <row>
  486. <entry><constant>V4L2_CTRL_TYPE_CTRL_CLASS</constant></entry>
  487. <entry>n/a</entry>
  488. <entry>n/a</entry>
  489. <entry>n/a</entry>
  490. <entry>This is not a control. When
  491. <constant>VIDIOC_QUERYCTRL</constant> is called with a control ID
  492. equal to a control class code (see <xref linkend="ctrl-class" />) + 1, the
  493. ioctl returns the name of the control class and this control type.
  494. Older drivers which do not support this feature return an
  495. &EINVAL;.</entry>
  496. </row>
  497. <row>
  498. <entry><constant>V4L2_CTRL_TYPE_U8</constant></entry>
  499. <entry>any</entry>
  500. <entry>any</entry>
  501. <entry>any</entry>
  502. <entry>An unsigned 8-bit valued control ranging from minimum to
  503. maximum inclusive. The step value indicates the increment between
  504. values which are actually different on the hardware.
  505. </entry>
  506. </row>
  507. <row>
  508. <entry><constant>V4L2_CTRL_TYPE_U16</constant></entry>
  509. <entry>any</entry>
  510. <entry>any</entry>
  511. <entry>any</entry>
  512. <entry>An unsigned 16-bit valued control ranging from minimum to
  513. maximum inclusive. The step value indicates the increment between
  514. values which are actually different on the hardware.
  515. </entry>
  516. </row>
  517. </tbody>
  518. </tgroup>
  519. </table>
  520. <table pgwide="1" frame="none" id="control-flags">
  521. <title>Control Flags</title>
  522. <tgroup cols="3">
  523. &cs-def;
  524. <tbody valign="top">
  525. <row>
  526. <entry><constant>V4L2_CTRL_FLAG_DISABLED</constant></entry>
  527. <entry>0x0001</entry>
  528. <entry>This control is permanently disabled and should be
  529. ignored by the application. Any attempt to change the control will
  530. result in an &EINVAL;.</entry>
  531. </row>
  532. <row>
  533. <entry><constant>V4L2_CTRL_FLAG_GRABBED</constant></entry>
  534. <entry>0x0002</entry>
  535. <entry>This control is temporarily unchangeable, for
  536. example because another application took over control of the
  537. respective resource. Such controls may be displayed specially in a
  538. user interface. Attempts to change the control may result in an
  539. &EBUSY;.</entry>
  540. </row>
  541. <row>
  542. <entry><constant>V4L2_CTRL_FLAG_READ_ONLY</constant></entry>
  543. <entry>0x0004</entry>
  544. <entry>This control is permanently readable only. Any
  545. attempt to change the control will result in an &EINVAL;.</entry>
  546. </row>
  547. <row>
  548. <entry><constant>V4L2_CTRL_FLAG_UPDATE</constant></entry>
  549. <entry>0x0008</entry>
  550. <entry>A hint that changing this control may affect the
  551. value of other controls within the same control class. Applications
  552. should update their user interface accordingly.</entry>
  553. </row>
  554. <row>
  555. <entry><constant>V4L2_CTRL_FLAG_INACTIVE</constant></entry>
  556. <entry>0x0010</entry>
  557. <entry>This control is not applicable to the current
  558. configuration and should be displayed accordingly in a user interface.
  559. For example the flag may be set on a MPEG audio level 2 bitrate
  560. control when MPEG audio encoding level 1 was selected with another
  561. control.</entry>
  562. </row>
  563. <row>
  564. <entry><constant>V4L2_CTRL_FLAG_SLIDER</constant></entry>
  565. <entry>0x0020</entry>
  566. <entry>A hint that this control is best represented as a
  567. slider-like element in a user interface.</entry>
  568. </row>
  569. <row>
  570. <entry><constant>V4L2_CTRL_FLAG_WRITE_ONLY</constant></entry>
  571. <entry>0x0040</entry>
  572. <entry>This control is permanently writable only. Any
  573. attempt to read the control will result in an &EACCES; error code. This
  574. flag is typically present for relative controls or action controls where
  575. writing a value will cause the device to carry out a given action
  576. (&eg; motor control) but no meaningful value can be returned.</entry>
  577. </row>
  578. <row>
  579. <entry><constant>V4L2_CTRL_FLAG_VOLATILE</constant></entry>
  580. <entry>0x0080</entry>
  581. <entry>This control is volatile, which means that the value of the control
  582. changes continuously. A typical example would be the current gain value if the device
  583. is in auto-gain mode. In such a case the hardware calculates the gain value based on
  584. the lighting conditions which can change over time. Note that setting a new value for
  585. a volatile control will have no effect. The new value will just be ignored.</entry>
  586. </row>
  587. <row>
  588. <entry><constant>V4L2_CTRL_FLAG_HAS_PAYLOAD</constant></entry>
  589. <entry>0x0100</entry>
  590. <entry>This control has a pointer type, so its value has to be accessed
  591. using one of the pointer fields of &v4l2-ext-control;. This flag is set for controls
  592. that are an array, string, or have a compound type. In all cases you have to set a
  593. pointer to memory containing the payload of the control.</entry>
  594. </row>
  595. </tbody>
  596. </tgroup>
  597. </table>
  598. </refsect1>
  599. <refsect1>
  600. &return-value;
  601. <variablelist>
  602. <varlistentry>
  603. <term><errorcode>EINVAL</errorcode></term>
  604. <listitem>
  605. <para>The &v4l2-queryctrl; <structfield>id</structfield>
  606. is invalid. The &v4l2-querymenu; <structfield>id</structfield> is
  607. invalid or <structfield>index</structfield> is out of range (less than
  608. <structfield>minimum</structfield> or greater than <structfield>maximum</structfield>)
  609. or this particular menu item is not supported by the driver.</para>
  610. </listitem>
  611. </varlistentry>
  612. <varlistentry>
  613. <term><errorcode>EACCES</errorcode></term>
  614. <listitem>
  615. <para>An attempt was made to read a write-only control.</para>
  616. </listitem>
  617. </varlistentry>
  618. </variablelist>
  619. </refsect1>
  620. </refentry>