Lines Matching +full:suspend +full:- +full:to +full:- +full:disk
1 .. SPDX-License-Identifier: GFDL-1.1-no-invariants-or-later
14 streaming methods, to determine if the memory mapping flavor is
16 with the memory type set to ``V4L2_MEMORY_MMAP``.
18 Streaming is an I/O method where only pointers to buffers are exchanged
20 mapping is primarily intended to map buffers in device memory into the
22 memory on a graphics card with a video capture add-on. However, being
24 drivers support streaming as well, allocating buffers in DMA-able main
29 a different type of data. To access different sets at the same time
32 To allocate device buffers applications call the
35 This ioctl can also be used to change the number of buffers or to free
41 :ref:`VIDIOC_QUERYBUF` ioctl. In the single-planar
44 parameter to the :c:func:`mmap()` function. When using the
45 multi-planar API, struct :c:type:`v4l2_buffer` contains an
48 multi-planar API, every plane of every buffer has to be mapped
49 separately, so the number of calls to :c:func:`mmap()` should
50 be equal to number of buffers times number of planes in each buffer. The
52 allocated in physical memory, as opposed to virtual memory, which can be
53 swapped out to disk. Applications should free the buffers as soon as
56 Example: Mapping buffers in the single-planar API
59 .. code-block:: c
73 if (-1 == ioctl (fd, VIDIOC_REQBUFS, &reqbuf)) {
75 printf("Video capturing or mmap-streaming is not supported\\n");
85 /* You may need to free the buffers here. */
101 if (-1 == ioctl (fd, VIDIOC_QUERYBUF, &buffer)) {
126 Example: Mapping buffers in the multi-planar API
129 .. code-block:: c
148 printf("Video capturing or mmap-streaming is not supported\\n");
158 /* You may need to free the buffers here. */
174 /* length in struct v4l2_buffer in multi-planar API stores the size
184 /* Every plane has to be mapped separately */
210 operation locked to a video clock from the application which is subject
211 to random disk or network delays and preemption by other processes,
217 to function, apart of this no limit exists on the number of buffers
225 driver. For capturing applications it is customary to first enqueue all
226 mapped buffers, then to start capturing and enter the read loop. Here
228 re-enqueues the buffer when the data is no longer needed. Output
234 To enqueue and dequeue a buffer applications use the
238 methods exist to suspend execution of the application until one or more
241 flag was given to the :c:func:`open()` function,
246 To start and stop capturing or output applications call the
253 application needs to synchronize with another event it should examine
262 <func-mmap>`, :c:func:`munmap()`, :ref:`select()
263 <func-select>` and :c:func:`poll()` function. [#f3]_
277 order (such as video codecs) to return buffers earlier, reducing the
278 probability of data loss. Random fill order allows drivers to reuse
279 buffers on a LIFO-basis, taking advantage of caches holding
280 scatter-gather lists and the like.
284 the same, and :c:func:`select()` is too important to be optional.