€•­tŒ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”Œ1/translations/zh_CN/userspace-api/media/v4l/userp”Œmodname”NŒ classname”NŒ refexplicit”ˆuŒtagname”hhh ubh)”}”(hhh]”hŒChinese (Traditional)”…””}”hh2sbah}”(h]”h ]”h"]”h$]”h&]”Œ refdomain”h)Œreftype”h+Œ reftarget”Œ1/translations/zh_TW/userspace-api/media/v4l/userp”Œmodname”NŒ classname”NŒ refexplicit”ˆuh1hhh ubh)”}”(hhh]”hŒItalian”…””}”hhFsbah}”(h]”h ]”h"]”h$]”h&]”Œ refdomain”h)Œreftype”h+Œ reftarget”Œ1/translations/it_IT/userspace-api/media/v4l/userp”Œmodname”NŒ classname”NŒ refexplicit”ˆuh1hhh ubh)”}”(hhh]”hŒJapanese”…””}”hhZsbah}”(h]”h ]”h"]”h$]”h&]”Œ refdomain”h)Œreftype”h+Œ reftarget”Œ1/translations/ja_JP/userspace-api/media/v4l/userp”Œmodname”NŒ classname”NŒ refexplicit”ˆuh1hhh ubh)”}”(hhh]”hŒKorean”…””}”hhnsbah}”(h]”h ]”h"]”h$]”h&]”Œ refdomain”h)Œreftype”h+Œ reftarget”Œ1/translations/ko_KR/userspace-api/media/v4l/userp”Œmodname”NŒ classname”NŒ refexplicit”ˆuh1hhh ubh)”}”(hhh]”hŒSpanish”…””}”hh‚sbah}”(h]”h ]”h"]”h$]”h&]”Œ refdomain”h)Œreftype”h+Œ reftarget”Œ1/translations/sp_SP/userspace-api/media/v4l/userp”Œ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ŸŒK/var/lib/git/docbuild/linux/Documentation/userspace-api/media/v4l/userp.rst”h KubhŒtarget”“”)”}”(hŒ .. _userp:”h]”h}”(h]”h ]”h"]”h$]”h&]”Œrefid”Œuserp”uh1h´h KhhhžhhŸh³ubhŒsection”“”)”}”(hhh]”(hŒtitle”“”)”}”(hŒStreaming I/O (User Pointers)”h]”hŒStreaming I/O (User Pointers)”…””}”(hhÉhžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÇhhÄhžhhŸh³h KubhŒ paragraph”“”)”}”(hXŒInput and output devices support this I/O method when the ``V4L2_CAP_STREAMING`` flag in the ``capabilities`` field of struct :c:type:`v4l2_capability` returned by the :ref:`VIDIOC_QUERYCAP` ioctl is set. If the particular user pointer method (not only memory mapping) is supported must be determined by calling the :ref:`VIDIOC_REQBUFS` ioctl with the memory type set to ``V4L2_MEMORY_USERPTR``.”h]”(hŒ:Input and output devices support this I/O method when the ”…””}”(hhÙhžhhŸNh NubhŒliteral”“”)”}”(hŒ``V4L2_CAP_STREAMING``”h]”hŒV4L2_CAP_STREAMING”…””}”(hhãhžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1háhhÙubhŒ flag in the ”…””}”(hhÙhžhhŸNh Nubhâ)”}”(hŒ``capabilities``”h]”hŒ capabilities”…””}”(hhõhžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1háhhÙubhŒ field of struct ”…””}”(hhÙhžhhŸNh Nubh)”}”(hŒ:c:type:`v4l2_capability`”h]”hâ)”}”(hj h]”hŒv4l2_capability”…””}”(hj hžhhŸNh Nubah}”(h]”h ]”(Œxref”Œc”Œc-type”eh"]”h$]”h&]”uh1háhjubah}”(h]”h ]”h"]”h$]”h&]”Œrefdoc”Œuserspace-api/media/v4l/userp”Œ refdomain”jŒreftype”Œtype”Œ refexplicit”‰Œrefwarn”‰Œ c:parent_key”Œsphinx.domains.c”Œ LookupKey”“”)”}”Œdata”]”j)Œ ASTIdentifier”“”)”}”Œ identifier”ŒV4L”sbN†”asbŒ reftarget”Œv4l2_capability”uh1hhŸh³h K hhÙubhŒ returned by the ”…””}”(hhÙhžhhŸNh Nubh)”}”(hŒ:ref:`VIDIOC_QUERYCAP`”h]”hŒinline”“”)”}”(hj?h]”hŒVIDIOC_QUERYCAP”…””}”(hjChžhhŸNh Nubah}”(h]”h ]”(jŒstd”Œstd-ref”eh"]”h$]”h&]”uh1jAhj=ubah}”(h]”h ]”h"]”h$]”h&]”Œrefdoc”j"Œ refdomain”jMŒreftype”Œref”Œ refexplicit”‰Œrefwarn”ˆj7Œvidioc_querycap”uh1hhŸh³h K hhÙubhŒ~ ioctl is set. If the particular user pointer method (not only memory mapping) is supported must be determined by calling the ”…””}”(hhÙhžhhŸNh Nubh)”}”(hŒ:ref:`VIDIOC_REQBUFS`”h]”jB)”}”(hjeh]”hŒVIDIOC_REQBUFS”…””}”(hjghžhhŸNh Nubah}”(h]”h ]”(jŒstd”Œstd-ref”eh"]”h$]”h&]”uh1jAhjcubah}”(h]”h ]”h"]”h$]”h&]”Œrefdoc”j"Œ refdomain”jqŒreftype”Œref”Œ refexplicit”‰Œrefwarn”ˆj7Œvidioc_reqbufs”uh1hhŸh³h K hhÙubhŒ# ioctl with the memory type set to ”…””}”(hhÙhžhhŸNh Nubhâ)”}”(hŒ``V4L2_MEMORY_USERPTR``”h]”hŒV4L2_MEMORY_USERPTR”…””}”(hj‡hžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1háhhÙubhŒ.”…””}”(hhÙhžhhŸNh Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1h×hŸh³h K hhÄhžhubhØ)”}”(hX¦This I/O method combines advantages of the read/write and memory mapping methods. Buffers (planes) are allocated by the application itself, and can reside for example in virtual or shared memory. Only pointers to data are exchanged, these pointers and meta-information are passed in struct :c:type:`v4l2_buffer` (or in struct :c:type:`v4l2_plane` in the multi-planar API case). The driver must be switched into user pointer I/O mode by calling the :ref:`VIDIOC_REQBUFS` with the desired buffer type. No buffers (planes) are allocated beforehand, consequently they are not indexed and cannot be queried like mapped buffers with the :ref:`VIDIOC_QUERYBUF ` ioctl.”h]”(hX"This I/O method combines advantages of the read/write and memory mapping methods. Buffers (planes) are allocated by the application itself, and can reside for example in virtual or shared memory. Only pointers to data are exchanged, these pointers and meta-information are passed in struct ”…””}”(hjŸhžhhŸNh Nubh)”}”(hŒ:c:type:`v4l2_buffer`”h]”hâ)”}”(hj©h]”hŒ v4l2_buffer”…””}”(hj«hžhhŸNh Nubah}”(h]”h ]”(jjŒc-type”eh"]”h$]”h&]”uh1háhj§ubah}”(h]”h ]”h"]”h$]”h&]”Œrefdoc”j"Œ refdomain”jŒreftype”Œtype”Œ refexplicit”‰Œrefwarn”‰j(j,j7Œ v4l2_buffer”uh1hhŸh³h KhjŸubhŒ (or in struct ”…””}”(hjŸhžhhŸNh Nubh)”}”(hŒ:c:type:`v4l2_plane`”h]”hâ)”}”(hjÌh]”hŒ v4l2_plane”…””}”(hjÎhžhhŸNh Nubah}”(h]”h ]”(jjŒc-type”eh"]”h$]”h&]”uh1háhjÊubah}”(h]”h ]”h"]”h$]”h&]”Œrefdoc”j"Œ refdomain”jŒreftype”Œtype”Œ refexplicit”‰Œrefwarn”‰j(j,j7Œ v4l2_plane”uh1hhŸh³h KhjŸubhŒf in the multi-planar API case). The driver must be switched into user pointer I/O mode by calling the ”…””}”(hjŸhžhhŸNh Nubh)”}”(hŒ:ref:`VIDIOC_REQBUFS`”h]”jB)”}”(hjïh]”hŒVIDIOC_REQBUFS”…””}”(hjñhžhhŸNh Nubah}”(h]”h ]”(jŒstd”Œstd-ref”eh"]”h$]”h&]”uh1jAhjíubah}”(h]”h ]”h"]”h$]”h&]”Œrefdoc”j"Œ refdomain”jûŒreftype”Œref”Œ refexplicit”‰Œrefwarn”ˆj7Œvidioc_reqbufs”uh1hhŸh³h KhjŸubhŒ¢ with the desired buffer type. No buffers (planes) are allocated beforehand, consequently they are not indexed and cannot be queried like mapped buffers with the ”…””}”(hjŸhžhhŸNh Nubh)”}”(hŒ(:ref:`VIDIOC_QUERYBUF `”h]”jB)”}”(hjh]”hŒVIDIOC_QUERYBUF”…””}”(hjhžhhŸNh Nubah}”(h]”h ]”(jŒstd”Œstd-ref”eh"]”h$]”h&]”uh1jAhjubah}”(h]”h ]”h"]”h$]”h&]”Œrefdoc”j"Œ refdomain”jŒreftype”Œref”Œ refexplicit”ˆŒrefwarn”ˆj7Œvidioc_querybuf”uh1hhŸh³h KhjŸubhŒ ioctl.”…””}”(hjŸhžhhŸNh Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1h×hŸh³h KhhÄhžhubhÃ)”}”(hhh]”(hÈ)”}”(hŒ4Example: Initiating streaming I/O with user pointers”h]”hŒ4Example: Initiating streaming I/O with user pointers”…””}”(hj>hžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÇhj;hžhhŸh³h KubhŒ literal_block”“”)”}”(hX~struct v4l2_requestbuffers reqbuf; memset (&reqbuf, 0, sizeof (reqbuf)); reqbuf.type = V4L2_BUF_TYPE_VIDEO_CAPTURE; reqbuf.memory = V4L2_MEMORY_USERPTR; if (ioctl (fd, VIDIOC_REQBUFS, &reqbuf) == -1) { if (errno == EINVAL) printf ("Video capturing or user pointer streaming is not supported\\n"); else perror ("VIDIOC_REQBUFS"); exit (EXIT_FAILURE); }”h]”hX~struct v4l2_requestbuffers reqbuf; memset (&reqbuf, 0, sizeof (reqbuf)); reqbuf.type = V4L2_BUF_TYPE_VIDEO_CAPTURE; reqbuf.memory = V4L2_MEMORY_USERPTR; if (ioctl (fd, VIDIOC_REQBUFS, &reqbuf) == -1) { if (errno == EINVAL) printf ("Video capturing or user pointer streaming is not supported\\n"); else perror ("VIDIOC_REQBUFS"); exit (EXIT_FAILURE); }”…””}”hjNsbah}”(h]”h ]”h"]”h$]”h&]”h±h²Œforce”‰Œlanguage”jŒhighlight_args”}”uh1jLhŸh³h K!hj;hžhubhØ)”}”(hXCBuffer (plane) addresses and sizes are passed on the fly with the :ref:`VIDIOC_QBUF ` ioctl. Although buffers are commonly cycled, applications can pass different addresses and sizes at each :ref:`VIDIOC_QBUF ` call. If required by the hardware the driver swaps memory pages within physical memory to create a continuous area of memory. This happens transparently to the application in the virtual memory subsystem of the kernel. When buffer pages have been swapped out to disk they are brought back and finally locked in physical memory for DMA. [#f1]_”h]”(hŒBBuffer (plane) addresses and sizes are passed on the fly with the ”…””}”(hj`hžhhŸNh Nubh)”}”(hŒ :ref:`VIDIOC_QBUF `”h]”jB)”}”(hjjh]”hŒ VIDIOC_QBUF”…””}”(hjlhžhhŸNh Nubah}”(h]”h ]”(jŒstd”Œstd-ref”eh"]”h$]”h&]”uh1jAhjhubah}”(h]”h ]”h"]”h$]”h&]”Œrefdoc”j"Œ refdomain”jvŒreftype”Œref”Œ refexplicit”ˆŒrefwarn”ˆj7Œ vidioc_qbuf”uh1hhŸh³h K2hj`ubhŒj ioctl. Although buffers are commonly cycled, applications can pass different addresses and sizes at each ”…””}”(hj`hžhhŸNh Nubh)”}”(hŒ :ref:`VIDIOC_QBUF `”h]”jB)”}”(hjŽh]”hŒ VIDIOC_QBUF”…””}”(hjhžhhŸNh Nubah}”(h]”h ]”(jŒstd”Œstd-ref”eh"]”h$]”h&]”uh1jAhjŒubah}”(h]”h ]”h"]”h$]”h&]”Œrefdoc”j"Œ refdomain”jšŒreftype”Œref”Œ refexplicit”ˆŒrefwarn”ˆj7Œ vidioc_qbuf”uh1hhŸh³h K2hj`ubhXQ call. If required by the hardware the driver swaps memory pages within physical memory to create a continuous area of memory. This happens transparently to the application in the virtual memory subsystem of the kernel. When buffer pages have been swapped out to disk they are brought back and finally locked in physical memory for DMA. ”…””}”(hj`hžhhŸNh NubhŒfootnote_reference”“”)”}”(hŒ[#f1]_”h]”hŒ1”…””}”(hj²hžhhŸNh Nubah}”(h]”Œid1”ah ]”h"]”h$]”h&]”Œauto”KhÀŒf1”Œdocname”j"uh1j°hj`Œresolved”Kubeh}”(h]”h ]”h"]”h$]”h&]”uh1h×hŸh³h K2hj;hžhubhØ)”}”(hXªFilled or displayed buffers are dequeued with the :ref:`VIDIOC_DQBUF ` ioctl. The driver can unlock the memory pages at any time between the completion of the DMA and this ioctl. The memory is also unlocked when :ref:`VIDIOC_STREAMOFF ` is called, :ref:`VIDIOC_REQBUFS`, or when the device is closed. Applications must take care not to free buffers without dequeuing. Firstly, the buffers remain locked for longer, wasting physical memory. Secondly the driver will not be notified when the memory is returned to the application's free list and subsequently reused for other purposes, possibly completing the requested DMA and overwriting valuable data.”h]”(hŒ2Filled or displayed buffers are dequeued with the ”…””}”(hjËhžhhŸNh Nubh)”}”(hŒ!:ref:`VIDIOC_DQBUF `”h]”jB)”}”(hjÕh]”hŒ VIDIOC_DQBUF”…””}”(hj×hžhhŸNh Nubah}”(h]”h ]”(jŒstd”Œstd-ref”eh"]”h$]”h&]”uh1jAhjÓubah}”(h]”h ]”h"]”h$]”h&]”Œrefdoc”j"Œ refdomain”jáŒreftype”Œref”Œ refexplicit”ˆŒrefwarn”ˆj7Œ vidioc_qbuf”uh1hhŸh³h K`”h]”jB)”}”(hjùh]”hŒVIDIOC_STREAMOFF”…””}”(hjûhžhhŸNh Nubah}”(h]”h ]”(jŒstd”Œstd-ref”eh"]”h$]”h&]”uh1jAhj÷ubah}”(h]”h ]”h"]”h$]”h&]”Œrefdoc”j"Œ refdomain”jŒreftype”Œref”Œ refexplicit”ˆŒrefwarn”ˆj7Œvidioc_streamon”uh1hhŸh³h K` blocks when no buffer is in the outgoing queue. When the ``O_NONBLOCK`` flag was given to the :c:func:`open()` function, :ref:`VIDIOC_DQBUF ` returns immediately with an ``EAGAIN`` error code when no buffer is available. The :ref:`select() ` or :c:func:`poll()` function are always available.”h]”(hXQFor capturing applications it is customary to enqueue a number of empty buffers, to start capturing and enter the read loop. Here the application waits until a filled buffer can be dequeued, and re-enqueues the buffer when the data is no longer needed. Output applications fill and enqueue buffers, when enough buffers are stacked up output is started. In the write loop, when the application runs out of free buffers it must wait until an empty buffer can be dequeued and reused. Two methods exist to suspend execution of the application until one or more buffers can be dequeued. By default ”…””}”(hjEhžhhŸNh Nubh)”}”(hŒ!:ref:`VIDIOC_DQBUF `”h]”jB)”}”(hjOh]”hŒ VIDIOC_DQBUF”…””}”(hjQhžhhŸNh Nubah}”(h]”h ]”(jŒstd”Œstd-ref”eh"]”h$]”h&]”uh1jAhjMubah}”(h]”h ]”h"]”h$]”h&]”Œrefdoc”j"Œ refdomain”j[Œreftype”Œref”Œ refexplicit”ˆŒrefwarn”ˆj7Œ vidioc_qbuf”uh1hhŸh³h KHhjEubhŒ: blocks when no buffer is in the outgoing queue. When the ”…””}”(hjEhžhhŸNh Nubhâ)”}”(hŒ``O_NONBLOCK``”h]”hŒ O_NONBLOCK”…””}”(hjqhžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1háhjEubhŒ flag was given to the ”…””}”(hjEhžhhŸNh Nubh)”}”(hŒ:c:func:`open()`”h]”hâ)”}”(hj…h]”hŒopen()”…””}”(hj‡hžhhŸNh Nubah}”(h]”h ]”(jjŒc-func”eh"]”h$]”h&]”uh1háhjƒubah}”(h]”h ]”h"]”h$]”h&]”Œrefdoc”j"Œ refdomain”jŒreftype”Œfunc”Œ refexplicit”‰Œrefwarn”‰j(j,j7Œopen”uh1hhŸh³h KHhjEubhŒ function, ”…””}”(hjEhžhhŸNh Nubh)”}”(hŒ!:ref:`VIDIOC_DQBUF `”h]”jB)”}”(hj¨h]”hŒ VIDIOC_DQBUF”…””}”(hjªhžhhŸNh Nubah}”(h]”h ]”(jŒstd”Œstd-ref”eh"]”h$]”h&]”uh1jAhj¦ubah}”(h]”h ]”h"]”h$]”h&]”Œrefdoc”j"Œ refdomain”j´Œreftype”Œref”Œ refexplicit”ˆŒrefwarn”ˆj7Œ vidioc_qbuf”uh1hhŸh³h KHhjEubhŒ returns immediately with an ”…””}”(hjEhžhhŸNh Nubhâ)”}”(hŒ ``EAGAIN``”h]”hŒEAGAIN”…””}”(hjÊhžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1háhjEubhŒ- error code when no buffer is available. The ”…””}”(hjEhžhhŸNh Nubh)”}”(hŒ:ref:`select() `”h]”jB)”}”(hjÞh]”hŒselect()”…””}”(hjàhžhhŸNh Nubah}”(h]”h ]”(jŒstd”Œstd-ref”eh"]”h$]”h&]”uh1jAhjÜubah}”(h]”h ]”h"]”h$]”h&]”Œrefdoc”j"Œ refdomain”jêŒreftype”Œref”Œ refexplicit”ˆŒrefwarn”ˆj7Œ func-select”uh1hhŸh³h KHhjEubhŒ or ”…””}”(hjEhžhhŸNh Nubh)”}”(hŒ:c:func:`poll()`”h]”hâ)”}”(hjh]”hŒpoll()”…””}”(hjhžhhŸNh Nubah}”(h]”h ]”(jjŒc-func”eh"]”h$]”h&]”uh1háhjubah}”(h]”h ]”h"]”h$]”h&]”Œrefdoc”j"Œ refdomain”jŒreftype”Œfunc”Œ refexplicit”‰Œrefwarn”‰j(j,j7Œpoll”uh1hhŸh³h KHhjEubhŒ function are always available.”…””}”(hjEhžhhŸNh Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1h×hŸh³h KHhj;hžhubhØ)”}”(hŒ™To start and stop capturing or output applications call the :ref:`VIDIOC_STREAMON ` and :ref:`VIDIOC_STREAMOFF ` ioctl.”h]”(hŒ`”h]”jB)”}”(hj3h]”hŒVIDIOC_STREAMON”…””}”(hj5hžhhŸNh Nubah}”(h]”h ]”(jŒstd”Œstd-ref”eh"]”h$]”h&]”uh1jAhj1ubah}”(h]”h ]”h"]”h$]”h&]”Œrefdoc”j"Œ refdomain”j?Œreftype”Œref”Œ refexplicit”ˆŒrefwarn”ˆj7Œvidioc_streamon”uh1hhŸh³h KXhj)ubhŒ and ”…””}”(hj)hžhhŸNh Nubh)”}”(hŒ):ref:`VIDIOC_STREAMOFF `”h]”jB)”}”(hjWh]”hŒVIDIOC_STREAMOFF”…””}”(hjYhžhhŸNh Nubah}”(h]”h ]”(jŒstd”Œstd-ref”eh"]”h$]”h&]”uh1jAhjUubah}”(h]”h ]”h"]”h$]”h&]”Œrefdoc”j"Œ refdomain”jcŒreftype”Œref”Œ refexplicit”ˆŒrefwarn”ˆj7Œvidioc_streamon”uh1hhŸh³h KXhj)ubhŒ ioctl.”…””}”(hj)hžhhŸNh Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1h×hŸh³h KXhj;hžhubhŒnote”“”)”}”(hX`:ref:`VIDIOC_STREAMOFF ` removes all buffers from both queues and unlocks all buffers as a side effect. Since there is no notion of doing anything "now" on a multitasking system, if an application needs to synchronize with another event it should examine the struct :c:type:`v4l2_buffer` ``timestamp`` of captured or outputted buffers.”h]”hØ)”}”(hX`:ref:`VIDIOC_STREAMOFF ` removes all buffers from both queues and unlocks all buffers as a side effect. Since there is no notion of doing anything "now" on a multitasking system, if an application needs to synchronize with another event it should examine the struct :c:type:`v4l2_buffer` ``timestamp`` of captured or outputted buffers.”h]”(h)”}”(hŒ):ref:`VIDIOC_STREAMOFF `”h]”jB)”}”(hj‹h]”hŒVIDIOC_STREAMOFF”…””}”(hjhžhhŸNh Nubah}”(h]”h ]”(jŒstd”Œstd-ref”eh"]”h$]”h&]”uh1jAhj‰ubah}”(h]”h ]”h"]”h$]”h&]”Œrefdoc”j"Œ refdomain”j—Œreftype”Œref”Œ refexplicit”ˆŒrefwarn”ˆj7Œvidioc_streamon”uh1hhŸh³h K^hj…ubhŒö removes all buffers from both queues and unlocks all buffers as a side effect. Since there is no notion of doing anything “now†on a multitasking system, if an application needs to synchronize with another event it should examine the struct ”…””}”(hj…hžhhŸNh Nubh)”}”(hŒ:c:type:`v4l2_buffer`”h]”hâ)”}”(hj¯h]”hŒ v4l2_buffer”…””}”(hj±hžhhŸNh Nubah}”(h]”h ]”(jjŒc-type”eh"]”h$]”h&]”uh1háhj­ubah}”(h]”h ]”h"]”h$]”h&]”Œrefdoc”j"Œ refdomain”jŒreftype”Œtype”Œ refexplicit”‰Œrefwarn”‰j(j,j7Œ v4l2_buffer”uh1hhŸh³h K^hj…ubhŒ ”…””}”(hj…hžhhŸNh Nubhâ)”}”(hŒ ``timestamp``”h]”hŒ timestamp”…””}”(hjÐhžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1háhj…ubhŒ" of captured or outputted buffers.”…””}”(hj…hžhhŸNh Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1h×hŸh³h K^hjubah}”(h]”h ]”h"]”h$]”h&]”uh1jhj;hžhhŸh³h NubhØ)”}”(hX?Drivers implementing user pointer I/O must support the :ref:`VIDIOC_REQBUFS `, :ref:`VIDIOC_QBUF `, :ref:`VIDIOC_DQBUF `, :ref:`VIDIOC_STREAMON ` and :ref:`VIDIOC_STREAMOFF ` ioctls, the :c:func:`select()` and :c:func:`poll()` function. [#f2]_”h]”(hŒ7Drivers implementing user pointer I/O must support the ”…””}”(hjîhžhhŸNh Nubh)”}”(hŒ&:ref:`VIDIOC_REQBUFS `”h]”jB)”}”(hjøh]”hŒVIDIOC_REQBUFS”…””}”(hjúhžhhŸNh Nubah}”(h]”h ]”(jŒstd”Œstd-ref”eh"]”h$]”h&]”uh1jAhjöubah}”(h]”h ]”h"]”h$]”h&]”Œrefdoc”j"Œ refdomain”jŒreftype”Œref”Œ refexplicit”ˆŒrefwarn”ˆj7Œvidioc_reqbufs”uh1hhŸh³h KehjîubhŒ, ”…””}”(hjîhžhhŸNh Nubh)”}”(hŒ :ref:`VIDIOC_QBUF `”h]”jB)”}”(hjh]”hŒ VIDIOC_QBUF”…””}”(hjhžhhŸNh Nubah}”(h]”h ]”(jŒstd”Œstd-ref”eh"]”h$]”h&]”uh1jAhjubah}”(h]”h ]”h"]”h$]”h&]”Œrefdoc”j"Œ refdomain”j(Œreftype”Œref”Œ refexplicit”ˆŒrefwarn”ˆj7Œ vidioc_qbuf”uh1hhŸh³h KehjîubhŒ, ”…””}”(hjîhžhhŸNh Nubh)”}”(hŒ!:ref:`VIDIOC_DQBUF `”h]”jB)”}”(hj@h]”hŒ VIDIOC_DQBUF”…””}”(hjBhžhhŸNh Nubah}”(h]”h ]”(jŒstd”Œstd-ref”eh"]”h$]”h&]”uh1jAhj>ubah}”(h]”h ]”h"]”h$]”h&]”Œrefdoc”j"Œ refdomain”jLŒreftype”Œref”Œ refexplicit”ˆŒrefwarn”ˆj7Œ vidioc_qbuf”uh1hhŸh³h KehjîubhŒ, ”…””}”hjîsbh)”}”(hŒ(:ref:`VIDIOC_STREAMON `”h]”jB)”}”(hjdh]”hŒVIDIOC_STREAMON”…””}”(hjfhžhhŸNh Nubah}”(h]”h ]”(jŒstd”Œstd-ref”eh"]”h$]”h&]”uh1jAhjbubah}”(h]”h ]”h"]”h$]”h&]”Œrefdoc”j"Œ refdomain”jpŒreftype”Œref”Œ refexplicit”ˆŒrefwarn”ˆj7Œvidioc_streamon”uh1hhŸh³h KehjîubhŒ and ”…””}”(hjîhžhhŸNh Nubh)”}”(hŒ):ref:`VIDIOC_STREAMOFF `”h]”jB)”}”(hjˆh]”hŒVIDIOC_STREAMOFF”…””}”(hjŠhžhhŸNh Nubah}”(h]”h ]”(jŒstd”Œstd-ref”eh"]”h$]”h&]”uh1jAhj†ubah}”(h]”h ]”h"]”h$]”h&]”Œrefdoc”j"Œ refdomain”j”Œreftype”Œref”Œ refexplicit”ˆŒrefwarn”ˆj7Œvidioc_streamon”uh1hhŸh³h KehjîubhŒ ioctls, the ”…””}”(hjîhžhhŸNh Nubh)”}”(hŒ:c:func:`select()`”h]”hâ)”}”(hj¬h]”hŒselect()”…””}”(hj®hžhhŸNh Nubah}”(h]”h ]”(jjŒc-func”eh"]”h$]”h&]”uh1háhjªubah}”(h]”h ]”h"]”h$]”h&]”Œrefdoc”j"Œ refdomain”jŒreftype”Œfunc”Œ refexplicit”‰Œrefwarn”‰j(j,j7Œselect”uh1hhŸh³h KehjîubhŒ and ”…””}”(hjîhžhhŸNh Nubh)”}”(hŒ:c:func:`poll()`”h]”hâ)”}”(hjÏh]”hŒpoll()”…””}”(hjÑhžhhŸNh Nubah}”(h]”h ]”(jjŒc-func”eh"]”h$]”h&]”uh1háhjÍubah}”(h]”h ]”h"]”h$]”h&]”Œrefdoc”j"Œ refdomain”jŒreftype”Œfunc”Œ refexplicit”‰Œrefwarn”‰j(j,j7Œpoll”uh1hhŸh³h KehjîubhŒ function. ”…””}”(hjîhžhhŸNh Nubj±)”}”(hŒ[#f2]_”h]”hŒ2”…””}”(hjðhžhhŸNh Nubah}”(h]”Œid2”ah ]”h"]”h$]”h&]”jÁKhÀŒf2”jÃj"uh1j°hjîjÄKubeh}”(h]”h ]”h"]”h$]”h&]”uh1h×hŸh³h Kehj;hžhubhŒfootnote”“”)”}”(hX¨We expect that frequently used buffers are typically not swapped out. Anyway, the process of swapping, locking or generating scatter-gather lists may be time consuming. The delay can be masked by the depth of the incoming buffer queue, and perhaps by maintaining caches assuming a buffer will be soon enqueued again. On the other hand, to optimize memory usage drivers can limit the number of buffers locked in advance and recycle the most recently used buffers first. Of course, the pages of empty buffers in the incoming queue need not be saved to disk. Output buffers must be saved on the incoming and outgoing queue because an application may share them with other processes. ”h]”(hŒlabel”“”)”}”(hhh]”hŒ1”…””}”(hjhžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j hjhžhhŸNh NubhØ)”}”(hX§We expect that frequently used buffers are typically not swapped out. Anyway, the process of swapping, locking or generating scatter-gather lists may be time consuming. The delay can be masked by the depth of the incoming buffer queue, and perhaps by maintaining caches assuming a buffer will be soon enqueued again. On the other hand, to optimize memory usage drivers can limit the number of buffers locked in advance and recycle the most recently used buffers first. Of course, the pages of empty buffers in the incoming queue need not be saved to disk. Output buffers must be saved on the incoming and outgoing queue because an application may share them with other processes.”h]”hX§We expect that frequently used buffers are typically not swapped out. Anyway, the process of swapping, locking or generating scatter-gather lists may be time consuming. The delay can be masked by the depth of the incoming buffer queue, and perhaps by maintaining caches assuming a buffer will be soon enqueued again. On the other hand, to optimize memory usage drivers can limit the number of buffers locked in advance and recycle the most recently used buffers first. Of course, the pages of empty buffers in the incoming queue need not be saved to disk. Output buffers must be saved on the incoming and outgoing queue because an application may share them with other processes.”…””}”(hjhžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1h×hŸh³h Klhjubeh}”(h]”jÂah ]”h"]”Œf1”ah$]”h&]”j¼ajÁKjÃj"uh1jhŸh³h Kkhj;hžhubj)”}”(hŒAt the driver level :c:func:`select()` and :c:func:`poll()` are the same, and :c:func:`select()` is too important to be optional. The rest should be evident.”h]”(j )”}”(hhh]”hŒ2”…””}”(hj4hžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j hj0hžhhŸNh NubhØ)”}”(hŒAt the driver level :c:func:`select()` and :c:func:`poll()` are the same, and :c:func:`select()` is too important to be optional. The rest should be evident.”h]”(hŒAt the driver level ”…””}”(hjAhžhhŸNh Nubh)”}”(hŒ:c:func:`select()`”h]”hâ)”}”(hjKh]”hŒselect()”…””}”(hjMhžhhŸNh Nubah}”(h]”h ]”(jjŒc-func”eh"]”h$]”h&]”uh1háhjIubah}”(h]”h ]”h"]”h$]”h&]”Œrefdoc”j"Œ refdomain”jŒreftype”Œfunc”Œ refexplicit”‰Œrefwarn”‰j(j,j7Œselect”uh1hhŸh³h KxhjAubhŒ and ”…””}”(hjAhžhhŸNh Nubh)”}”(hŒ:c:func:`poll()`”h]”hâ)”}”(hjnh]”hŒpoll()”…””}”(hjphžhhŸNh Nubah}”(h]”h ]”(jjŒc-func”eh"]”h$]”h&]”uh1háhjlubah}”(h]”h ]”h"]”h$]”h&]”Œrefdoc”j"Œ refdomain”jŒreftype”Œfunc”Œ refexplicit”‰Œrefwarn”‰j(j,j7Œpoll”uh1hhŸh³h KxhjAubhŒ are the same, and ”…””}”(hjAhžhhŸNh Nubh)”}”(hŒ:c:func:`select()`”h]”hâ)”}”(hj‘h]”hŒselect()”…””}”(hj“hžhhŸNh Nubah}”(h]”h ]”(jjŒc-func”eh"]”h$]”h&]”uh1háhjubah}”(h]”h ]”h"]”h$]”h&]”Œrefdoc”j"Œ refdomain”jŒreftype”Œfunc”Œ refexplicit”‰Œrefwarn”‰j(j,j7Œselect”uh1hhŸh³h KxhjAubhŒ= is too important to be optional. The rest should be evident.”…””}”(hjAhžhhŸNh Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1h×hŸh³h Kxhj0ubeh}”(h]”jÿah ]”h"]”Œf2”ah$]”h&]”júajÁKjÃj"uh1jhŸh³h Kwhj;hžhubeh}”(h]”Œ3example-initiating-streaming-i-o-with-user-pointers”ah ]”h"]”Œ4example: initiating streaming i/o with user pointers”ah$]”h&]”uh1hÂhhÄhžhhŸh³h Kubeh}”(h]”(Œstreaming-i-o-user-pointers”hÁeh ]”h"]”(Œstreaming i/o (user pointers)”Œuserp”eh$]”h&]”uh1hÂhhhžhhŸh³h KŒexpect_referenced_by_name”}”jÍ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”}”(Œf1”]”j²aŒf2”]”jðauŒrefids”}”(hÁ]”h¶ajÂ]”j²ajÿ]”jðauŒnameids”}”(jÍhÁjÌjÉjÄjÁj-jÂj¼jÿuŒ nametypes”}”(j͈j̉jĉj-ˆj¼ˆuh}”(hÁhÄjÉhÄjÁj;j¼j²jújðjÂjjÿj0uŒ footnote_refs”}”(j7]”j²aj9]”jðauŒ citation_refs”}”Œ autofootnotes”]”(jj0eŒautofootnote_refs”]”(j²jðeŒsymbol_footnotes”]”Œsymbol_footnote_refs”]”Œ footnotes”]”Œ citations”]”Œautofootnote_start”KŒsymbol_footnote_start”KŒ id_counter”Œ collections”ŒCounter”“”}”jKs…”R”Œparse_messages”]”Œtransform_messages”]”hŒsystem_message”“”)”}”(hhh]”hØ)”}”(hhh]”hŒ+Hyperlink target "userp" is not referenced.”…””}”hjisbah}”(h]”h ]”h"]”h$]”h&]”uh1h×hjfubah}”(h]”h ]”h"]”h$]”h&]”Œlevel”KŒtype”ŒINFO”Œsource”h³Œline”Kuh1jdubaŒ transformer”NŒ include_log”]”Œ decoration”Nhžhub.