vidioc-prepare-buf.xml 2.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  1. <refentry id="vidioc-prepare-buf">
  2. <refmeta>
  3. <refentrytitle>ioctl VIDIOC_PREPARE_BUF</refentrytitle>
  4. &manvol;
  5. </refmeta>
  6. <refnamediv>
  7. <refname>VIDIOC_PREPARE_BUF</refname>
  8. <refpurpose>Prepare a buffer for I/O</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_PREPARE_BUF</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>Applications can optionally call the
  46. <constant>VIDIOC_PREPARE_BUF</constant> ioctl to pass ownership of the buffer
  47. to the driver before actually enqueuing it, using the
  48. <constant>VIDIOC_QBUF</constant> ioctl, and to prepare it for future I/O.
  49. Such preparations may include cache invalidation or cleaning. Performing them
  50. in advance saves time during the actual I/O. In case such cache operations are
  51. not required, the application can use one of
  52. <constant>V4L2_BUF_FLAG_NO_CACHE_INVALIDATE</constant> and
  53. <constant>V4L2_BUF_FLAG_NO_CACHE_CLEAN</constant> flags to skip the respective
  54. step.</para>
  55. <para>The <structname>v4l2_buffer</structname> structure is
  56. specified in <xref linkend="buffer" />.</para>
  57. </refsect1>
  58. <refsect1>
  59. &return-value;
  60. <variablelist>
  61. <varlistentry>
  62. <term><errorcode>EBUSY</errorcode></term>
  63. <listitem>
  64. <para>File I/O is in progress.</para>
  65. </listitem>
  66. </varlistentry>
  67. <varlistentry>
  68. <term><errorcode>EINVAL</errorcode></term>
  69. <listitem>
  70. <para>The buffer <structfield>type</structfield> is not
  71. supported, or the <structfield>index</structfield> is out of bounds,
  72. or no buffers have been allocated yet, or the
  73. <structfield>userptr</structfield> or
  74. <structfield>length</structfield> are invalid.</para>
  75. </listitem>
  76. </varlistentry>
  77. </variablelist>
  78. </refsect1>
  79. </refentry>