Vsphinx.addnodesdocument)}( rawsourcechildren]( translations LanguagesNode)}(hhh](h pending_xref)}(hhh]docutils.nodesTextChinese (Simplified)}parenthsba attributes}(ids]classes]names]dupnames]backrefs] refdomainstdreftypedoc reftarget;/translations/zh_CN/userspace-api/media/v4l/vidioc-querybufmodnameN classnameN refexplicitutagnamehhh ubh)}(hhh]hChinese (Traditional)}hh2sbah}(h]h ]h"]h$]h&] refdomainh)reftypeh+ reftarget;/translations/zh_TW/userspace-api/media/v4l/vidioc-querybufmodnameN classnameN refexplicituh1hhh ubh)}(hhh]hItalian}hhFsbah}(h]h ]h"]h$]h&] refdomainh)reftypeh+ reftarget;/translations/it_IT/userspace-api/media/v4l/vidioc-querybufmodnameN classnameN refexplicituh1hhh ubh)}(hhh]hJapanese}hhZsbah}(h]h ]h"]h$]h&] refdomainh)reftypeh+ reftarget;/translations/ja_JP/userspace-api/media/v4l/vidioc-querybufmodnameN classnameN refexplicituh1hhh ubh)}(hhh]hKorean}hhnsbah}(h]h ]h"]h$]h&] refdomainh)reftypeh+ reftarget;/translations/ko_KR/userspace-api/media/v4l/vidioc-querybufmodnameN classnameN refexplicituh1hhh ubh)}(hhh]hSpanish}hhsbah}(h]h ]h"]h$]h&] refdomainh)reftypeh+ reftarget;/translations/sp_SP/userspace-api/media/v4l/vidioc-querybufmodnameN 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:spacepreserveuh1hhhhhhU/var/lib/git/docbuild/linux/Documentation/userspace-api/media/v4l/vidioc-querybuf.rsthKubhtarget)}(h.. _VIDIOC_QUERYBUF:h]h}(h]h ]h"]h$]h&]refidvidioc-querybufuh1hhKhhhhhhubhsection)}(hhh](htitle)}(hioctl VIDIOC_QUERYBUFh]hioctl VIDIOC_QUERYBUF}(hhhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhhhhhKubh)}(hhh](h)}(hNameh]hName}(hhhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhhhhhK ubh paragraph)}(h.VIDIOC_QUERYBUF - Query the status of a bufferh]h.VIDIOC_QUERYBUF - Query the status of a buffer}(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_QUERYBUF (C macro)c.V4L.VIDIOC_QUERYBUFhNtauh1jhjhhhNhNubhdesc)}(hhh](hdesc_signature)}(hVIDIOC_QUERYBUFh]hdesc_signature_line)}(hVIDIOC_QUERYBUFh]h desc_name)}(hVIDIOC_QUERYBUFh]h desc_sig_name)}(hj+h]hVIDIOC_QUERYBUF}(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_QUERYBUF, struct v4l2_buffer *argp)``h]hliteral)}(hjh]h` I/O method. It can be used to query the status of a buffer at any time after buffers have been allocated with the :ref:`VIDIOC_REQBUFS` ioctl.h](hThis ioctl is part of the }(hjhhhNhNubh)}(h:ref:`streaming `h]hinline)}(hjh]h streaming}(hjhhhNhNubah}(h]h ](jstdstd-refeh"]h$]h&]uh1jhjubah}(h]h ]h"]h$]h&]refdocj refdomainjreftyperef refexplicitrefwarnjmmapuh1hhhhK"hjubhs I/O method. It can be used to query the status of a buffer at any time after buffers have been allocated with the }(hjhhhNhNubh)}(h:ref:`VIDIOC_REQBUFS`h]j)}(hjh]hVIDIOC_REQBUFS}(hjhhhNhNubah}(h]h ](jstdstd-refeh"]h$]h&]uh1jhjubah}(h]h ]h"]h$]h&]refdocj refdomainjreftyperef refexplicitrefwarnjvidioc_reqbufsuh1hhhhK"hjubh ioctl.}(hjhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhK"hjhhubh)}(hX4Applications 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``, and 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 ``reserved`` and ``reserved2`` fields must be set to 0. When using the :ref:`multi-planar API `, the ``m.planes`` field must contain a userspace pointer to an array of struct :c:type:`v4l2_plane` and the ``length`` field has to be set to the number of elements in that array. After calling :ref:`VIDIOC_QUERYBUF` with a pointer to this structure drivers return an error code or fill the rest of the structure.h](hApplications set the }(hjhhhNhNubj)}(h``type``h]htype}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubh field of a struct }(hjhhhNhNubh)}(h:c:type:`v4l2_buffer`h]j)}(hjh]h v4l2_buffer}(hjhhhNhNubah}(h]h ](jjsc-typeeh"]h$]h&]uh1jhjubah}(h]h ]h"]h$]h&]refdocj refdomainjsreftypetype refexplicitrefwarnjjj v4l2_bufferuh1hhhhK&hjubh< to the same buffer type as was previously used with struct }(hjhhhNhNubh)}(h:c:type:`v4l2_format`h]j)}(hj9h]h v4l2_format}(hj;hhhNhNubah}(h]h ](jjsc-typeeh"]h$]h&]uh1jhj7ubah}(h]h ]h"]h$]h&]refdocj refdomainjsreftypetype refexplicitrefwarnjjj v4l2_formatuh1hhhhK&hjubh }(hjhhhNhNubj)}(h``type``h]htype}(hjZhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubh and struct }(hjhhhNhNubh)}(h:c:type:`v4l2_requestbuffers`h]j)}(hjnh]hv4l2_requestbuffers}(hjphhhNhNubah}(h]h ](jjsc-typeeh"]h$]h&]uh1jhjlubah}(h]h ]h"]h$]h&]refdocj refdomainjsreftypetype refexplicitrefwarnjjjv4l2_requestbuffersuh1hhhhK&hjubh }hjsbj)}(h``type``h]htype}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubh , and the }(hjhhhNhNubj)}(h ``index``h]hindex}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubhT field. Valid index numbers range from zero to the number of buffers allocated with }(hjhhhNhNubh)}(h:ref:`VIDIOC_REQBUFS`h]j)}(hjh]hVIDIOC_REQBUFS}(hjhhhNhNubah}(h]h ](jstdstd-refeh"]h$]h&]uh1jhjubah}(h]h ]h"]h$]h&]refdocj refdomainjreftyperef refexplicitrefwarnjvidioc_reqbufsuh1hhhhK&hjubh (struct }(hjhhhNhNubh)}(h:c:type:`v4l2_requestbuffers`h]j)}(hjh]hv4l2_requestbuffers}(hjhhhNhNubah}(h]h ](jjsc-typeeh"]h$]h&]uh1jhjubah}(h]h ]h"]h$]h&]refdocj refdomainjsreftypetype refexplicitrefwarnjjjv4l2_requestbuffersuh1hhhhK&hjubh }hjsbj)}(h ``count``h]hcount}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubh) minus one. The }(hjhhhNhNubj)}(h ``reserved``h]hreserved}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubh and }(hjhhhNhNubj)}(h ``reserved2``h]h reserved2}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubh) fields must be set to 0. When using the }(hjhhhNhNubh)}(h%:ref:`multi-planar API `h]j)}(hj2h]hmulti-planar API}(hj4hhhNhNubah}(h]h ](jstdstd-refeh"]h$]h&]uh1jhj0ubah}(h]h ]h"]h$]h&]refdocj refdomainj>reftyperef refexplicitrefwarnj planar-apisuh1hhhhK&hjubh, the }(hjhhhNhNubj)}(h ``m.planes``h]hm.planes}(hjThhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubh> field must contain a userspace pointer to an array of struct }(hjhhhNhNubh)}(h:c:type:`v4l2_plane`h]j)}(hjhh]h v4l2_plane}(hjjhhhNhNubah}(h]h ](jjsc-typeeh"]h$]h&]uh1jhjfubah}(h]h ]h"]h$]h&]refdocj refdomainjsreftypetype refexplicitrefwarnjjj v4l2_planeuh1hhhhK&hjubh and the }(hjhhhNhNubj)}(h ``length``h]hlength}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubhL field has to be set to the number of elements in that array. After calling }(hjhhhNhNubh)}(h:ref:`VIDIOC_QUERYBUF`h]j)}(hjh]hVIDIOC_QUERYBUF}(hjhhhNhNubah}(h]h ](jstdstd-refeh"]h$]h&]uh1jhjubah}(h]h ]h"]h$]h&]refdocj refdomainjreftyperef refexplicitrefwarnjvidioc_querybufuh1hhhhK&hjubha with a pointer to this structure drivers return an error code or fill the rest of the structure.}(hjhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhK&hjhhubh)}(hXIn the ``flags`` field the ``V4L2_BUF_FLAG_MAPPED``, ``V4L2_BUF_FLAG_PREPARED``, ``V4L2_BUF_FLAG_QUEUED`` and ``V4L2_BUF_FLAG_DONE`` flags will be valid. The ``memory`` field will be set to the current I/O method. For the single-planar API, the ``m.offset`` contains the offset of the buffer from the start of the device memory, the ``length`` field its size. For the multi-planar API, fields ``m.mem_offset`` and ``length`` in the ``m.planes`` array elements will be used instead and the ``length`` field of struct :c:type:`v4l2_buffer` is set to the number of filled-in array elements. The driver may or may not set the remaining fields and flags, they are meaningless in this context.h](hIn the }(hjhhhNhNubj)}(h ``flags``h]hflags}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubh field the }(hjhhhNhNubj)}(h``V4L2_BUF_FLAG_MAPPED``h]hV4L2_BUF_FLAG_MAPPED}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubh, }(hjhhhNhNubj)}(h``V4L2_BUF_FLAG_PREPARED``h]hV4L2_BUF_FLAG_PREPARED}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubh, }(hjhhhNhNubj)}(h``V4L2_BUF_FLAG_QUEUED``h]hV4L2_BUF_FLAG_QUEUED}(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 will be valid. The }(hjhhhNhNubj)}(h ``memory``h]hmemory}(hj'hhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubhM field will be set to the current I/O method. For the single-planar API, the }(hjhhhNhNubj)}(h ``m.offset``h]hm.offset}(hj9hhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubhL contains the offset of the buffer from the start of the device memory, the }(hjhhhNhNubj)}(h ``length``h]hlength}(hjKhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubh2 field its size. For the multi-planar API, fields }(hjhhhNhNubj)}(h``m.mem_offset``h]h m.mem_offset}(hj]hhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubh and }(hjhhhNhNubj)}(h ``length``h]hlength}(hjohhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubh in the }(hjhhhNhNubj)}(h ``m.planes``h]hm.planes}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubh- array elements will be used instead and the }(hjhhhNhNubj)}(h ``length``h]hlength}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubh field of struct }(hjhhhNhNubh)}(h:c:type:`v4l2_buffer`h]j)}(hjh]h v4l2_buffer}(hjhhhNhNubah}(h]h ](jjsc-typeeh"]h$]h&]uh1jhjubah}(h]h ]h"]h$]h&]refdocj refdomainjsreftypetype refexplicitrefwarnjjj v4l2_bufferuh1hhhhK6hjubh is set to the number of filled-in array elements. The driver may or may not set the remaining fields and flags, they are meaningless in this context.}(hjhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhK6hjhhubh)}(hIThe struct :c:type:`v4l2_buffer` structure is specified in :ref:`buffer`.h](h The struct }(hjhhhNhNubh)}(h:c:type:`v4l2_buffer`h]j)}(hjh]h v4l2_buffer}(hjhhhNhNubah}(h]h ](jjsc-typeeh"]h$]h&]uh1jhjubah}(h]h ]h"]h$]h&]refdocj refdomainjsreftypetype refexplicitrefwarnjjj v4l2_bufferuh1hhhhKBhjubh structure is specified in }(hjhhhNhNubh)}(h :ref:`buffer`h]j)}(hjh]hbuffer}(hjhhhNhNubah}(h]h ](jstdstd-refeh"]h$]h&]uh1jhjubah}(h]h ]h"]h$]h&]refdocj refdomainjreftyperef refexplicitrefwarnjbufferuh1hhhhKBhjubh.}(hjhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhKBhjhhubeh}(h] descriptionah ]h"] descriptionah$]h&]uh1hhhhhhhhK ubh)}(hhh](h)}(h Return Valueh]h Return Value}(hj.hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj+hhhhhKFubh)}(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}(hjDhhhNhNubah}(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)}(hjXh]hGeneric Error Codes}(hjZhhhNhNubah}(h]h ](jstdstd-refeh"]h$]h&]uh1jhjVubah}(h]h ]h"]h$]h&]refdocj refdomainjdreftyperef refexplicitrefwarnj gen-errorsuh1hhhhKHhj<ubh chapter.}(hj<hhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhKHhj+hhubj)}(hhh]j)}(hOEINVAL The buffer ``type`` is not supported, or the ``index`` is out of bounds.h](j)}(hEINVALh]hEINVAL}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhhhKMhjubj)}(hhh]h)}(hHThe buffer ``type`` is not supported, or the ``index`` is out of bounds.h](h The buffer }(hjhhhNhNubj)}(h``type``h]htype}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubh is not supported, or the }(hjhhhNhNubj)}(h ``index``h]hindex}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubh is out of bounds.}(hjhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhKMhjubah}(h]h ]h"]h$]h&]uh1jhjubeh}(h]h ]h"]h$]h&]uh1jhhhKMhjubah}(h]h ]h"]h$]h&]uh1jhj+hhhhhNubeh}(h] return-valueah ]h"] return valueah$]h&]uh1hhhhhhhhKFubeh}(h](ioctl-vidioc-querybufheh ]h"](ioctl vidioc_querybufvidioc_querybufeh$]h&]uh1hhhhhhhhKexpect_referenced_by_name}jhsexpect_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}(jhjjhhjjjjj(j%jju nametypes}(jjhjjj(juh}(hhjhhhjjj j)jjj%jjj+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]h5Hyperlink target "vidioc-querybuf" is not referenced.}hj~sbah}(h]h ]h"]h$]h&]uh1hhj{ubah}(h]h ]h"]h$]h&]levelKtypeINFOsourcehlineKuh1jyuba transformerN include_log] decorationNhhub.