vidioc-querybuf.xml 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104
  1. <refentry id="vidioc-querybuf">
  2. <refmeta>
  3. <refentrytitle>ioctl VIDIOC_QUERYBUF</refentrytitle>
  4. &manvol;
  5. </refmeta>
  6. <refnamediv>
  7. <refname>VIDIOC_QUERYBUF</refname>
  8. <refpurpose>Query the status of a buffer</refpurpose>
  9. </refnamediv>
  10. <refsynopsisdiv>
  11. <funcsynopsis>
  12. <funcprototype>
  13. <funcdef>int <function>ioctl</function></funcdef>
  14. <paramdef>int <parameter>fd</parameter></paramdef>
  15. <paramdef>int <parameter>request</parameter></paramdef>
  16. <paramdef>struct v4l2_buffer *<parameter>argp</parameter></paramdef>
  17. </funcprototype>
  18. </funcsynopsis>
  19. </refsynopsisdiv>
  20. <refsect1>
  21. <title>Arguments</title>
  22. <variablelist>
  23. <varlistentry>
  24. <term><parameter>fd</parameter></term>
  25. <listitem>
  26. <para>&fd;</para>
  27. </listitem>
  28. </varlistentry>
  29. <varlistentry>
  30. <term><parameter>request</parameter></term>
  31. <listitem>
  32. <para>VIDIOC_QUERYBUF</para>
  33. </listitem>
  34. </varlistentry>
  35. <varlistentry>
  36. <term><parameter>argp</parameter></term>
  37. <listitem>
  38. <para></para>
  39. </listitem>
  40. </varlistentry>
  41. </variablelist>
  42. </refsect1>
  43. <refsect1>
  44. <title>Description</title>
  45. <para>This ioctl is part of the <link linkend="mmap">memory
  46. mapping</link> I/O method. It can be used to query the status of a
  47. buffer at any time after buffers have been allocated with the
  48. &VIDIOC-REQBUFS; ioctl.</para>
  49. <para>Applications set the <structfield>type</structfield> field
  50. of a &v4l2-buffer; to the same buffer type as was previously used with
  51. &v4l2-format; <structfield>type</structfield> and &v4l2-requestbuffers;
  52. <structfield>type</structfield>, and the <structfield>index</structfield>
  53. field. Valid index numbers range from zero
  54. to the number of buffers allocated with &VIDIOC-REQBUFS;
  55. (&v4l2-requestbuffers; <structfield>count</structfield>) minus one.
  56. The <structfield>reserved</structfield> field should to set to 0.
  57. After calling <constant>VIDIOC_QUERYBUF</constant> with a pointer to
  58. this structure drivers return an error code or fill the rest of
  59. the structure.</para>
  60. <para>In the <structfield>flags</structfield> field the
  61. <constant>V4L2_BUF_FLAG_MAPPED</constant>,
  62. <constant>V4L2_BUF_FLAG_QUEUED</constant> and
  63. <constant>V4L2_BUF_FLAG_DONE</constant> flags will be valid. The
  64. <structfield>memory</structfield> field will be set to the current
  65. I/O method, the <structfield>m.offset</structfield>
  66. contains the offset of the buffer from the start of the device memory,
  67. the <structfield>length</structfield> field its size. The driver may
  68. or may not set the remaining fields and flags, they are meaningless in
  69. this context.</para>
  70. <para>The <structname>v4l2_buffer</structname> structure is
  71. specified in <xref linkend="buffer" />.</para>
  72. </refsect1>
  73. <refsect1>
  74. &return-value;
  75. <variablelist>
  76. <varlistentry>
  77. <term><errorcode>EINVAL</errorcode></term>
  78. <listitem>
  79. <para>The buffer <structfield>type</structfield> is not
  80. supported, or the <structfield>index</structfield> is out of bounds.</para>
  81. </listitem>
  82. </varlistentry>
  83. </variablelist>
  84. </refsect1>
  85. </refentry>
  86. <!--
  87. Local Variables:
  88. mode: sgml
  89. sgml-parent-document: "v4l2.sgml"
  90. indent-tabs-mode: nil
  91. End:
  92. -->