1 <refentry id="vidioc-querybuf">
3 <refentrytitle>ioctl VIDIOC_QUERYBUF</refentrytitle>
8 <refname>VIDIOC_QUERYBUF</refname>
9 <refpurpose>Query the status of a buffer</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_QUERYBUF</para>
40 <term><parameter>argp</parameter></term>
49 <title>Description</title>
51 <para>This ioctl is part of the <link linkend="mmap">memory
52 mapping</link> I/O method. It can be used to query the status of a
53 buffer at any time after buffers have been allocated with the
54 &VIDIOC-REQBUFS; ioctl.</para>
56 <para>Applications set the <structfield>type</structfield> field
57 of a &v4l2-buffer; to the same buffer type as was previously used with
58 &v4l2-format; <structfield>type</structfield> and &v4l2-requestbuffers;
59 <structfield>type</structfield>, and the <structfield>index</structfield>
60 field. Valid index numbers range from zero
61 to the number of buffers allocated with &VIDIOC-REQBUFS;
62 (&v4l2-requestbuffers; <structfield>count</structfield>) minus one.
63 The <structfield>reserved</structfield> field should to set to 0.
64 After calling <constant>VIDIOC_QUERYBUF</constant> with a pointer to
65 this structure drivers return an error code or fill the rest of
68 <para>In the <structfield>flags</structfield> field the
69 <constant>V4L2_BUF_FLAG_MAPPED</constant>,
70 <constant>V4L2_BUF_FLAG_QUEUED</constant> and
71 <constant>V4L2_BUF_FLAG_DONE</constant> flags will be valid. The
72 <structfield>memory</structfield> field will be set to the current
73 I/O method, the <structfield>m.offset</structfield>
74 contains the offset of the buffer from the start of the device memory,
75 the <structfield>length</structfield> field its size. The driver may
76 or may not set the remaining fields and flags, they are meaningless in
79 <para>The <structname>v4l2_buffer</structname> structure is
80 specified in <xref linkend="buffer" />.</para>
88 <term><errorcode>EINVAL</errorcode></term>
90 <para>The buffer <structfield>type</structfield> is not
91 supported, or the <structfield>index</structfield> is out of bounds.</para>
101 sgml-parent-document: "v4l2.sgml"
102 indent-tabs-mode: nil