sphinx.addnodesdocument)}( rawsourcechildren]( translations LanguagesNode)}(hhh](h pending_xref)}(hhh]docutils.nodesTextChinese (Simplified)}parenthsba attributes}(ids]classes]names]dupnames]backrefs] refdomainstdreftypedoc reftarget7/translations/zh_CN/userspace-api/media/v4l/vidioc-qbufmodnameN classnameN refexplicitutagnamehhh ubh)}(hhh]hChinese (Traditional)}hh2sbah}(h]h ]h"]h$]h&] refdomainh)reftypeh+ reftarget7/translations/zh_TW/userspace-api/media/v4l/vidioc-qbufmodnameN classnameN refexplicituh1hhh ubh)}(hhh]hItalian}hhFsbah}(h]h ]h"]h$]h&] refdomainh)reftypeh+ reftarget7/translations/it_IT/userspace-api/media/v4l/vidioc-qbufmodnameN classnameN refexplicituh1hhh ubh)}(hhh]hJapanese}hhZsbah}(h]h ]h"]h$]h&] refdomainh)reftypeh+ reftarget7/translations/ja_JP/userspace-api/media/v4l/vidioc-qbufmodnameN classnameN refexplicituh1hhh ubh)}(hhh]hKorean}hhnsbah}(h]h ]h"]h$]h&] refdomainh)reftypeh+ reftarget7/translations/ko_KR/userspace-api/media/v4l/vidioc-qbufmodnameN classnameN refexplicituh1hhh ubh)}(hhh]hSpanish}hhsbah}(h]h ]h"]h$]h&] refdomainh)reftypeh+ reftarget7/translations/sp_SP/userspace-api/media/v4l/vidioc-qbufmodnameN classnameN refexplicituh1hhh ubeh}(h]h ]h"]h$]h&]current_languageEnglishuh1h hh _documenthsourceNlineNubhcomment)}(h8SPDX-License-Identifier: GFDL-1.1-no-invariants-or-laterh]h8SPDX-License-Identifier: GFDL-1.1-no-invariants-or-later}hhsbah}(h]h ]h"]h$]h&] xml:spacepreserveuh1hhhhhhQ/var/lib/git/docbuild/linux/Documentation/userspace-api/media/v4l/vidioc-qbuf.rsthKubhtarget)}(h.. _VIDIOC_QBUF:h]h}(h]h ]h"]h$]h&]refid vidioc-qbufuh1hhKhhhhhhubhsection)}(hhh](htitle)}(hioctl VIDIOC_QBUF, VIDIOC_DQBUFh]hioctl VIDIOC_QBUF, VIDIOC_DQBUF}(hhhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhhhhhKubh)}(hhh](h)}(hNameh]hName}(hhhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhhhhhK ubh paragraph)}(h>VIDIOC_QBUF - VIDIOC_DQBUF - Exchange a buffer with the driverh]h>VIDIOC_QBUF - VIDIOC_DQBUF - Exchange a buffer with the driver}(hhhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK hhhhubeh}(h]nameah ]h"]nameah$]h&]uh1hhhhhhhhK ubh)}(hhh](h)}(hSynopsish]hSynopsis}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjhhhhhKubhindex)}(hhh]h}(h]h ]h"]h$]h&]entries](singleV4L.VIDIOC_QBUF (C macro)c.V4L.VIDIOC_QBUFhNtauh1jhjhhhNhNubhdesc)}(hhh](hdesc_signature)}(h VIDIOC_QBUFh]hdesc_signature_line)}(h VIDIOC_QBUFh]h desc_name)}(h VIDIOC_QBUFh]h desc_sig_name)}(hj+h]h VIDIOC_QBUF}(hj;hhhNhNubah}(h]h ]nah"]h$]h&]uh1j9hj5ubah}(h]h ](sig-namedescnameeh"]h$]h&]hhuh1j3hj/hhhhhKubah}(h]h ]h"]h$]h&]hh add_permalinkuh1j-sphinx_line_type declaratorhj)hhhhhKubah}(h]j ah ](sig sig-objecteh"]h$]h&] is_multiline _toc_parts) _toc_namehuh1j'hhhKhj$hhubh desc_content)}(hhh]h}(h]h ]h"]h$]h&]uh1jehj$hhhhhKubeh}(h]h ](cmacroeh"]h$]h&]domainjsobjtypejtdesctypejtnoindex noindexentrynocontentsentryuh1j"hhhjhNhNubh)}(h<``int ioctl(int fd, VIDIOC_QBUF, struct v4l2_buffer *argp)``h]hliteral)}(hjh]h8int ioctl(int fd, VIDIOC_QBUF, struct v4l2_buffer *argp)}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhj~ubah}(h]h ]h"]h$]h&]uh1hhhhKhjhhubj)}(hhh]h}(h]h ]h"]h$]h&]entries](jV4L.VIDIOC_DQBUF (C macro)c.V4L.VIDIOC_DQBUFhNtauh1jhjhhhNhNubj#)}(hhh](j()}(h VIDIOC_DQBUFh]j.)}(h VIDIOC_DQBUFh]j4)}(h VIDIOC_DQBUFh]j:)}(hjh]h VIDIOC_DQBUF}(hjhhhNhNubah}(h]h ]jEah"]h$]h&]uh1j9hjubah}(h]h ](jLjMeh"]h$]h&]hhuh1j3hjhhhhhKubah}(h]h ]h"]h$]h&]hhjWuh1j-jXjYhjhhhhhKubah}(h]jah ](j]j^eh"]h$]h&]jbjc)jdhuh1j'hhhKhjhhubjf)}(hhh]h}(h]h ]h"]h$]h&]uh1jehjhhhhhKubeh}(h]h ](jsmacroeh"]h$]h&]jxjsjyjjzjj{j|j}uh1j"hhhjhNhNubh)}(h=``int ioctl(int fd, VIDIOC_DQBUF, struct v4l2_buffer *argp)``h]j)}(hjh]h9int ioctl(int fd, VIDIOC_DQBUF, struct v4l2_buffer *argp)}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubah}(h]h ]h"]h$]h&]uh1hhhhKhjhhubeh}(h]synopsisah ]h"]synopsisah$]h&]uh1hhhhhhhhKubh)}(hhh](h)}(h Argumentsh]h Arguments}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjhhhhhKubhdefinition_list)}(hhh](hdefinition_list_item)}(h5``fd`` File descriptor returned by :c:func:`open()`. h](hterm)}(h``fd``h]j)}(hj"h]hfd}(hj$hhhNhNubah}(h]h ]h"]h$]h&]uh1jhj ubah}(h]h ]h"]h$]h&]uh1jhhhKhjubh definition)}(hhh]h)}(h-File descriptor returned by :c:func:`open()`.h](hFile descriptor returned by }(hj<hhhNhNubh)}(h:c:func:`open()`h]j)}(hjFh]hopen()}(hjHhhhNhNubah}(h]h ](xrefjsc-funceh"]h$]h&]uh1jhjDubah}(h]h ]h"]h$]h&]refdoc#userspace-api/media/v4l/vidioc-qbuf refdomainjsreftypefunc refexplicitrefwarn c:parent_keysphinx.domains.c LookupKey)}data]je ASTIdentifier)} identifierV4LsbNasb reftargetopenuh1hhhhKhj<ubh.}(hj<hhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhKhj9ubah}(h]h ]h"]h$]h&]uh1j7hjubeh}(h]h ]h"]h$]h&]uh1jhhhKhjubj)}(h2``argp`` Pointer to struct :c:type:`v4l2_buffer`. h](j)}(h``argp``h]j)}(hjh]hargp}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubah}(h]h ]h"]h$]h&]uh1jhhhK!hjubj8)}(hhh]h)}(h(Pointer to struct :c:type:`v4l2_buffer`.h](hPointer to struct }(hjhhhNhNubh)}(h:c:type:`v4l2_buffer`h]j)}(hjh]h v4l2_buffer}(hjhhhNhNubah}(h]h ](jRjsc-typeeh"]h$]h&]uh1jhjubah}(h]h ]h"]h$]h&]refdocj^ refdomainjsreftypetype refexplicitrefwarnjdjhjs v4l2_bufferuh1hhhhK!hjubh.}(hjhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhK!hjubah}(h]h ]h"]h$]h&]uh1j7hjubeh}(h]h ]h"]h$]h&]uh1jhhhK!hjhhubeh}(h]h ]h"]h$]h&]uh1jhjhhhhhNubeh}(h] argumentsah ]h"] argumentsah$]h&]uh1hhhhhhhhKubh)}(hhh](h)}(h Descriptionh]h Description}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjhhhhhK$ubh)}(hApplications call the ``VIDIOC_QBUF`` ioctl to enqueue an empty (capturing) or filled (output) buffer in the driver's incoming queue. The semantics depend on the selected I/O method.h](hApplications call the }(hjhhhNhNubj)}(h``VIDIOC_QBUF``h]h VIDIOC_QBUF}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubh ioctl to enqueue an empty (capturing) or filled (output) buffer in the driver’s incoming queue. The semantics depend on the selected I/O method.}(hjhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhK&hjhhubh)}(hXTo enqueue a buffer applications set the ``type`` field of a struct :c:type:`v4l2_buffer` to the same buffer type as was previously used with struct :c:type:`v4l2_format` ``type`` and struct :c:type:`v4l2_requestbuffers` ``type``. Applications must also set the ``index`` field. Valid index numbers range from zero to the number of buffers allocated with :ref:`VIDIOC_REQBUFS` (struct :c:type:`v4l2_requestbuffers` ``count``) minus one. The contents of the struct :c:type:`v4l2_buffer` returned by a :ref:`VIDIOC_QUERYBUF` ioctl will do as well. When the buffer is intended for output (``type`` is ``V4L2_BUF_TYPE_VIDEO_OUTPUT``, ``V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE``, or ``V4L2_BUF_TYPE_VBI_OUTPUT``) applications must also initialize the ``bytesused``, ``field`` and ``timestamp`` fields, see :ref:`buffer` for details. Applications must also set ``flags`` to 0. The ``reserved2`` and ``reserved`` fields must be set to 0. When using the :ref:`multi-planar API `, the ``m.planes`` field must contain a userspace pointer to a filled-in array of struct :c:type:`v4l2_plane` and the ``length`` field must be set to the number of elements in that array.h](h)To enqueue a buffer applications set the }(hj%hhhNhNubj)}(h``type``h]htype}(hj-hhhNhNubah}(h]h ]h"]h$]h&]uh1jhj%ubh field of a struct }(hj%hhhNhNubh)}(h:c:type:`v4l2_buffer`h]j)}(hjAh]h v4l2_buffer}(hjChhhNhNubah}(h]h ](jRjsc-typeeh"]h$]h&]uh1jhj?ubah}(h]h ]h"]h$]h&]refdocj^ refdomainjsreftypetype refexplicitrefwarnjdjhjs v4l2_bufferuh1hhhhK*hj%ubh< to the same buffer type as was previously used with struct }(hj%hhhNhNubh)}(h:c:type:`v4l2_format`h]j)}(hjdh]h v4l2_format}(hjfhhhNhNubah}(h]h ](jRjsc-typeeh"]h$]h&]uh1jhjbubah}(h]h ]h"]h$]h&]refdocj^ refdomainjsreftypetype refexplicitrefwarnjdjhjs v4l2_formatuh1hhhhK*hj%ubh }(hj%hhhNhNubj)}(h``type``h]htype}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhj%ubh and struct }(hj%hhhNhNubh)}(h:c:type:`v4l2_requestbuffers`h]j)}(hjh]hv4l2_requestbuffers}(hjhhhNhNubah}(h]h ](jRjsc-typeeh"]h$]h&]uh1jhjubah}(h]h ]h"]h$]h&]refdocj^ refdomainjsreftypetype refexplicitrefwarnjdjhjsv4l2_requestbuffersuh1hhhhK*hj%ubh }hj%sbj)}(h``type``h]htype}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhj%ubh!. Applications must also set the }(hj%hhhNhNubj)}(h ``index``h]hindex}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhj%ubhT field. Valid index numbers range from zero to the number of buffers allocated with }(hj%hhhNhNubh)}(h:ref:`VIDIOC_REQBUFS`h]hinline)}(hjh]hVIDIOC_REQBUFS}(hjhhhNhNubah}(h]h ](jRstdstd-refeh"]h$]h&]uh1jhjubah}(h]h ]h"]h$]h&]refdocj^ refdomainjreftyperef refexplicitrefwarnjsvidioc_reqbufsuh1hhhhK*hj%ubh (struct }(hj%hhhNhNubh)}(h:c:type:`v4l2_requestbuffers`h]j)}(hjh]hv4l2_requestbuffers}(hjhhhNhNubah}(h]h ](jRjsc-typeeh"]h$]h&]uh1jhjubah}(h]h ]h"]h$]h&]refdocj^ refdomainjsreftypetype refexplicitrefwarnjdjhjsv4l2_requestbuffersuh1hhhhK*hj%ubh }hj%sbj)}(h ``count``h]hcount}(hj'hhhNhNubah}(h]h ]h"]h$]h&]uh1jhj%ubh() minus one. The contents of the struct }(hj%hhhNhNubh)}(h:c:type:`v4l2_buffer`h]j)}(hj;h]h v4l2_buffer}(hj=hhhNhNubah}(h]h ](jRjsc-typeeh"]h$]h&]uh1jhj9ubah}(h]h ]h"]h$]h&]refdocj^ refdomainjsreftypetype refexplicitrefwarnjdjhjs v4l2_bufferuh1hhhhK*hj%ubh returned by a }(hj%hhhNhNubh)}(h:ref:`VIDIOC_QUERYBUF`h]j)}(hj^h]hVIDIOC_QUERYBUF}(hj`hhhNhNubah}(h]h ](jRstdstd-refeh"]h$]h&]uh1jhj\ubah}(h]h ]h"]h$]h&]refdocj^ refdomainjjreftyperef refexplicitrefwarnjsvidioc_querybufuh1hhhhK*hj%ubh@ ioctl will do as well. When the buffer is intended for output (}(hj%hhhNhNubj)}(h``type``h]htype}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhj%ubh is }(hj%hhhNhNubj)}(h``V4L2_BUF_TYPE_VIDEO_OUTPUT``h]hV4L2_BUF_TYPE_VIDEO_OUTPUT}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhj%ubh, }(hj%hhhNhNubj)}(h%``V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE``h]h!V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhj%ubh, or }(hj%hhhNhNubj)}(h``V4L2_BUF_TYPE_VBI_OUTPUT``h]hV4L2_BUF_TYPE_VBI_OUTPUT}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhj%ubh() applications must also initialize the }(hj%hhhNhNubj)}(h ``bytesused``h]h bytesused}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhj%ubh, }hj%sbj)}(h ``field``h]hfield}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhj%ubh and }(hj%hhhNhNubj)}(h ``timestamp``h]h timestamp}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhj%ubh fields, see }(hj%hhhNhNubh)}(h :ref:`buffer`h]j)}(hjh]hbuffer}(hjhhhNhNubah}(h]h ](jRstdstd-refeh"]h$]h&]uh1jhjubah}(h]h ]h"]h$]h&]refdocj^ refdomainj reftyperef refexplicitrefwarnjsbufferuh1hhhhK*hj%ubh) for details. Applications must also set }(hj%hhhNhNubj)}(h ``flags``h]hflags}(hj"hhhNhNubah}(h]h ]h"]h$]h&]uh1jhj%ubh to 0. The }(hj%hhhNhNubj)}(h ``reserved2``h]h reserved2}(hj4hhhNhNubah}(h]h ]h"]h$]h&]uh1jhj%ubh and }hj%sbj)}(h ``reserved``h]hreserved}(hjFhhhNhNubah}(h]h ]h"]h$]h&]uh1jhj%ubh) fields must be set to 0. When using the }(hj%hhhNhNubh)}(h%:ref:`multi-planar API `h]j)}(hjZh]hmulti-planar API}(hj\hhhNhNubah}(h]h ](jRstdstd-refeh"]h$]h&]uh1jhjXubah}(h]h ]h"]h$]h&]refdocj^ refdomainjfreftyperef refexplicitrefwarnjs planar-apisuh1hhhhK*hj%ubh, the }(hj%hhhNhNubj)}(h ``m.planes``h]hm.planes}(hj|hhhNhNubah}(h]h ]h"]h$]h&]uh1jhj%ubhG field must contain a userspace pointer to a filled-in array of struct }(hj%hhhNhNubh)}(h:c:type:`v4l2_plane`h]j)}(hjh]h v4l2_plane}(hjhhhNhNubah}(h]h ](jRjsc-typeeh"]h$]h&]uh1jhjubah}(h]h ]h"]h$]h&]refdocj^ refdomainjsreftypetype refexplicitrefwarnjdjhjs v4l2_planeuh1hhhhK*hj%ubh and the }(hj%hhhNhNubj)}(h ``length``h]hlength}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhj%ubh; field must be set to the number of elements in that array.}(hj%hhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhK*hjhhubh)}(hXiTo enqueue a :ref:`memory mapped ` buffer applications set the ``memory`` field to ``V4L2_MEMORY_MMAP``. When ``VIDIOC_QBUF`` is called with a pointer to this structure the driver sets the ``V4L2_BUF_FLAG_MAPPED`` and ``V4L2_BUF_FLAG_QUEUED`` flags and clears the ``V4L2_BUF_FLAG_DONE`` flag in the ``flags`` field, or it returns an ``EINVAL`` error code.h](h To enqueue a }(hjhhhNhNubh)}(h:ref:`memory mapped `h]j)}(hjh]h memory mapped}(hjhhhNhNubah}(h]h ](jRstdstd-refeh"]h$]h&]uh1jhjubah}(h]h ]h"]h$]h&]refdocj^ refdomainjreftyperef refexplicitrefwarnjsmmapuh1hhhhK?hjubh buffer applications set the }(hjhhhNhNubj)}(h ``memory``h]hmemory}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubh field to }(hjhhhNhNubj)}(h``V4L2_MEMORY_MMAP``h]hV4L2_MEMORY_MMAP}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubh. When }(hjhhhNhNubj)}(h``VIDIOC_QBUF``h]h VIDIOC_QBUF}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubh@ is called with a pointer to this structure the driver sets the }(hjhhhNhNubj)}(h``V4L2_BUF_FLAG_MAPPED``h]hV4L2_BUF_FLAG_MAPPED}(hj+hhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubh and }(hjhhhNhNubj)}(h``V4L2_BUF_FLAG_QUEUED``h]hV4L2_BUF_FLAG_QUEUED}(hj=hhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubh flags and clears the }(hjhhhNhNubj)}(h``V4L2_BUF_FLAG_DONE``h]hV4L2_BUF_FLAG_DONE}(hjOhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubh flag in the }(hjhhhNhNubj)}(h ``flags``h]hflags}(hjahhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubh field, or it returns an }(hjhhhNhNubj)}(h ``EINVAL``h]hEINVAL}(hjshhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubh error code.}(hjhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhK?hjhhubh)}(hXQTo enqueue a :ref:`user pointer ` buffer applications set the ``memory`` field to ``V4L2_MEMORY_USERPTR``, the ``m.userptr`` field to the address of the buffer and ``length`` to its size. When the multi-planar API is used, ``m.userptr`` and ``length`` members of the passed array of struct :c:type:`v4l2_plane` have to be used instead. When ``VIDIOC_QBUF`` is called with a pointer to this structure the driver sets the ``V4L2_BUF_FLAG_QUEUED`` flag and clears the ``V4L2_BUF_FLAG_MAPPED`` and ``V4L2_BUF_FLAG_DONE`` flags in the ``flags`` field, or it returns an error code. This ioctl locks the memory pages of the buffer in physical memory, they cannot be swapped out to disk. Buffers remain locked until dequeued, until the :ref:`VIDIOC_STREAMOFF ` or :ref:`VIDIOC_REQBUFS` ioctl is called, or until the device is closed.h](h To enqueue a }(hjhhhNhNubh)}(h:ref:`user pointer `h]j)}(hjh]h user pointer}(hjhhhNhNubah}(h]h ](jRstdstd-refeh"]h$]h&]uh1jhjubah}(h]h ]h"]h$]h&]refdocj^ refdomainjreftyperef refexplicitrefwarnjsuserpuh1hhhhKFhjubh buffer applications set the }(hjhhhNhNubj)}(h ``memory``h]hmemory}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubh field to }(hjhhhNhNubj)}(h``V4L2_MEMORY_USERPTR``h]hV4L2_MEMORY_USERPTR}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubh, the }(hjhhhNhNubj)}(h ``m.userptr``h]h m.userptr}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubh( field to the address of the buffer and }(hjhhhNhNubj)}(h ``length``h]hlength}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubh1 to its size. When the multi-planar API is used, }(hjhhhNhNubj)}(h ``m.userptr``h]h m.userptr}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubh and }(hjhhhNhNubj)}(h ``length``h]hlength}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubh' members of the passed array of struct }(hjhhhNhNubh)}(h:c:type:`v4l2_plane`h]j)}(hj%h]h v4l2_plane}(hj'hhhNhNubah}(h]h ](jRjsc-typeeh"]h$]h&]uh1jhj#ubah}(h]h ]h"]h$]h&]refdocj^ refdomainjsreftypetype refexplicitrefwarnjdjhjs v4l2_planeuh1hhhhKFhjubh have to be used instead. When }(hjhhhNhNubj)}(h``VIDIOC_QBUF``h]h VIDIOC_QBUF}(hjFhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubh@ is called with a pointer to this structure the driver sets the }(hjhhhNhNubj)}(h``V4L2_BUF_FLAG_QUEUED``h]hV4L2_BUF_FLAG_QUEUED}(hjXhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubh flag and clears the }(hjhhhNhNubj)}(h``V4L2_BUF_FLAG_MAPPED``h]hV4L2_BUF_FLAG_MAPPED}(hjjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubh and }hjsbj)}(h``V4L2_BUF_FLAG_DONE``h]hV4L2_BUF_FLAG_DONE}(hj|hhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubh flags in the }(hjhhhNhNubj)}(h ``flags``h]hflags}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubh field, or it returns an error code. This ioctl locks the memory pages of the buffer in physical memory, they cannot be swapped out to disk. Buffers remain locked until dequeued, until the }(hjhhhNhNubh)}(h):ref:`VIDIOC_STREAMOFF `h]j)}(hjh]hVIDIOC_STREAMOFF}(hjhhhNhNubah}(h]h ](jRstdstd-refeh"]h$]h&]uh1jhjubah}(h]h ]h"]h$]h&]refdocj^ refdomainjreftyperef refexplicitrefwarnjsvidioc_streamonuh1hhhhKFhjubh or }(hjhhhNhNubh)}(h:ref:`VIDIOC_REQBUFS`h]j)}(hjh]hVIDIOC_REQBUFS}(hjhhhNhNubah}(h]h ](jRstdstd-refeh"]h$]h&]uh1jhjubah}(h]h ]h"]h$]h&]refdocj^ refdomainjreftyperef refexplicitrefwarnjsvidioc_reqbufsuh1hhhhKFhjubh0 ioctl is called, or until the device is closed.}(hjhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhKFhjhhubh)}(hXTo enqueue a :ref:`DMABUF ` buffer applications set the ``memory`` field to ``V4L2_MEMORY_DMABUF`` and the ``m.fd`` field to a file descriptor associated with a DMABUF buffer. When the multi-planar API is used the ``m.fd`` fields of the passed array of struct :c:type:`v4l2_plane` have to be used instead. When ``VIDIOC_QBUF`` is called with a pointer to this structure the driver sets the ``V4L2_BUF_FLAG_QUEUED`` flag and clears the ``V4L2_BUF_FLAG_MAPPED`` and ``V4L2_BUF_FLAG_DONE`` flags in the ``flags`` field, or it returns an error code. This ioctl locks the buffer. Locking a buffer means passing it to a driver for a hardware access (usually DMA). If an application accesses (reads/writes) a locked buffer then the result is undefined. Buffers remain locked until dequeued, until the :ref:`VIDIOC_STREAMOFF ` or :ref:`VIDIOC_REQBUFS` ioctl is called, or until the device is closed.h](h To enqueue a }(hjhhhNhNubh)}(h:ref:`DMABUF `h]j)}(hjh]hDMABUF}(hjhhhNhNubah}(h]h ](jRstdstd-refeh"]h$]h&]uh1jhjubah}(h]h ]h"]h$]h&]refdocj^ refdomainjreftyperef refexplicitrefwarnjsdmabufuh1hhhhKUhjubh buffer applications set the }(hjhhhNhNubj)}(h ``memory``h]hmemory}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubh field to }(hjhhhNhNubj)}(h``V4L2_MEMORY_DMABUF``h]hV4L2_MEMORY_DMABUF}(hj,hhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubh and the }(hjhhhNhNubj)}(h``m.fd``h]hm.fd}(hj>hhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubhc field to a file descriptor associated with a DMABUF buffer. When the multi-planar API is used the }(hjhhhNhNubj)}(h``m.fd``h]hm.fd}(hjPhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubh& fields of the passed array of struct }(hjhhhNhNubh)}(h:c:type:`v4l2_plane`h]j)}(hjdh]h v4l2_plane}(hjfhhhNhNubah}(h]h ](jRjsc-typeeh"]h$]h&]uh1jhjbubah}(h]h ]h"]h$]h&]refdocj^ refdomainjsreftypetype refexplicitrefwarnjdjhjs v4l2_planeuh1hhhhKUhjubh have to be used instead. When }(hjhhhNhNubj)}(h``VIDIOC_QBUF``h]h VIDIOC_QBUF}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubh@ is called with a pointer to this structure the driver sets the }(hjhhhNhNubj)}(h``V4L2_BUF_FLAG_QUEUED``h]hV4L2_BUF_FLAG_QUEUED}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubh flag and clears the }(hjhhhNhNubj)}(h``V4L2_BUF_FLAG_MAPPED``h]hV4L2_BUF_FLAG_MAPPED}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubh and }(hjhhhNhNubj)}(h``V4L2_BUF_FLAG_DONE``h]hV4L2_BUF_FLAG_DONE}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubh flags in the }(hjhhhNhNubj)}(h ``flags``h]hflags}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubhX field, or it returns an error code. This ioctl locks the buffer. Locking a buffer means passing it to a driver for a hardware access (usually DMA). If an application accesses (reads/writes) a locked buffer then the result is undefined. Buffers remain locked until dequeued, until the }(hjhhhNhNubh)}(h):ref:`VIDIOC_STREAMOFF `h]j)}(hjh]hVIDIOC_STREAMOFF}(hjhhhNhNubah}(h]h ](jRstdstd-refeh"]h$]h&]uh1jhjubah}(h]h ]h"]h$]h&]refdocj^ refdomainjreftyperef refexplicitrefwarnjsvidioc_streamonuh1hhhhKUhjubh or }(hjhhhNhNubh)}(h:ref:`VIDIOC_REQBUFS`h]j)}(hj h]hVIDIOC_REQBUFS}(hj hhhNhNubah}(h]h ](jRstdstd-refeh"]h$]h&]uh1jhj ubah}(h]h ]h"]h$]h&]refdocj^ refdomainj reftyperef refexplicitrefwarnjsvidioc_reqbufsuh1hhhhKUhjubh0 ioctl is called, or until the device is closed.}(hjhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhKUhjhhubh)}(hXfThe ``request_fd`` field can be used with the ``VIDIOC_QBUF`` ioctl to specify the file descriptor of a :ref:`request `, if requests are in use. Setting it means that the buffer will not be passed to the driver until the request itself is queued. Also, the driver will apply any settings associated with the request for this buffer. This field will be ignored unless the ``V4L2_BUF_FLAG_REQUEST_FD`` flag is set. If the device does not support requests, then ``EBADR`` will be returned. If requests are supported but an invalid request file descriptor is given, then ``EINVAL`` will be returned.h](hThe }(hj- hhhNhNubj)}(h``request_fd``h]h request_fd}(hj5 hhhNhNubah}(h]h ]h"]h$]h&]uh1jhj- ubh field can be used with the }(hj- hhhNhNubj)}(h``VIDIOC_QBUF``h]h VIDIOC_QBUF}(hjG hhhNhNubah}(h]h ]h"]h$]h&]uh1jhj- ubh+ ioctl to specify the file descriptor of a }(hj- hhhNhNubh)}(h":ref:`request `h]j)}(hj[ h]hrequest}(hj] hhhNhNubah}(h]h ](jRstdstd-refeh"]h$]h&]uh1jhjY ubah}(h]h ]h"]h$]h&]refdocj^ refdomainjg reftyperef refexplicitrefwarnjsmedia-request-apiuh1hhhhKehj- ubh, if requests are in use. Setting it means that the buffer will not be passed to the driver until the request itself is queued. Also, the driver will apply any settings associated with the request for this buffer. This field will be ignored unless the }(hj- hhhNhNubj)}(h``V4L2_BUF_FLAG_REQUEST_FD``h]hV4L2_BUF_FLAG_REQUEST_FD}(hj} hhhNhNubah}(h]h ]h"]h$]h&]uh1jhj- ubh< flag is set. If the device does not support requests, then }(hj- hhhNhNubj)}(h ``EBADR``h]hEBADR}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1jhj- ubhc will be returned. If requests are supported but an invalid request file descriptor is given, then }(hj- hhhNhNubj)}(h ``EINVAL``h]hEINVAL}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1jhj- ubh will be returned.}(hj- hhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhKehjhhubhcaution)}(hX<It is not allowed to mix queuing requests with queuing buffers directly. ``EBUSY`` will be returned if the first buffer was queued directly and then the application tries to queue a request, or vice versa. After closing the file descriptor, calling :ref:`VIDIOC_STREAMOFF ` or calling :ref:`VIDIOC_REQBUFS` the check for this will be reset. For :ref:`memory-to-memory devices ` you can specify the ``request_fd`` only for output buffers, not for capture buffers. Attempting to specify this for a capture buffer will result in an ``EBADR`` error.h](h)}(hXeIt is not allowed to mix queuing requests with queuing buffers directly. ``EBUSY`` will be returned if the first buffer was queued directly and then the application tries to queue a request, or vice versa. After closing the file descriptor, calling :ref:`VIDIOC_STREAMOFF ` or calling :ref:`VIDIOC_REQBUFS` the check for this will be reset.h](hIIt is not allowed to mix queuing requests with queuing buffers directly. }(hj hhhNhNubj)}(h ``EBUSY``h]hEBUSY}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1jhj ubh will be returned if the first buffer was queued directly and then the application tries to queue a request, or vice versa. After closing the file descriptor, calling }(hj hhhNhNubh)}(h):ref:`VIDIOC_STREAMOFF `h]j)}(hj h]hVIDIOC_STREAMOFF}(hj hhhNhNubah}(h]h ](jRstdstd-refeh"]h$]h&]uh1jhj ubah}(h]h ]h"]h$]h&]refdocj^ refdomainj reftyperef refexplicitrefwarnjsvidioc_streamonuh1hhhhKphj ubh or calling }(hj hhhNhNubh)}(h:ref:`VIDIOC_REQBUFS`h]j)}(hj h]hVIDIOC_REQBUFS}(hj hhhNhNubah}(h]h ](jRstdstd-refeh"]h$]h&]uh1jhj ubah}(h]h ]h"]h$]h&]refdocj^ refdomainj reftyperef refexplicitrefwarnjsvidioc_reqbufsuh1hhhhKphj ubh" the check for this will be reset.}(hj hhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhKphj ubh)}(hFor :ref:`memory-to-memory devices ` you can specify the ``request_fd`` only for output buffers, not for capture buffers. Attempting to specify this for a capture buffer will result in an ``EBADR`` error.h](hFor }(hj' hhhNhNubh)}(h):ref:`memory-to-memory devices `h]j)}(hj1 h]hmemory-to-memory devices}(hj3 hhhNhNubah}(h]h ](jRstdstd-refeh"]h$]h&]uh1jhj/ ubah}(h]h ]h"]h$]h&]refdocj^ refdomainj= reftyperef refexplicitrefwarnjsmem2memuh1hhhhKwhj' ubh you can specify the }(hj' hhhNhNubj)}(h``request_fd``h]h request_fd}(hjS hhhNhNubah}(h]h ]h"]h$]h&]uh1jhj' ubhu only for output buffers, not for capture buffers. Attempting to specify this for a capture buffer will result in an }(hj' hhhNhNubj)}(h ``EBADR``h]hEBADR}(hje hhhNhNubah}(h]h ]h"]h$]h&]uh1jhj' ubh error.}(hj' hhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhKwhj ubeh}(h]h ]h"]h$]h&]uh1j hjhhhhhNubh)}(hXApplications call the ``VIDIOC_DQBUF`` ioctl to dequeue a filled (capturing) or displayed (output) buffer from the driver's outgoing queue. They just set the ``type``, ``memory`` and ``reserved`` fields of a struct :c:type:`v4l2_buffer` as above, when ``VIDIOC_DQBUF`` is called with a pointer to this structure the driver fills all remaining fields or returns an error code. The driver may also set ``V4L2_BUF_FLAG_ERROR`` in the ``flags`` field. It indicates a non-critical (recoverable) streaming error. In such case the application may continue as normal, but should be aware that data in the dequeued buffer might be corrupted. When using the multi-planar API, the planes array must be passed in as well.h](hApplications call the }(hj hhhNhNubj)}(h``VIDIOC_DQBUF``h]h VIDIOC_DQBUF}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1jhj ubhz ioctl to dequeue a filled (capturing) or displayed (output) buffer from the driver’s outgoing queue. They just set the }(hj hhhNhNubj)}(h``type``h]htype}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1jhj ubh, }(hj hhhNhNubj)}(h ``memory``h]hmemory}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1jhj ubh and }(hj hhhNhNubj)}(h ``reserved``h]hreserved}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1jhj ubh fields of a struct }(hj hhhNhNubh)}(h:c:type:`v4l2_buffer`h]j)}(hj h]h v4l2_buffer}(hj hhhNhNubah}(h]h ](jRjsc-typeeh"]h$]h&]uh1jhj ubah}(h]h ]h"]h$]h&]refdocj^ refdomainjsreftypetype refexplicitrefwarnjdjhjs v4l2_bufferuh1hhhhK{hj ubh as above, when }(hj hhhNhNubj)}(h``VIDIOC_DQBUF``h]h VIDIOC_DQBUF}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1jhj ubh is called with a pointer to this structure the driver fills all remaining fields or returns an error code. The driver may also set }(hj hhhNhNubj)}(h``V4L2_BUF_FLAG_ERROR``h]hV4L2_BUF_FLAG_ERROR}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1jhj ubh in the }(hj hhhNhNubj)}(h ``flags``h]hflags}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1jhj ubhX  field. It indicates a non-critical (recoverable) streaming error. In such case the application may continue as normal, but should be aware that data in the dequeued buffer might be corrupted. When using the multi-planar API, the planes array must be passed in as well.}(hj hhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhK{hjhhubh)}(hXIf the application sets the ``memory`` field to ``V4L2_MEMORY_DMABUF`` to dequeue a :ref:`DMABUF ` buffer, the driver fills the ``m.fd`` field with a file descriptor numerically the same as the one given to ``VIDIOC_QBUF`` when the buffer was enqueued. No new file descriptor is created at dequeue time and the value is only for the application convenience. When the multi-planar API is used the ``m.fd`` fields of the passed array of struct :c:type:`v4l2_plane` are filled instead.h](hIf the application sets the }(hj2 hhhNhNubj)}(h ``memory``h]hmemory}(hj: hhhNhNubah}(h]h ]h"]h$]h&]uh1jhj2 ubh field to }(hj2 hhhNhNubj)}(h``V4L2_MEMORY_DMABUF``h]hV4L2_MEMORY_DMABUF}(hjL hhhNhNubah}(h]h ]h"]h$]h&]uh1jhj2 ubh to dequeue a }(hj2 hhhNhNubh)}(h:ref:`DMABUF `h]j)}(hj` h]hDMABUF}(hjb hhhNhNubah}(h]h ](jRstdstd-refeh"]h$]h&]uh1jhj^ ubah}(h]h ]h"]h$]h&]refdocj^ refdomainjl reftyperef refexplicitrefwarnjsdmabufuh1hhhhKhj2 ubh buffer, the driver fills the }(hj2 hhhNhNubj)}(h``m.fd``h]hm.fd}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1jhj2 ubhG field with a file descriptor numerically the same as the one given to }(hj2 hhhNhNubj)}(h``VIDIOC_QBUF``h]h VIDIOC_QBUF}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1jhj2 ubh when the buffer was enqueued. No new file descriptor is created at dequeue time and the value is only for the application convenience. When the multi-planar API is used the }(hj2 hhhNhNubj)}(h``m.fd``h]hm.fd}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1jhj2 ubh& fields of the passed array of struct }(hj2 hhhNhNubh)}(h:c:type:`v4l2_plane`h]j)}(hj h]h v4l2_plane}(hj hhhNhNubah}(h]h ](jRjsc-typeeh"]h$]h&]uh1jhj ubah}(h]h ]h"]h$]h&]refdocj^ refdomainjsreftypetype refexplicitrefwarnjdjhjs v4l2_planeuh1hhhhKhj2 ubh are filled instead.}(hj2 hhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhKhjhhubh)}(hBy default ``VIDIOC_DQBUF`` blocks when no buffer is in the outgoing queue. When the ``O_NONBLOCK`` flag was given to the :c:func:`open()` function, ``VIDIOC_DQBUF`` returns immediately with an ``EAGAIN`` error code when no buffer is available.h](h By default }(hj hhhNhNubj)}(h``VIDIOC_DQBUF``h]h VIDIOC_DQBUF}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1jhj ubh: blocks when no buffer is in the outgoing queue. When the }(hj hhhNhNubj)}(h``O_NONBLOCK``h]h O_NONBLOCK}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1jhj ubh flag was given to the }(hj hhhNhNubh)}(h:c:func:`open()`h]j)}(hj h]hopen()}(hj hhhNhNubah}(h]h ](jRjsc-funceh"]h$]h&]uh1jhj ubah}(h]h ]h"]h$]h&]refdocj^ refdomainjsreftypefunc refexplicitrefwarnjdjhjsopenuh1hhhhKhj ubh function, }(hj hhhNhNubj)}(h``VIDIOC_DQBUF``h]h VIDIOC_DQBUF}(hj0 hhhNhNubah}(h]h ]h"]h$]h&]uh1jhj ubh returns immediately with an }(hj hhhNhNubj)}(h ``EAGAIN``h]hEAGAIN}(hjB hhhNhNubah}(h]h ]h"]h$]h&]uh1jhj ubh( error code when no buffer is available.}(hj hhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhKhjhhubh)}(hIThe struct :c:type:`v4l2_buffer` structure is specified in :ref:`buffer`.h](h The struct }(hjZ hhhNhNubh)}(h:c:type:`v4l2_buffer`h]j)}(hjd h]h v4l2_buffer}(hjf hhhNhNubah}(h]h ](jRjsc-typeeh"]h$]h&]uh1jhjb ubah}(h]h ]h"]h$]h&]refdocj^ refdomainjsreftypetype refexplicitrefwarnjdjhjs v4l2_bufferuh1hhhhKhjZ ubh structure is specified in }(hjZ hhhNhNubh)}(h :ref:`buffer`h]j)}(hj h]hbuffer}(hj hhhNhNubah}(h]h ](jRstdstd-refeh"]h$]h&]uh1jhj ubah}(h]h ]h"]h$]h&]refdocj^ refdomainj reftyperef refexplicitrefwarnjsbufferuh1hhhhKhjZ ubh.}(hjZ hhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhKhjhhubeh}(h] descriptionah ]h"] descriptionah$]h&]uh1hhhhhhhhK$ubh)}(hhh](h)}(h Return Valueh]h Return Value}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj hhhhhKubh)}(hOn success 0 is returned, on error -1 and the ``errno`` variable is set appropriately. The generic error codes are described at the :ref:`Generic Error Codes ` chapter.h](h.On success 0 is returned, on error -1 and the }(hj hhhNhNubj)}(h ``errno``h]herrno}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1jhj ubhM variable is set appropriately. The generic error codes are described at the }(hj hhhNhNubh)}(h':ref:`Generic Error Codes `h]j)}(hj h]hGeneric Error Codes}(hj hhhNhNubah}(h]h ](jRstdstd-refeh"]h$]h&]uh1jhj ubah}(h]h ]h"]h$]h&]refdocj^ refdomainj reftyperef refexplicitrefwarnjs gen-errorsuh1hhhhKhj ubh chapter.}(hj hhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhKhj hhubj)}(hhh](j)}(hhEAGAIN Non-blocking I/O has been selected using ``O_NONBLOCK`` and no buffer was in the outgoing queue. h](j)}(hEAGAINh]hEAGAIN}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1jhhhKhj ubj8)}(hhh]h)}(h`Non-blocking I/O has been selected using ``O_NONBLOCK`` and no buffer was in the outgoing queue.h](h)Non-blocking I/O has been selected using }(hj$ hhhNhNubj)}(h``O_NONBLOCK``h]h O_NONBLOCK}(hj, hhhNhNubah}(h]h ]h"]h$]h&]uh1jhj$ ubh) and no buffer was in the outgoing queue.}(hj$ hhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhKhj! ubah}(h]h ]h"]h$]h&]uh1j7hj ubeh}(h]h ]h"]h$]h&]uh1jhhhKhj ubj)}(hX3EINVAL The buffer ``type`` is not supported, or the ``index`` is out of bounds, or no buffers have been allocated yet, or the ``userptr`` or ``length`` are invalid, or the ``V4L2_BUF_FLAG_REQUEST_FD`` flag was set but the given ``request_fd`` was invalid, or ``m.fd`` was an invalid DMABUF file descriptor. h](j)}(hEINVALh]hEINVAL}(hjT hhhNhNubah}(h]h ]h"]h$]h&]uh1jhhhKhjP ubj8)}(hhh]h)}(hX+The buffer ``type`` is not supported, or the ``index`` is out of bounds, or no buffers have been allocated yet, or the ``userptr`` or ``length`` are invalid, or the ``V4L2_BUF_FLAG_REQUEST_FD`` flag was set but the given ``request_fd`` was invalid, or ``m.fd`` was an invalid DMABUF file descriptor.h](h The buffer }(hje hhhNhNubj)}(h``type``h]htype}(hjm hhhNhNubah}(h]h ]h"]h$]h&]uh1jhje ubh is not supported, or the }(hje hhhNhNubj)}(h ``index``h]hindex}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1jhje ubhA is out of bounds, or no buffers have been allocated yet, or the }(hje hhhNhNubj)}(h ``userptr``h]huserptr}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1jhje ubh or }(hje hhhNhNubj)}(h ``length``h]hlength}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1jhje ubh are invalid, or the }(hje hhhNhNubj)}(h``V4L2_BUF_FLAG_REQUEST_FD``h]hV4L2_BUF_FLAG_REQUEST_FD}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1jhje ubh flag was set but the given }(hje hhhNhNubj)}(h``request_fd``h]h request_fd}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1jhje ubh was invalid, or }(hje hhhNhNubj)}(h``m.fd``h]hm.fd}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1jhje ubh' was an invalid DMABUF file descriptor.}(hje hhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhKhjb ubah}(h]h ]h"]h$]h&]uh1j7hjP ubeh}(h]h ]h"]h$]h&]uh1jhhhKhj hhubj)}(hX-EIO ``VIDIOC_DQBUF`` failed due to an internal error. Can also indicate temporary problems like signal loss. .. note:: The driver might dequeue an (empty) buffer despite returning an error, or even stop capturing. Reusing such buffer may be unsafe though and its details (e.g. ``index``) may not be returned either. It is recommended that drivers indicate recoverable errors by setting the ``V4L2_BUF_FLAG_ERROR`` and returning 0 instead. In that case the application should be able to safely reuse the buffer and continue streaming. h](j)}(hEIOh]hEIO}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhhhKhj ubj8)}(hhh](h)}(hh``VIDIOC_DQBUF`` failed due to an internal error. Can also indicate temporary problems like signal loss.h](j)}(h``VIDIOC_DQBUF``h]h VIDIOC_DQBUF}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubhX failed due to an internal error. Can also indicate temporary problems like signal loss.}(hjhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhKhjubhnote)}(hXThe driver might dequeue an (empty) buffer despite returning an error, or even stop capturing. Reusing such buffer may be unsafe though and its details (e.g. ``index``) may not be returned either. It is recommended that drivers indicate recoverable errors by setting the ``V4L2_BUF_FLAG_ERROR`` and returning 0 instead. In that case the application should be able to safely reuse the buffer and continue streaming.h]h)}(hXThe driver might dequeue an (empty) buffer despite returning an error, or even stop capturing. Reusing such buffer may be unsafe though and its details (e.g. ``index``) may not be returned either. It is recommended that drivers indicate recoverable errors by setting the ``V4L2_BUF_FLAG_ERROR`` and returning 0 instead. In that case the application should be able to safely reuse the buffer and continue streaming.h](hThe driver might dequeue an (empty) buffer despite returning an error, or even stop capturing. Reusing such buffer may be unsafe though and its details (e.g. }(hj4hhhNhNubj)}(h ``index``h]hindex}(hj<hhhNhNubah}(h]h ]h"]h$]h&]uh1jhj4ubhh) may not be returned either. It is recommended that drivers indicate recoverable errors by setting the }(hj4hhhNhNubj)}(h``V4L2_BUF_FLAG_ERROR``h]hV4L2_BUF_FLAG_ERROR}(hjNhhhNhNubah}(h]h ]h"]h$]h&]uh1jhj4ubhx and returning 0 instead. In that case the application should be able to safely reuse the buffer and continue streaming.}(hj4hhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhKhj0ubah}(h]h ]h"]h$]h&]uh1j.hjubeh}(h]h ]h"]h$]h&]uh1j7hj ubeh}(h]h ]h"]h$]h&]uh1jhhhKhj hhubj)}(hEPIPE ``VIDIOC_DQBUF`` returns this on an empty capture queue for mem2mem codecs if a buffer with the ``V4L2_BUF_FLAG_LAST`` was already dequeued and no new buffers are expected to become available. h](j)}(hEPIPEh]hEPIPE}(hj|hhhNhNubah}(h]h ]h"]h$]h&]uh1jhhhKhjxubj8)}(hhh]h)}(h``VIDIOC_DQBUF`` returns this on an empty capture queue for mem2mem codecs if a buffer with the ``V4L2_BUF_FLAG_LAST`` was already dequeued and no new buffers are expected to become available.h](j)}(h``VIDIOC_DQBUF``h]h VIDIOC_DQBUF}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubhP returns this on an empty capture queue for mem2mem codecs if a buffer with the }(hjhhhNhNubj)}(h``V4L2_BUF_FLAG_LAST``h]hV4L2_BUF_FLAG_LAST}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubhJ was already dequeued and no new buffers are expected to become available.}(hjhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhKhjubah}(h]h ]h"]h$]h&]uh1j7hjxubeh}(h]h ]h"]h$]h&]uh1jhhhKhj hhubj)}(hEBADR The ``V4L2_BUF_FLAG_REQUEST_FD`` flag was set but the device does not support requests for the given buffer type, or the ``V4L2_BUF_FLAG_REQUEST_FD`` flag was not set but the device requires that the buffer is part of a request. h](j)}(hEBADRh]hEBADR}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhhhKhjubj8)}(hhh]h)}(hThe ``V4L2_BUF_FLAG_REQUEST_FD`` flag was set but the device does not support requests for the given buffer type, or the ``V4L2_BUF_FLAG_REQUEST_FD`` flag was not set but the device requires that the buffer is part of a request.h](hThe }(hjhhhNhNubj)}(h``V4L2_BUF_FLAG_REQUEST_FD``h]hV4L2_BUF_FLAG_REQUEST_FD}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubhY flag was set but the device does not support requests for the given buffer type, or the }(hjhhhNhNubj)}(h``V4L2_BUF_FLAG_REQUEST_FD``h]hV4L2_BUF_FLAG_REQUEST_FD}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubhO flag was not set but the device requires that the buffer is part of a request.}(hjhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhKhjubah}(h]h ]h"]h$]h&]uh1j7hjubeh}(h]h ]h"]h$]h&]uh1jhhhKhj hhubj)}(hEBUSY The first buffer was queued via a request, but the application now tries to queue it directly, or vice versa (it is not permitted to mix the two APIs).h](j)}(hEBUSYh]hEBUSY}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhhhKhjubj8)}(hhh]h)}(hThe first buffer was queued via a request, but the application now tries to queue it directly, or vice versa (it is not permitted to mix the two APIs).h]hThe first buffer was queued via a request, but the application now tries to queue it directly, or vice versa (it is not permitted to mix the two APIs).}(hj/hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhj,ubah}(h]h ]h"]h$]h&]uh1j7hjubeh}(h]h ]h"]h$]h&]uh1jhhhKhj hhubeh}(h]h ]h"]h$]h&]uh1jhj hhhhhNubeh}(h] return-valueah ]h"] return valueah$]h&]uh1hhhhhhhhKubeh}(h](ioctl-vidioc-qbuf-vidioc-dqbufheh ]h"](ioctl vidioc_qbuf, vidioc_dqbuf vidioc_qbufeh$]h&]uh1hhhhhhhhKexpect_referenced_by_name}j]hsexpect_referenced_by_id}hhsubeh}(h]h ]h"]h$]h&]sourcehuh1hcurrent_sourceN current_lineNsettingsdocutils.frontendValues)}(hN generatorN datestampN source_linkN source_urlN toc_backlinksentryfootnote_backlinksK sectnum_xformKstrip_commentsNstrip_elements_with_classesN strip_classesN report_levelK halt_levelKexit_status_levelKdebugNwarning_streamN tracebackinput_encoding utf-8-siginput_encoding_error_handlerstrictoutput_encodingutf-8output_encoding_error_handlerjerror_encodingutf-8error_encoding_error_handlerbackslashreplace language_codeenrecord_dependenciesNconfigN id_prefixhauto_id_prefixid dump_settingsNdump_internalsNdump_transformsNdump_pseudo_xmlNexpose_internalsNstrict_visitorN_disable_configN_sourceh _destinationN _config_files]7/var/lib/git/docbuild/linux/Documentation/docutils.confafile_insertion_enabled raw_enabledKline_length_limitM'pep_referencesN pep_base_urlhttps://peps.python.org/pep_file_url_templatepep-%04drfc_referencesN rfc_base_url&https://datatracker.ietf.org/doc/html/ tab_widthKtrim_footnote_reference_spacesyntax_highlightlong smart_quotessmartquotes_locales]character_level_inline_markupdoctitle_xform docinfo_xformKsectsubtitle_xform image_loadinglinkembed_stylesheetcloak_email_addressessection_self_linkenvNubreporterNindirect_targets]substitution_defs}substitution_names}refnames}refids}h]hasnameids}(j]hj\jYhhjjjjj j jTjQu nametypes}(j]j\hjjj jTuh}(hhjYhhhjjj j)jjjjj jjQj u footnote_refs} citation_refs} autofootnotes]autofootnote_refs]symbol_footnotes]symbol_footnote_refs] footnotes] citations]autofootnote_startKsymbol_footnote_startK id_counter collectionsCounter}Rparse_messages]transform_messages]hsystem_message)}(hhh]h)}(hhh]h1Hyperlink target "vidioc-qbuf" is not referenced.}hjsbah}(h]h ]h"]h$]h&]uh1hhjubah}(h]h ]h"]h$]h&]levelKtypeINFOsourcehlineKuh1juba transformerN include_log] decorationNhhub.