vidioc-querybuf.xml 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103
  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 previously
  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. After calling <constant>VIDIOC_QUERYBUF</constant> with a pointer to
  57. this structure drivers return an error code or fill the rest of
  58. the structure.</para>
  59. <para>In the <structfield>flags</structfield> field the
  60. <constant>V4L2_BUF_FLAG_MAPPED</constant>,
  61. <constant>V4L2_BUF_FLAG_QUEUED</constant> and
  62. <constant>V4L2_BUF_FLAG_DONE</constant> flags will be valid. The
  63. <structfield>memory</structfield> field will be set to
  64. <constant>V4L2_MEMORY_MMAP</constant>, the <structfield>m.offset</structfield>
  65. contains the offset of the buffer from the start of the device memory,
  66. the <structfield>length</structfield> field its size. The driver may
  67. or may not set the remaining fields and flags, they are meaningless in
  68. this context.</para>
  69. <para>The <structname>v4l2_buffer</structname> structure is
  70. specified in <xref linkend="buffer" />.</para>
  71. </refsect1>
  72. <refsect1>
  73. &return-value;
  74. <variablelist>
  75. <varlistentry>
  76. <term><errorcode>EINVAL</errorcode></term>
  77. <listitem>
  78. <para>The buffer <structfield>type</structfield> is not
  79. supported, or the <structfield>index</structfield> is out of bounds.</para>
  80. </listitem>
  81. </varlistentry>
  82. </variablelist>
  83. </refsect1>
  84. </refentry>
  85. <!--
  86. Local Variables:
  87. mode: sgml
  88. sgml-parent-document: "v4l2.sgml"
  89. indent-tabs-mode: nil
  90. End:
  91. -->