Lines Matching +full:frame +full:- +full:buffer
1 .. SPDX-License-Identifier: GPL-2.0 OR GFDL-1.1-no-invariants-or-later
4 .. _media-request-api:
12 the same pipeline to reconfigure and collaborate closely on a per-frame basis.
14 to specific frames (aka 'per-frame controls') in order to be used efficiently.
16 While the initial use-case was V4L2, it can be extended to other subsystems
20 it is, it is terribly inefficient: user-space would have to flush all activity
21 on the media pipeline, reconfigure it for the next frame, queue the buffers to
23 dequeuing before considering the next frame. This defeats the purpose of having
24 buffer queues since in practice only one buffer would be queued at a time.
28 specific buffers. This allows user-space to schedule several tasks ("requests")
34 -------------
37 subsystem-specific APIs to support request usage. At the Media Controller
40 an opaque way. Configuration data, buffer handles and processing results
41 stored in requests are accessed through subsystem-specific APIs extended for
46 ------------------
48 User-space allocates requests using :ref:`MEDIA_IOC_REQUEST_ALLOC`
53 -------------------
60 enter the regular buffer queue until the request itself is queued.
63 ------------------
67 A request must contain at least one buffer, otherwise ``ENOENT`` is returned.
71 For :ref:`memory-to-memory devices <mem2mem>` you can use requests only for
72 output buffers, not for capture buffers. Attempting to add a capture buffer
85 :ref:`closed <func-close>`. Attempts to directly queue a buffer when earlier
86 a buffer was queued via a request or vice versa will result in an ``EBUSY``
97 User-space can :c:func:`poll()` a request file descriptor in
101 Note that user-space does not need to wait for the request to complete to
106 executed. User-space can query that state by calling
113 .. _media-request-life-time:
116 -------------------------
130 --------------------------
132 For use-cases such as :ref:`codecs <mem2mem>`, the request API can be used
134 be applied by the driver for the OUTPUT buffer, allowing user-space
139 Put into code, after obtaining a request, user-space can assign controls and one
140 OUTPUT buffer to it:
142 .. code-block:: c
163 since there are no per-frame settings to report there.
167 .. code-block:: c
172 User-space can then either wait for the request to complete by calling poll() on
177 .. code-block:: c
186 Note that this example assumes for simplicity that for every OUTPUT buffer
187 there will be one CAPTURE buffer, but this does not have to be the case.
193 query values as soon as the capture buffer is produced.
195 .. code-block:: c
198 poll(&pfd, 1, -1);
208 .. code-block:: c
215 .. code-block:: c
220 -----------------------------------
223 for a given CAPTURE buffer.
225 .. code-block:: c
247 .. code-block:: c
252 User-space can then dequeue buffers, wait for the request completion, query