vidioc-g-ctrl.xml 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130
  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.</para>
  61. <para>These ioctls work only with user controls. For other
  62. control classes the &VIDIOC-G-EXT-CTRLS;, &VIDIOC-S-EXT-CTRLS; or
  63. &VIDIOC-TRY-EXT-CTRLS; must be used.</para>
  64. <table pgwide="1" frame="none" id="v4l2-control">
  65. <title>struct <structname>v4l2_control</structname></title>
  66. <tgroup cols="3">
  67. &cs-str;
  68. <tbody valign="top">
  69. <row>
  70. <entry>__u32</entry>
  71. <entry><structfield>id</structfield></entry>
  72. <entry>Identifies the control, set by the
  73. application.</entry>
  74. </row>
  75. <row>
  76. <entry>__s32</entry>
  77. <entry><structfield>value</structfield></entry>
  78. <entry>New value or current value.</entry>
  79. </row>
  80. </tbody>
  81. </tgroup>
  82. </table>
  83. </refsect1>
  84. <refsect1>
  85. &return-value;
  86. <variablelist>
  87. <varlistentry>
  88. <term><errorcode>EINVAL</errorcode></term>
  89. <listitem>
  90. <para>The &v4l2-control; <structfield>id</structfield> is
  91. invalid.</para>
  92. </listitem>
  93. </varlistentry>
  94. <varlistentry>
  95. <term><errorcode>ERANGE</errorcode></term>
  96. <listitem>
  97. <para>The &v4l2-control; <structfield>value</structfield>
  98. is out of bounds.</para>
  99. </listitem>
  100. </varlistentry>
  101. <varlistentry>
  102. <term><errorcode>EBUSY</errorcode></term>
  103. <listitem>
  104. <para>The control is temporarily not changeable, possibly
  105. because another applications took over control of the device function
  106. this control belongs to.</para>
  107. </listitem>
  108. </varlistentry>
  109. </variablelist>
  110. </refsect1>
  111. </refentry>
  112. <!--
  113. Local Variables:
  114. mode: sgml
  115. sgml-parent-document: "v4l2.sgml"
  116. indent-tabs-mode: nil
  117. End:
  118. -->