vidioc-g-ctrl.xml 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133
  1. <refentry id="vidioc-g-ctrl">
  2. <refmeta>
  3. <refentrytitle>ioctl VIDIOC_G_CTRL, VIDIOC_S_CTRL</refentrytitle>
  4. &manvol;
  5. </refmeta>
  6. <refnamediv>
  7. <refname>VIDIOC_G_CTRL</refname>
  8. <refname>VIDIOC_S_CTRL</refname>
  9. <refpurpose>Get or set the value of a control</refpurpose>
  10. </refnamediv>
  11. <refsynopsisdiv>
  12. <funcsynopsis>
  13. <funcprototype>
  14. <funcdef>int <function>ioctl</function></funcdef>
  15. <paramdef>int <parameter>fd</parameter></paramdef>
  16. <paramdef>int <parameter>request</parameter></paramdef>
  17. <paramdef>struct v4l2_control
  18. *<parameter>argp</parameter></paramdef>
  19. </funcprototype>
  20. </funcsynopsis>
  21. </refsynopsisdiv>
  22. <refsect1>
  23. <title>Arguments</title>
  24. <variablelist>
  25. <varlistentry>
  26. <term><parameter>fd</parameter></term>
  27. <listitem>
  28. <para>&fd;</para>
  29. </listitem>
  30. </varlistentry>
  31. <varlistentry>
  32. <term><parameter>request</parameter></term>
  33. <listitem>
  34. <para>VIDIOC_G_CTRL, VIDIOC_S_CTRL</para>
  35. </listitem>
  36. </varlistentry>
  37. <varlistentry>
  38. <term><parameter>argp</parameter></term>
  39. <listitem>
  40. <para></para>
  41. </listitem>
  42. </varlistentry>
  43. </variablelist>
  44. </refsect1>
  45. <refsect1>
  46. <title>Description</title>
  47. <para>To get the current value of a control applications
  48. initialize the <structfield>id</structfield> field of a struct
  49. <structname>v4l2_control</structname> and call the
  50. <constant>VIDIOC_G_CTRL</constant> ioctl with a pointer to this
  51. structure. To change the value of a control applications initialize
  52. the <structfield>id</structfield> and <structfield>value</structfield>
  53. fields of a struct <structname>v4l2_control</structname> and call the
  54. <constant>VIDIOC_S_CTRL</constant> ioctl.</para>
  55. <para>When the <structfield>id</structfield> is invalid drivers
  56. return an &EINVAL;. When the <structfield>value</structfield> is out
  57. of bounds drivers can choose to take the closest valid value or return
  58. an &ERANGE;, whatever seems more appropriate. However,
  59. <constant>VIDIOC_S_CTRL</constant> is a write-only ioctl, it does not
  60. return the actual new value. If the <structfield>value</structfield>
  61. is inappropriate for the control (e.g. if it refers to an unsupported
  62. menu index of a menu control), then &EINVAL; is returned as well.</para>
  63. <para>These ioctls work only with user controls. For other
  64. control classes the &VIDIOC-G-EXT-CTRLS;, &VIDIOC-S-EXT-CTRLS; or
  65. &VIDIOC-TRY-EXT-CTRLS; must be used.</para>
  66. <table pgwide="1" frame="none" id="v4l2-control">
  67. <title>struct <structname>v4l2_control</structname></title>
  68. <tgroup cols="3">
  69. &cs-str;
  70. <tbody valign="top">
  71. <row>
  72. <entry>__u32</entry>
  73. <entry><structfield>id</structfield></entry>
  74. <entry>Identifies the control, set by the
  75. application.</entry>
  76. </row>
  77. <row>
  78. <entry>__s32</entry>
  79. <entry><structfield>value</structfield></entry>
  80. <entry>New value or current value.</entry>
  81. </row>
  82. </tbody>
  83. </tgroup>
  84. </table>
  85. </refsect1>
  86. <refsect1>
  87. &return-value;
  88. <variablelist>
  89. <varlistentry>
  90. <term><errorcode>EINVAL</errorcode></term>
  91. <listitem>
  92. <para>The &v4l2-control; <structfield>id</structfield> is
  93. invalid or the <structfield>value</structfield> is inappropriate for
  94. the given control (i.e. if a menu item is selected that is not supported
  95. by the driver according to &VIDIOC-QUERYMENU;).</para>
  96. </listitem>
  97. </varlistentry>
  98. <varlistentry>
  99. <term><errorcode>ERANGE</errorcode></term>
  100. <listitem>
  101. <para>The &v4l2-control; <structfield>value</structfield>
  102. is out of bounds.</para>
  103. </listitem>
  104. </varlistentry>
  105. <varlistentry>
  106. <term><errorcode>EBUSY</errorcode></term>
  107. <listitem>
  108. <para>The control is temporarily not changeable, possibly
  109. because another applications took over control of the device function
  110. this control belongs to.</para>
  111. </listitem>
  112. </varlistentry>
  113. <varlistentry>
  114. <term><errorcode>EACCES</errorcode></term>
  115. <listitem>
  116. <para>Attempt to set a read-only control or to get a
  117. write-only control.</para>
  118. </listitem>
  119. </varlistentry>
  120. </variablelist>
  121. </refsect1>
  122. </refentry>