Lines Matching +full:output +full:- +full:only

1 .. SPDX-License-Identifier: GPL-2.0 OR GFDL-1.1-no-invariants-or-later
6 Memory-to-Memory Stateful Video Encoder Interface
12 further post-processing by the client.
34 5. Single-planar API (see :ref:`planar-apis`) and applicable structures may be
35 used interchangeably with multi-planar API, unless specified otherwise,
41 7. Given an ``OUTPUT`` buffer A, then A' represents a buffer on the ``CAPTURE``
47 Refer to :ref:`decoder-glossary`.
52 .. kernel-render:: DOT
65 qi -> Initialization [ label = "open()" ];
67 Initialization -> Encoding [ label = "Both queues streaming" ];
69 Encoding -> Drain [ label = "V4L2_ENC_CMD_STOP" ];
70 Encoding -> Reset [ label = "VIDIOC_STREAMOFF(CAPTURE)" ];
71 Encoding -> Stopped [ label = "VIDIOC_STREAMOFF(OUTPUT)" ];
72 Encoding -> Encoding;
74 Drain -> Stopped [ label = "All CAPTURE\nbuffers dequeued\nor\nVIDIOC_STREAMOFF(OUTPUT)" ];
75 Drain -> Reset [ label = "VIDIOC_STREAMOFF(CAPTURE)" ];
77 Reset -> Encoding [ label = "VIDIOC_STREAMON(CAPTURE)" ];
78 Reset -> Initialization [ label = "VIDIOC_REQBUFS(OUTPUT, 0)" ];
80 Stopped -> Encoding [ label = "V4L2_ENC_CMD_START\nor\nVIDIOC_STREAMON(OUTPUT)" ];
81 Stopped -> Reset [ label = "VIDIOC_STREAMOFF(CAPTURE)" ];
91 format set on ``OUTPUT``.
94 :c:func:`VIDIOC_ENUM_FMT` on ``OUTPUT``.
96 * Only the formats supported for the format currently active on ``CAPTURE``
101 enumerate the formats on ``OUTPUT``.
161 ignored (read-only).
173 ``OUTPUT`` format, selection rectangles, etc. (read-only).
177 Changing the ``CAPTURE`` format may change the currently set ``OUTPUT``
178 format. How the new ``OUTPUT`` format is determined is up to the encoder
181 2. **Optional.** Enumerate supported ``OUTPUT`` formats (raw formats for
187 a ``V4L2_BUF_TYPE_*`` enum appropriate for ``OUTPUT``.
201 3. Set the raw source format on the ``OUTPUT`` queue via
207 a ``V4L2_BUF_TYPE_*`` enum appropriate for ``OUTPUT``.
228 * Setting the ``OUTPUT`` format will reset the selection rectangles to their
232 4. Set the raw frame interval on the ``OUTPUT`` queue via
239 a ``V4L2_BUF_TYPE_*`` enum appropriate for ``OUTPUT``.
241 ``parm.output``
242 set all fields except ``parm.output.timeperframe`` to 0.
244 ``parm.output.timeperframe``
250 ``parm.output.timeperframe``
255 Changing the ``OUTPUT`` frame interval *also* sets the framerate that
259 ``OUTPUT`` queue is just a hint, the application may provide raw
264 changed to a different value. This is useful for off-line encoding
276 It is due to historical reasons that changing the ``OUTPUT`` frame
282 :c:func:`VIDIOC_S_PARM`. This is only necessary if the coded frame
284 the case for off-line encoding. Support for this feature is signalled
285 by the :ref:`V4L2_FMT_FLAG_ENC_CAP_FRAME_INTERVAL <fmtdesc-flags>` format flag.
309 fast raw frames are queued on the ``OUTPUT`` queue.
320 the desired coded frame interval for the ``OUTPUT`` queue.
323 ``OUTPUT`` frame interval must support this optional feature.
326 :c:func:`VIDIOC_S_SELECTION` on the ``OUTPUT`` queue if it is desired
327 to be different than the full OUTPUT resolution.
332 a ``V4L2_BUF_TYPE_*`` enum appropriate for ``OUTPUT``.
347 * The following selection targets are supported on ``OUTPUT``:
350 equal to the full source frame, matching the active ``OUTPUT``
375 7. Allocate buffers for both ``OUTPUT`` and ``CAPTURE`` via
384 a ``V4L2_BUF_TYPE_*`` enum appropriate for ``OUTPUT`` or
403 To allocate more than the minimum number of OUTPUT buffers (for pipeline
418 a ``V4L2_BUF_TYPE_*`` enum appropriate for ``OUTPUT``.
428 8. Begin streaming on both ``OUTPUT`` and ``CAPTURE`` queues via
455 format and may be affected by codec-specific extended controls, as stated
459 queues and memory-to-memory devices. In addition, the order of encoded frames
461 frames to the ``OUTPUT`` queue, due to properties of the selected coded format,
465 ``OUTPUT`` buffers and any specific timing of buffers becoming
468 * a buffer queued to ``OUTPUT`` may result in more than one buffer produced on
473 * a buffer queued to ``OUTPUT`` may result in a buffer being produced on
475 ``OUTPUT`` buffers, or be returned out of order, e.g. if display
479 buffers queued to ``OUTPUT`` (e.g. during drain or ``EOS``), because of the
480 ``OUTPUT`` buffers queued in the past whose encoding results are only
483 * buffers queued to ``OUTPUT`` may not become available to dequeue instantly
489 To allow matching encoded ``CAPTURE`` buffers with ``OUTPUT`` buffers they
491 :c:type:`v4l2_buffer` struct when queuing an ``OUTPUT`` buffer. The
492 ``CAPTURE`` buffer(s), which resulted from encoding that ``OUTPUT`` buffer
495 In addition to the straightforward case of one ``OUTPUT`` buffer producing
498 * one ``OUTPUT`` buffer generates multiple ``CAPTURE`` buffers: the same
499 ``OUTPUT`` timestamp will be copied to multiple ``CAPTURE`` buffers,
502 ``CAPTURE`` buffers are out-of-order compared to the ``OUTPUT`` buffers):
503 ``CAPTURE`` timestamps will not retain the order of ``OUTPUT`` timestamps.
520 * if the encoder is able to precisely report the ``OUTPUT`` buffer(s) that triggered
532 further operations on corresponding encoder file handle will return the -EIO
541 parameters at any time. The availability of parameters is encoder-specific
544 The ability to change each parameter during encoding is encoder-specific, as
547 -EBUSY error code, the ``CAPTURE`` queue needs to be stopped for the
551 The timing of parameter updates is encoder-specific, as per the standard
554 (:ref:`media-request-api`) should be considered, if supported by the encoder.
559 To ensure that all the queued ``OUTPUT`` buffers have been processed and the
562 received all encoded frames for all ``OUTPUT`` buffers queued before the
580 The sequence can be only initiated if both ``OUTPUT`` and ``CAPTURE``
586 2. Any ``OUTPUT`` buffers queued by the client before the
603 marked with ``V4L2_BUF_FLAG_LAST`` will result in a -EPIPE error from
606 * dequeuing processed ``OUTPUT`` buffers, until all the buffers queued
618 3. Once all ``OUTPUT`` buffers queued before the ``V4L2_ENC_CMD_STOP`` call are
620 and it will accept, but not process any newly queued ``OUTPUT`` buffers
623 * ``V4L2_ENC_CMD_START`` - the encoder will not be reset and will resume
627 ``CAPTURE`` queue - the encoder will be reset (see the `Reset` sequence)
631 ``OUTPUT`` queue - the encoder will resume operation normally, however any
632 source frames queued to the ``OUTPUT`` queue between ``V4L2_ENC_CMD_STOP``
639 issuing :c:func:`VIDIOC_STREAMOFF` on any of the ``OUTPUT`` or ``CAPTURE``
642 will fail with -EBUSY error code if attempted.
646 * In case of no buffer in the ``OUTPUT`` queue at the time the
660 * If :c:func:`VIDIOC_STREAMOFF` is called on the ``OUTPUT`` queue in the
683 1. Perform the `Drain` sequence to ensure all the in-flight encoding finishes
694 starting at the first ``OUTPUT`` buffer queued after issuing the
707 supported/advertised on the ``OUTPUT`` queue. In particular, it also means
708 that the ``OUTPUT`` format may be reset and the client must not rely on the
711 2. Enumerating formats on the ``OUTPUT`` queue always returns only formats
714 3. Setting the format on the ``OUTPUT`` queue does not change the list of
715 formats available on the ``CAPTURE`` queue. An attempt to set the ``OUTPUT``
717 will result in the encoder adjusting the requested ``OUTPUT`` format to a
721 supported coded formats, irrespective of the current ``OUTPUT`` format.
723 5. While buffers are allocated on any of the ``OUTPUT`` or ``CAPTURE`` queues,
725 return the -EBUSY error code for any such format change attempt.
729 set of supported formats for the ``OUTPUT`` queue.