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]hPortuguese (Brazilian)}hhsbah}(h]h ]h"]h$]h&] refdomainh)reftypeh+ reftarget7/translations/pt_BR/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_QBUFhNtauh1j%hjhhhNhNubhdesc)}(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}(hjOhhhNhNubah}(h]h ]nah"]h$]h&]uh1jMhjIubah}(h]h ](sig-namedescnameeh"]h$]h&]hhuh1jGhjChhhhhKubah}(h]h ]h"]h$]h&]hhƌ add_permalinkuh1jAsphinx_line_type declaratorhj=hhhhhKubah}(h]j4ah ](sig sig-objecteh"]h$]h&] is_multiline _toc_parts) _toc_namehuh1j;hhhKhj8hhubh desc_content)}(hhh]h}(h]h ]h"]h$]h&]uh1jyhj8hhhhhKubeh}(h]h ](cmacroeh"]h$]h&]domainjobjtypejdesctypejnoindex noindexentrynocontentsentryuh1j6hhhjhNhNubh)}(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&]uh1jhjubah}(h]h ]h"]h$]h&]uh1hhhhKhjhhubj&)}(hhh]h}(h]h ]h"]h$]h&]entries](j2V4L.VIDIOC_DQBUF (C macro)c.V4L.VIDIOC_DQBUFhNtauh1j%hjhhhNhNubj7)}(hhh](j<)}(h VIDIOC_DQBUFh]jB)}(h VIDIOC_DQBUFh]jH)}(h VIDIOC_DQBUFh]jN)}(hjh]h VIDIOC_DQBUF}(hjhhhNhNubah}(h]h ]jYah"]h$]h&]uh1jMhjubah}(h]h ](j`jaeh"]h$]h&]hhuh1jGhjhhhhhKubah}(h]h ]h"]h$]h&]hhjkuh1jAjljmhjhhhhhKubah}(h]jah ](jqjreh"]h$]h&]jvjw)jxhuh1j;hhhKhjhhubjz)}(hhh]h}(h]h ]h"]h$]h&]uh1jyhjhhhhhKubeh}(h]h ](jmacroeh"]h$]h&]jjjjjjjjjuh1j6hhhjhNhNubh)}(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)}(hj6h]hfd}(hj8hhhNhNubah}(h]h ]h"]h$]h&]uh1jhj4ubah}(h]h ]h"]h$]h&]uh1j2hhhKhj.ubh definition)}(hhh]h)}(h-File descriptor returned by :c:func:`open()`.h](hFile descriptor returned by }(hjPhhhNhNubh)}(h:c:func:`open()`h]j)}(hjZh]hopen()}(hj\hhhNhNubah}(h]h ](xrefjc-funceh"]h$]h&]uh1jhjXubah}(h]h ]h"]h$]h&]refdoc#userspace-api/media/v4l/vidioc-qbuf refdomainjreftypefunc refexplicitrefwarn c:parent_keysphinx.domains.c LookupKey)}data]jy ASTIdentifier)} identifierV4LsbNasb reftargetopenuh1hhhhKhjPubh.}(hjPhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhKhjMubah}(h]h ]h"]h$]h&]uh1jKhj.ubeh}(h]h ]h"]h$]h&]uh1j,hhhKhj)ubj-)}(h2``argp`` Pointer to struct :c:type:`v4l2_buffer`. h](j3)}(h``argp``h]j)}(hjh]hargp}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubah}(h]h ]h"]h$]h&]uh1j2hhhK!hjubjL)}(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 ](jfjc-typeeh"]h$]h&]uh1jhjubah}(h]h ]h"]h$]h&]refdocjr refdomainjreftypetype refexplicitrefwarnjxj|j v4l2_bufferuh1hhhhK!hjubh.}(hjhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhK!hjubah}(h]h ]h"]h$]h&]uh1jKhjubeh}(h]h ]h"]h$]h&]uh1j,hhhK!hj)hhubeh}(h]h ]h"]h$]h&]uh1j'hjhhhhhNubeh}(h] argumentsah ]h"] argumentsah$]h&]uh1hhhhhhhhKubh)}(hhh](h)}(h Descriptionh]h Description}(hj hhhNhNubah}(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 }(hj9hhhNhNubj)}(h``type``h]htype}(hjAhhhNhNubah}(h]h ]h"]h$]h&]uh1jhj9ubh field of a struct }(hj9hhhNhNubh)}(h:c:type:`v4l2_buffer`h]j)}(hjUh]h v4l2_buffer}(hjWhhhNhNubah}(h]h ](jfjc-typeeh"]h$]h&]uh1jhjSubah}(h]h ]h"]h$]h&]refdocjr refdomainjreftypetype refexplicitrefwarnjxj|j v4l2_bufferuh1hhhhK*hj9ubh< to the same buffer type as was previously used with struct }(hj9hhhNhNubh)}(h:c:type:`v4l2_format`h]j)}(hjxh]h v4l2_format}(hjzhhhNhNubah}(h]h ](jfjc-typeeh"]h$]h&]uh1jhjvubah}(h]h ]h"]h$]h&]refdocjr refdomainjreftypetype refexplicitrefwarnjxj|j v4l2_formatuh1hhhhK*hj9ubh }(hj9hhhNhNubj)}(h``type``h]htype}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhj9ubh and struct }(hj9hhhNhNubh)}(h:c:type:`v4l2_requestbuffers`h]j)}(hjh]hv4l2_requestbuffers}(hjhhhNhNubah}(h]h ](jfjc-typeeh"]h$]h&]uh1jhjubah}(h]h ]h"]h$]h&]refdocjr refdomainjreftypetype refexplicitrefwarnjxj|jv4l2_requestbuffersuh1hhhhK*hj9ubh }hj9sbj)}(h``type``h]htype}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhj9ubh!. Applications must also set the }(hj9hhhNhNubj)}(h ``index``h]hindex}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhj9ubhT field. Valid index numbers range from zero to the number of buffers allocated with }(hj9hhhNhNubh)}(h:ref:`VIDIOC_REQBUFS`h]hinline)}(hjh]hVIDIOC_REQBUFS}(hjhhhNhNubah}(h]h ](jfstdstd-refeh"]h$]h&]uh1jhjubah}(h]h ]h"]h$]h&]refdocjr refdomainjreftyperef refexplicitrefwarnjvidioc_reqbufsuh1hhhhK*hj9ubh (struct }(hj9hhhNhNubh)}(h:c:type:`v4l2_requestbuffers`h]j)}(hjh]hv4l2_requestbuffers}(hjhhhNhNubah}(h]h ](jfjc-typeeh"]h$]h&]uh1jhjubah}(h]h ]h"]h$]h&]refdocjr refdomainjreftypetype refexplicitrefwarnjxj|jv4l2_requestbuffersuh1hhhhK*hj9ubh }hj9sbj)}(h ``count``h]hcount}(hj;hhhNhNubah}(h]h ]h"]h$]h&]uh1jhj9ubh() minus one. The contents of the struct }(hj9hhhNhNubh)}(h:c:type:`v4l2_buffer`h]j)}(hjOh]h v4l2_buffer}(hjQhhhNhNubah}(h]h ](jfjc-typeeh"]h$]h&]uh1jhjMubah}(h]h ]h"]h$]h&]refdocjr refdomainjreftypetype refexplicitrefwarnjxj|j v4l2_bufferuh1hhhhK*hj9ubh returned by a }(hj9hhhNhNubh)}(h:ref:`VIDIOC_QUERYBUF`h]j)}(hjrh]hVIDIOC_QUERYBUF}(hjthhhNhNubah}(h]h ](jfstdstd-refeh"]h$]h&]uh1jhjpubah}(h]h ]h"]h$]h&]refdocjr refdomainj~reftyperef refexplicitrefwarnjvidioc_querybufuh1hhhhK*hj9ubh@ ioctl will do as well. When the buffer is intended for output (}(hj9hhhNhNubj)}(h``type``h]htype}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhj9ubh is }(hj9hhhNhNubj)}(h``V4L2_BUF_TYPE_VIDEO_OUTPUT``h]hV4L2_BUF_TYPE_VIDEO_OUTPUT}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhj9ubh, }(hj9hhhNhNubj)}(h%``V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE``h]h!V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhj9ubh, or }(hj9hhhNhNubj)}(h``V4L2_BUF_TYPE_VBI_OUTPUT``h]hV4L2_BUF_TYPE_VBI_OUTPUT}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhj9ubh() applications must also initialize the }(hj9hhhNhNubj)}(h ``bytesused``h]h bytesused}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhj9ubh, }hj9sbj)}(h ``field``h]hfield}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhj9ubh and }(hj9hhhNhNubj)}(h ``timestamp``h]h timestamp}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhj9ubh fields, see }(hj9hhhNhNubh)}(h :ref:`buffer`h]j)}(hjh]hbuffer}(hjhhhNhNubah}(h]h ](jfstdstd-refeh"]h$]h&]uh1jhjubah}(h]h ]h"]h$]h&]refdocjr refdomainj reftyperef refexplicitrefwarnjbufferuh1hhhhK*hj9ubh) for details. Applications must also set }(hj9hhhNhNubj)}(h ``flags``h]hflags}(hj6hhhNhNubah}(h]h ]h"]h$]h&]uh1jhj9ubh to 0. The }(hj9hhhNhNubj)}(h ``reserved2``h]h reserved2}(hjHhhhNhNubah}(h]h ]h"]h$]h&]uh1jhj9ubh and }hj9sbj)}(h ``reserved``h]hreserved}(hjZhhhNhNubah}(h]h ]h"]h$]h&]uh1jhj9ubh) fields must be set to 0. When using the }(hj9hhhNhNubh)}(h%:ref:`multi-planar API `h]j)}(hjnh]hmulti-planar API}(hjphhhNhNubah}(h]h ](jfstdstd-refeh"]h$]h&]uh1jhjlubah}(h]h ]h"]h$]h&]refdocjr refdomainjzreftyperef refexplicitrefwarnj planar-apisuh1hhhhK*hj9ubh, the }(hj9hhhNhNubj)}(h ``m.planes``h]hm.planes}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhj9ubhG field must contain a userspace pointer to a filled-in array of struct }(hj9hhhNhNubh)}(h:c:type:`v4l2_plane`h]j)}(hjh]h v4l2_plane}(hjhhhNhNubah}(h]h ](jfjc-typeeh"]h$]h&]uh1jhjubah}(h]h ]h"]h$]h&]refdocjr refdomainjreftypetype refexplicitrefwarnjxj|j v4l2_planeuh1hhhhK*hj9ubh and the }(hj9hhhNhNubj)}(h ``length``h]hlength}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhj9ubh; field must be set to the number of elements in that array.}(hj9hhhNhNubeh}(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 ](jfstdstd-refeh"]h$]h&]uh1jhjubah}(h]h ]h"]h$]h&]refdocjr refdomainjreftyperef refexplicitrefwarnjmmapuh1hhhhK?hjubh buffer applications set the }(hjhhhNhNubj)}(h ``memory``h]hmemory}(hj hhhNhNubah}(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}(hj-hhhNhNubah}(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}(hjQhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubh flags and clears the }(hjhhhNhNubj)}(h``V4L2_BUF_FLAG_DONE``h]hV4L2_BUF_FLAG_DONE}(hjchhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubh flag in the }(hjhhhNhNubj)}(h ``flags``h]hflags}(hjuhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubh field, or it returns an }(hjhhhNhNubj)}(h ``EINVAL``h]hEINVAL}(hjhhhNhNubah}(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 ](jfstdstd-refeh"]h$]h&]uh1jhjubah}(h]h ]h"]h$]h&]refdocjr refdomainjreftyperef refexplicitrefwarnjuserpuh1hhhhKFhjubh 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}(hj%hhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubh' members of the passed array of struct }(hjhhhNhNubh)}(h:c:type:`v4l2_plane`h]j)}(hj9h]h v4l2_plane}(hj;hhhNhNubah}(h]h ](jfjc-typeeh"]h$]h&]uh1jhj7ubah}(h]h ]h"]h$]h&]refdocjr refdomainjreftypetype refexplicitrefwarnjxj|j v4l2_planeuh1hhhhKFhjubh have to be used instead. When }(hjhhhNhNubj)}(h``VIDIOC_QBUF``h]h VIDIOC_QBUF}(hjZhhhNhNubah}(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}(hjlhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubh flag and clears the }(hjhhhNhNubj)}(h``V4L2_BUF_FLAG_MAPPED``h]hV4L2_BUF_FLAG_MAPPED}(hj~hhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubh and }hjsbj)}(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&]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 ](jfstdstd-refeh"]h$]h&]uh1jhjubah}(h]h ]h"]h$]h&]refdocjr refdomainjreftyperef refexplicitrefwarnjvidioc_streamonuh1hhhhKFhjubh or }(hjhhhNhNubh)}(h:ref:`VIDIOC_REQBUFS`h]j)}(hjh]hVIDIOC_REQBUFS}(hjhhhNhNubah}(h]h ](jfstdstd-refeh"]h$]h&]uh1jhjubah}(h]h ]h"]h$]h&]refdocjr refdomainjreftyperef refexplicitrefwarnjvidioc_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)}(hj h]hDMABUF}(hjhhhNhNubah}(h]h ](jfstdstd-refeh"]h$]h&]uh1jhj ubah}(h]h ]h"]h$]h&]refdocjr refdomainjreftyperef refexplicitrefwarnjdmabufuh1hhhhKUhjubh buffer applications set the }(hjhhhNhNubj)}(h ``memory``h]hmemory}(hj.hhhNhNubah}(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}(hjRhhhNhNubah}(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}(hjdhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubh& fields of the passed array of struct }(hjhhhNhNubh)}(h:c:type:`v4l2_plane`h]j)}(hjxh]h v4l2_plane}(hjzhhhNhNubah}(h]h ](jfjc-typeeh"]h$]h&]uh1jhjvubah}(h]h ]h"]h$]h&]refdocjr refdomainjreftypetype refexplicitrefwarnjxj|j 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 ](jfstdstd-refeh"]h$]h&]uh1jhjubah}(h]h ]h"]h$]h&]refdocjr refdomainj reftyperef refexplicitrefwarnjvidioc_streamonuh1hhhhKUhjubh or }(hjhhhNhNubh)}(h:ref:`VIDIOC_REQBUFS`h]j)}(hj h]hVIDIOC_REQBUFS}(hj hhhNhNubah}(h]h ](jfstdstd-refeh"]h$]h&]uh1jhj ubah}(h]h ]h"]h$]h&]refdocjr refdomainj% reftyperef refexplicitrefwarnjvidioc_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 }(hjA hhhNhNubj)}(h``request_fd``h]h request_fd}(hjI hhhNhNubah}(h]h ]h"]h$]h&]uh1jhjA ubh field can be used with the }(hjA hhhNhNubj)}(h``VIDIOC_QBUF``h]h VIDIOC_QBUF}(hj[ hhhNhNubah}(h]h ]h"]h$]h&]uh1jhjA ubh+ ioctl to specify the file descriptor of a }(hjA hhhNhNubh)}(h":ref:`request `h]j)}(hjo h]hrequest}(hjq hhhNhNubah}(h]h ](jfstdstd-refeh"]h$]h&]uh1jhjm ubah}(h]h ]h"]h$]h&]refdocjr refdomainj{ reftyperef refexplicitrefwarnjmedia-request-apiuh1hhhhKehjA 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 }(hjA hhhNhNubj)}(h``V4L2_BUF_FLAG_REQUEST_FD``h]hV4L2_BUF_FLAG_REQUEST_FD}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1jhjA ubh< flag is set. If the device does not support requests, then }(hjA hhhNhNubj)}(h ``EBADR``h]hEBADR}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1jhjA ubhc will be returned. If requests are supported but an invalid request file descriptor is given, then }(hjA hhhNhNubj)}(h ``EINVAL``h]hEINVAL}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1jhjA ubh will be returned.}(hjA 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 ](jfstdstd-refeh"]h$]h&]uh1jhj ubah}(h]h ]h"]h$]h&]refdocjr refdomainj reftyperef refexplicitrefwarnjvidioc_streamonuh1hhhhKphj ubh or calling }(hj hhhNhNubh)}(h:ref:`VIDIOC_REQBUFS`h]j)}(hj h]hVIDIOC_REQBUFS}(hj hhhNhNubah}(h]h ](jfstdstd-refeh"]h$]h&]uh1jhj ubah}(h]h ]h"]h$]h&]refdocjr refdomainj reftyperef refexplicitrefwarnjvidioc_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)}(hjE h]hmemory-to-memory devices}(hjG hhhNhNubah}(h]h ](jfstdstd-refeh"]h$]h&]uh1jhjC ubah}(h]h ]h"]h$]h&]refdocjr refdomainjQ reftyperef refexplicitrefwarnjmem2memuh1hhhhKwhj; ubh you can specify the }(hj; hhhNhNubj)}(h``request_fd``h]h request_fd}(hjg 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}(hjy 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 ](jfjc-typeeh"]h$]h&]uh1jhj ubah}(h]h ]h"]h$]h&]refdocjr refdomainjreftypetype refexplicitrefwarnjxj|j 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 }(hjF hhhNhNubj)}(h ``memory``h]hmemory}(hjN hhhNhNubah}(h]h ]h"]h$]h&]uh1jhjF ubh field to }(hjF hhhNhNubj)}(h``V4L2_MEMORY_DMABUF``h]hV4L2_MEMORY_DMABUF}(hj` hhhNhNubah}(h]h ]h"]h$]h&]uh1jhjF ubh to dequeue a }(hjF hhhNhNubh)}(h:ref:`DMABUF `h]j)}(hjt h]hDMABUF}(hjv hhhNhNubah}(h]h ](jfstdstd-refeh"]h$]h&]uh1jhjr ubah}(h]h ]h"]h$]h&]refdocjr refdomainj reftyperef refexplicitrefwarnjdmabufuh1hhhhKhjF ubh buffer, the driver fills the }(hjF hhhNhNubj)}(h``m.fd``h]hm.fd}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1jhjF ubhG field with a file descriptor numerically the same as the one given to }(hjF hhhNhNubj)}(h``VIDIOC_QBUF``h]h VIDIOC_QBUF}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1jhjF 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 }(hjF hhhNhNubj)}(h``m.fd``h]hm.fd}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1jhjF ubh& fields of the passed array of struct }(hjF hhhNhNubh)}(h:c:type:`v4l2_plane`h]j)}(hj h]h v4l2_plane}(hj hhhNhNubah}(h]h ](jfjc-typeeh"]h$]h&]uh1jhj ubah}(h]h ]h"]h$]h&]refdocjr refdomainjreftypetype refexplicitrefwarnjxj|j v4l2_planeuh1hhhhKhjF ubh are filled instead.}(hjF 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 ](jfjc-funceh"]h$]h&]uh1jhj! ubah}(h]h ]h"]h$]h&]refdocjr refdomainjreftypefunc refexplicitrefwarnjxj|jopenuh1hhhhKhj ubh function, }(hj hhhNhNubj)}(h``VIDIOC_DQBUF``h]h VIDIOC_DQBUF}(hjD hhhNhNubah}(h]h ]h"]h$]h&]uh1jhj ubh returns immediately with an }(hj hhhNhNubj)}(h ``EAGAIN``h]hEAGAIN}(hjV 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 }(hjn hhhNhNubh)}(h:c:type:`v4l2_buffer`h]j)}(hjx h]h v4l2_buffer}(hjz hhhNhNubah}(h]h ](jfjc-typeeh"]h$]h&]uh1jhjv ubah}(h]h ]h"]h$]h&]refdocjr refdomainjreftypetype refexplicitrefwarnjxj|j v4l2_bufferuh1hhhhKhjn ubh structure is specified in }(hjn hhhNhNubh)}(h :ref:`buffer`h]j)}(hj h]hbuffer}(hj hhhNhNubah}(h]h ](jfstdstd-refeh"]h$]h&]uh1jhj ubah}(h]h ]h"]h$]h&]refdocjr refdomainj reftyperef refexplicitrefwarnjbufferuh1hhhhKhjn ubh.}(hjn 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 ](jfstdstd-refeh"]h$]h&]uh1jhj ubah}(h]h ]h"]h$]h&]refdocjr refdomainj reftyperef refexplicitrefwarnj 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](j3)}(hEAGAINh]hEAGAIN}(hj' hhhNhNubah}(h]h ]h"]h$]h&]uh1j2hhhKhj# ubjL)}(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 }(hj8 hhhNhNubj)}(h``O_NONBLOCK``h]h O_NONBLOCK}(hj@ hhhNhNubah}(h]h ]h"]h$]h&]uh1jhj8 ubh) and no buffer was in the outgoing queue.}(hj8 hhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhKhj5 ubah}(h]h ]h"]h$]h&]uh1jKhj# ubeh}(h]h ]h"]h$]h&]uh1j,hhhKhj 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](j3)}(hEINVALh]hEINVAL}(hjh hhhNhNubah}(h]h ]h"]h$]h&]uh1j2hhhKhjd ubjL)}(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 }(hjy hhhNhNubj)}(h``type``h]htype}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1jhjy ubh is not supported, or the }(hjy hhhNhNubj)}(h ``index``h]hindex}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1jhjy ubhA is out of bounds, or no buffers have been allocated yet, or the }(hjy hhhNhNubj)}(h ``userptr``h]huserptr}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1jhjy ubh or }(hjy hhhNhNubj)}(h ``length``h]hlength}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1jhjy ubh are invalid, or the }(hjy hhhNhNubj)}(h``V4L2_BUF_FLAG_REQUEST_FD``h]hV4L2_BUF_FLAG_REQUEST_FD}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1jhjy ubh flag was set but the given }(hjy hhhNhNubj)}(h``request_fd``h]h request_fd}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1jhjy ubh was invalid, or }(hjy hhhNhNubj)}(h``m.fd``h]hm.fd}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1jhjy ubh' was an invalid DMABUF file descriptor.}(hjy hhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhKhjv ubah}(h]h ]h"]h$]h&]uh1jKhjd ubeh}(h]h ]h"]h$]h&]uh1j,hhhKhj 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](j3)}(hEIOh]hEIO}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1j2hhhKhjubjL)}(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}(hj*hhhNhNubah}(h]h ]h"]h$]h&]uh1jhj&ubhX failed due to an internal error. Can also indicate temporary problems like signal loss.}(hj&hhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhKhj#ubhnote)}(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. }(hjHhhhNhNubj)}(h ``index``h]hindex}(hjPhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjHubhh) may not be returned either. It is recommended that drivers indicate recoverable errors by setting the }(hjHhhhNhNubj)}(h``V4L2_BUF_FLAG_ERROR``h]hV4L2_BUF_FLAG_ERROR}(hjbhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjHubhx and returning 0 instead. In that case the application should be able to safely reuse the buffer and continue streaming.}(hjHhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhKhjDubah}(h]h ]h"]h$]h&]uh1jBhj#ubeh}(h]h ]h"]h$]h&]uh1jKhjubeh}(h]h ]h"]h$]h&]uh1j,hhhKhj 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](j3)}(hEPIPEh]hEPIPE}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1j2hhhKhjubjL)}(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&]uh1jKhjubeh}(h]h ]h"]h$]h&]uh1j,hhhKhj 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](j3)}(hEBADRh]hEBADR}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1j2hhhKhjubjL)}(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}(hj hhhNhNubah}(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&]uh1jKhjubeh}(h]h ]h"]h$]h&]uh1j,hhhKhj 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](j3)}(hEBUSYh]hEBUSY}(hj2hhhNhNubah}(h]h ]h"]h$]h&]uh1j2hhhKhj.ubjL)}(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).}(hjChhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhj@ubah}(h]h ]h"]h$]h&]uh1jKhj.ubeh}(h]h ]h"]h$]h&]uh1j,hhhKhj hhubeh}(h]h ]h"]h$]h&]uh1j'hj 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}jqhsexpect_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_sourcehnj _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}(jqhjpjmjjjjjjj j jhjeu nametypes}(jqjpjjjj jhuh}(hhjmhjhjjj4j=jjjjj jjej 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&]levelKtypeINFOsourcehnjlineKuh1juba transformerN include_log] decorationNhhub.