€•(}Œsphinx.addnodes”Œdocument”“”)”}”(Œ rawsource”Œ”Œchildren”]”(Œ translations”Œ LanguagesNode”“”)”}”(hhh]”(hŒ pending_xref”“”)”}”(hhh]”Œdocutils.nodes”ŒText”“”ŒChinese (Simplified)”…””}”Œparent”hsbaŒ attributes”}”(Œids”]”Œclasses”]”Œnames”]”Œdupnames”]”Œbackrefs”]”Œ refdomain”Œstd”Œreftype”Œdoc”Œ reftarget”Œ5/translations/zh_CN/userspace-api/media/v4l/func-read”Œmodname”NŒ classname”NŒ refexplicit”ˆuŒtagname”hhh ubh)”}”(hhh]”hŒChinese (Traditional)”…””}”hh2sbah}”(h]”h ]”h"]”h$]”h&]”Œ refdomain”h)Œreftype”h+Œ reftarget”Œ5/translations/zh_TW/userspace-api/media/v4l/func-read”Œmodname”NŒ classname”NŒ refexplicit”ˆuh1hhh ubh)”}”(hhh]”hŒItalian”…””}”hhFsbah}”(h]”h ]”h"]”h$]”h&]”Œ refdomain”h)Œreftype”h+Œ reftarget”Œ5/translations/it_IT/userspace-api/media/v4l/func-read”Œmodname”NŒ classname”NŒ refexplicit”ˆuh1hhh ubh)”}”(hhh]”hŒJapanese”…””}”hhZsbah}”(h]”h ]”h"]”h$]”h&]”Œ refdomain”h)Œreftype”h+Œ reftarget”Œ5/translations/ja_JP/userspace-api/media/v4l/func-read”Œmodname”NŒ classname”NŒ refexplicit”ˆuh1hhh ubh)”}”(hhh]”hŒKorean”…””}”hhnsbah}”(h]”h ]”h"]”h$]”h&]”Œ refdomain”h)Œreftype”h+Œ reftarget”Œ5/translations/ko_KR/userspace-api/media/v4l/func-read”Œmodname”NŒ classname”NŒ refexplicit”ˆuh1hhh ubh)”}”(hhh]”hŒPortuguese (Brazilian)”…””}”hh‚sbah}”(h]”h ]”h"]”h$]”h&]”Œ refdomain”h)Œreftype”h+Œ reftarget”Œ5/translations/pt_BR/userspace-api/media/v4l/func-read”Œmodname”NŒ classname”NŒ refexplicit”ˆuh1hhh ubh)”}”(hhh]”hŒSpanish”…””}”hh–sbah}”(h]”h ]”h"]”h$]”h&]”Œ refdomain”h)Œreftype”h+Œ reftarget”Œ5/translations/sp_SP/userspace-api/media/v4l/func-read”Œmodname”NŒ classname”NŒ refexplicit”ˆuh1hhh ubeh}”(h]”h ]”h"]”h$]”h&]”Œcurrent_language”ŒEnglish”uh1h hhŒ _document”hŒsource”NŒline”NubhŒcomment”“”)”}”(hŒ8SPDX-License-Identifier: GFDL-1.1-no-invariants-or-later”h]”hŒ8SPDX-License-Identifier: GFDL-1.1-no-invariants-or-later”…””}”hh·sbah}”(h]”h ]”h"]”h$]”h&]”Œ xml:space”Œpreserve”uh1hµhhh²hh³ŒO/var/lib/git/docbuild/linux/Documentation/userspace-api/media/v4l/func-read.rst”h´KubhŒtarget”“”)”}”(hŒ.. _func-read:”h]”h}”(h]”h ]”h"]”h$]”h&]”Œrefid”Œ func-read”uh1hÈh´Khhh²hh³hÇubhŒsection”“”)”}”(hhh]”(hŒtitle”“”)”}”(hŒ V4L2 read()”h]”hŒ V4L2 read()”…””}”(hhÝh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÛhhØh²hh³hÇh´Kubh×)”}”(hhh]”(hÜ)”}”(hŒName”h]”hŒName”…””}”(hhîh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÛhhëh²hh³hÇh´K ubhŒ paragraph”“”)”}”(hŒ#v4l2-read - Read from a V4L2 device”h]”hŒ#v4l2-read - Read from a V4L2 device”…””}”(hhþh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hüh³hÇh´K hhëh²hubeh}”(h]”Œname”ah ]”h"]”Œname”ah$]”h&]”uh1hÖhhØh²hh³hÇh´K ubh×)”}”(hhh]”(hÜ)”}”(hŒSynopsis”h]”hŒSynopsis”…””}”(hjh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÛhjh²hh³hÇh´KubhŒ literal_block”“”)”}”(hŒ#include ”h]”hŒ#include ”…””}”hj'sbah}”(h]”h ]”h"]”h$]”h&]”hÅhÆŒforce”‰Œlanguage”Œc”Œhighlight_args”}”uh1j%h³hÇh´Khjh²hubhŒindex”“”)”}”(hhh]”h}”(h]”h ]”h"]”h$]”h&]”Œentries”]”(Œsingle”ŒV4L.read (C function)”Œ c.V4L.read”hNt”auh1j:hjh²hh³Nh´NubhŒdesc”“”)”}”(hhh]”(hŒdesc_signature”“”)”}”(hŒ/ssize_t read( int fd, void *buf, size_t count )”h]”hŒdesc_signature_line”“”)”}”(hŒ-ssize_t read(int fd, void *buf, size_t count)”h]”(h)”}”(hhh]”hŒ desc_sig_name”“”)”}”(hŒssize_t”h]”hŒssize_t”…””}”(hjah²hh³Nh´Nubah}”(h]”h ]”Œn”ah"]”h$]”h&]”uh1j_hj\ubah}”(h]”h ]”h"]”h$]”h&]”Œ refdomain”j7Œreftype”Œ identifier”Œ reftarget”jcŒmodname”NŒ classname”NŒ c:parent_key”Œsphinx.domains.c”Œ LookupKey”“”)”}”Œdata”]”(j}Œ ASTIdentifier”“”)”}”jxŒV4L”sbN†”j…)”}”jxŒread”sbŒ c.V4L.read”†”esbuh1hhjXh²hh³hÇh´KubhŒdesc_sig_space”“”)”}”(hŒ ”h]”hŒ ”…””}”(hj‘h²hh³Nh´Nubah}”(h]”h ]”Œw”ah"]”h$]”h&]”uh1jhjXh²hh³hÇh´KubhŒ desc_name”“”)”}”(hŒread”h]”j`)”}”(hjŒh]”hŒread”…””}”(hj¦h²hh³Nh´Nubah}”(h]”h ]”jlah"]”h$]”h&]”uh1j_hj¢ubah}”(h]”h ]”(Œsig-name”Œdescname”eh"]”h$]”h&]”hÅhÆuh1j hjXh²hh³hÇh´KubhŒdesc_parameterlist”“”)”}”(hŒ!(int fd, void *buf, size_t count)”h]”(hŒdesc_parameter”“”)”}”(hŒint fd”h]”(hŒdesc_sig_keyword_type”“”)”}”(hŒint”h]”hŒint”…””}”(hjÉh²hh³Nh´Nubah}”(h]”h ]”Œkt”ah"]”h$]”h&]”uh1jÇhjÃubj)”}”(hŒ ”h]”hŒ ”…””}”(hjØh²hh³Nh´Nubah}”(h]”h ]”jœah"]”h$]”h&]”uh1jhjÃubj`)”}”(hŒfd”h]”hŒfd”…””}”(hjæh²hh³Nh´Nubah}”(h]”h ]”jlah"]”h$]”h&]”uh1j_hjÃubeh}”(h]”h ]”h"]”h$]”h&]”Œnoemph”ˆhÅhÆuh1jÁhj½ubjÂ)”}”(hŒ void *buf”h]”(jÈ)”}”(hŒvoid”h]”hŒvoid”…””}”(hjÿh²hh³Nh´Nubah}”(h]”h ]”jÔah"]”h$]”h&]”uh1jÇhjûubj)”}”(hŒ ”h]”hŒ ”…””}”(hj h²hh³Nh´Nubah}”(h]”h ]”jœah"]”h$]”h&]”uh1jhjûubhŒdesc_sig_punctuation”“”)”}”(hŒ*”h]”hŒ*”…””}”(hjh²hh³Nh´Nubah}”(h]”h ]”Œp”ah"]”h$]”h&]”uh1jhjûubj`)”}”(hŒbuf”h]”hŒbuf”…””}”(hj,h²hh³Nh´Nubah}”(h]”h ]”jlah"]”h$]”h&]”uh1j_hjûubeh}”(h]”h ]”h"]”h$]”h&]”Œnoemph”ˆhÅhÆuh1jÁhj½ubjÂ)”}”(hŒ size_t count”h]”(h)”}”(hhh]”j`)”}”(hŒsize_t”h]”hŒsize_t”…””}”(hjHh²hh³Nh´Nubah}”(h]”h ]”jlah"]”h$]”h&]”uh1j_hjEubah}”(h]”h ]”h"]”h$]”h&]”Œ refdomain”j7Œreftype”jxŒ reftarget”jJŒmodname”NŒ classname”Nj|j)”}”j‚]”(j†N†”jŠŒ c.V4L.read”†”esbuh1hhjAubj)”}”(hŒ ”h]”hŒ ”…””}”(hjgh²hh³Nh´Nubah}”(h]”h ]”jœah"]”h$]”h&]”uh1jhjAubj`)”}”(hŒcount”h]”hŒcount”…””}”(hjuh²hh³Nh´Nubah}”(h]”h ]”jlah"]”h$]”h&]”uh1j_hjAubeh}”(h]”h ]”h"]”h$]”h&]”Œnoemph”ˆhÅhÆuh1jÁhj½ubeh}”(h]”h ]”h"]”h$]”h&]”hÅhÆuh1j»hjXh²hh³hÇh´Kubeh}”(h]”h ]”h"]”h$]”h&]”hÅhÆŒ add_permalink”ˆuh1jVŒsphinx_line_type”Œ declarator”hjRh²hh³hÇh´Kubah}”(h]”jIah ]”(Œsig”Œ sig-object”eh"]”h$]”h&]”Œ is_multiline”ˆŒ _toc_parts”)Œ _toc_name”huh1jPh³hÇh´KhjMh²hubhŒ desc_content”“”)”}”(hhh]”h}”(h]”h ]”h"]”h$]”h&]”uh1j¤hjMh²hh³hÇh´Kubeh}”(h]”h ]”(j7Œfunction”eh"]”h$]”h&]”Œdomain”j7Œobjtype”j²Œdesctype”j²Œnoindex”‰Œ noindexentry”‰Œnocontentsentry”‰uh1jKh²hhjh³Nh´Nubeh}”(h]”Œsynopsis”ah ]”h"]”Œsynopsis”ah$]”h&]”uh1hÖhhØh²hh³hÇh´Kubh×)”}”(hhh]”(hÜ)”}”(hŒ Arguments”h]”hŒ Arguments”…””}”(hjÇh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÛhjÄh²hh³hÇh´KubhŒdefinition_list”“”)”}”(hhh]”(hŒdefinition_list_item”“”)”}”(hŒ5``fd`` File descriptor returned by :c:func:`open()`. ”h]”(hŒterm”“”)”}”(hŒ``fd``”h]”hŒliteral”“”)”}”(hjäh]”hŒfd”…””}”(hjèh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jæhjâubah}”(h]”h ]”h"]”h$]”h&]”uh1jàh³hÇh´KhjÜubhŒ definition”“”)”}”(hhh]”hý)”}”(hŒ-File descriptor returned by :c:func:`open()`.”h]”(hŒFile descriptor returned by ”…””}”(hjh²hh³Nh´Nubh)”}”(hŒ:c:func:`open()`”h]”jç)”}”(hj h]”hŒopen()”…””}”(hj h²hh³Nh´Nubah}”(h]”h ]”(Œxref”j7Œc-func”eh"]”h$]”h&]”uh1jæhjubah}”(h]”h ]”h"]”h$]”h&]”Œrefdoc”Œ!userspace-api/media/v4l/func-read”Œ refdomain”j7Œreftype”Œfunc”Œ refexplicit”‰Œrefwarn”‰j|j)”}”j‚]”j†N†”asbŒ reftarget”Œopen”uh1hh³hÇh´KhjubhŒ.”…””}”(hjh²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1hüh³hÇh´Khjýubah}”(h]”h ]”h"]”h$]”h&]”uh1jûhjÜubeh}”(h]”h ]”h"]”h$]”h&]”uh1jÚh³hÇh´Khj×ubjÛ)”}”(hŒ``buf`` Buffer to be filled ”h]”(já)”}”(hŒ``buf``”h]”jç)”}”(hjJh]”hŒbuf”…””}”(hjLh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jæhjHubah}”(h]”h ]”h"]”h$]”h&]”uh1jàh³hÇh´KhjDubjü)”}”(hhh]”hý)”}”(hŒBuffer to be filled”h]”hŒBuffer to be filled”…””}”(hjbh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hüh³hÇh´Khj_ubah}”(h]”h ]”h"]”h$]”h&]”uh1jûhjDubeh}”(h]”h ]”h"]”h$]”h&]”uh1jÚh³hÇh´Khj×h²hubjÛ)”}”(hŒ&``count`` Max number of bytes to read ”h]”(já)”}”(hŒ ``count``”h]”jç)”}”(hj‚h]”hŒcount”…””}”(hj„h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jæhj€ubah}”(h]”h ]”h"]”h$]”h&]”uh1jàh³hÇh´K"hj|ubjü)”}”(hhh]”hý)”}”(hŒMax number of bytes to read”h]”hŒMax number of bytes to read”…””}”(hjšh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hüh³hÇh´K"hj—ubah}”(h]”h ]”h"]”h$]”h&]”uh1jûhj|ubeh}”(h]”h ]”h"]”h$]”h&]”uh1jÚh³hÇh´K"hj×h²hubeh}”(h]”h ]”h"]”h$]”h&]”uh1jÕhjÄh²hh³hÇh´Nubeh}”(h]”Œ arguments”ah ]”h"]”Œ arguments”ah$]”h&]”uh1hÖhhØh²hh³hÇh´Kubh×)”}”(hhh]”(hÜ)”}”(hŒ Description”h]”hŒ Description”…””}”(hjÅh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÛhjÂh²hh³hÇh´K%ubhý)”}”(hXë:c:func:`read()` attempts to read up to ``count`` bytes from file descriptor ``fd`` into the buffer starting at ``buf``. The layout of the data in the buffer is discussed in the respective device interface section, see ##. If ``count`` is zero, :c:func:`read()` returns zero and has no other results. If ``count`` is greater than ``SSIZE_MAX``, the result is unspecified. Regardless of the ``count`` value each :c:func:`read()` call will provide at most one frame (two fields) worth of data.”h]”(h)”}”(hŒ:c:func:`read()`”h]”jç)”}”(hjÙh]”hŒread()”…””}”(hjÛh²hh³Nh´Nubah}”(h]”h ]”(jj7Œc-func”eh"]”h$]”h&]”uh1jæhj×ubah}”(h]”h ]”h"]”h$]”h&]”Œrefdoc”j"Œ refdomain”j7Œreftype”Œfunc”Œ refexplicit”‰Œrefwarn”‰j|j(j,Œread”uh1hh³hÇh´K'hjÓubhŒ attempts to read up to ”…””}”(hjÓh²hh³Nh´Nubjç)”}”(hŒ ``count``”h]”hŒcount”…””}”(hjúh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jæhjÓubhŒ bytes from file descriptor ”…””}”(hjÓh²hh³Nh´Nubjç)”}”(hŒ``fd``”h]”hŒfd”…””}”(hj h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jæhjÓubhŒ into the buffer starting at ”…””}”(hjÓh²hh³Nh´Nubjç)”}”(hŒ``buf``”h]”hŒbuf”…””}”(hjh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jæhjÓubhŒk. The layout of the data in the buffer is discussed in the respective device interface section, see ##. If ”…””}”(hjÓh²hh³Nh´Nubjç)”}”(hŒ ``count``”h]”hŒcount”…””}”(hj0h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jæhjÓubhŒ is zero, ”…””}”(hjÓh²hh³Nh´Nubh)”}”(hŒ:c:func:`read()`”h]”jç)”}”(hjDh]”hŒread()”…””}”(hjFh²hh³Nh´Nubah}”(h]”h ]”(jj7Œc-func”eh"]”h$]”h&]”uh1jæhjBubah}”(h]”h ]”h"]”h$]”h&]”Œrefdoc”j"Œ refdomain”j7Œreftype”Œfunc”Œ refexplicit”‰Œrefwarn”‰j|j(j,Œread”uh1hh³hÇh´K'hjÓubhŒ+ returns zero and has no other results. If ”…””}”(hjÓh²hh³Nh´Nubjç)”}”(hŒ ``count``”h]”hŒcount”…””}”(hjeh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jæhjÓubhŒ is greater than ”…””}”(hjÓh²hh³Nh´Nubjç)”}”(hŒ ``SSIZE_MAX``”h]”hŒ SSIZE_MAX”…””}”(hjwh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jæhjÓubhŒ/, the result is unspecified. Regardless of the ”…””}”(hjÓh²hh³Nh´Nubjç)”}”(hŒ ``count``”h]”hŒcount”…””}”(hj‰h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jæhjÓubhŒ value each ”…””}”(hjÓh²hh³Nh´Nubh)”}”(hŒ:c:func:`read()`”h]”jç)”}”(hjh]”hŒread()”…””}”(hjŸh²hh³Nh´Nubah}”(h]”h ]”(jj7Œc-func”eh"]”h$]”h&]”uh1jæhj›ubah}”(h]”h ]”h"]”h$]”h&]”Œrefdoc”j"Œ refdomain”j7Œreftype”Œfunc”Œ refexplicit”‰Œrefwarn”‰j|j(j,Œread”uh1hh³hÇh´K'hjÓubhŒ@ call will provide at most one frame (two fields) worth of data.”…””}”(hjÓh²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1hüh³hÇh´K'hjÂh²hubhý)”}”(hXÃBy default :c:func:`read()` blocks until data becomes available. When the ``O_NONBLOCK`` flag was given to the :c:func:`open()` function it returns immediately with an ``EAGAIN`` error code when no data is available. The :c:func:`select()` or :c:func:`poll()` functions can always be used to suspend execution until data becomes available. All drivers supporting the :c:func:`read()` function must also support :c:func:`select()` and :c:func:`poll()`.”h]”(hŒ By default ”…””}”(hjÄh²hh³Nh´Nubh)”}”(hŒ:c:func:`read()`”h]”jç)”}”(hjÎh]”hŒread()”…””}”(hjÐh²hh³Nh´Nubah}”(h]”h ]”(jj7Œc-func”eh"]”h$]”h&]”uh1jæhjÌubah}”(h]”h ]”h"]”h$]”h&]”Œrefdoc”j"Œ refdomain”j7Œreftype”Œfunc”Œ refexplicit”‰Œrefwarn”‰j|j(j,Œread”uh1hh³hÇh´K0hjÄubhŒ/ blocks until data becomes available. When the ”…””}”(hjÄh²hh³Nh´Nubjç)”}”(hŒ``O_NONBLOCK``”h]”hŒ O_NONBLOCK”…””}”(hjïh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jæhjÄubhŒ flag was given to the ”…””}”(hjÄh²hh³Nh´Nubh)”}”(hŒ:c:func:`open()`”h]”jç)”}”(hjh]”hŒopen()”…””}”(hjh²hh³Nh´Nubah}”(h]”h ]”(jj7Œc-func”eh"]”h$]”h&]”uh1jæhjubah}”(h]”h ]”h"]”h$]”h&]”Œrefdoc”j"Œ refdomain”j7Œreftype”Œfunc”Œ refexplicit”‰Œrefwarn”‰j|j(j,Œopen”uh1hh³hÇh´K0hjÄubhŒ) function it returns immediately with an ”…””}”(hjÄh²hh³Nh´Nubjç)”}”(hŒ ``EAGAIN``”h]”hŒEAGAIN”…””}”(hj$h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jæhjÄubhŒ+ error code when no data is available. The ”…””}”(hjÄh²hh³Nh´Nubh)”}”(hŒ:c:func:`select()`”h]”jç)”}”(hj8h]”hŒselect()”…””}”(hj:h²hh³Nh´Nubah}”(h]”h ]”(jj7Œc-func”eh"]”h$]”h&]”uh1jæhj6ubah}”(h]”h ]”h"]”h$]”h&]”Œrefdoc”j"Œ refdomain”j7Œreftype”Œfunc”Œ refexplicit”‰Œrefwarn”‰j|j(j,Œselect”uh1hh³hÇh´K0hjÄubhŒ or ”…””}”(hjÄh²hh³Nh´Nubh)”}”(hŒ:c:func:`poll()`”h]”jç)”}”(hj[h]”hŒpoll()”…””}”(hj]h²hh³Nh´Nubah}”(h]”h ]”(jj7Œc-func”eh"]”h$]”h&]”uh1jæhjYubah}”(h]”h ]”h"]”h$]”h&]”Œrefdoc”j"Œ refdomain”j7Œreftype”Œfunc”Œ refexplicit”‰Œrefwarn”‰j|j(j,Œpoll”uh1hh³hÇh´K0hjÄubhŒl functions can always be used to suspend execution until data becomes available. All drivers supporting the ”…””}”(hjÄh²hh³Nh´Nubh)”}”(hŒ:c:func:`read()`”h]”jç)”}”(hj~h]”hŒread()”…””}”(hj€h²hh³Nh´Nubah}”(h]”h ]”(jj7Œc-func”eh"]”h$]”h&]”uh1jæhj|ubah}”(h]”h ]”h"]”h$]”h&]”Œrefdoc”j"Œ refdomain”j7Œreftype”Œfunc”Œ refexplicit”‰Œrefwarn”‰j|j(j,Œread”uh1hh³hÇh´K0hjÄubhŒ function must also support ”…””}”(hjÄh²hh³Nh´Nubh)”}”(hŒ:c:func:`select()`”h]”jç)”}”(hj¡h]”hŒselect()”…””}”(hj£h²hh³Nh´Nubah}”(h]”h ]”(jj7Œc-func”eh"]”h$]”h&]”uh1jæhjŸubah}”(h]”h ]”h"]”h$]”h&]”Œrefdoc”j"Œ refdomain”j7Œreftype”Œfunc”Œ refexplicit”‰Œrefwarn”‰j|j(j,Œselect”uh1hh³hÇh´K0hjÄubhŒ and ”…””}”(hjÄh²hh³Nh´Nubh)”}”(hŒ:c:func:`poll()`”h]”jç)”}”(hjÄh]”hŒpoll()”…””}”(hjÆh²hh³Nh´Nubah}”(h]”h ]”(jj7Œc-func”eh"]”h$]”h&]”uh1jæhjÂubah}”(h]”h ]”h"]”h$]”h&]”Œrefdoc”j"Œ refdomain”j7Œreftype”Œfunc”Œ refexplicit”‰Œrefwarn”‰j|j(j,Œpoll”uh1hh³hÇh´K0hjÄubhŒ.”…””}”(hjÄh²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1hüh³hÇh´K0hjÂh²hubhý)”}”(hŒ¯Drivers can implement read functionality in different ways, using a single or multiple buffers and discarding the oldest or newest frames once the internal buffers are filled.”h]”hŒ¯Drivers can implement read functionality in different ways, using a single or multiple buffers and discarding the oldest or newest frames once the internal buffers are filled.”…””}”(hjëh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hüh³hÇh´K9hjÂh²hubhý)”}”(hXh:c:func:`read()` never returns a "snapshot" of a buffer being filled. Using a single buffer the driver will stop capturing when the application starts reading the buffer until the read is finished. Thus only the period of the vertical blanking interval is available for reading, or the capture rate must fall below the nominal frame rate of the video standard.”h]”(h)”}”(hŒ:c:func:`read()`”h]”jç)”}”(hjÿh]”hŒread()”…””}”(hjh²hh³Nh´Nubah}”(h]”h ]”(jj7Œc-func”eh"]”h$]”h&]”uh1jæhjýubah}”(h]”h ]”h"]”h$]”h&]”Œrefdoc”j"Œ refdomain”j7Œreftype”Œfunc”Œ refexplicit”‰Œrefwarn”‰j|j(j,Œread”uh1hh³hÇh´K=hjùubhX\ never returns a “snapshot†of a buffer being filled. Using a single buffer the driver will stop capturing when the application starts reading the buffer until the read is finished. Thus only the period of the vertical blanking interval is available for reading, or the capture rate must fall below the nominal frame rate of the video standard.”…””}”(hjùh²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1hüh³hÇh´K=hjÂh²hubhý)”}”(hXThe behavior of :c:func:`read()` when called during the active picture period or the vertical blanking separating the top and bottom field depends on the discarding policy. A driver discarding the oldest frames keeps capturing into an internal buffer, continuously overwriting the previously, not read frame, and returns the frame being received at the time of the :c:func:`read()` call as soon as it is complete.”h]”(hŒThe behavior of ”…””}”(hj&h²hh³Nh´Nubh)”}”(hŒ:c:func:`read()`”h]”jç)”}”(hj0h]”hŒread()”…””}”(hj2h²hh³Nh´Nubah}”(h]”h ]”(jj7Œc-func”eh"]”h$]”h&]”uh1jæhj.ubah}”(h]”h ]”h"]”h$]”h&]”Œrefdoc”j"Œ refdomain”j7Œreftype”Œfunc”Œ refexplicit”‰Œrefwarn”‰j|j(j,Œread”uh1hh³hÇh´KDhj&ubhXM when called during the active picture period or the vertical blanking separating the top and bottom field depends on the discarding policy. A driver discarding the oldest frames keeps capturing into an internal buffer, continuously overwriting the previously, not read frame, and returns the frame being received at the time of the ”…””}”(hj&h²hh³Nh´Nubh)”}”(hŒ:c:func:`read()`”h]”jç)”}”(hjSh]”hŒread()”…””}”(hjUh²hh³Nh´Nubah}”(h]”h ]”(jj7Œc-func”eh"]”h$]”h&]”uh1jæhjQubah}”(h]”h ]”h"]”h$]”h&]”Œrefdoc”j"Œ refdomain”j7Œreftype”Œfunc”Œ refexplicit”‰Œrefwarn”‰j|j(j,Œread”uh1hh³hÇh´KDhj&ubhŒ call as soon as it is complete.”…””}”(hj&h²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1hüh³hÇh´KDhjÂh²hubhý)”}”(hXÍA driver discarding the newest frames stops capturing until the next :c:func:`read()` call. The frame being received at :c:func:`read()` time is discarded, returning the following frame instead. Again this implies a reduction of the capture rate to one half or less of the nominal frame rate. An example of this model is the video read mode of the bttv driver, initiating a DMA to user memory when :c:func:`read()` is called and returning when the DMA finished.”h]”(hŒEA driver discarding the newest frames stops capturing until the next ”…””}”(hjzh²hh³Nh´Nubh)”}”(hŒ:c:func:`read()`”h]”jç)”}”(hj„h]”hŒread()”…””}”(hj†h²hh³Nh´Nubah}”(h]”h ]”(jj7Œc-func”eh"]”h$]”h&]”uh1jæhj‚ubah}”(h]”h ]”h"]”h$]”h&]”Œrefdoc”j"Œ refdomain”j7Œreftype”Œfunc”Œ refexplicit”‰Œrefwarn”‰j|j(j,Œread”uh1hh³hÇh´KKhjzubhŒ# call. The frame being received at ”…””}”(hjzh²hh³Nh´Nubh)”}”(hŒ:c:func:`read()`”h]”jç)”}”(hj§h]”hŒread()”…””}”(hj©h²hh³Nh´Nubah}”(h]”h ]”(jj7Œc-func”eh"]”h$]”h&]”uh1jæhj¥ubah}”(h]”h ]”h"]”h$]”h&]”Œrefdoc”j"Œ refdomain”j7Œreftype”Œfunc”Œ refexplicit”‰Œrefwarn”‰j|j(j,Œread”uh1hh³hÇh´KKhjzubhX time is discarded, returning the following frame instead. Again this implies a reduction of the capture rate to one half or less of the nominal frame rate. An example of this model is the video read mode of the bttv driver, initiating a DMA to user memory when ”…””}”(hjzh²hh³Nh´Nubh)”}”(hŒ:c:func:`read()`”h]”jç)”}”(hjÊh]”hŒread()”…””}”(hjÌh²hh³Nh´Nubah}”(h]”h ]”(jj7Œc-func”eh"]”h$]”h&]”uh1jæhjÈubah}”(h]”h ]”h"]”h$]”h&]”Œrefdoc”j"Œ refdomain”j7Œreftype”Œfunc”Œ refexplicit”‰Œrefwarn”‰j|j(j,Œread”uh1hh³hÇh´KKhjzubhŒ/ is called and returning when the DMA finished.”…””}”(hjzh²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1hüh³hÇh´KKhjÂh²hubhý)”}”(hX2In the multiple buffer model drivers maintain a ring of internal buffers, automatically advancing to the next free buffer. This allows continuous capturing when the application can empty the buffers fast enough. Again, the behavior when the driver runs out of free buffers depends on the discarding policy.”h]”hX2In the multiple buffer model drivers maintain a ring of internal buffers, automatically advancing to the next free buffer. This allows continuous capturing when the application can empty the buffers fast enough. Again, the behavior when the driver runs out of free buffers depends on the discarding policy.”…””}”(hjñh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hüh³hÇh´KShjÂh²hubhý)”}”(hX5Applications can get and set the number of buffers used internally by the driver with the :ref:`VIDIOC_G_PARM ` and :ref:`VIDIOC_S_PARM ` ioctls. They are optional, however. The discarding policy is not reported and cannot be changed. For minimum requirements see :ref:`devices`.”h]”(hŒZApplications can get and set the number of buffers used internally by the driver with the ”…””}”(hjÿh²hh³Nh´Nubh)”}”(hŒ$:ref:`VIDIOC_G_PARM `”h]”hŒinline”“”)”}”(hj h]”hŒ VIDIOC_G_PARM”…””}”(hj h²hh³Nh´Nubah}”(h]”h ]”(jŒstd”Œstd-ref”eh"]”h$]”h&]”uh1j hjubah}”(h]”h ]”h"]”h$]”h&]”Œrefdoc”j"Œ refdomain”jŒreftype”Œref”Œ refexplicit”ˆŒrefwarn”ˆj,Œ vidioc_g_parm”uh1hh³hÇh´KYhjÿubhŒ and ”…””}”(hjÿh²hh³Nh´Nubh)”}”(hŒ$:ref:`VIDIOC_S_PARM `”h]”j )”}”(hj/h]”hŒ VIDIOC_S_PARM”…””}”(hj1h²hh³Nh´Nubah}”(h]”h ]”(jŒstd”Œstd-ref”eh"]”h$]”h&]”uh1j hj-ubah}”(h]”h ]”h"]”h$]”h&]”Œrefdoc”j"Œ refdomain”j;Œreftype”Œref”Œ refexplicit”ˆŒrefwarn”ˆj,Œ vidioc_g_parm”uh1hh³hÇh´KYhjÿubhŒ ioctls. They are optional, however. The discarding policy is not reported and cannot be changed. For minimum requirements see ”…””}”(hjÿh²hh³Nh´Nubh)”}”(hŒ:ref:`devices`”h]”j )”}”(hjSh]”hŒdevices”…””}”(hjUh²hh³Nh´Nubah}”(h]”h ]”(jŒstd”Œstd-ref”eh"]”h$]”h&]”uh1j hjQubah}”(h]”h ]”h"]”h$]”h&]”Œrefdoc”j"Œ refdomain”j_Œreftype”Œref”Œ refexplicit”‰Œrefwarn”ˆj,Œdevices”uh1hh³hÇh´KYhjÿubhŒ.”…””}”(hjÿh²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1hüh³hÇh´KYhjÂh²hubeh}”(h]”Œ description”ah ]”h"]”Œ description”ah$]”h&]”uh1hÖhhØh²hh³hÇh´K%ubh×)”}”(hhh]”(hÜ)”}”(hŒ Return Value”h]”hŒ Return Value”…””}”(hj†h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÛhjƒh²hh³hÇh´K`ubhý)”}”(hX®On success, the number of bytes read is returned. It is not an error if this number is smaller than the number of bytes requested, or the amount of data required for one frame. This may happen for example because :c:func:`read()` was interrupted by a signal. On error, -1 is returned, and the ``errno`` variable is set appropriately. In this case the next read will start at the beginning of a new frame. Possible error codes are:”h]”(hŒÕOn success, the number of bytes read is returned. It is not an error if this number is smaller than the number of bytes requested, or the amount of data required for one frame. This may happen for example because ”…””}”(hj”h²hh³Nh´Nubh)”}”(hŒ:c:func:`read()`”h]”jç)”}”(hjžh]”hŒread()”…””}”(hj h²hh³Nh´Nubah}”(h]”h ]”(jj7Œc-func”eh"]”h$]”h&]”uh1jæhjœubah}”(h]”h ]”h"]”h$]”h&]”Œrefdoc”j"Œ refdomain”j7Œreftype”Œfunc”Œ refexplicit”‰Œrefwarn”‰j|j(j,Œread”uh1hh³hÇh´Kbhj”ubhŒ@ was interrupted by a signal. On error, -1 is returned, and the ”…””}”(hj”h²hh³Nh´Nubjç)”}”(hŒ ``errno``”h]”hŒerrno”…””}”(hj¿h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jæhj”ubhŒ€ variable is set appropriately. In this case the next read will start at the beginning of a new frame. Possible error codes are:”…””}”(hj”h²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1hüh³hÇh´Kbhjƒh²hubjÖ)”}”(hhh]”(jÛ)”}”(hŒnEAGAIN Non-blocking I/O has been selected using O_NONBLOCK and no data was immediately available for reading. ”h]”(já)”}”(hŒEAGAIN”h]”hŒEAGAIN”…””}”(hjÞh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jàh³hÇh´KlhjÚubjü)”}”(hhh]”hý)”}”(hŒfNon-blocking I/O has been selected using O_NONBLOCK and no data was immediately available for reading.”h]”hŒfNon-blocking I/O has been selected using O_NONBLOCK and no data was immediately available for reading.”…””}”(hjïh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hüh³hÇh´Kkhjìubah}”(h]”h ]”h"]”h$]”h&]”uh1jûhjÚubeh}”(h]”h ]”h"]”h$]”h&]”uh1jÚh³hÇh´Klhj×ubjÛ)”}”(hŒ…EBADF ``fd`` is not a valid file descriptor or is not open for reading, or the process already has the maximum number of files open. ”h]”(já)”}”(hŒEBADF”h]”hŒEBADF”…””}”(hj h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jàh³hÇh´Kphj ubjü)”}”(hhh]”hý)”}”(hŒ~``fd`` is not a valid file descriptor or is not open for reading, or the process already has the maximum number of files open.”h]”(jç)”}”(hŒ``fd``”h]”hŒfd”…””}”(hj"h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jæhjubhŒx is not a valid file descriptor or is not open for reading, or the process already has the maximum number of files open.”…””}”(hjh²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1hüh³hÇh´Kohjubah}”(h]”h ]”h"]”h$]”h&]”uh1jûhj ubeh}”(h]”h ]”h"]”h$]”h&]”uh1jÚh³hÇh´Kphj×h²hubjÛ)”}”(hŒZEBUSY The driver does not support multiple read streams and the device is already in use. ”h]”(já)”}”(hŒEBUSY”h]”hŒEBUSY”…””}”(hjJh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jàh³hÇh´KthjFubjü)”}”(hhh]”hý)”}”(hŒSThe driver does not support multiple read streams and the device is already in use.”h]”hŒSThe driver does not support multiple read streams and the device is already in use.”…””}”(hj[h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hüh³hÇh´KshjXubah}”(h]”h ]”h"]”h$]”h&]”uh1jûhjFubeh}”(h]”h ]”h"]”h$]”h&]”uh1jÚh³hÇh´Kthj×h²hubjÛ)”}”(hŒ7EFAULT ``buf`` references an inaccessible memory area. ”h]”(já)”}”(hŒEFAULT”h]”hŒEFAULT”…””}”(hjyh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jàh³hÇh´Kwhjuubjü)”}”(hhh]”hý)”}”(hŒ/``buf`` references an inaccessible memory area.”h]”(jç)”}”(hŒ``buf``”h]”hŒbuf”…””}”(hjŽh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jæhjŠubhŒ( references an inaccessible memory area.”…””}”(hjŠh²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1hüh³hÇh´Kwhj‡ubah}”(h]”h ]”h"]”h$]”h&]”uh1jûhjuubeh}”(h]”h ]”h"]”h$]”h&]”uh1jÚh³hÇh´Kwhj×h²hubjÛ)”}”(hŒEEINTR The call was interrupted by a signal before any data was read. ”h]”(já)”}”(hŒEINTR”h]”hŒEINTR”…””}”(hj¶h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jàh³hÇh´Kzhj²ubjü)”}”(hhh]”hý)”}”(hŒ>The call was interrupted by a signal before any data was read.”h]”hŒ>The call was interrupted by a signal before any data was read.”…””}”(hjÇh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hüh³hÇh´KzhjÄubah}”(h]”h ]”h"]”h$]”h&]”uh1jûhj²ubeh}”(h]”h ]”h"]”h$]”h&]”uh1jÚh³hÇh´Kzhj×h²hubjÛ)”}”(hŒxEIO I/O error. This indicates some hardware problem or a failure to communicate with a remote device (USB camera etc.). ”h]”(já)”}”(hŒEIO”h]”hŒEIO”…””}”(hjåh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jàh³hÇh´K~hjáubjü)”}”(hhh]”hý)”}”(hŒsI/O error. This indicates some hardware problem or a failure to communicate with a remote device (USB camera etc.).”h]”hŒsI/O error. This indicates some hardware problem or a failure to communicate with a remote device (USB camera etc.).”…””}”(hjöh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hüh³hÇh´K}hjóubah}”(h]”h ]”h"]”h$]”h&]”uh1jûhjáubeh}”(h]”h ]”h"]”h$]”h&]”uh1jÚh³hÇh´K~hj×h²hubjÛ)”}”(hŒ‚EINVAL The :c:func:`read()` function is not supported by this driver, not on this device, or generally not on this type of device.”h]”(já)”}”(hŒEINVAL”h]”hŒEINVAL”…””}”(hj h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jàh³hÇh´Khj ubjü)”}”(hhh]”hý)”}”(hŒ{The :c:func:`read()` function is not supported by this driver, not on this device, or generally not on this type of device.”h]”(hŒThe ”…””}”(hj% h²hh³Nh´Nubh)”}”(hŒ:c:func:`read()`”h]”jç)”}”(hj/ h]”hŒread()”…””}”(hj1 h²hh³Nh´Nubah}”(h]”h ]”(jj7Œc-func”eh"]”h$]”h&]”uh1jæhj- ubah}”(h]”h ]”h"]”h$]”h&]”Œrefdoc”j"Œ refdomain”j7Œreftype”Œfunc”Œ refexplicit”‰Œrefwarn”‰j|j(j,Œread”uh1hh³hÇh´Khj% ubhŒg function is not supported by this driver, not on this device, or generally not on this type of device.”…””}”(hj% h²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1hüh³hÇh´Khj" ubah}”(h]”h ]”h"]”h$]”h&]”uh1jûhj ubeh}”(h]”h ]”h"]”h$]”h&]”uh1jÚh³hÇh´Khj×h²hubeh}”(h]”h ]”h"]”h$]”h&]”uh1jÕhjƒh²hh³hÇh´Nubeh}”(h]”Œ return-value”ah ]”h"]”Œ return value”ah$]”h&]”uh1hÖhhØh²hh³hÇh´K`ubeh}”(h]”(Œ v4l2-read”hÕeh ]”h"]”(Œ v4l2 read()”Œ func-read”eh$]”h&]”uh1hÖhhh²hh³hÇh´KŒexpect_referenced_by_name”}”jv hÊsŒexpect_referenced_by_id”}”hÕhÊsubeh}”(h]”h ]”h"]”h$]”h&]”Œsource”hÇuh1hŒcurrent_source”NŒ current_line”NŒsettings”Œdocutils.frontend”ŒValues”“”)”}”(hÛNŒ generator”NŒ datestamp”NŒ source_link”NŒ source_url”NŒ toc_backlinks”Œentry”Œfootnote_backlinks”KŒ sectnum_xform”KŒstrip_comments”NŒstrip_elements_with_classes”NŒ strip_classes”NŒ report_level”KŒ halt_level”KŒexit_status_level”KŒdebug”NŒwarning_stream”NŒ traceback”ˆŒinput_encoding”Œ utf-8-sig”Œinput_encoding_error_handler”Œstrict”Œoutput_encoding”Œutf-8”Œoutput_encoding_error_handler”j  Œerror_encoding”Œutf-8”Œerror_encoding_error_handler”Œbackslashreplace”Œ language_code”Œen”Œrecord_dependencies”NŒconfig”NŒ id_prefix”hŒauto_id_prefix”Œid”Œ dump_settings”NŒdump_internals”NŒdump_transforms”NŒdump_pseudo_xml”NŒexpose_internals”NŒstrict_visitor”NŒ_disable_config”NŒ_source”hÇŒ _destination”NŒ _config_files”]”Œ7/var/lib/git/docbuild/linux/Documentation/docutils.conf”aŒfile_insertion_enabled”ˆŒ raw_enabled”KŒline_length_limit”M'Œpep_references”NŒ pep_base_url”Œhttps://peps.python.org/”Œpep_file_url_template”Œpep-%04d”Œrfc_references”NŒ rfc_base_url”Œ&https://datatracker.ietf.org/doc/html/”Œ tab_width”KŒtrim_footnote_reference_space”‰Œsyntax_highlight”Œlong”Œ smart_quotes”ˆŒsmartquotes_locales”]”Œcharacter_level_inline_markup”‰Œdoctitle_xform”‰Œ docinfo_xform”KŒsectsubtitle_xform”‰Œ image_loading”Œlink”Œembed_stylesheet”‰Œcloak_email_addresses”ˆŒsection_self_link”‰Œenv”NubŒreporter”NŒindirect_targets”]”Œsubstitution_defs”}”Œsubstitution_names”}”Œrefnames”}”Œrefids”}”hÕ]”hÊasŒnameids”}”(jv hÕju jr jjjÁj¾j¿j¼j€j}jm jj uŒ nametypes”}”(jv ˆju ‰j‰jÁ‰j¿‰j€‰jm ‰uh}”(hÕhØjr hØjhëj¾jjIjRj¼jÄj}jÂjj jƒuŒ footnote_refs”}”Œ citation_refs”}”Œ autofootnotes”]”Œautofootnote_refs”]”Œsymbol_footnotes”]”Œsymbol_footnote_refs”]”Œ footnotes”]”Œ citations”]”Œautofootnote_start”KŒsymbol_footnote_start”KŒ id_counter”Œ collections”ŒCounter”“”}”…”R”Œparse_messages”]”Œtransform_messages”]”hŒsystem_message”“”)”}”(hhh]”hý)”}”(hhh]”hŒ/Hyperlink target "func-read" is not referenced.”…””}”hj sbah}”(h]”h ]”h"]”h$]”h&]”uh1hühj ubah}”(h]”h ]”h"]”h$]”h&]”Œlevel”KŒtype”ŒINFO”Œsource”hÇŒline”Kuh1j ubaŒ transformer”NŒ include_log”]”Œ decoration”Nh²hub.