€•ÿnŒ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”Œ2/translations/zh_CN/userspace-api/media/v4l/dmabuf”Œmodname”NŒ classname”NŒ refexplicit”ˆuŒtagname”hhh ubh)”}”(hhh]”hŒChinese (Traditional)”…””}”hh2sbah}”(h]”h ]”h"]”h$]”h&]”Œ refdomain”h)Œreftype”h+Œ reftarget”Œ2/translations/zh_TW/userspace-api/media/v4l/dmabuf”Œmodname”NŒ classname”NŒ refexplicit”ˆuh1hhh ubh)”}”(hhh]”hŒItalian”…””}”hhFsbah}”(h]”h ]”h"]”h$]”h&]”Œ refdomain”h)Œreftype”h+Œ reftarget”Œ2/translations/it_IT/userspace-api/media/v4l/dmabuf”Œmodname”NŒ classname”NŒ refexplicit”ˆuh1hhh ubh)”}”(hhh]”hŒJapanese”…””}”hhZsbah}”(h]”h ]”h"]”h$]”h&]”Œ refdomain”h)Œreftype”h+Œ reftarget”Œ2/translations/ja_JP/userspace-api/media/v4l/dmabuf”Œmodname”NŒ classname”NŒ refexplicit”ˆuh1hhh ubh)”}”(hhh]”hŒKorean”…””}”hhnsbah}”(h]”h ]”h"]”h$]”h&]”Œ refdomain”h)Œreftype”h+Œ reftarget”Œ2/translations/ko_KR/userspace-api/media/v4l/dmabuf”Œmodname”NŒ classname”NŒ refexplicit”ˆuh1hhh ubh)”}”(hhh]”hŒSpanish”…””}”hh‚sbah}”(h]”h ]”h"]”h$]”h&]”Œ refdomain”h)Œreftype”h+Œ reftarget”Œ2/translations/sp_SP/userspace-api/media/v4l/dmabuf”Œ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ŸŒL/var/lib/git/docbuild/linux/Documentation/userspace-api/media/v4l/dmabuf.rst”h KubhŒtarget”“”)”}”(hŒ .. _dmabuf:”h]”h}”(h]”h ]”h"]”h$]”h&]”Œrefid”Œdmabuf”uh1h´h KhhhžhhŸh³ubhŒsection”“”)”}”(hhh]”(hŒtitle”“”)”}”(hŒ$Streaming I/O (DMA buffer importing)”h]”hŒ$Streaming I/O (DMA buffer importing)”…””}”(hhÉhžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÇhhÄhžhhŸh³h KubhŒ paragraph”“”)”}”(hX­The DMABUF framework provides a generic method for sharing buffers between multiple devices. Device drivers that support DMABUF can export a DMA buffer to userspace as a file descriptor (known as the exporter role), import a DMA buffer from userspace using a file descriptor previously exported for a different or the same device (known as the importer role), or both. This section describes the DMABUF importer role API in V4L2.”h]”hX­The DMABUF framework provides a generic method for sharing buffers between multiple devices. Device drivers that support DMABUF can export a DMA buffer to userspace as a file descriptor (known as the exporter role), import a DMA buffer from userspace using a file descriptor previously exported for a different or the same device (known as the importer role), or both. This section describes the DMABUF importer role API in V4L2.”…””}”(hhÙhžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1h×hŸh³h K hhÄhžhubhØ)”}”(hŒuRefer to :ref:`DMABUF exporting ` for details about exporting V4L2 buffers as DMABUF file descriptors.”h]”(hŒ Refer to ”…””}”(hhçhžhhŸNh Nubh)”}”(hŒ':ref:`DMABUF exporting `”h]”hŒinline”“”)”}”(hhñh]”hŒDMABUF exporting”…””}”(hhõhžhhŸNh Nubah}”(h]”h ]”(Œxref”Œstd”Œstd-ref”eh"]”h$]”h&]”uh1hóhhïubah}”(h]”h ]”h"]”h$]”h&]”Œrefdoc”Œuserspace-api/media/v4l/dmabuf”Œ refdomain”jŒreftype”Œref”Œ refexplicit”ˆŒrefwarn”ˆŒ reftarget”Œ vidioc_expbuf”uh1hhŸh³h KhhçubhŒE for details about exporting V4L2 buffers as DMABUF file descriptors.”…””}”(hhçhžhhŸNh Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1h×hŸh³h KhhÄhžhubhØ)”}”(hX°Input and output devices support the streaming 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. Whether importing DMA buffers through DMABUF file descriptors is supported is determined by calling the :ref:`VIDIOC_REQBUFS ` ioctl with the memory type set to ``V4L2_MEMORY_DMABUF``.”h]”(hŒCInput and output devices support the streaming I/O method when the ”…””}”(hjhžhhŸNh NubhŒliteral”“”)”}”(hŒ``V4L2_CAP_STREAMING``”h]”hŒV4L2_CAP_STREAMING”…””}”(hj(hžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j&hjubhŒ flag in the ”…””}”(hjhžhhŸNh Nubj')”}”(hŒ``capabilities``”h]”hŒ capabilities”…””}”(hj:hžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j&hjubhŒ field of struct ”…””}”(hjhžhhŸNh Nubh)”}”(hŒ:c:type:`v4l2_capability`”h]”j')”}”(hjNh]”hŒv4l2_capability”…””}”(hjPhžhhŸNh Nubah}”(h]”h ]”(hÿŒc”Œc-type”eh"]”h$]”h&]”uh1j&hjLubah}”(h]”h ]”h"]”h$]”h&]”Œrefdoc”j Œ refdomain”jZŒreftype”Œtype”Œ refexplicit”‰Œrefwarn”‰Œ c:parent_key”Œsphinx.domains.c”Œ LookupKey”“”)”}”Œdata”]”jlŒ ASTIdentifier”“”)”}”Œ identifier”ŒV4L”sbN†”asbjŒv4l2_capability”uh1hhŸh³h KhjubhŒ returned by the ”…””}”(hjhžhhŸNh Nubh)”}”(hŒ(:ref:`VIDIOC_QUERYCAP `”h]”hô)”}”(hjh]”hŒVIDIOC_QUERYCAP”…””}”(hjƒhžhhŸNh Nubah}”(h]”h ]”(hÿŒstd”Œstd-ref”eh"]”h$]”h&]”uh1hóhjubah}”(h]”h ]”h"]”h$]”h&]”Œrefdoc”j Œ refdomain”jŒreftype”Œref”Œ refexplicit”ˆŒrefwarn”ˆjŒvidioc_querycap”uh1hhŸh³h KhjubhŒw ioctl is set. Whether importing DMA buffers through DMABUF file descriptors is supported is determined by calling the ”…””}”(hjhžhhŸNh Nubh)”}”(hŒ&:ref:`VIDIOC_REQBUFS `”h]”hô)”}”(hj¥h]”hŒVIDIOC_REQBUFS”…””}”(hj§hžhhŸNh Nubah}”(h]”h ]”(hÿŒstd”Œstd-ref”eh"]”h$]”h&]”uh1hóhj£ubah}”(h]”h ]”h"]”h$]”h&]”Œrefdoc”j Œ refdomain”j±Œreftype”Œref”Œ refexplicit”ˆŒrefwarn”ˆjŒvidioc_reqbufs”uh1hhŸh³h KhjubhŒ# ioctl with the memory type set to ”…””}”(hjhžhhŸNh Nubj')”}”(hŒ``V4L2_MEMORY_DMABUF``”h]”hŒV4L2_MEMORY_DMABUF”…””}”(hjÇhžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j&hjubhŒ.”…””}”(hjhžhhŸNh Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1h×hŸh³h KhhÄhžhubhØ)”}”(hXšThis I/O method is dedicated to sharing DMA buffers between different devices, which may be V4L devices or other video-related devices (e.g. DRM). Buffers (planes) are allocated by a driver on behalf of an application. Next, these buffers are exported to the application as file descriptors using an API which is specific for an allocator driver. Only such file descriptor are exchanged. The descriptors 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 DMABUF I/O mode by calling the :ref:`VIDIOC_REQBUFS ` with the desired buffer type.”h]”(hX¾This I/O method is dedicated to sharing DMA buffers between different devices, which may be V4L devices or other video-related devices (e.g. DRM). Buffers (planes) are allocated by a driver on behalf of an application. Next, these buffers are exported to the application as file descriptors using an API which is specific for an allocator driver. Only such file descriptor are exchanged. The descriptors and meta-information are passed in struct ”…””}”(hjßhžhhŸNh Nubh)”}”(hŒ:c:type:`v4l2_buffer`”h]”j')”}”(hjéh]”hŒ v4l2_buffer”…””}”(hjëhžhhŸNh Nubah}”(h]”h ]”(hÿjZŒc-type”eh"]”h$]”h&]”uh1j&hjçubah}”(h]”h ]”h"]”h$]”h&]”Œrefdoc”j Œ refdomain”jZŒreftype”Œtype”Œ refexplicit”‰Œrefwarn”‰jkjojŒ v4l2_buffer”uh1hhŸh³h KhjßubhŒ (or in struct ”…””}”(hjßhžhhŸNh Nubh)”}”(hŒ:c:type:`v4l2_plane`”h]”j')”}”(hj h]”hŒ v4l2_plane”…””}”(hjhžhhŸNh Nubah}”(h]”h ]”(hÿjZŒc-type”eh"]”h$]”h&]”uh1j&hj ubah}”(h]”h ]”h"]”h$]”h&]”Œrefdoc”j Œ refdomain”jZŒreftype”Œtype”Œ refexplicit”‰Œrefwarn”‰jkjojŒ v4l2_plane”uh1hhŸh³h KhjßubhŒ` in the multi-planar API case). The driver must be switched into DMABUF I/O mode by calling the ”…””}”(hjßhžhhŸNh Nubh)”}”(hŒ&:ref:`VIDIOC_REQBUFS `”h]”hô)”}”(hj/h]”hŒVIDIOC_REQBUFS”…””}”(hj1hžhhŸNh Nubah}”(h]”h ]”(hÿŒstd”Œstd-ref”eh"]”h$]”h&]”uh1hóhj-ubah}”(h]”h ]”h"]”h$]”h&]”Œrefdoc”j Œ refdomain”j;Œreftype”Œref”Œ refexplicit”ˆŒrefwarn”ˆjŒvidioc_reqbufs”uh1hhŸh³h KhjßubhŒ with the desired buffer type.”…””}”(hjßhžhhŸNh Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1h×hŸh³h KhhÄhžhubhÃ)”}”(hhh]”(hÈ)”}”(hŒ>Example: Initiating streaming I/O with DMABUF file descriptors”h]”hŒ>Example: Initiating streaming I/O with DMABUF file descriptors”…””}”(hjZhžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÇhjWhžhhŸh³h K)ubhŒ literal_block”“”)”}”(hX„struct v4l2_requestbuffers reqbuf; memset(&reqbuf, 0, sizeof (reqbuf)); reqbuf.type = V4L2_BUF_TYPE_VIDEO_CAPTURE; reqbuf.memory = V4L2_MEMORY_DMABUF; reqbuf.count = 1; if (ioctl(fd, VIDIOC_REQBUFS, &reqbuf) == -1) { if (errno == EINVAL) printf("Video capturing or DMABUF 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_DMABUF; reqbuf.count = 1; if (ioctl(fd, VIDIOC_REQBUFS, &reqbuf) == -1) { if (errno == EINVAL) printf("Video capturing or DMABUF streaming is not supported\\n"); else perror("VIDIOC_REQBUFS"); exit(EXIT_FAILURE); }”…””}”hjjsbah}”(h]”h ]”h"]”h$]”h&]”h±h²Œforce”‰Œlanguage”jZŒhighlight_args”}”uh1jhhŸh³h K+hjWhžhubhØ)”}”(hXSThe buffer (plane) file descriptor is passed on the fly with the :ref:`VIDIOC_QBUF ` ioctl. In case of multiplanar buffers, every plane can be associated with a different DMABUF descriptor. Although buffers are commonly cycled, applications can pass a different DMABUF descriptor at each :ref:`VIDIOC_QBUF ` call.”h]”(hŒAThe buffer (plane) file descriptor is passed on the fly with the ”…””}”(hj|hžhhŸNh Nubh)”}”(hŒ :ref:`VIDIOC_QBUF `”h]”hô)”}”(hj†h]”hŒ VIDIOC_QBUF”…””}”(hjˆhžhhŸNh Nubah}”(h]”h ]”(hÿŒstd”Œstd-ref”eh"]”h$]”h&]”uh1hóhj„ubah}”(h]”h ]”h"]”h$]”h&]”Œrefdoc”j Œ refdomain”j’Œreftype”Œref”Œ refexplicit”ˆŒrefwarn”ˆjŒ vidioc_qbuf”uh1hhŸh³h K=hj|ubhŒÌ ioctl. In case of multiplanar buffers, every plane can be associated with a different DMABUF descriptor. Although buffers are commonly cycled, applications can pass a different DMABUF descriptor at each ”…””}”(hj|hžhhŸNh Nubh)”}”(hŒ :ref:`VIDIOC_QBUF `”h]”hô)”}”(hjªh]”hŒ VIDIOC_QBUF”…””}”(hj¬hžhhŸNh Nubah}”(h]”h ]”(hÿŒstd”Œstd-ref”eh"]”h$]”h&]”uh1hóhj¨ubah}”(h]”h ]”h"]”h$]”h&]”Œrefdoc”j Œ refdomain”j¶Œreftype”Œref”Œ refexplicit”ˆŒrefwarn”ˆjŒ vidioc_qbuf”uh1hhŸh³h K=hj|ubhŒ call.”…””}”(hj|hžhhŸNh Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1h×hŸh³h K=hjWhžhubeh}”(h]”Œ=example-initiating-streaming-i-o-with-dmabuf-file-descriptors”ah ]”h"]”Œ>example: initiating streaming i/o with dmabuf file descriptors”ah$]”h&]”uh1hÂhhÄhžhhŸh³h K)ubhÃ)”}”(hhh]”(hÈ)”}”(hŒ/Example: Queueing DMABUF using single plane API”h]”hŒ/Example: Queueing DMABUF using single plane API”…””}”(hjÝhžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÇhjÚhžhhŸh³h KDubji)”}”(hXjint buffer_queue(int v4lfd, int index, int dmafd) { struct v4l2_buffer buf; memset(&buf, 0, sizeof buf); buf.type = V4L2_BUF_TYPE_VIDEO_CAPTURE; buf.memory = V4L2_MEMORY_DMABUF; buf.index = index; buf.m.fd = dmafd; if (ioctl(v4lfd, VIDIOC_QBUF, &buf) == -1) { perror("VIDIOC_QBUF"); return -1; } return 0; }”h]”hXjint buffer_queue(int v4lfd, int index, int dmafd) { struct v4l2_buffer buf; memset(&buf, 0, sizeof buf); buf.type = V4L2_BUF_TYPE_VIDEO_CAPTURE; buf.memory = V4L2_MEMORY_DMABUF; buf.index = index; buf.m.fd = dmafd; if (ioctl(v4lfd, VIDIOC_QBUF, &buf) == -1) { perror("VIDIOC_QBUF"); return -1; } return 0; }”…””}”hjësbah}”(h]”h ]”h"]”h$]”h&]”h±h²jx‰jyjZjz}”uh1jhhŸh³h KFhjÚhžhubeh}”(h]”Œ.example-queueing-dmabuf-using-single-plane-api”ah ]”h"]”Œ/example: queueing dmabuf using single plane api”ah$]”h&]”uh1hÂhhÄhžhhŸh³h KDubhÃ)”}”(hhh]”(hÈ)”}”(hŒ2Example 3.6. Queueing DMABUF using multi plane API”h]”hŒ2Example 3.6. Queueing DMABUF using multi plane API”…””}”(hjhžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÇhjhžhhŸh³h K[ubji)”}”(hXTint buffer_queue_mp(int v4lfd, int index, int dmafd[], int n_planes) { struct v4l2_buffer buf; struct v4l2_plane planes[VIDEO_MAX_PLANES]; int i; memset(&buf, 0, sizeof buf); buf.type = V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE; buf.memory = V4L2_MEMORY_DMABUF; buf.index = index; buf.m.planes = planes; buf.length = n_planes; memset(&planes, 0, sizeof planes); for (i = 0; i < n_planes; ++i) buf.m.planes[i].m.fd = dmafd[i]; if (ioctl(v4lfd, VIDIOC_QBUF, &buf) == -1) { perror("VIDIOC_QBUF"); return -1; } return 0; }”h]”hXTint buffer_queue_mp(int v4lfd, int index, int dmafd[], int n_planes) { struct v4l2_buffer buf; struct v4l2_plane planes[VIDEO_MAX_PLANES]; int i; memset(&buf, 0, sizeof buf); buf.type = V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE; buf.memory = V4L2_MEMORY_DMABUF; buf.index = index; buf.m.planes = planes; buf.length = n_planes; memset(&planes, 0, sizeof planes); for (i = 0; i < n_planes; ++i) buf.m.planes[i].m.fd = dmafd[i]; if (ioctl(v4lfd, VIDIOC_QBUF, &buf) == -1) { perror("VIDIOC_QBUF"); return -1; } return 0; }”…””}”hjsbah}”(h]”h ]”h"]”h$]”h&]”h±h²jx‰jyjZjz}”uh1jhhŸh³h K]hjhžhubhØ)”}”(hXWCaptured or displayed buffers are dequeued with the :ref:`VIDIOC_DQBUF ` ioctl. The driver can unlock the buffer 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.”h]”(hŒ4Captured or displayed buffers are dequeued with the ”…””}”(hj"hžhhŸNh Nubh)”}”(hŒ!:ref:`VIDIOC_DQBUF `”h]”hô)”}”(hj,h]”hŒ VIDIOC_DQBUF”…””}”(hj.hžhhŸNh Nubah}”(h]”h ]”(hÿŒstd”Œstd-ref”eh"]”h$]”h&]”uh1hóhj*ubah}”(h]”h ]”h"]”h$]”h&]”Œrefdoc”j Œ refdomain”j8Œreftype”Œref”Œ refexplicit”ˆŒrefwarn”ˆjŒ vidioc_qbuf”uh1hhŸh³h Kyhj"ubhŒˆ ioctl. The driver can unlock the buffer at any time between the completion of the DMA and this ioctl. The memory is also unlocked when ”…””}”(hj"hžhhŸNh Nubh)”}”(hŒ):ref:`VIDIOC_STREAMOFF `”h]”hô)”}”(hjPh]”hŒVIDIOC_STREAMOFF”…””}”(hjRhžhhŸNh Nubah}”(h]”h ]”(hÿŒstd”Œstd-ref”eh"]”h$]”h&]”uh1hóhjNubah}”(h]”h ]”h"]”h$]”h&]”Œrefdoc”j Œ refdomain”j\Œreftype”Œref”Œ refexplicit”ˆŒrefwarn”ˆjŒvidioc_streamon”uh1hhŸh³h Kyhj"ubhŒ is called, ”…””}”(hj"hžhhŸNh Nubh)”}”(hŒ&:ref:`VIDIOC_REQBUFS `”h]”hô)”}”(hjth]”hŒVIDIOC_REQBUFS”…””}”(hjvhžhhŸNh Nubah}”(h]”h ]”(hÿŒstd”Œstd-ref”eh"]”h$]”h&]”uh1hóhjrubah}”(h]”h ]”h"]”h$]”h&]”Œrefdoc”j Œ refdomain”j€Œreftype”Œref”Œ refexplicit”ˆŒrefwarn”ˆjŒvidioc_reqbufs”uh1hhŸh³h Kyhj"ubhŒ, or when the device is closed.”…””}”(hj"hžhhŸNh Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1h×hŸh³h KyhjhžhubhØ)”}”(hX¨For 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 :ref:`VIDIOC_DQBUF ` 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 :c:func:`select()` and :c:func:`poll()` functions 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 ”…””}”(hjœhžhhŸNh Nubh)”}”(hŒ!:ref:`VIDIOC_DQBUF `”h]”hô)”}”(hj¦h]”hŒ VIDIOC_DQBUF”…””}”(hj¨hžhhŸNh Nubah}”(h]”h ]”(hÿŒstd”Œstd-ref”eh"]”h$]”h&]”uh1hóhj¤ubah}”(h]”h ]”h"]”h$]”h&]”Œrefdoc”j Œ refdomain”j²Œreftype”Œref”Œ refexplicit”ˆŒrefwarn”ˆjŒ vidioc_qbuf”uh1hhŸh³h K€hjœubhŒ: blocks when no buffer is in the outgoing queue. 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')”}”(hjÜh]”hŒopen()”…””}”(hjÞhžhhŸNh Nubah}”(h]”h ]”(hÿjZŒc-func”eh"]”h$]”h&]”uh1j&hjÚubah}”(h]”h ]”h"]”h$]”h&]”Œrefdoc”j Œ refdomain”jZŒreftype”Œfunc”Œ refexplicit”‰Œrefwarn”‰jkjojŒopen”uh1hhŸh³h K€hjœubhŒ function, ”…””}”(hjœhžhhŸNh Nubh)”}”(hŒ!:ref:`VIDIOC_DQBUF `”h]”hô)”}”(hjÿh]”hŒ VIDIOC_DQBUF”…””}”(hjhžhhŸNh Nubah}”(h]”h ]”(hÿŒstd”Œstd-ref”eh"]”h$]”h&]”uh1hóhjýubah}”(h]”h ]”h"]”h$]”h&]”Œrefdoc”j Œ refdomain”j Œreftype”Œref”Œ refexplicit”ˆŒrefwarn”ˆjŒ vidioc_qbuf”uh1hhŸh³h K€hjœubhŒ 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 buffer is available. The ”…””}”(hjœhžhhŸNh Nubh)”}”(hŒ:c:func:`select()`”h]”j')”}”(hj5h]”hŒselect()”…””}”(hj7hžhhŸNh Nubah}”(h]”h ]”(hÿjZŒc-func”eh"]”h$]”h&]”uh1j&hj3ubah}”(h]”h ]”h"]”h$]”h&]”Œrefdoc”j Œ refdomain”jZŒreftype”Œfunc”Œ refexplicit”‰Œrefwarn”‰jkjojŒselect”uh1hhŸh³h K€hjœubhŒ and ”…””}”(hjœhžhhŸNh Nubh)”}”(hŒ:c:func:`poll()`”h]”j')”}”(hjXh]”hŒpoll()”…””}”(hjZhžhhŸNh Nubah}”(h]”h ]”(hÿjZŒc-func”eh"]”h$]”h&]”uh1j&hjVubah}”(h]”h ]”h"]”h$]”h&]”Œrefdoc”j Œ refdomain”jZŒreftype”Œfunc”Œ refexplicit”‰Œrefwarn”‰jkjojŒpoll”uh1hhŸh³h K€hjœubhŒ functions are always available.”…””}”(hjœhžhhŸNh Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1h×hŸh³h K€hjhžhubhØ)”}”(hŒžTo start and stop capturing or displaying applications call the :ref:`VIDIOC_STREAMON ` and :ref:`VIDIOC_STREAMOFF ` ioctls.”h]”(hŒ@To start and stop capturing or displaying applications call the ”…””}”(hjhžhhŸNh Nubh)”}”(hŒ(:ref:`VIDIOC_STREAMON `”h]”hô)”}”(hj‰h]”hŒVIDIOC_STREAMON”…””}”(hj‹hžhhŸNh Nubah}”(h]”h ]”(hÿŒstd”Œstd-ref”eh"]”h$]”h&]”uh1hóhj‡ubah}”(h]”h ]”h"]”h$]”h&]”Œrefdoc”j Œ refdomain”j•Œreftype”Œref”Œ refexplicit”ˆŒrefwarn”ˆjŒvidioc_streamon”uh1hhŸh³h KhjubhŒ and ”…””}”(hjhžhhŸNh Nubh)”}”(hŒ):ref:`VIDIOC_STREAMOFF `”h]”hô)”}”(hj­h]”hŒVIDIOC_STREAMOFF”…””}”(hj¯hžhhŸNh Nubah}”(h]”h ]”(hÿŒstd”Œstd-ref”eh"]”h$]”h&]”uh1hóhj«ubah}”(h]”h ]”h"]”h$]”h&]”Œrefdoc”j Œ refdomain”j¹Œreftype”Œref”Œ refexplicit”ˆŒrefwarn”ˆjŒvidioc_streamon”uh1hhŸh³h KhjubhŒ ioctls.”…””}”(hjhžhhŸNh Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1h×hŸh³h Khjhž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]”hô)”}”(hjáh]”hŒVIDIOC_STREAMOFF”…””}”(hjãhžhhŸNh Nubah}”(h]”h ]”(hÿŒstd”Œstd-ref”eh"]”h$]”h&]”uh1hóhjßubah}”(h]”h ]”h"]”h$]”h&]”Œrefdoc”j Œ refdomain”jíŒreftype”Œref”Œ refexplicit”ˆŒrefwarn”ˆjŒ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]”j')”}”(hjh]”hŒ v4l2_buffer”…””}”(hjhžhhŸNh Nubah}”(h]”h ]”(hÿjZŒc-type”eh"]”h$]”h&]”uh1j&hjubah}”(h]”h ]”h"]”h$]”h&]”Œrefdoc”j Œ refdomain”jZŒreftype”Œtype”Œ refexplicit”‰Œrefwarn”‰jkjojŒ v4l2_buffer”uh1hhŸh³h K–hjÛubhŒ ”…””}”(hjÛhžhhŸNh Nubj')”}”(hŒ ``timestamp``”h]”hŒ timestamp”…””}”(hj&hžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j&hjÛubhŒ" of captured or outputted buffers.”…””}”(hjÛhžhhŸNh Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1h×hŸh³h K–hj×ubah}”(h]”h ]”h"]”h$]”h&]”uh1jÕhjhžhhŸh³h NubhØ)”}”(hXADrivers implementing DMABUF importing I/O must support the :ref:`VIDIOC_REQBUFS `, :ref:`VIDIOC_QBUF `, :ref:`VIDIOC_DQBUF `, :ref:`VIDIOC_STREAMON ` and :ref:`VIDIOC_STREAMOFF ` ioctls, and the :c:func:`select()` and :c:func:`poll()` functions.”h]”(hŒ;Drivers implementing DMABUF importing I/O must support the ”…””}”(hjDhžhhŸNh Nubh)”}”(hŒ&:ref:`VIDIOC_REQBUFS `”h]”hô)”}”(hjNh]”hŒVIDIOC_REQBUFS”…””}”(hjPhžhhŸNh Nubah}”(h]”h ]”(hÿŒstd”Œstd-ref”eh"]”h$]”h&]”uh1hóhjLubah}”(h]”h ]”h"]”h$]”h&]”Œrefdoc”j Œ refdomain”jZŒreftype”Œref”Œ refexplicit”ˆŒrefwarn”ˆjŒvidioc_reqbufs”uh1hhŸh³h KhjDubhŒ, ”…””}”(hjDhžhhŸNh Nubh)”}”(hŒ :ref:`VIDIOC_QBUF `”h]”hô)”}”(hjrh]”hŒ VIDIOC_QBUF”…””}”(hjthžhhŸNh Nubah}”(h]”h ]”(hÿŒstd”Œstd-ref”eh"]”h$]”h&]”uh1hóhjpubah}”(h]”h ]”h"]”h$]”h&]”Œrefdoc”j Œ refdomain”j~Œreftype”Œref”Œ refexplicit”ˆŒrefwarn”ˆjŒ vidioc_qbuf”uh1hhŸh³h KhjDubhŒ, ”…””}”(hjDhžhhŸNh Nubh)”}”(hŒ!:ref:`VIDIOC_DQBUF `”h]”hô)”}”(hj–h]”hŒ VIDIOC_DQBUF”…””}”(hj˜hžhhŸNh Nubah}”(h]”h ]”(hÿŒstd”Œstd-ref”eh"]”h$]”h&]”uh1hóhj”ubah}”(h]”h ]”h"]”h$]”h&]”Œrefdoc”j Œ refdomain”j¢Œreftype”Œref”Œ refexplicit”ˆŒrefwarn”ˆjŒ vidioc_qbuf”uh1hhŸh³h KhjDubhŒ, ”…””}”hjDsbh)”}”(hŒ(:ref:`VIDIOC_STREAMON `”h]”hô)”}”(hjºh]”hŒVIDIOC_STREAMON”…””}”(hj¼hžhhŸNh Nubah}”(h]”h ]”(hÿŒstd”Œstd-ref”eh"]”h$]”h&]”uh1hóhj¸ubah}”(h]”h ]”h"]”h$]”h&]”Œrefdoc”j Œ refdomain”jÆŒreftype”Œref”Œ refexplicit”ˆŒrefwarn”ˆjŒvidioc_streamon”uh1hhŸh³h KhjDubhŒ and ”…””}”(hjDhžhhŸNh Nubh)”}”(hŒ):ref:`VIDIOC_STREAMOFF `”h]”hô)”}”(hjÞh]”hŒVIDIOC_STREAMOFF”…””}”(hjàhžhhŸNh Nubah}”(h]”h ]”(hÿŒstd”Œstd-ref”eh"]”h$]”h&]”uh1hóhjÜubah}”(h]”h ]”h"]”h$]”h&]”Œrefdoc”j Œ refdomain”jêŒreftype”Œref”Œ refexplicit”ˆŒrefwarn”ˆjŒvidioc_streamon”uh1hhŸh³h KhjDubhŒ ioctls, and the ”…””}”(hjDhžhhŸNh Nubh)”}”(hŒ:c:func:`select()`”h]”j')”}”(hjh]”hŒselect()”…””}”(hjhžhhŸNh Nubah}”(h]”h ]”(hÿjZŒc-func”eh"]”h$]”h&]”uh1j&hjubah}”(h]”h ]”h"]”h$]”h&]”Œrefdoc”j Œ refdomain”jZŒreftype”Œfunc”Œ refexplicit”‰Œrefwarn”‰jkjojŒselect”uh1hhŸh³h KhjDubhŒ and ”…””}”hjDsbh)”}”(hŒ:c:func:`poll()`”h]”j')”}”(hj%h]”hŒpoll()”…””}”(hj'hžhhŸNh Nubah}”(h]”h ]”(hÿjZŒc-func”eh"]”h$]”h&]”uh1j&hj#ubah}”(h]”h ]”h"]”h$]”h&]”Œrefdoc”j Œ refdomain”jZŒreftype”Œfunc”Œ refexplicit”‰Œrefwarn”‰jkjojŒpoll”uh1hhŸh³h KhjDubhŒ functions.”…””}”(hjDhžhhŸNh Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1h×hŸh³h Khjhžhubeh}”(h]”Œ1example-3-6-queueing-dmabuf-using-multi-plane-api”ah ]”h"]”Œ2example 3.6. queueing dmabuf using multi plane api”ah$]”h&]”uh1hÂhhÄhžhhŸh³h K[ubeh}”(h]”(Œ"streaming-i-o-dma-buffer-importing”hÁeh ]”h"]”(Œ$streaming i/o (dma buffer importing)”Œdmabuf”eh$]”h&]”uh1hÂhhhžhhŸh³h KŒexpect_referenced_by_name”}”jZh¶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”}”(jZhÁjYjVj×jÔjÿjüjQjNuŒ nametypes”}”(jZˆjY‰j׉jÿ‰jQ‰uh}”(hÁhÄjVhÄjÔjWjüjÚjNjuŒ 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 "dmabuf" 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.