Lines Matching +full:memory +full:- +full:mapped

1 .. SPDX-License-Identifier: GFDL-1.1-no-invariants-or-later
7 Streaming I/O (Memory Mapping)
14 streaming methods, to determine if the memory mapping flavor is
16 with the memory type set to ``V4L2_MEMORY_MMAP``.
19 between application and driver, the data itself is not copied. Memory
20 mapping is primarily intended to map buffers in device memory into the
21 application's address space. Device memory can be for example the video
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
25 memory.
36 the allocated memory, provided none of the buffers are still mapped.
40 location of the buffers in device memory can be determined with the
41 :ref:`VIDIOC_QUERYBUF` ioctl. In the single-planar
45 multi-planar API, struct :c:type:`v4l2_buffer` contains an
48 multi-planar API, every plane of every buffer has to be mapped
52 allocated in physical memory, as opposed to virtual memory, which can be
56 Example: Mapping buffers in the single-planar API
59 .. code-block:: c
70 reqbuf.memory = V4L2_MEMORY_MMAP;
73 if (-1 == ioctl (fd, VIDIOC_REQBUFS, &reqbuf)) {
75 printf("Video capturing or mmap-streaming is not supported\\n");
86 printf("Not enough buffer memory\\n");
98 buffer.memory = V4L2_MEMORY_MMAP;
101 if (-1 == ioctl (fd, VIDIOC_QUERYBUF, &buffer)) {
115 the buffers mapped so far. */
126 Example: Mapping buffers in the multi-planar API
129 .. code-block:: c
143 reqbuf.memory = V4L2_MEMORY_MMAP;
148 printf("Video capturing or mmap-streaming is not supported\\n");
159 printf("Not enough buffer memory\\n");
172 buffer.memory = V4L2_MEMORY_MMAP;
174 /* length in struct v4l2_buffer in multi-planar API stores the size
184 /* Every plane has to be mapped separately */
195 the buffers and planes mapped so far. */
224 Initially all mapped buffers are in dequeued state, inaccessible by the
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
236 ioctl. The status of a buffer being mapped, enqueued, full or empty can
257 Drivers implementing memory mapping I/O must support the
262 <func-mmap>`, :c:func:`munmap()`, :ref:`select()
263 <func-select>` and :c:func:`poll()` function. [#f3]_
279 buffers on a LIFO-basis, taking advantage of caches holding
280 scatter-gather lists and the like.