1 <refentry id="vidioc-prepare-buf">
3 <refentrytitle>ioctl VIDIOC_PREPARE_BUF</refentrytitle>
8 <refname>VIDIOC_PREPARE_BUF</refname>
9 <refpurpose>Prepare a buffer for I/O</refpurpose>
15 <funcdef>int <function>ioctl</function></funcdef>
16 <paramdef>int <parameter>fd</parameter></paramdef>
17 <paramdef>int <parameter>request</parameter></paramdef>
18 <paramdef>struct v4l2_buffer *<parameter>argp</parameter></paramdef>
24 <title>Arguments</title>
28 <term><parameter>fd</parameter></term>
34 <term><parameter>request</parameter></term>
36 <para>VIDIOC_PREPARE_BUF</para>
40 <term><parameter>argp</parameter></term>
49 <title>Description</title>
52 <title>Experimental</title>
53 <para>This is an <link linkend="experimental"> experimental </link>
54 interface and may change in the future.</para>
57 <para>Applications can optionally call the
58 <constant>VIDIOC_PREPARE_BUF</constant> ioctl to pass ownership of the buffer
59 to the driver before actually enqueuing it, using the
60 <constant>VIDIOC_QBUF</constant> ioctl, and to prepare it for future I/O.
61 Such preparations may include cache invalidation or cleaning. Performing them
62 in advance saves time during the actual I/O. In case such cache operations are
63 not required, the application can use one of
64 <constant>V4L2_BUF_FLAG_NO_CACHE_INVALIDATE</constant> and
65 <constant>V4L2_BUF_FLAG_NO_CACHE_CLEAN</constant> flags to skip the respective
68 <para>The <structname>v4l2_buffer</structname> structure is
69 specified in <xref linkend="buffer" />.</para>
77 <term><errorcode>EBUSY</errorcode></term>
79 <para>File I/O is in progress.</para>
83 <term><errorcode>EINVAL</errorcode></term>
85 <para>The buffer <structfield>type</structfield> is not
86 supported, or the <structfield>index</structfield> is out of bounds,
87 or no buffers have been allocated yet, or the
88 <structfield>userptr</structfield> or
89 <structfield>length</structfield> are invalid.</para>