sphinx.addnodesdocument)}( rawsourcechildren]( translations LanguagesNode)}(hhh](h pending_xref)}(hhh]docutils.nodesTextChinese (Simplified)}parenthsba attributes}(ids]classes]names]dupnames]backrefs] refdomainstdreftypedoc reftarget7/translations/zh_CN/userspace-api/media/v4l/dev-decodermodnameN classnameN refexplicitutagnamehhh ubh)}(hhh]hChinese (Traditional)}hh2sbah}(h]h ]h"]h$]h&] refdomainh)reftypeh+ reftarget7/translations/zh_TW/userspace-api/media/v4l/dev-decodermodnameN classnameN refexplicituh1hhh ubh)}(hhh]hItalian}hhFsbah}(h]h ]h"]h$]h&] refdomainh)reftypeh+ reftarget7/translations/it_IT/userspace-api/media/v4l/dev-decodermodnameN classnameN refexplicituh1hhh ubh)}(hhh]hJapanese}hhZsbah}(h]h ]h"]h$]h&] refdomainh)reftypeh+ reftarget7/translations/ja_JP/userspace-api/media/v4l/dev-decodermodnameN classnameN refexplicituh1hhh ubh)}(hhh]hKorean}hhnsbah}(h]h ]h"]h$]h&] refdomainh)reftypeh+ reftarget7/translations/ko_KR/userspace-api/media/v4l/dev-decodermodnameN classnameN refexplicituh1hhh ubh)}(hhh]hPortuguese (Brazilian)}hhsbah}(h]h ]h"]h$]h&] refdomainh)reftypeh+ reftarget7/translations/pt_BR/userspace-api/media/v4l/dev-decodermodnameN classnameN refexplicituh1hhh ubh)}(hhh]hSpanish}hhsbah}(h]h ]h"]h$]h&] refdomainh)reftypeh+ reftarget7/translations/sp_SP/userspace-api/media/v4l/dev-decodermodnameN classnameN refexplicituh1hhh ubeh}(h]h ]h"]h$]h&]current_languageEnglishuh1h hh _documenthsourceNlineNubhcomment)}(h SPDX-License-Identifier: GPL-2.0h]h SPDX-License-Identifier: GPL-2.0}hhsbah}(h]h ]h"]h$]h&] xml:spacepreserveuh1hhhhhhQ/var/lib/git/docbuild/linux/Documentation/userspace-api/media/v4l/dev-decoder.rsthKubhtarget)}(h .. _decoder:h]h}(h]h ]h"]h$]h&]refiddecoderuh1hhKhhhhhhubhsection)}(hhh](htitle)}(h1Memory-to-Memory Stateful Video Decoder Interfaceh]h1Memory-to-Memory Stateful Video Decoder Interface}(hhhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhhhhhKubh paragraph)}(hXA stateful video decoder takes complete chunks of the bytestream (e.g. Annex-B H.264/HEVC stream, raw VP8/9 stream) and decodes them into raw video frames in display order. The decoder is expected not to require any additional information from the client to process these buffers.h]hXA stateful video decoder takes complete chunks of the bytestream (e.g. Annex-B H.264/HEVC stream, raw VP8/9 stream) and decodes them into raw video frames in display order. The decoder is expected not to require any additional information from the client to process these buffers.}(hhhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK hhhhubh)}(hPerforming software parsing, processing etc. of the stream in the driver in order to support this interface is strongly discouraged. In case such operations are needed, use of the Stateless Video Decoder Interface (in development) is strongly advised.h]hPerforming software parsing, processing etc. of the stream in the driver in order to support this interface is strongly discouraged. In case such operations are needed, use of the Stateless Video Decoder Interface (in development) is strongly advised.}(hhhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhhhhubh)}(hhh](h)}(h/Conventions and Notations Used in This Documenth]h/Conventions and Notations Used in This Document}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj hhhhhKubhenumerated_list)}(hhh](h list_item)}(hNThe general V4L2 API rules apply if not specified in this document otherwise. h]h)}(hMThe general V4L2 API rules apply if not specified in this document otherwise.h]hMThe general V4L2 API rules apply if not specified in this document otherwise.}(hj%hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhj!ubah}(h]h ]h"]h$]h&]uh1jhjhhhhhNubj )}(hpThe meaning of words "must", "may", "should", etc. is as per `RFC 2119 `_. h]h)}(hoThe meaning of words "must", "may", "should", etc. is as per `RFC 2119 `_.h](hIThe meaning of words “must”, “may”, “should”, etc. is as per }(hj=hhhNhNubh reference)}(h1`RFC 2119 `_h]hRFC 2119}(hjGhhhNhNubah}(h]h ]h"]h$]h&]nameRFC 2119refuri#https://tools.ietf.org/html/rfc2119uh1jEhj=ubh)}(h& h]h}(h]rfc-2119ah ]h"]rfc 2119ah$]h&]refurijXuh1hȌ referencedKhj=ubh.}(hj=hhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhKhj9ubah}(h]h ]h"]h$]h&]uh1jhjhhhhhNubj )}(h.All steps not marked "optional" are required. h]h)}(h-All steps not marked "optional" are required.h]h1All steps not marked “optional” are required.}(hj{hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjwubah}(h]h ]h"]h$]h&]uh1jhjhhhhhNubj )}(h:c:func:`VIDIOC_G_EXT_CTRLS` and :c:func:`VIDIOC_S_EXT_CTRLS` may be used interchangeably with :c:func:`VIDIOC_G_CTRL` and :c:func:`VIDIOC_S_CTRL`, unless specified otherwise. h]h)}(h:c:func:`VIDIOC_G_EXT_CTRLS` and :c:func:`VIDIOC_S_EXT_CTRLS` may be used interchangeably with :c:func:`VIDIOC_G_CTRL` and :c:func:`VIDIOC_S_CTRL`, unless specified otherwise.h](h)}(h:c:func:`VIDIOC_G_EXT_CTRLS`h]hliteral)}(hjh]hVIDIOC_G_EXT_CTRLS()}(hjhhhNhNubah}(h]h ](xrefcc-funceh"]h$]h&]uh1jhjubah}(h]h ]h"]h$]h&]refdoc#userspace-api/media/v4l/dev-decoder refdomainjreftypefunc refexplicitrefwarn c:parent_keysphinx.domains.c LookupKey)}data]j ASTIdentifier)} identifierV4LsbNasb reftargetVIDIOC_G_EXT_CTRLSuh1hhhhKhjubh and }(hjhhhNhNubh)}(h:c:func:`VIDIOC_S_EXT_CTRLS`h]j)}(hjh]hVIDIOC_S_EXT_CTRLS()}(hjhhhNhNubah}(h]h ](jjc-funceh"]h$]h&]uh1jhjubah}(h]h ]h"]h$]h&]refdocj refdomainjreftypefunc refexplicitrefwarnjjjVIDIOC_S_EXT_CTRLSuh1hhhhKhjubh" may be used interchangeably with }(hjhhhNhNubh)}(h:c:func:`VIDIOC_G_CTRL`h]j)}(hjh]hVIDIOC_G_CTRL()}(hjhhhNhNubah}(h]h ](jjc-funceh"]h$]h&]uh1jhjubah}(h]h ]h"]h$]h&]refdocj refdomainjreftypefunc refexplicitrefwarnjjj VIDIOC_G_CTRLuh1hhhhKhjubh and }hjsbh)}(h:c:func:`VIDIOC_S_CTRL`h]j)}(hjh]hVIDIOC_S_CTRL()}(hjhhhNhNubah}(h]h ](jjc-funceh"]h$]h&]uh1jhjubah}(h]h ]h"]h$]h&]refdocj refdomainjreftypefunc refexplicitrefwarnjjj VIDIOC_S_CTRLuh1hhhhKhjubh, unless specified otherwise.}(hjhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhKhjubah}(h]h ]h"]h$]h&]uh1jhjhhhhhNubj )}(hSingle-planar API (see :ref:`planar-apis`) and applicable structures may be used interchangeably with multi-planar API, unless specified otherwise, depending on decoder capabilities and following the general V4L2 guidelines. h]h)}(hSingle-planar API (see :ref:`planar-apis`) and applicable structures may be used interchangeably with multi-planar API, unless specified otherwise, depending on decoder capabilities and following the general V4L2 guidelines.h](hSingle-planar API (see }(hjHhhhNhNubh)}(h:ref:`planar-apis`h]hinline)}(hjRh]h planar-apis}(hjVhhhNhNubah}(h]h ](jstdstd-refeh"]h$]h&]uh1jThjPubah}(h]h ]h"]h$]h&]refdocj refdomainj`reftyperef refexplicitrefwarnj planar-apisuh1hhhhK#hjHubh) and applicable structures may be used interchangeably with multi-planar API, unless specified otherwise, depending on decoder capabilities and following the general V4L2 guidelines.}(hjHhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhK#hjDubah}(h]h ]h"]h$]h&]uh1jhjhhhhhNubj )}(hWi = [a..b]: sequence of integers from a to b, inclusive, i.e. i = [0..2]: i = 0, 1, 2. h]h)}(hVi = [a..b]: sequence of integers from a to b, inclusive, i.e. i = [0..2]: i = 0, 1, 2.h]hVi = [a..b]: sequence of integers from a to b, inclusive, i.e. i = [0..2]: i = 0, 1, 2.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK'hjubah}(h]h ]h"]h$]h&]uh1jhjhhhhhNubj )}(hGiven an ``OUTPUT`` buffer A, then A' represents a buffer on the ``CAPTURE`` queue containing data that resulted from processing buffer A. h]h)}(hGiven an ``OUTPUT`` buffer A, then A' represents a buffer on the ``CAPTURE`` queue containing data that resulted from processing buffer A.h](h Given an }(hjhhhNhNubj)}(h ``OUTPUT``h]hOUTPUT}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubh0 buffer A, then A’ represents a buffer on the }(hjhhhNhNubj)}(h ``CAPTURE``h]hCAPTURE}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubh> queue containing data that resulted from processing buffer A.}(hjhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhK*hjubah}(h]h ]h"]h$]h&]uh1jhjhhhhhNubeh}(h]h ]h"]h$]h&]enumtypearabicprefixhsuffix.uh1jhj hhhhhKubh)}(h.. _decoder-glossary:h]h}(h]h ]h"]h$]h&]hԌdecoder-glossaryuh1hhK-hj hhhhubeh}(h]/conventions-and-notations-used-in-this-documentah ]h"]/conventions and notations used in this documentah$]h&]uh1hhhhhhhhKubh)}(hhh](h)}(hGlossaryh]hGlossary}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjhhhhhK0ubhdefinition_list)}(hhh](hdefinition_list_item)}(hX1CAPTURE the destination buffer queue; for decoders, the queue of buffers containing decoded frames; for encoders, the queue of buffers containing an encoded bytestream; ``V4L2_BUF_TYPE_VIDEO_CAPTURE`` or ``V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE``; data is captured from the hardware into ``CAPTURE`` buffers. h](hterm)}(hCAPTUREh]hCAPTURE}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhhhK7hj ubh definition)}(hhh]h)}(hX(the destination buffer queue; for decoders, the queue of buffers containing decoded frames; for encoders, the queue of buffers containing an encoded bytestream; ``V4L2_BUF_TYPE_VIDEO_CAPTURE`` or ``V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE``; data is captured from the hardware into ``CAPTURE`` buffers.h](hthe destination buffer queue; for decoders, the queue of buffers containing decoded frames; for encoders, the queue of buffers containing an encoded bytestream; }(hj%hhhNhNubj)}(h``V4L2_BUF_TYPE_VIDEO_CAPTURE``h]hV4L2_BUF_TYPE_VIDEO_CAPTURE}(hj-hhhNhNubah}(h]h ]h"]h$]h&]uh1jhj%ubh or }(hj%hhhNhNubj)}(h&``V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE``h]h"V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE}(hj?hhhNhNubah}(h]h ]h"]h$]h&]uh1jhj%ubh*; data is captured from the hardware into }(hj%hhhNhNubj)}(h ``CAPTURE``h]hCAPTURE}(hjQhhhNhNubah}(h]h ]h"]h$]h&]uh1jhj%ubh buffers.}(hj%hhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhK3hj"ubah}(h]h ]h"]h$]h&]uh1j hj ubeh}(h]h ]h"]h$]h&]uh1j hhhK7hjubj )}(h^client the application communicating with the decoder or encoder implementing this interface. h](j)}(hclienth]hclient}(hjyhhhNhNubah}(h]h ]h"]h$]h&]uh1jhhhK;hjuubj!)}(hhh]h)}(hVthe application communicating with the decoder or encoder implementing this interface.h]hVthe application communicating with the decoder or encoder implementing this interface.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK:hjubah}(h]h ]h"]h$]h&]uh1j hjuubeh}(h]h ]h"]h$]h&]uh1j hhhK;hjhhubj )}(hgcoded format encoded/compressed video bytestream format (e.g. H.264, VP8, etc.); see also: raw format. h](j)}(h coded formath]h coded format}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhhhK?hjubj!)}(hhh]h)}(hYencoded/compressed video bytestream format (e.g. H.264, VP8, etc.); see also: raw format.h]hYencoded/compressed video bytestream format (e.g. H.264, VP8, etc.); see also: raw format.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK>hjubah}(h]h ]h"]h$]h&]uh1j hjubeh}(h]h ]h"]h$]h&]uh1j hhhK?hjhhubj )}(h0coded height height for given coded resolution. h](j)}(h coded heighth]h coded height}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhhhKBhjubj!)}(hhh]h)}(h"height for given coded resolution.h]h"height for given coded resolution.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKBhjubah}(h]h ]h"]h$]h&]uh1j hjubeh}(h]h ]h"]h$]h&]uh1j hhhKBhjhhubj )}(hcoded resolution stream resolution in pixels aligned to codec and hardware requirements; typically visible resolution rounded up to full macroblocks; see also: visible resolution. h](j)}(hcoded resolutionh]hcoded resolution}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhhhKGhjubj!)}(hhh]h)}(hstream resolution in pixels aligned to codec and hardware requirements; typically visible resolution rounded up to full macroblocks; see also: visible resolution.h]hstream resolution in pixels aligned to codec and hardware requirements; typically visible resolution rounded up to full macroblocks; see also: visible resolution.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKEhjubah}(h]h ]h"]h$]h&]uh1j hjubeh}(h]h ]h"]h$]h&]uh1j hhhKGhjhhubj )}(h.coded width width for given coded resolution. h](j)}(h coded widthh]h coded width}(hj5hhhNhNubah}(h]h ]h"]h$]h&]uh1jhhhKJhj1ubj!)}(hhh]h)}(h!width for given coded resolution.h]h!width for given coded resolution.}(hjFhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKJhjCubah}(h]h ]h"]h$]h&]uh1j hj1ubeh}(h]h ]h"]h$]h&]uh1j hhhKJhjhhubj )}(hcoding tree unit processing unit of the HEVC codec (corresponds to macroblock units in H.264, VP8, VP9), can use block structures of up to 64×64 pixels. Good at sub-partitioning the picture into variable sized structures. h](j)}(hcoding tree unith]hcoding tree unit}(hjdhhhNhNubah}(h]h ]h"]h$]h&]uh1jhhhKPhj`ubj!)}(hhh]h)}(hprocessing unit of the HEVC codec (corresponds to macroblock units in H.264, VP8, VP9), can use block structures of up to 64×64 pixels. Good at sub-partitioning the picture into variable sized structures.h]hprocessing unit of the HEVC codec (corresponds to macroblock units in H.264, VP8, VP9), can use block structures of up to 64×64 pixels. Good at sub-partitioning the picture into variable sized structures.}(hjuhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKMhjrubah}(h]h ]h"]h$]h&]uh1j hj`ubeh}(h]h ]h"]h$]h&]uh1j hhhKPhjhhubj )}(hX/decode order the order in which frames are decoded; may differ from display order if the coded format includes a feature of frame reordering; for decoders, ``OUTPUT`` buffers must be queued by the client in decode order; for encoders ``CAPTURE`` buffers must be returned by the encoder in decode order. h](j)}(h decode orderh]h decode order}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhhhKVhjubj!)}(hhh]h)}(hX!the order in which frames are decoded; may differ from display order if the coded format includes a feature of frame reordering; for decoders, ``OUTPUT`` buffers must be queued by the client in decode order; for encoders ``CAPTURE`` buffers must be returned by the encoder in decode order.h](hthe order in which frames are decoded; may differ from display order if the coded format includes a feature of frame reordering; for decoders, }(hjhhhNhNubj)}(h ``OUTPUT``h]hOUTPUT}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubhD buffers must be queued by the client in decode order; for encoders }(hjhhhNhNubj)}(h ``CAPTURE``h]hCAPTURE}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubh9 buffers must be returned by the encoder in decode order.}(hjhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhKShjubah}(h]h ]h"]h$]h&]uh1j hjubeh}(h]h ]h"]h$]h&]uh1j hhhKVhjhhubj )}(hEdestination data resulting from the decode process; see ``CAPTURE``. h](j)}(h destinationh]h destination}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhhhKYhjubj!)}(hhh]h)}(h8data resulting from the decode process; see ``CAPTURE``.h](h,data resulting from the decode process; see }(hjhhhNhNubj)}(h ``CAPTURE``h]hCAPTURE}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubh.}(hjhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhKYhjubah}(h]h ]h"]h$]h&]uh1j hjubeh}(h]h ]h"]h$]h&]uh1j hhhKYhjhhubj )}(hdisplay order the order in which frames must be displayed; for encoders, ``OUTPUT`` buffers must be queued by the client in display order; for decoders, ``CAPTURE`` buffers must be returned by the decoder in display order. h](j)}(h display orderh]h display order}(hj'hhhNhNubah}(h]h ]h"]h$]h&]uh1jhhhK^hj#ubj!)}(hhh]h)}(hthe order in which frames must be displayed; for encoders, ``OUTPUT`` buffers must be queued by the client in display order; for decoders, ``CAPTURE`` buffers must be returned by the decoder in display order.h](h;the order in which frames must be displayed; for encoders, }(hj8hhhNhNubj)}(h ``OUTPUT``h]hOUTPUT}(hj@hhhNhNubah}(h]h ]h"]h$]h&]uh1jhj8ubhF buffers must be queued by the client in display order; for decoders, }(hj8hhhNhNubj)}(h ``CAPTURE``h]hCAPTURE}(hjRhhhNhNubah}(h]h ]h"]h$]h&]uh1jhj8ubh: buffers must be returned by the decoder in display order.}(hj8hhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhK\hj5ubah}(h]h ]h"]h$]h&]uh1j hj#ubeh}(h]h ]h"]h$]h&]uh1j hhhK^hjhhubj )}(hDPB Decoded Picture Buffer; an H.264/HEVC term for a buffer that stores a decoded raw frame available for reference in further decoding steps. h](j)}(hDPBh]hDPB}(hjzhhhNhNubah}(h]h ]h"]h$]h&]uh1jhhhKbhjvubj!)}(hhh]h)}(hDecoded Picture Buffer; an H.264/HEVC term for a buffer that stores a decoded raw frame available for reference in further decoding steps.h]hDecoded Picture Buffer; an H.264/HEVC term for a buffer that stores a decoded raw frame available for reference in further decoding steps.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKahjubah}(h]h ]h"]h$]h&]uh1j hjvubeh}(h]h ]h"]h$]h&]uh1j hhhKbhjhhubj )}(hEOS end of stream. h](j)}(hEOSh]hEOS}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhhhKehjubj!)}(hhh]h)}(hend of stream.h]hend of stream.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKehjubah}(h]h ]h"]h$]h&]uh1j hjubeh}(h]h ]h"]h$]h&]uh1j hhhKehjhhubj )}(hIDR Instantaneous Decoder Refresh; a type of a keyframe in an H.264/HEVC-encoded stream, which clears the list of earlier reference frames (DPBs). h](j)}(hIDRh]hIDR}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhhhKihjubj!)}(hhh]h)}(hInstantaneous Decoder Refresh; a type of a keyframe in an H.264/HEVC-encoded stream, which clears the list of earlier reference frames (DPBs).h]hInstantaneous Decoder Refresh; a type of a keyframe in an H.264/HEVC-encoded stream, which clears the list of earlier reference frames (DPBs).}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhhjubah}(h]h ]h"]h$]h&]uh1j hjubeh}(h]h ]h"]h$]h&]uh1j hhhKihjhhubj )}(hpkeyframe an encoded frame that does not reference frames decoded earlier, i.e. can be decoded fully on its own. h](j)}(hkeyframeh]hkeyframe}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhhhKmhjubj!)}(hhh]h)}(hfan encoded frame that does not reference frames decoded earlier, i.e. can be decoded fully on its own.h]hfan encoded frame that does not reference frames decoded earlier, i.e. can be decoded fully on its own.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKlhjubah}(h]h ]h"]h$]h&]uh1j hjubeh}(h]h ]h"]h$]h&]uh1j hhhKmhjhhubj )}(hX,macroblock a processing unit in image and video compression formats based on linear block transforms (e.g. H.264, VP8, VP9); codec-specific, but for most of popular codecs the size is 16x16 samples (pixels). The HEVC codec uses a slightly more flexible processing unit called coding tree unit (CTU). h](j)}(h macroblockh]h macroblock}(hj6hhhNhNubah}(h]h ]h"]h$]h&]uh1jhhhKshj2ubj!)}(hhh]h)}(hX a processing unit in image and video compression formats based on linear block transforms (e.g. H.264, VP8, VP9); codec-specific, but for most of popular codecs the size is 16x16 samples (pixels). The HEVC codec uses a slightly more flexible processing unit called coding tree unit (CTU).h]hX a processing unit in image and video compression formats based on linear block transforms (e.g. H.264, VP8, VP9); codec-specific, but for most of popular codecs the size is 16x16 samples (pixels). The HEVC codec uses a slightly more flexible processing unit called coding tree unit (CTU).}(hjGhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKphjDubah}(h]h ]h"]h$]h&]uh1j hj2ubeh}(h]h ]h"]h$]h&]uh1j hhhKshjhhubj )}(hXOUTPUT the source buffer queue; for decoders, the queue of buffers containing an encoded bytestream; for encoders, the queue of buffers containing raw frames; ``V4L2_BUF_TYPE_VIDEO_OUTPUT`` or ``V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE``; the hardware is fed with data from ``OUTPUT`` buffers. h](j)}(hOUTPUTh]hOUTPUT}(hjehhhNhNubah}(h]h ]h"]h$]h&]uh1jhhhKzhjaubj!)}(hhh]h)}(hXthe source buffer queue; for decoders, the queue of buffers containing an encoded bytestream; for encoders, the queue of buffers containing raw frames; ``V4L2_BUF_TYPE_VIDEO_OUTPUT`` or ``V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE``; the hardware is fed with data from ``OUTPUT`` buffers.h](hthe source buffer queue; for decoders, the queue of buffers containing an encoded bytestream; for encoders, the queue of buffers containing raw frames; }(hjvhhhNhNubj)}(h``V4L2_BUF_TYPE_VIDEO_OUTPUT``h]hV4L2_BUF_TYPE_VIDEO_OUTPUT}(hj~hhhNhNubah}(h]h ]h"]h$]h&]uh1jhjvubh or }(hjvhhhNhNubj)}(h%``V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE``h]h!V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjvubh%; the hardware is fed with data from }(hjvhhhNhNubj)}(h ``OUTPUT``h]hOUTPUT}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjvubh buffers.}(hjvhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhKvhjsubah}(h]h ]h"]h$]h&]uh1j hjaubeh}(h]h ]h"]h$]h&]uh1j hhhKzhjhhubj )}(hRPPS Picture Parameter Set; a type of metadata entity in an H.264/HEVC bytestream. h](j)}(hPPSh]hPPS}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhhhK}hjubj!)}(hhh]h)}(hMPicture Parameter Set; a type of metadata entity in an H.264/HEVC bytestream.h]hMPicture Parameter Set; a type of metadata entity in an H.264/HEVC bytestream.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK}hjubah}(h]h ]h"]h$]h&]uh1j hjubeh}(h]h ]h"]h$]h&]uh1j hhhK}hjhhubj )}(hRraw format uncompressed format containing raw pixel data (e.g. YUV, RGB formats). h](j)}(h raw formath]h raw format}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhhhKhjubj!)}(hhh]h)}(hFuncompressed format containing raw pixel data (e.g. YUV, RGB formats).h]hFuncompressed format containing raw pixel data (e.g. YUV, RGB formats).}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjubah}(h]h ]h"]h$]h&]uh1j hjubeh}(h]h ]h"]h$]h&]uh1j hhhKhjhhubj )}(hXresume point a point in the bytestream from which decoding may start/continue, without any previous state/data present, e.g.: a keyframe (VP8/VP9) or SPS/PPS/IDR sequence (H.264/HEVC); a resume point is required to start decode of a new stream, or to resume decoding after a seek. h](j)}(h resume pointh]h resume point}(hj(hhhNhNubah}(h]h ]h"]h$]h&]uh1jhhhKhj$ubj!)}(hhh]h)}(hX a point in the bytestream from which decoding may start/continue, without any previous state/data present, e.g.: a keyframe (VP8/VP9) or SPS/PPS/IDR sequence (H.264/HEVC); a resume point is required to start decode of a new stream, or to resume decoding after a seek.h]hX a point in the bytestream from which decoding may start/continue, without any previous state/data present, e.g.: a keyframe (VP8/VP9) or SPS/PPS/IDR sequence (H.264/HEVC); a resume point is required to start decode of a new stream, or to resume decoding after a seek.}(hj9hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhj6ubah}(h]h ]h"]h$]h&]uh1j hj$ubeh}(h]h ]h"]h$]h&]uh1j hhhKhjhhubj )}(h;source data fed to the decoder or encoder; see ``OUTPUT``. h](j)}(hsourceh]hsource}(hjWhhhNhNubah}(h]h ]h"]h$]h&]uh1jhhhKhjSubj!)}(hhh]h)}(h3data fed to the decoder or encoder; see ``OUTPUT``.h](h(data fed to the decoder or encoder; see }(hjhhhhNhNubj)}(h ``OUTPUT``h]hOUTPUT}(hjphhhNhNubah}(h]h ]h"]h$]h&]uh1jhjhubh.}(hjhhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhKhjeubah}(h]h ]h"]h$]h&]uh1j hjSubeh}(h]h ]h"]h$]h&]uh1j hhhKhjhhubj )}(hWsource height height in pixels for given source resolution; relevant to encoders only. h](j)}(h source heighth]h source height}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhhhKhjubj!)}(hhh]h)}(hHheight in pixels for given source resolution; relevant to encoders only.h]hHheight in pixels for given source resolution; relevant to encoders only.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjubah}(h]h ]h"]h$]h&]uh1j hjubeh}(h]h ]h"]h$]h&]uh1j hhhKhjhhubj )}(hsource resolution resolution in pixels of source frames being source to the encoder and subject to further cropping to the bounds of visible resolution; relevant to encoders only. h](j)}(hsource resolutionh]hsource resolution}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhhhKhjubj!)}(hhh]h)}(hresolution in pixels of source frames being source to the encoder and subject to further cropping to the bounds of visible resolution; relevant to encoders only.h]hresolution in pixels of source frames being source to the encoder and subject to further cropping to the bounds of visible resolution; relevant to encoders only.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjubah}(h]h ]h"]h$]h&]uh1j hjubeh}(h]h ]h"]h$]h&]uh1j hhhKhjhhubj )}(hUsource width width in pixels for given source resolution; relevant to encoders only. h](j)}(h source widthh]h source width}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhhhKhjubj!)}(hhh]h)}(hGwidth in pixels for given source resolution; relevant to encoders only.h]hGwidth in pixels for given source resolution; relevant to encoders only.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjubah}(h]h ]h"]h$]h&]uh1j hjubeh}(h]h ]h"]h$]h&]uh1j hhhKhjhhubj )}(hSSPS Sequence Parameter Set; a type of metadata entity in an H.264/HEVC bytestream. h](j)}(hSPSh]hSPS}(hj%hhhNhNubah}(h]h ]h"]h$]h&]uh1jhhhKhj!ubj!)}(hhh]h)}(hNSequence Parameter Set; a type of metadata entity in an H.264/HEVC bytestream.h]hNSequence Parameter Set; a type of metadata entity in an H.264/HEVC bytestream.}(hj6hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhj3ubah}(h]h ]h"]h$]h&]uh1j hj!ubeh}(h]h ]h"]h$]h&]uh1j hhhKhjhhubj )}(hstream metadata additional (non-visual) information contained inside encoded bytestream; for example: coded resolution, visible resolution, codec profile. h](j)}(hstream metadatah]hstream metadata}(hjThhhNhNubah}(h]h ]h"]h$]h&]uh1jhhhKhjPubj!)}(hhh]h)}(hadditional (non-visual) information contained inside encoded bytestream; for example: coded resolution, visible resolution, codec profile.h]hadditional (non-visual) information contained inside encoded bytestream; for example: coded resolution, visible resolution, codec profile.}(hjehhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjbubah}(h]h ]h"]h$]h&]uh1j hjPubeh}(h]h ]h"]h$]h&]uh1j hhhKhjhhubj )}(hDvisible height height for given visible resolution; display height. h](j)}(hvisible heighth]hvisible height}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhhhKhjubj!)}(hhh]h)}(h4height for given visible resolution; display height.h]h4height for given visible resolution; display height.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjubah}(h]h ]h"]h$]h&]uh1j hjubeh}(h]h ]h"]h$]h&]uh1j hhhKhjhhubj )}(hvisible resolution stream resolution of the visible picture, in pixels, to be used for display purposes; must be smaller or equal to coded resolution; display resolution. h](j)}(hvisible resolutionh]hvisible resolution}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhhhKhjubj!)}(hhh]h)}(hstream resolution of the visible picture, in pixels, to be used for display purposes; must be smaller or equal to coded resolution; display resolution.h]hstream resolution of the visible picture, in pixels, to be used for display purposes; must be smaller or equal to coded resolution; display resolution.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjubah}(h]h ]h"]h$]h&]uh1j hjubeh}(h]h ]h"]h$]h&]uh1j hhhKhjhhubj )}(hAvisible width width for given visible resolution; display width. h](j)}(h visible widthh]h visible width}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhhhKhjubj!)}(hhh]h)}(h2width for given visible resolution; display width.h]h2width for given visible resolution; display width.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjubah}(h]h ]h"]h$]h&]uh1j hjubeh}(h]h ]h"]h$]h&]uh1j hhhKhjhhubeh}(h]h ]h"]h$]h&]uh1jhjhhhhhNubeh}(h](glossaryjeh ]h"](glossarydecoder-glossaryeh$]h&]uh1hhhhhhhhK0expect_referenced_by_name}j jsexpect_referenced_by_id}jjsubh)}(hhh](h)}(h State Machineh]h State Machine}(hj" hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj hhhhhKubhfigure)}(hhh](kfigure kernel_render)}(hhh]h literal_block)}(hXdigraph decoder_state_machine { node [shape = doublecircle, label="Decoding"] Decoding; node [shape = circle, label="Initialization"] Initialization; node [shape = circle, label="Capture\nsetup"] CaptureSetup; node [shape = circle, label="Dynamic\nResolution\nChange"] ResChange; node [shape = circle, label="Stopped"] Stopped; node [shape = circle, label="Drain"] Drain; node [shape = circle, label="Seek"] Seek; node [shape = circle, label="End of Stream"] EoS; node [shape = point]; qi qi -> Initialization [ label = "open()" ]; Initialization -> CaptureSetup [ label = "CAPTURE\nformat\nestablished" ]; CaptureSetup -> Stopped [ label = "CAPTURE\nbuffers\nready" ]; Decoding -> ResChange [ label = "Stream\nresolution\nchange" ]; Decoding -> Drain [ label = "V4L2_DEC_CMD_STOP" ]; Decoding -> EoS [ label = "EoS mark\nin the stream" ]; Decoding -> Seek [ label = "VIDIOC_STREAMOFF(OUTPUT)" ]; Decoding -> Stopped [ label = "VIDIOC_STREAMOFF(CAPTURE)" ]; Decoding -> Decoding; ResChange -> CaptureSetup [ label = "CAPTURE\nformat\nestablished" ]; ResChange -> Seek [ label = "VIDIOC_STREAMOFF(OUTPUT)" ]; EoS -> Drain [ label = "Implicit\ndrain" ]; Drain -> Stopped [ label = "All CAPTURE\nbuffers dequeued\nor\nVIDIOC_STREAMOFF(CAPTURE)" ]; Drain -> Seek [ label = "VIDIOC_STREAMOFF(OUTPUT)" ]; Seek -> Decoding [ label = "VIDIOC_STREAMON(OUTPUT)" ]; Seek -> Initialization [ label = "VIDIOC_REQBUFS(OUTPUT, 0)" ]; Stopped -> Decoding [ label = "V4L2_DEC_CMD_START\nor\nVIDIOC_STREAMON(CAPTURE)" ]; Stopped -> Seek [ label = "VIDIOC_STREAMOFF(OUTPUT)" ]; }h]hXdigraph decoder_state_machine { node [shape = doublecircle, label="Decoding"] Decoding; node [shape = circle, label="Initialization"] Initialization; node [shape = circle, label="Capture\nsetup"] CaptureSetup; node [shape = circle, label="Dynamic\nResolution\nChange"] ResChange; node [shape = circle, label="Stopped"] Stopped; node [shape = circle, label="Drain"] Drain; node [shape = circle, label="Seek"] Seek; node [shape = circle, label="End of Stream"] EoS; node [shape = point]; qi qi -> Initialization [ label = "open()" ]; Initialization -> CaptureSetup [ label = "CAPTURE\nformat\nestablished" ]; CaptureSetup -> Stopped [ label = "CAPTURE\nbuffers\nready" ]; Decoding -> ResChange [ label = "Stream\nresolution\nchange" ]; Decoding -> Drain [ label = "V4L2_DEC_CMD_STOP" ]; Decoding -> EoS [ label = "EoS mark\nin the stream" ]; Decoding -> Seek [ label = "VIDIOC_STREAMOFF(OUTPUT)" ]; Decoding -> Stopped [ label = "VIDIOC_STREAMOFF(CAPTURE)" ]; Decoding -> Decoding; ResChange -> CaptureSetup [ label = "CAPTURE\nformat\nestablished" ]; ResChange -> Seek [ label = "VIDIOC_STREAMOFF(OUTPUT)" ]; EoS -> Drain [ label = "Implicit\ndrain" ]; Drain -> Stopped [ label = "All CAPTURE\nbuffers dequeued\nor\nVIDIOC_STREAMOFF(CAPTURE)" ]; Drain -> Seek [ label = "VIDIOC_STREAMOFF(OUTPUT)" ]; Seek -> Decoding [ label = "VIDIOC_STREAMON(OUTPUT)" ]; Seek -> Initialization [ label = "VIDIOC_REQBUFS(OUTPUT, 0)" ]; Stopped -> Decoding [ label = "V4L2_DEC_CMD_START\nor\nVIDIOC_STREAMON(CAPTURE)" ]; Stopped -> Seek [ label = "VIDIOC_STREAMOFF(OUTPUT)" ]; }}hj= sbah}(h]h ]h"]h$]h&]hhuh1j; hj8 hhubah}(h]h ]h"]h$]h&]alt$DOT digraph of decoder state machinesrclangDOTuh1j6 hj2 ubhcaption)}(hDecoder State Machineh]hDecoder State Machine}(hjW hhhNhNubah}(h]h ]h"]h$]h&]uh1jU hhhKhj2 ubeh}(h]id1ah ]h"]h$]h&]altjR captionjY uh1j0 hj hhhhhNubeh}(h] state-machineah ]h"] state machineah$]h&]uh1hhhhhhhhKubh)}(hhh](h)}(hQuerying Capabilitiesh]hQuerying Capabilities}(hjy hhhNhNubah}(h]h ]h"]h$]h&]uh1hhjv hhhhhKubj)}(hhh](j )}(hXTo enumerate the set of coded formats supported by the decoder, the client may call :c:func:`VIDIOC_ENUM_FMT` on ``OUTPUT``. * The full set of supported formats will be returned, regardless of the format set on ``CAPTURE``. * Check the flags field of :c:type:`v4l2_fmtdesc` for more information about the decoder's capabilities with respect to each coded format. In particular whether or not the decoder has a full-fledged bytestream parser and if the decoder supports dynamic resolution changes. h](h)}(h|To enumerate the set of coded formats supported by the decoder, the client may call :c:func:`VIDIOC_ENUM_FMT` on ``OUTPUT``.h](hTTo enumerate the set of coded formats supported by the decoder, the client may call }(hj hhhNhNubh)}(h:c:func:`VIDIOC_ENUM_FMT`h]j)}(hj h]hVIDIOC_ENUM_FMT()}(hj hhhNhNubah}(h]h ](jjc-funceh"]h$]h&]uh1jhj ubah}(h]h ]h"]h$]h&]refdocj refdomainjreftypefunc refexplicitrefwarnjjjVIDIOC_ENUM_FMTuh1hhhhKhj ubh on }(hj hhhNhNubj)}(h ``OUTPUT``h]hOUTPUT}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1jhj ubh.}(hj hhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhKhj ubh bullet_list)}(hhh](j )}(h`The full set of supported formats will be returned, regardless of the format set on ``CAPTURE``.h]h)}(h`The full set of supported formats will be returned, regardless of the format set on ``CAPTURE``.h](hTThe full set of supported formats will be returned, regardless of the format set on }(hj hhhNhNubj)}(h ``CAPTURE``h]hCAPTURE}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1jhj ubh.}(hj hhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhKhj ubah}(h]h ]h"]h$]h&]uh1jhj ubj )}(hXCheck the flags field of :c:type:`v4l2_fmtdesc` for more information about the decoder's capabilities with respect to each coded format. In particular whether or not the decoder has a full-fledged bytestream parser and if the decoder supports dynamic resolution changes. h]h)}(hXCheck the flags field of :c:type:`v4l2_fmtdesc` for more information about the decoder's capabilities with respect to each coded format. In particular whether or not the decoder has a full-fledged bytestream parser and if the decoder supports dynamic resolution changes.h](hCheck the flags field of }(hj hhhNhNubh)}(h:c:type:`v4l2_fmtdesc`h]j)}(hj h]h v4l2_fmtdesc}(hj hhhNhNubah}(h]h ](jjc-typeeh"]h$]h&]uh1jhj ubah}(h]h ]h"]h$]h&]refdocj refdomainjreftypetype refexplicitrefwarnjjj v4l2_fmtdescuh1hhhhKhj ubh for more information about the decoder’s capabilities with respect to each coded format. In particular whether or not the decoder has a full-fledged bytestream parser and if the decoder supports dynamic resolution changes.}(hj hhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhKhj ubah}(h]h ]h"]h$]h&]uh1jhj ubeh}(h]h ]h"]h$]h&]bullet*uh1j hhhKhj ubeh}(h]h ]h"]h$]h&]uh1jhj hhhNhNubj )}(hX~To enumerate the set of supported raw formats, the client may call :c:func:`VIDIOC_ENUM_FMT` on ``CAPTURE``. * Only the formats supported for the format currently active on ``OUTPUT`` will be returned. * In order to enumerate raw formats supported by a given coded format, the client must first set that coded format on ``OUTPUT`` and then enumerate formats on ``CAPTURE``. h](h)}(hlTo enumerate the set of supported raw formats, the client may call :c:func:`VIDIOC_ENUM_FMT` on ``CAPTURE``.h](hCTo enumerate the set of supported raw formats, the client may call }(hjM hhhNhNubh)}(h:c:func:`VIDIOC_ENUM_FMT`h]j)}(hjW h]hVIDIOC_ENUM_FMT()}(hjY hhhNhNubah}(h]h ](jjc-funceh"]h$]h&]uh1jhjU ubah}(h]h ]h"]h$]h&]refdocj refdomainjreftypefunc refexplicitrefwarnjjjVIDIOC_ENUM_FMTuh1hhhhKhjM ubh on }(hjM hhhNhNubj)}(h ``CAPTURE``h]hCAPTURE}(hjx hhhNhNubah}(h]h ]h"]h$]h&]uh1jhjM ubh.}(hjM hhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhKhjI ubj )}(hhh](j )}(h[Only the formats supported for the format currently active on ``OUTPUT`` will be returned. h]h)}(hZOnly the formats supported for the format currently active on ``OUTPUT`` will be returned.h](h>Only the formats supported for the format currently active on }(hj hhhNhNubj)}(h ``OUTPUT``h]hOUTPUT}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1jhj ubh will be returned.}(hj hhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhKhj ubah}(h]h ]h"]h$]h&]uh1jhj ubj )}(hIn order to enumerate raw formats supported by a given coded format, the client must first set that coded format on ``OUTPUT`` and then enumerate formats on ``CAPTURE``. h]h)}(hIn order to enumerate raw formats supported by a given coded format, the client must first set that coded format on ``OUTPUT`` and then enumerate formats on ``CAPTURE``.h](htIn order to enumerate raw formats supported by a given coded format, the client must first set that coded format on }(hj hhhNhNubj)}(h ``OUTPUT``h]hOUTPUT}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1jhj ubh and then enumerate formats on }(hj hhhNhNubj)}(h ``CAPTURE``h]hCAPTURE}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1jhj ubh.}(hj hhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhKhj ubah}(h]h ]h"]h$]h&]uh1jhj ubeh}(h]h ]h"]h$]h&]jA jB uh1j hhhKhjI ubeh}(h]h ]h"]h$]h&]uh1jhj hhhNhNubj )}(hXYThe client may use :c:func:`VIDIOC_ENUM_FRAMESIZES` to detect supported resolutions for a given format, passing desired pixel format in :c:type:`v4l2_frmsizeenum` ``pixel_format``. * Values returned by :c:func:`VIDIOC_ENUM_FRAMESIZES` for a coded pixel format will include all possible coded resolutions supported by the decoder for given coded pixel format. * Values returned by :c:func:`VIDIOC_ENUM_FRAMESIZES` for a raw pixel format will include all possible frame buffer resolutions supported by the decoder for given raw pixel format and the coded format currently set on ``OUTPUT``. h](h)}(hThe client may use :c:func:`VIDIOC_ENUM_FRAMESIZES` to detect supported resolutions for a given format, passing desired pixel format in :c:type:`v4l2_frmsizeenum` ``pixel_format``.h](hThe client may use }(hj hhhNhNubh)}(h :c:func:`VIDIOC_ENUM_FRAMESIZES`h]j)}(hj h]hVIDIOC_ENUM_FRAMESIZES()}(hj hhhNhNubah}(h]h ](jjc-funceh"]h$]h&]uh1jhj ubah}(h]h ]h"]h$]h&]refdocj refdomainjreftypefunc refexplicitrefwarnjjjVIDIOC_ENUM_FRAMESIZESuh1hhhhKhj ubhU to detect supported resolutions for a given format, passing desired pixel format in }(hj hhhNhNubh)}(h:c:type:`v4l2_frmsizeenum`h]j)}(hj6 h]hv4l2_frmsizeenum}(hj8 hhhNhNubah}(h]h ](jjc-typeeh"]h$]h&]uh1jhj4 ubah}(h]h ]h"]h$]h&]refdocj refdomainjreftypetype refexplicitrefwarnjjjv4l2_frmsizeenumuh1hhhhKhj ubh }(hj hhhNhNubj)}(h``pixel_format``h]h pixel_format}(hjW hhhNhNubah}(h]h ]h"]h$]h&]uh1jhj ubh.}(hj hhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhKhj ubj )}(hhh](j )}(hValues returned by :c:func:`VIDIOC_ENUM_FRAMESIZES` for a coded pixel format will include all possible coded resolutions supported by the decoder for given coded pixel format. h]h)}(hValues returned by :c:func:`VIDIOC_ENUM_FRAMESIZES` for a coded pixel format will include all possible coded resolutions supported by the decoder for given coded pixel format.h](hValues returned by }(hjv hhhNhNubh)}(h :c:func:`VIDIOC_ENUM_FRAMESIZES`h]j)}(hj h]hVIDIOC_ENUM_FRAMESIZES()}(hj hhhNhNubah}(h]h ](jjc-funceh"]h$]h&]uh1jhj~ ubah}(h]h ]h"]h$]h&]refdocj refdomainjreftypefunc refexplicitrefwarnjjjVIDIOC_ENUM_FRAMESIZESuh1hhhhKhjv ubh| for a coded pixel format will include all possible coded resolutions supported by the decoder for given coded pixel format.}(hjv hhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhKhjr ubah}(h]h ]h"]h$]h&]uh1jhjo ubj )}(hValues returned by :c:func:`VIDIOC_ENUM_FRAMESIZES` for a raw pixel format will include all possible frame buffer resolutions supported by the decoder for given raw pixel format and the coded format currently set on ``OUTPUT``. h]h)}(hValues returned by :c:func:`VIDIOC_ENUM_FRAMESIZES` for a raw pixel format will include all possible frame buffer resolutions supported by the decoder for given raw pixel format and the coded format currently set on ``OUTPUT``.h](hValues returned by }(hj hhhNhNubh)}(h :c:func:`VIDIOC_ENUM_FRAMESIZES`h]j)}(hj h]hVIDIOC_ENUM_FRAMESIZES()}(hj hhhNhNubah}(h]h ](jjc-funceh"]h$]h&]uh1jhj ubah}(h]h ]h"]h$]h&]refdocj refdomainjreftypefunc refexplicitrefwarnjjjVIDIOC_ENUM_FRAMESIZESuh1hhhhKhj ubh for a raw pixel format will include all possible frame buffer resolutions supported by the decoder for given raw pixel format and the coded format currently set on }(hj hhhNhNubj)}(h ``OUTPUT``h]hOUTPUT}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1jhj ubh.}(hj hhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhKhj ubah}(h]h ]h"]h$]h&]uh1jhjo ubeh}(h]h ]h"]h$]h&]jA jB uh1j hhhKhj ubeh}(h]h ]h"]h$]h&]uh1jhj hhhNhNubj )}(hSupported profiles and levels for the coded format currently set on ``OUTPUT``, if applicable, may be queried using their respective controls via :c:func:`VIDIOC_QUERYCTRL`. h]h)}(hSupported profiles and levels for the coded format currently set on ``OUTPUT``, if applicable, may be queried using their respective controls via :c:func:`VIDIOC_QUERYCTRL`.h](hDSupported profiles and levels for the coded format currently set on }(hj hhhNhNubj)}(h ``OUTPUT``h]hOUTPUT}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1jhj ubhD, if applicable, may be queried using their respective controls via }(hj hhhNhNubh)}(h:c:func:`VIDIOC_QUERYCTRL`h]j)}(hj& h]hVIDIOC_QUERYCTRL()}(hj( hhhNhNubah}(h]h ](jjc-funceh"]h$]h&]uh1jhj$ ubah}(h]h ]h"]h$]h&]refdocj refdomainjreftypefunc refexplicitrefwarnjjjVIDIOC_QUERYCTRLuh1hhhhKhj ubh.}(hj hhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhKhj ubah}(h]h ]h"]h$]h&]uh1jhj hhhhhNubeh}(h]h ]h"]h$]h&]jjjhjjuh1jhjv hhhhhKubeh}(h]querying-capabilitiesah ]h"]querying capabilitiesah$]h&]uh1hhhhhhhhKubh)}(hhh](h)}(hInitializationh]hInitialization}(hjd hhhNhNubah}(h]h ]h"]h$]h&]uh1hhja hhhhhMubj)}(hhh](j )}(hXSet the coded format on ``OUTPUT`` via :c:func:`VIDIOC_S_FMT`. * **Required fields:** ``type`` a ``V4L2_BUF_TYPE_*`` enum appropriate for ``OUTPUT``. ``pixelformat`` a coded pixel format. ``width``, ``height`` coded resolution of the stream; required only if it cannot be parsed from the stream for the given coded format; otherwise the decoder will use this resolution as a placeholder resolution that will likely change as soon as it can parse the actual coded resolution from the stream. ``sizeimage`` desired size of ``OUTPUT`` buffers; the decoder may adjust it to match hardware requirements. other fields follow standard semantics. * **Returned fields:** ``sizeimage`` adjusted size of ``OUTPUT`` buffers. * The ``CAPTURE`` format will be updated with an appropriate frame buffer resolution instantly based on the width and height returned by :c:func:`VIDIOC_S_FMT`. However, for coded formats that include stream resolution information, after the decoder is done parsing the information from the stream, it will update the ``CAPTURE`` format with new values and signal a source change event, regardless of whether they match the values set by the client or not. .. important:: Changing the ``OUTPUT`` format may change the currently set ``CAPTURE`` format. How the new ``CAPTURE`` format is determined is up to the decoder and the client must ensure it matches its needs afterwards. h](h)}(h>Set the coded format on ``OUTPUT`` via :c:func:`VIDIOC_S_FMT`.h](hSet the coded format on }(hjy hhhNhNubj)}(h ``OUTPUT``h]hOUTPUT}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1jhjy ubh via }(hjy hhhNhNubh)}(h:c:func:`VIDIOC_S_FMT`h]j)}(hj h]hVIDIOC_S_FMT()}(hj hhhNhNubah}(h]h ](jjc-funceh"]h$]h&]uh1jhj ubah}(h]h ]h"]h$]h&]refdocj refdomainjreftypefunc refexplicitrefwarnjjj VIDIOC_S_FMTuh1hhhhMhjy ubh.}(hjy hhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhMhju ubj )}(hhh](j )}(hXg**Required fields:** ``type`` a ``V4L2_BUF_TYPE_*`` enum appropriate for ``OUTPUT``. ``pixelformat`` a coded pixel format. ``width``, ``height`` coded resolution of the stream; required only if it cannot be parsed from the stream for the given coded format; otherwise the decoder will use this resolution as a placeholder resolution that will likely change as soon as it can parse the actual coded resolution from the stream. ``sizeimage`` desired size of ``OUTPUT`` buffers; the decoder may adjust it to match hardware requirements. other fields follow standard semantics. h](h)}(h**Required fields:**h]hstrong)}(hj h]hRequired fields:}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1j hj ubah}(h]h ]h"]h$]h&]uh1hhhhMhj ubj)}(hhh](j )}(h@``type`` a ``V4L2_BUF_TYPE_*`` enum appropriate for ``OUTPUT``. h](j)}(h``type``h]j)}(hj h]htype}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1jhj ubah}(h]h ]h"]h$]h&]uh1jhhhMhj ubj!)}(hhh]h)}(h6a ``V4L2_BUF_TYPE_*`` enum appropriate for ``OUTPUT``.h](ha }(hj hhhNhNubj)}(h``V4L2_BUF_TYPE_*``h]hV4L2_BUF_TYPE_*}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1jhj ubh enum appropriate for }(hj hhhNhNubj)}(h ``OUTPUT``h]hOUTPUT}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1jhj ubh.}(hj hhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhMhj ubah}(h]h ]h"]h$]h&]uh1j hj ubeh}(h]h ]h"]h$]h&]uh1j hhhMhj ubj )}(h&``pixelformat`` a coded pixel format. h](j)}(h``pixelformat``h]j)}(hjA h]h pixelformat}(hjC hhhNhNubah}(h]h ]h"]h$]h&]uh1jhj? ubah}(h]h ]h"]h$]h&]uh1jhhhM hj; ubj!)}(hhh]h)}(ha coded pixel format.h]ha coded pixel format.}(hjY hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhM hjV ubah}(h]h ]h"]h$]h&]uh1j hj; ubeh}(h]h ]h"]h$]h&]uh1j hhhM hj ubj )}(hX/``width``, ``height`` coded resolution of the stream; required only if it cannot be parsed from the stream for the given coded format; otherwise the decoder will use this resolution as a placeholder resolution that will likely change as soon as it can parse the actual coded resolution from the stream. h](j)}(h``width``, ``height``h](j)}(h ``width``h]hwidth}(hj{ hhhNhNubah}(h]h ]h"]h$]h&]uh1jhjw ubh, }(hjw hhhNhNubj)}(h ``height``h]hheight}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1jhjw ubeh}(h]h ]h"]h$]h&]uh1jhhhMhjs ubj!)}(hhh]h)}(hXcoded resolution of the stream; required only if it cannot be parsed from the stream for the given coded format; otherwise the decoder will use this resolution as a placeholder resolution that will likely change as soon as it can parse the actual coded resolution from the stream.h]hXcoded resolution of the stream; required only if it cannot be parsed from the stream for the given coded format; otherwise the decoder will use this resolution as a placeholder resolution that will likely change as soon as it can parse the actual coded resolution from the stream.}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhM hj ubah}(h]h ]h"]h$]h&]uh1j hjs ubeh}(h]h ]h"]h$]h&]uh1j hhhMhj ubj )}(hl``sizeimage`` desired size of ``OUTPUT`` buffers; the decoder may adjust it to match hardware requirements. h](j)}(h ``sizeimage``h]j)}(hj h]h sizeimage}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1jhj ubah}(h]h ]h"]h$]h&]uh1jhhhMhj ubj!)}(hhh]h)}(h]desired size of ``OUTPUT`` buffers; the decoder may adjust it to match hardware requirements.h](hdesired size of }(hj hhhNhNubj)}(h ``OUTPUT``h]hOUTPUT}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1jhj ubhC buffers; the decoder may adjust it to match hardware requirements.}(hj hhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhMhj ubah}(h]h ]h"]h$]h&]uh1j hj ubeh}(h]h ]h"]h$]h&]uh1j hhhMhj ubj )}(h(other fields follow standard semantics. h](j)}(h other fieldsh]h other fields}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1jhhhMhjubj!)}(hhh]h)}(hfollow standard semantics.h]hfollow standard semantics.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhjubah}(h]h ]h"]h$]h&]uh1j hjubeh}(h]h ]h"]h$]h&]uh1j hhhMhj ubeh}(h]h ]h"]h$]h&]uh1jhj ubeh}(h]h ]h"]h$]h&]uh1jhj ubj )}(hM**Returned fields:** ``sizeimage`` adjusted size of ``OUTPUT`` buffers. h](h)}(h**Returned fields:**h]j )}(hjIh]hReturned fields:}(hjKhhhNhNubah}(h]h ]h"]h$]h&]uh1j hjGubah}(h]h ]h"]h$]h&]uh1hhhhMhjCubj)}(hhh]j )}(h3``sizeimage`` adjusted size of ``OUTPUT`` buffers. h](j)}(h ``sizeimage``h]j)}(hjgh]h sizeimage}(hjihhhNhNubah}(h]h ]h"]h$]h&]uh1jhjeubah}(h]h ]h"]h$]h&]uh1jhhhMhjaubj!)}(hhh]h)}(h$adjusted size of ``OUTPUT`` buffers.h](hadjusted size of }(hjhhhNhNubj)}(h ``OUTPUT``h]hOUTPUT}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubh buffers.}(hjhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhMhj|ubah}(h]h ]h"]h$]h&]uh1j hjaubeh}(h]h ]h"]h$]h&]uh1j hhhMhj^ubah}(h]h ]h"]h$]h&]uh1jhjCubeh}(h]h ]h"]h$]h&]uh1jhj ubj )}(hXThe ``CAPTURE`` format will be updated with an appropriate frame buffer resolution instantly based on the width and height returned by :c:func:`VIDIOC_S_FMT`. However, for coded formats that include stream resolution information, after the decoder is done parsing the information from the stream, it will update the ``CAPTURE`` format with new values and signal a source change event, regardless of whether they match the values set by the client or not. h]h)}(hXThe ``CAPTURE`` format will be updated with an appropriate frame buffer resolution instantly based on the width and height returned by :c:func:`VIDIOC_S_FMT`. However, for coded formats that include stream resolution information, after the decoder is done parsing the information from the stream, it will update the ``CAPTURE`` format with new values and signal a source change event, regardless of whether they match the values set by the client or not.h](hThe }(hjhhhNhNubj)}(h ``CAPTURE``h]hCAPTURE}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubhx format will be updated with an appropriate frame buffer resolution instantly based on the width and height returned by }(hjhhhNhNubh)}(h:c:func:`VIDIOC_S_FMT`h]j)}(hjh]hVIDIOC_S_FMT()}(hjhhhNhNubah}(h]h ](jjc-funceh"]h$]h&]uh1jhjubah}(h]h ]h"]h$]h&]refdocj refdomainjreftypefunc refexplicitrefwarnjjj VIDIOC_S_FMTuh1hhhhMhjubh. However, for coded formats that include stream resolution information, after the decoder is done parsing the information from the stream, it will update the }(hjhhhNhNubj)}(h ``CAPTURE``h]hCAPTURE}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubh format with new values and signal a source change event, regardless of whether they match the values set by the client or not.}(hjhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhMhjubah}(h]h ]h"]h$]h&]uh1jhj ubeh}(h]h ]h"]h$]h&]jA jB uh1j hhhMhju ubh important)}(hChanging the ``OUTPUT`` format may change the currently set ``CAPTURE`` format. How the new ``CAPTURE`` format is determined is up to the decoder and the client must ensure it matches its needs afterwards.h]h)}(hChanging the ``OUTPUT`` format may change the currently set ``CAPTURE`` format. How the new ``CAPTURE`` format is determined is up to the decoder and the client must ensure it matches its needs afterwards.h](h Changing the }(hj"hhhNhNubj)}(h ``OUTPUT``h]hOUTPUT}(hj*hhhNhNubah}(h]h ]h"]h$]h&]uh1jhj"ubh% format may change the currently set }(hj"hhhNhNubj)}(h ``CAPTURE``h]hCAPTURE}(hj<hhhNhNubah}(h]h ]h"]h$]h&]uh1jhj"ubh format. How the new }(hj"hhhNhNubj)}(h ``CAPTURE``h]hCAPTURE}(hjNhhhNhNubah}(h]h ]h"]h$]h&]uh1jhj"ubhf format is determined is up to the decoder and the client must ensure it matches its needs afterwards.}(hj"hhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhM)hjubah}(h]h ]h"]h$]h&]uh1jhju ubeh}(h]h ]h"]h$]h&]uh1jhjr hhhNhNubj )}(hXAllocate source (bytestream) buffers via :c:func:`VIDIOC_REQBUFS` on ``OUTPUT``. * **Required fields:** ``count`` requested number of buffers to allocate; greater than zero. ``type`` a ``V4L2_BUF_TYPE_*`` enum appropriate for ``OUTPUT``. ``memory`` follows standard semantics. * **Returned fields:** ``count`` the actual number of buffers allocated. .. warning:: The actual number of allocated buffers may differ from the ``count`` given. The client must check the updated value of ``count`` after the call returns. Alternatively, :c:func:`VIDIOC_CREATE_BUFS` on the ``OUTPUT`` queue can be used to have more control over buffer allocation. * **Required fields:** ``count`` requested number of buffers to allocate; greater than zero. ``type`` a ``V4L2_BUF_TYPE_*`` enum appropriate for ``OUTPUT``. ``memory`` follows standard semantics. ``format`` follows standard semantics. * **Returned fields:** ``count`` adjusted to the number of allocated buffers. .. warning:: The actual number of allocated buffers may differ from the ``count`` given. The client must check the updated value of ``count`` after the call returns. h](h)}(hPAllocate source (bytestream) buffers via :c:func:`VIDIOC_REQBUFS` on ``OUTPUT``.h](h)Allocate source (bytestream) buffers via }(hjvhhhNhNubh)}(h:c:func:`VIDIOC_REQBUFS`h]j)}(hjh]hVIDIOC_REQBUFS()}(hjhhhNhNubah}(h]h ](jjc-funceh"]h$]h&]uh1jhj~ubah}(h]h ]h"]h$]h&]refdocj refdomainjreftypefunc refexplicitrefwarnjjjVIDIOC_REQBUFSuh1hhhhM-hjvubh on }(hjvhhhNhNubj)}(h ``OUTPUT``h]hOUTPUT}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjvubh.}(hjvhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhM-hjrubj )}(hhh](j )}(h**Required fields:** ``count`` requested number of buffers to allocate; greater than zero. ``type`` a ``V4L2_BUF_TYPE_*`` enum appropriate for ``OUTPUT``. ``memory`` follows standard semantics. h](h)}(h**Required fields:**h]j )}(hjh]hRequired fields:}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1j hjubah}(h]h ]h"]h$]h&]uh1hhhhM0hjubj)}(hhh](j )}(hF``count`` requested number of buffers to allocate; greater than zero. h](j)}(h ``count``h]j)}(hjh]hcount}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubah}(h]h ]h"]h$]h&]uh1jhhhM3hjubj!)}(hhh]h)}(h;requested number of buffers to allocate; greater than zero.h]h;requested number of buffers to allocate; greater than zero.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhM3hjubah}(h]h ]h"]h$]h&]uh1j hjubeh}(h]h ]h"]h$]h&]uh1j hhhM3hjubj )}(h@``type`` a ``V4L2_BUF_TYPE_*`` enum appropriate for ``OUTPUT``. h](j)}(h``type``h]j)}(hjh]htype}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubah}(h]h ]h"]h$]h&]uh1jhhhM6hjubj!)}(hhh]h)}(h6a ``V4L2_BUF_TYPE_*`` enum appropriate for ``OUTPUT``.[h](ha }(hj0hhhNhNubj)}(h``V4L2_BUF_TYPE_*``h]hV4L2_BUF_TYPE_*}(hj8hhhNhNubah}(h]h ]h"]h$]h&]uh1jhj0ubh enum appropriate for }(hj0hhhNhNubj)}(h ``OUTPUT``h]hOUTPUT}(hjJhhhNhNubah}(h]h ]h"]h$]h&]uh1jhj0ubh.}(hj0hhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhM6hj-ubah}(h]h ]h"]h$]h&]uh1j hjubeh}(h]h ]h"]h$]h&]uh1j hhhM6hjubj )}(h'``memory`` follows standard semantics. h](j)}(h ``memory``h]j)}(hjth]hmemory}(hjvhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjrubah}(h]h ]h"]h$]h&]uh1jhhhM9hjnubj!)}(hhh]h)}(hfollows standard semantics.h]hfollows standard semantics.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhM9hjubah}(h]h ]h"]h$]h&]uh1j hjnubeh}(h]h ]h"]h$]h&]uh1j hhhM9hjubeh}(h]h ]h"]h$]h&]uh1jhjubeh}(h]h ]h"]h$]h&]uh1jhjubj )}(hL**Returned fields:** ``count`` the actual number of buffers allocated. h](h)}(h**Returned fields:**h]j )}(hjh]hReturned fields:}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1j hjubah}(h]h ]h"]h$]h&]uh1hhhhM;hjubj)}(hhh]j )}(h2``count`` the actual number of buffers allocated. h](j)}(h ``count``h]j)}(hjh]hcount}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubah}(h]h ]h"]h$]h&]uh1jhhhM>hjubj!)}(hhh]h)}(h'the actual number of buffers allocated.h]h'the actual number of buffers allocated.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhM>hjubah}(h]h ]h"]h$]h&]uh1j hjubeh}(h]h ]h"]h$]h&]uh1j hhhM>hjubah}(h]h ]h"]h$]h&]uh1jhjubeh}(h]h ]h"]h$]h&]uh1jhjubeh}(h]h ]h"]h$]h&]jA jB uh1j hhhM0hjrubhwarning)}(hThe actual number of allocated buffers may differ from the ``count`` given. The client must check the updated value of ``count`` after the call returns.h]h)}(hThe actual number of allocated buffers may differ from the ``count`` given. The client must check the updated value of ``count`` after the call returns.h](h;The actual number of allocated buffers may differ from the }(hj hhhNhNubj)}(h ``count``h]hcount}(hj(hhhNhNubah}(h]h ]h"]h$]h&]uh1jhj ubh3 given. The client must check the updated value of }(hj hhhNhNubj)}(h ``count``h]hcount}(hj:hhhNhNubah}(h]h ]h"]h$]h&]uh1jhj ubh after the call returns.}(hj hhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhMBhjubah}(h]h ]h"]h$]h&]uh1jhjrubh)}(h|Alternatively, :c:func:`VIDIOC_CREATE_BUFS` on the ``OUTPUT`` queue can be used to have more control over buffer allocation.h](hAlternatively, }(hjXhhhNhNubh)}(h:c:func:`VIDIOC_CREATE_BUFS`h]j)}(hjbh]hVIDIOC_CREATE_BUFS()}(hjdhhhNhNubah}(h]h ](jjc-funceh"]h$]h&]uh1jhj`ubah}(h]h ]h"]h$]h&]refdocj refdomainjreftypefunc refexplicitrefwarnjjjVIDIOC_CREATE_BUFSuh1hhhhMFhjXubh on the }(hjXhhhNhNubj)}(h ``OUTPUT``h]hOUTPUT}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjXubh? queue can be used to have more control over buffer allocation.}(hjXhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhMFhjrubj )}(hhh](j )}(h**Required fields:** ``count`` requested number of buffers to allocate; greater than zero. ``type`` a ``V4L2_BUF_TYPE_*`` enum appropriate for ``OUTPUT``. ``memory`` follows standard semantics. ``format`` follows standard semantics. h](h)}(h**Required fields:**h]j )}(hjh]hRequired fields:}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1j hjubah}(h]h ]h"]h$]h&]uh1hhhhMIhjubj)}(hhh](j )}(hF``count`` requested number of buffers to allocate; greater than zero. h](j)}(h ``count``h]j)}(hjh]hcount}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubah}(h]h ]h"]h$]h&]uh1jhhhMLhjubj!)}(hhh]h)}(h;requested number of buffers to allocate; greater than zero.h]h;requested number of buffers to allocate; greater than zero.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMLhjubah}(h]h ]h"]h$]h&]uh1j hjubeh}(h]h ]h"]h$]h&]uh1j hhhMLhjubj )}(h@``type`` a ``V4L2_BUF_TYPE_*`` enum appropriate for ``OUTPUT``. h](j)}(h``type``h]j)}(hjh]htype}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubah}(h]h ]h"]h$]h&]uh1jhhhMOhjubj!)}(hhh]h)}(h6a ``V4L2_BUF_TYPE_*`` enum appropriate for ``OUTPUT``.h](ha }(hjhhhNhNubj)}(h``V4L2_BUF_TYPE_*``h]hV4L2_BUF_TYPE_*}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubh enum appropriate for }(hjhhhNhNubj)}(h ``OUTPUT``h]hOUTPUT}(hj,hhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubh.}(hjhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhMOhjubah}(h]h ]h"]h$]h&]uh1j hjubeh}(h]h ]h"]h$]h&]uh1j hhhMOhjubj )}(h'``memory`` follows standard semantics. h](j)}(h ``memory``h]j)}(hjVh]hmemory}(hjXhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjTubah}(h]h ]h"]h$]h&]uh1jhhhMRhjPubj!)}(hhh]h)}(hfollows standard semantics.h]hfollows standard semantics.}(hjnhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMRhjkubah}(h]h ]h"]h$]h&]uh1j hjPubeh}(h]h ]h"]h$]h&]uh1j hhhMRhjubj )}(h'``format`` follows standard semantics. h](j)}(h ``format``h]j)}(hjh]hformat}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubah}(h]h ]h"]h$]h&]uh1jhhhMUhjubj!)}(hhh]h)}(hfollows standard semantics.h]hfollows standard semantics.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMUhjubah}(h]h ]h"]h$]h&]uh1j hjubeh}(h]h ]h"]h$]h&]uh1j hhhMUhjubeh}(h]h ]h"]h$]h&]uh1jhjubeh}(h]h ]h"]h$]h&]uh1jhjubj )}(hQ**Returned fields:** ``count`` adjusted to the number of allocated buffers. h](h)}(h**Returned fields:**h]j )}(hjh]hReturned fields:}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1j hjubah}(h]h ]h"]h$]h&]uh1hhhhMWhjubj)}(hhh]j )}(h7``count`` adjusted to the number of allocated buffers. h](j)}(h ``count``h]j)}(hjh]hcount}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubah}(h]h ]h"]h$]h&]uh1jhhhMZhjubj!)}(hhh]h)}(h,adjusted to the number of allocated buffers.h]h,adjusted to the number of allocated buffers.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMZhjubah}(h]h ]h"]h$]h&]uh1j hjubeh}(h]h ]h"]h$]h&]uh1j hhhMZhjubah}(h]h ]h"]h$]h&]uh1jhjubeh}(h]h ]h"]h$]h&]uh1jhjubeh}(h]h ]h"]h$]h&]jA jB uh1j hhhMIhjrubj)}(hThe actual number of allocated buffers may differ from the ``count`` given. The client must check the updated value of ``count`` after the call returns.h]h)}(hThe actual number of allocated buffers may differ from the ``count`` given. The client must check the updated value of ``count`` after the call returns.h](h;The actual number of allocated buffers may differ from the }(hj8hhhNhNubj)}(h ``count``h]hcount}(hj@hhhNhNubah}(h]h ]h"]h$]h&]uh1jhj8ubh3 given. The client must check the updated value of }(hj8hhhNhNubj)}(h ``count``h]hcount}(hjRhhhNhNubah}(h]h ]h"]h$]h&]uh1jhj8ubh after the call returns.}(hj8hhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhM^hj4ubah}(h]h ]h"]h$]h&]uh1jhjrubeh}(h]h ]h"]h$]h&]uh1jhjr hhhNhNubj )}(hGStart streaming on the ``OUTPUT`` queue via :c:func:`VIDIOC_STREAMON`. h]h)}(hFStart streaming on the ``OUTPUT`` queue via :c:func:`VIDIOC_STREAMON`.h](hStart streaming on the }(hjzhhhNhNubj)}(h ``OUTPUT``h]hOUTPUT}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjzubh queue via }(hjzhhhNhNubh)}(h:c:func:`VIDIOC_STREAMON`h]j)}(hjh]hVIDIOC_STREAMON()}(hjhhhNhNubah}(h]h ](jjc-funceh"]h$]h&]uh1jhjubah}(h]h ]h"]h$]h&]refdocj refdomainjreftypefunc refexplicitrefwarnjjjVIDIOC_STREAMONuh1hhhhMbhjzubh.}(hjzhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhMbhjvubah}(h]h ]h"]h$]h&]uh1jhjr hhhhhNubj )}(hX\**This step only applies to coded formats that contain resolution information in the stream.** Continue queuing/dequeuing bytestream buffers to/from the ``OUTPUT`` queue via :c:func:`VIDIOC_QBUF` and :c:func:`VIDIOC_DQBUF`. The buffers will be processed and returned to the client in order, until required metadata to configure the ``CAPTURE`` queue are found. This is indicated by the decoder sending a ``V4L2_EVENT_SOURCE_CHANGE`` event with ``changes`` set to ``V4L2_EVENT_SRC_CH_RESOLUTION``. * It is not an error if the first buffer does not contain enough data for this to occur. Processing of the buffers will continue as long as more data is needed. * If data in a buffer that triggers the event is required to decode the first frame, it will not be returned to the client, until the initialization sequence completes and the frame is decoded. * If the client has not set the coded resolution of the stream on its own, calling :c:func:`VIDIOC_G_FMT`, :c:func:`VIDIOC_S_FMT`, :c:func:`VIDIOC_TRY_FMT` or :c:func:`VIDIOC_REQBUFS` on the ``CAPTURE`` queue will not return the real values for the stream until a ``V4L2_EVENT_SOURCE_CHANGE`` event with ``changes`` set to ``V4L2_EVENT_SRC_CH_RESOLUTION`` is signaled. .. important:: Any client query issued after the decoder queues the event will return values applying to the just parsed stream, including queue formats, selection rectangles and controls. .. note:: A client capable of acquiring stream parameters from the bytestream on its own may attempt to set the width and height of the ``OUTPUT`` format to non-zero values matching the coded size of the stream, skip this step and continue with the `Capture Setup` sequence. However, it must not rely on any driver queries regarding stream parameters, such as selection rectangles and controls, since the decoder has not parsed them from the stream yet. If the values configured by the client do not match those parsed by the decoder, a `Dynamic Resolution Change` will be triggered to reconfigure them. .. note:: No decoded frames are produced during this phase. h](h)}(hX**This step only applies to coded formats that contain resolution information in the stream.** Continue queuing/dequeuing bytestream buffers to/from the ``OUTPUT`` queue via :c:func:`VIDIOC_QBUF` and :c:func:`VIDIOC_DQBUF`. The buffers will be processed and returned to the client in order, until required metadata to configure the ``CAPTURE`` queue are found. This is indicated by the decoder sending a ``V4L2_EVENT_SOURCE_CHANGE`` event with ``changes`` set to ``V4L2_EVENT_SRC_CH_RESOLUTION``.h](j )}(h^**This step only applies to coded formats that contain resolution information in the stream.**h]hZThis step only applies to coded formats that contain resolution information in the stream.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1j hjubh; Continue queuing/dequeuing bytestream buffers to/from the }(hjhhhNhNubj)}(h ``OUTPUT``h]hOUTPUT}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubh queue via }(hjhhhNhNubh)}(h:c:func:`VIDIOC_QBUF`h]j)}(hjh]h VIDIOC_QBUF()}(hjhhhNhNubah}(h]h ](jjc-funceh"]h$]h&]uh1jhjubah}(h]h ]h"]h$]h&]refdocj refdomainjreftypefunc refexplicitrefwarnjjj VIDIOC_QBUFuh1hhhhMdhjubh and }(hjhhhNhNubh)}(h:c:func:`VIDIOC_DQBUF`h]j)}(hjh]hVIDIOC_DQBUF()}(hjhhhNhNubah}(h]h ](jjc-funceh"]h$]h&]uh1jhjubah}(h]h ]h"]h$]h&]refdocj refdomainjreftypefunc refexplicitrefwarnjjj VIDIOC_DQBUFuh1hhhhMdhjubhn. The buffers will be processed and returned to the client in order, until required metadata to configure the }(hjhhhNhNubj)}(h ``CAPTURE``h]hCAPTURE}(hj5hhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubh= queue are found. This is indicated by the decoder sending a }(hjhhhNhNubj)}(h``V4L2_EVENT_SOURCE_CHANGE``h]hV4L2_EVENT_SOURCE_CHANGE}(hjGhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubh event with }(hjhhhNhNubj)}(h ``changes``h]hchanges}(hjYhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubh set to }(hjhhhNhNubj)}(h ``V4L2_EVENT_SRC_CH_RESOLUTION``h]hV4L2_EVENT_SRC_CH_RESOLUTION}(hjkhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubh.}(hjhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhMdhjubj )}(hhh](j )}(hIt is not an error if the first buffer does not contain enough data for this to occur. Processing of the buffers will continue as long as more data is needed. h]h)}(hIt is not an error if the first buffer does not contain enough data for this to occur. Processing of the buffers will continue as long as more data is needed.h]hIt is not an error if the first buffer does not contain enough data for this to occur. Processing of the buffers will continue as long as more data is needed.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMlhjubah}(h]h ]h"]h$]h&]uh1jhjubj )}(hIf data in a buffer that triggers the event is required to decode the first frame, it will not be returned to the client, until the initialization sequence completes and the frame is decoded. h]h)}(hIf data in a buffer that triggers the event is required to decode the first frame, it will not be returned to the client, until the initialization sequence completes and the frame is decoded.h]hIf data in a buffer that triggers the event is required to decode the first frame, it will not be returned to the client, until the initialization sequence completes and the frame is decoded.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMphjubah}(h]h ]h"]h$]h&]uh1jhjubj )}(hXoIf the client has not set the coded resolution of the stream on its own, calling :c:func:`VIDIOC_G_FMT`, :c:func:`VIDIOC_S_FMT`, :c:func:`VIDIOC_TRY_FMT` or :c:func:`VIDIOC_REQBUFS` on the ``CAPTURE`` queue will not return the real values for the stream until a ``V4L2_EVENT_SOURCE_CHANGE`` event with ``changes`` set to ``V4L2_EVENT_SRC_CH_RESOLUTION`` is signaled. h]h)}(hXnIf the client has not set the coded resolution of the stream on its own, calling :c:func:`VIDIOC_G_FMT`, :c:func:`VIDIOC_S_FMT`, :c:func:`VIDIOC_TRY_FMT` or :c:func:`VIDIOC_REQBUFS` on the ``CAPTURE`` queue will not return the real values for the stream until a ``V4L2_EVENT_SOURCE_CHANGE`` event with ``changes`` set to ``V4L2_EVENT_SRC_CH_RESOLUTION`` is signaled.h](hQIf the client has not set the coded resolution of the stream on its own, calling }(hjhhhNhNubh)}(h:c:func:`VIDIOC_G_FMT`h]j)}(hjh]hVIDIOC_G_FMT()}(hjhhhNhNubah}(h]h ](jjc-funceh"]h$]h&]uh1jhjubah}(h]h ]h"]h$]h&]refdocj refdomainjreftypefunc refexplicitrefwarnjjj VIDIOC_G_FMTuh1hhhhMthjubh, }(hjhhhNhNubh)}(h:c:func:`VIDIOC_S_FMT`h]j)}(hjh]hVIDIOC_S_FMT()}(hjhhhNhNubah}(h]h ](jjc-funceh"]h$]h&]uh1jhjubah}(h]h ]h"]h$]h&]refdocj refdomainjreftypefunc refexplicitrefwarnjjj VIDIOC_S_FMTuh1hhhhMthjubh, }(hjhhhNhNubh)}(h:c:func:`VIDIOC_TRY_FMT`h]j)}(hj h]hVIDIOC_TRY_FMT()}(hj hhhNhNubah}(h]h ](jjc-funceh"]h$]h&]uh1jhjubah}(h]h ]h"]h$]h&]refdocj refdomainjreftypefunc refexplicitrefwarnjjjVIDIOC_TRY_FMTuh1hhhhMthjubh or }(hjhhhNhNubh)}(h:c:func:`VIDIOC_REQBUFS`h]j)}(hj-h]hVIDIOC_REQBUFS()}(hj/hhhNhNubah}(h]h ](jjc-funceh"]h$]h&]uh1jhj+ubah}(h]h ]h"]h$]h&]refdocj refdomainjreftypefunc refexplicitrefwarnjjjVIDIOC_REQBUFSuh1hhhhMthjubh on the }(hjhhhNhNubj)}(h ``CAPTURE``h]hCAPTURE}(hjNhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubh> queue will not return the real values for the stream until a }(hjhhhNhNubj)}(h``V4L2_EVENT_SOURCE_CHANGE``h]hV4L2_EVENT_SOURCE_CHANGE}(hj`hhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubh event with }(hjhhhNhNubj)}(h ``changes``h]hchanges}(hjrhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubh set to }(hjhhhNhNubj)}(h ``V4L2_EVENT_SRC_CH_RESOLUTION``h]hV4L2_EVENT_SRC_CH_RESOLUTION}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubh is signaled.}(hjhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhMthjubah}(h]h ]h"]h$]h&]uh1jhjubeh}(h]h ]h"]h$]h&]jA jB uh1j hhhMlhjubj)}(hAny client query issued after the decoder queues the event will return values applying to the just parsed stream, including queue formats, selection rectangles and controls.h]h)}(hAny client query issued after the decoder queues the event will return values applying to the just parsed stream, including queue formats, selection rectangles and controls.h]hAny client query issued after the decoder queues the event will return values applying to the just parsed stream, including queue formats, selection rectangles and controls.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhM}hjubah}(h]h ]h"]h$]h&]uh1jhjubhnote)}(hXQA client capable of acquiring stream parameters from the bytestream on its own may attempt to set the width and height of the ``OUTPUT`` format to non-zero values matching the coded size of the stream, skip this step and continue with the `Capture Setup` sequence. However, it must not rely on any driver queries regarding stream parameters, such as selection rectangles and controls, since the decoder has not parsed them from the stream yet. If the values configured by the client do not match those parsed by the decoder, a `Dynamic Resolution Change` will be triggered to reconfigure them.h]h)}(hXQA client capable of acquiring stream parameters from the bytestream on its own may attempt to set the width and height of the ``OUTPUT`` format to non-zero values matching the coded size of the stream, skip this step and continue with the `Capture Setup` sequence. However, it must not rely on any driver queries regarding stream parameters, such as selection rectangles and controls, since the decoder has not parsed them from the stream yet. If the values configured by the client do not match those parsed by the decoder, a `Dynamic Resolution Change` will be triggered to reconfigure them.h](h~A client capable of acquiring stream parameters from the bytestream on its own may attempt to set the width and height of the }(hjhhhNhNubj)}(h ``OUTPUT``h]hOUTPUT}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubhg format to non-zero values matching the coded size of the stream, skip this step and continue with the }(hjhhhNhNubhtitle_reference)}(h`Capture Setup`h]h Capture Setup}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubhX sequence. However, it must not rely on any driver queries regarding stream parameters, such as selection rectangles and controls, since the decoder has not parsed them from the stream yet. If the values configured by the client do not match those parsed by the decoder, a }(hjhhhNhNubj)}(h`Dynamic Resolution Change`h]hDynamic Resolution Change}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubh' will be triggered to reconfigure them.}(hjhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhMhjubah}(h]h ]h"]h$]h&]uh1jhjubj)}(h1No decoded frames are produced during this phase.h]h)}(hjh]h1No decoded frames are produced during this phase.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhjubah}(h]h ]h"]h$]h&]uh1jhjubeh}(h]h ]h"]h$]h&]uh1jhjr hhhNhNubj )}(h,Continue with the `Capture Setup` sequence. h]h)}(h+Continue with the `Capture Setup` sequence.h](hContinue with the }(hj3hhhNhNubj)}(h`Capture Setup`h]h Capture Setup}(hj;hhhNhNubah}(h]h ]h"]h$]h&]uh1jhj3ubh sequence.}(hj3hhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhMhj/ubah}(h]h ]h"]h$]h&]uh1jhjr hhhhhNubeh}(h]h ]h"]h$]h&]jjjhjjuh1jhja hhhhhMubeh}(h]initializationah ]h"]initializationah$]h&]uh1hhhhhhhhMubh)}(hhh](h)}(h Capture Setuph]h Capture Setup}(hjjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjghhhhhMubj)}(hhh](j )}(hXCall :c:func:`VIDIOC_G_FMT` on the ``CAPTURE`` queue to get format for the destination buffers parsed/decoded from the bytestream. * **Required fields:** ``type`` a ``V4L2_BUF_TYPE_*`` enum appropriate for ``CAPTURE``. * **Returned fields:** ``width``, ``height`` frame buffer resolution for the decoded frames. ``pixelformat`` pixel format for decoded frames. ``num_planes`` (for _MPLANE ``type`` only) number of planes for pixelformat. ``sizeimage``, ``bytesperline`` as per standard semantics; matching frame buffer format. .. note:: The value of ``pixelformat`` may be any pixel format supported by the decoder for the current stream. The decoder should choose a preferred/optimal format for the default configuration. For example, a YUV format may be preferred over an RGB format if an additional conversion step would be required for the latter. h](h)}(hCall :c:func:`VIDIOC_G_FMT` on the ``CAPTURE`` queue to get format for the destination buffers parsed/decoded from the bytestream.h](hCall }(hjhhhNhNubh)}(h:c:func:`VIDIOC_G_FMT`h]j)}(hjh]hVIDIOC_G_FMT()}(hjhhhNhNubah}(h]h ](jjc-funceh"]h$]h&]uh1jhjubah}(h]h ]h"]h$]h&]refdocj refdomainjreftypefunc refexplicitrefwarnjjj VIDIOC_G_FMTuh1hhhhMhjubh on the }(hjhhhNhNubj)}(h ``CAPTURE``h]hCAPTURE}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubhT queue to get format for the destination buffers parsed/decoded from the bytestream.}(hjhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhMhj{ubj )}(hhh](j )}(h[**Required fields:** ``type`` a ``V4L2_BUF_TYPE_*`` enum appropriate for ``CAPTURE``. h](h)}(h**Required fields:**h]j )}(hjh]hRequired fields:}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1j hjubah}(h]h ]h"]h$]h&]uh1hhhhMhjubj)}(hhh]j )}(hA``type`` a ``V4L2_BUF_TYPE_*`` enum appropriate for ``CAPTURE``. h](j)}(h``type``h]j)}(hjh]htype}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubah}(h]h ]h"]h$]h&]uh1jhhhMhjubj!)}(hhh]h)}(h7a ``V4L2_BUF_TYPE_*`` enum appropriate for ``CAPTURE``.h](ha }(hjhhhNhNubj)}(h``V4L2_BUF_TYPE_*``h]hV4L2_BUF_TYPE_*}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubh enum appropriate for }(hjhhhNhNubj)}(h ``CAPTURE``h]hCAPTURE}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubh.}(hjhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhMhjubah}(h]h ]h"]h$]h&]uh1j hjubeh}(h]h ]h"]h$]h&]uh1j hhhMhjubah}(h]h ]h"]h$]h&]uh1jhjubeh}(h]h ]h"]h$]h&]uh1jhjubj )}(hXF**Returned fields:** ``width``, ``height`` frame buffer resolution for the decoded frames. ``pixelformat`` pixel format for decoded frames. ``num_planes`` (for _MPLANE ``type`` only) number of planes for pixelformat. ``sizeimage``, ``bytesperline`` as per standard semantics; matching frame buffer format. h](h)}(h**Returned fields:**h]j )}(hjQh]hReturned fields:}(hjShhhNhNubah}(h]h ]h"]h$]h&]uh1j hjOubah}(h]h ]h"]h$]h&]uh1hhhhMhjKubj)}(hhh](j )}(hF``width``, ``height`` frame buffer resolution for the decoded frames. h](j)}(h``width``, ``height``h](j)}(h ``width``h]hwidth}(hjqhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjmubh, }(hjmhhhNhNubj)}(h ``height``h]hheight}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjmubeh}(h]h ]h"]h$]h&]uh1jhhhMhjiubj!)}(hhh]h)}(h/frame buffer resolution for the decoded frames.h]h/frame buffer resolution for the decoded frames.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhjubah}(h]h ]h"]h$]h&]uh1j hjiubeh}(h]h ]h"]h$]h&]uh1j hhhMhjfubj )}(h1``pixelformat`` pixel format for decoded frames. h](j)}(h``pixelformat``h]j)}(hjh]h pixelformat}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubah}(h]h ]h"]h$]h&]uh1jhhhMhjubj!)}(hhh]h)}(h pixel format for decoded frames.h]h pixel format for decoded frames.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhjubah}(h]h ]h"]h$]h&]uh1j hjubeh}(h]h ]h"]h$]h&]uh1j hhhMhjfubj )}(hM``num_planes`` (for _MPLANE ``type`` only) number of planes for pixelformat. h](j)}(h*``num_planes`` (for _MPLANE ``type`` only)h](j)}(h``num_planes``h]h num_planes}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubh (for _MPLANE }(hjhhhNhNubj)}(h``type``h]htype}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubh only)}(hjhhhNhNubeh}(h]h ]h"]h$]h&]uh1jhhhMhjubj!)}(hhh]h)}(h!number of planes for pixelformat.h]h!number of planes for pixelformat.}(hj!hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhjubah}(h]h ]h"]h$]h&]uh1j hjubeh}(h]h ]h"]h$]h&]uh1j hhhMhjfubj )}(hY``sizeimage``, ``bytesperline`` as per standard semantics; matching frame buffer format. h](j)}(h``sizeimage``, ``bytesperline``h](j)}(h ``sizeimage``h]h sizeimage}(hjChhhNhNubah}(h]h ]h"]h$]h&]uh1jhj?ubh, }(hj?hhhNhNubj)}(h``bytesperline``h]h bytesperline}(hjUhhhNhNubah}(h]h ]h"]h$]h&]uh1jhj?ubeh}(h]h ]h"]h$]h&]uh1jhhhMhj;ubj!)}(hhh]h)}(h8as per standard semantics; matching frame buffer format.h]h8as per standard semantics; matching frame buffer format.}(hjlhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhjiubah}(h]h ]h"]h$]h&]uh1j hj;ubeh}(h]h ]h"]h$]h&]uh1j hhhMhjfubeh}(h]h ]h"]h$]h&]uh1jhjKubeh}(h]h ]h"]h$]h&]uh1jhjubeh}(h]h ]h"]h$]h&]jA jB uh1j hhhMhj{ubj)}(hX:The value of ``pixelformat`` may be any pixel format supported by the decoder for the current stream. The decoder should choose a preferred/optimal format for the default configuration. For example, a YUV format may be preferred over an RGB format if an additional conversion step would be required for the latter.h]h)}(hX:The value of ``pixelformat`` may be any pixel format supported by the decoder for the current stream. The decoder should choose a preferred/optimal format for the default configuration. For example, a YUV format may be preferred over an RGB format if an additional conversion step would be required for the latter.h](h The value of }(hjhhhNhNubj)}(h``pixelformat``h]h pixelformat}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubhX may be any pixel format supported by the decoder for the current stream. The decoder should choose a preferred/optimal format for the default configuration. For example, a YUV format may be preferred over an RGB format if an additional conversion step would be required for the latter.}(hjhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhMhjubah}(h]h ]h"]h$]h&]uh1jhj{ubeh}(h]h ]h"]h$]h&]uh1jhjxhhhNhNubj )}(hX**Optional.** Acquire the visible resolution via :c:func:`VIDIOC_G_SELECTION`. * **Required fields:** ``type`` a ``V4L2_BUF_TYPE_*`` enum appropriate for ``CAPTURE``. ``target`` set to ``V4L2_SEL_TGT_COMPOSE``. * **Returned fields:** ``r.left``, ``r.top``, ``r.width``, ``r.height`` the visible rectangle; it must fit within the frame buffer resolution returned by :c:func:`VIDIOC_G_FMT` on ``CAPTURE``. * The following selection targets are supported on ``CAPTURE``: ``V4L2_SEL_TGT_CROP_BOUNDS`` corresponds to the coded resolution of the stream. ``V4L2_SEL_TGT_CROP_DEFAULT`` the rectangle covering the part of the ``CAPTURE`` buffer that contains meaningful picture data (visible area); width and height will be equal to the visible resolution of the stream. ``V4L2_SEL_TGT_CROP`` the rectangle within the coded resolution to be output to ``CAPTURE``; defaults to ``V4L2_SEL_TGT_CROP_DEFAULT``; read-only on hardware without additional compose/scaling capabilities. ``V4L2_SEL_TGT_COMPOSE_BOUNDS`` the maximum rectangle within a ``CAPTURE`` buffer, which the cropped frame can be composed into; equal to ``V4L2_SEL_TGT_CROP`` if the hardware does not support compose/scaling. ``V4L2_SEL_TGT_COMPOSE_DEFAULT`` equal to ``V4L2_SEL_TGT_CROP``. ``V4L2_SEL_TGT_COMPOSE`` the rectangle inside a ``CAPTURE`` buffer into which the cropped frame is written; defaults to ``V4L2_SEL_TGT_COMPOSE_DEFAULT``; read-only on hardware without additional compose/scaling capabilities. ``V4L2_SEL_TGT_COMPOSE_PADDED`` the rectangle inside a ``CAPTURE`` buffer which is overwritten by the hardware; equal to ``V4L2_SEL_TGT_COMPOSE`` if the hardware does not write padding pixels. .. warning:: The values are guaranteed to be meaningful only after the decoder successfully parses the stream metadata. The client must not rely on the query before that happens. h](h)}(hN**Optional.** Acquire the visible resolution via :c:func:`VIDIOC_G_SELECTION`.h](j )}(h **Optional.**h]h Optional.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1j hjubh$ Acquire the visible resolution via }(hjhhhNhNubh)}(h:c:func:`VIDIOC_G_SELECTION`h]j)}(hjh]hVIDIOC_G_SELECTION()}(hjhhhNhNubah}(h]h ](jjc-funceh"]h$]h&]uh1jhjubah}(h]h ]h"]h$]h&]refdocj refdomainjreftypefunc refexplicitrefwarnjjjVIDIOC_G_SELECTIONuh1hhhhMhjubh.}(hjhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhMhjubj )}(hhh](j )}(h**Required fields:** ``type`` a ``V4L2_BUF_TYPE_*`` enum appropriate for ``CAPTURE``. ``target`` set to ``V4L2_SEL_TGT_COMPOSE``. h](h)}(h**Required fields:**h]j )}(hjh]hRequired fields:}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1j hjubah}(h]h ]h"]h$]h&]uh1hhhhMhjubj)}(hhh](j )}(hA``type`` a ``V4L2_BUF_TYPE_*`` enum appropriate for ``CAPTURE``. h](j)}(h``type``h]j)}(hj2h]htype}(hj4hhhNhNubah}(h]h ]h"]h$]h&]uh1jhj0ubah}(h]h ]h"]h$]h&]uh1jhhhMhj,ubj!)}(hhh]h)}(h7a ``V4L2_BUF_TYPE_*`` enum appropriate for ``CAPTURE``.h](ha }(hjJhhhNhNubj)}(h``V4L2_BUF_TYPE_*``h]hV4L2_BUF_TYPE_*}(hjRhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjJubh enum appropriate for }(hjJhhhNhNubj)}(h ``CAPTURE``h]hCAPTURE}(hjdhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjJubh.}(hjJhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhMhjGubah}(h]h ]h"]h$]h&]uh1j hj,ubeh}(h]h ]h"]h$]h&]uh1j hhhMhj)ubj )}(h,``target`` set to ``V4L2_SEL_TGT_COMPOSE``. h](j)}(h ``target``h]j)}(hjh]htarget}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubah}(h]h ]h"]h$]h&]uh1jhhhMhjubj!)}(hhh]h)}(h set to ``V4L2_SEL_TGT_COMPOSE``.h](hset to }(hjhhhNhNubj)}(h``V4L2_SEL_TGT_COMPOSE``h]hV4L2_SEL_TGT_COMPOSE}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubh.}(hjhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhMhjubah}(h]h ]h"]h$]h&]uh1j hjubeh}(h]h ]h"]h$]h&]uh1j hhhMhj)ubeh}(h]h ]h"]h$]h&]uh1jhjubeh}(h]h ]h"]h$]h&]uh1jhj ubj )}(h**Returned fields:** ``r.left``, ``r.top``, ``r.width``, ``r.height`` the visible rectangle; it must fit within the frame buffer resolution returned by :c:func:`VIDIOC_G_FMT` on ``CAPTURE``. h](h)}(h**Returned fields:**h]j )}(hjh]hReturned fields:}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1j hjubah}(h]h ]h"]h$]h&]uh1hhhhMhjubj)}(hhh]j )}(h``r.left``, ``r.top``, ``r.width``, ``r.height`` the visible rectangle; it must fit within the frame buffer resolution returned by :c:func:`VIDIOC_G_FMT` on ``CAPTURE``. h](j)}(h0``r.left``, ``r.top``, ``r.width``, ``r.height``h](j)}(h ``r.left``h]hr.left}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubh, }(hjhhhNhNubj)}(h ``r.top``h]hr.top}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubh, }hjsbj)}(h ``r.width``h]hr.width}(hj(hhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubh, }hjsbj)}(h ``r.height``h]hr.height}(hj:hhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubeh}(h]h ]h"]h$]h&]uh1jhhhMhjubj!)}(hhh]h)}(hxthe visible rectangle; it must fit within the frame buffer resolution returned by :c:func:`VIDIOC_G_FMT` on ``CAPTURE``.h](hRthe visible rectangle; it must fit within the frame buffer resolution returned by }(hjQhhhNhNubh)}(h:c:func:`VIDIOC_G_FMT`h]j)}(hj[h]hVIDIOC_G_FMT()}(hj]hhhNhNubah}(h]h ](jjc-funceh"]h$]h&]uh1jhjYubah}(h]h ]h"]h$]h&]refdocj refdomainjreftypefunc refexplicitrefwarnjjj VIDIOC_G_FMTuh1hhhhMhjQubh on }(hjQhhhNhNubj)}(h ``CAPTURE``h]hCAPTURE}(hj|hhhNhNubah}(h]h ]h"]h$]h&]uh1jhjQubh.}(hjQhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhMhjNubah}(h]h ]h"]h$]h&]uh1j hjubeh}(h]h ]h"]h$]h&]uh1j hhhMhjubah}(h]h ]h"]h$]h&]uh1jhjubeh}(h]h ]h"]h$]h&]uh1jhj ubj )}(hX3The following selection targets are supported on ``CAPTURE``: ``V4L2_SEL_TGT_CROP_BOUNDS`` corresponds to the coded resolution of the stream. ``V4L2_SEL_TGT_CROP_DEFAULT`` the rectangle covering the part of the ``CAPTURE`` buffer that contains meaningful picture data (visible area); width and height will be equal to the visible resolution of the stream. ``V4L2_SEL_TGT_CROP`` the rectangle within the coded resolution to be output to ``CAPTURE``; defaults to ``V4L2_SEL_TGT_CROP_DEFAULT``; read-only on hardware without additional compose/scaling capabilities. ``V4L2_SEL_TGT_COMPOSE_BOUNDS`` the maximum rectangle within a ``CAPTURE`` buffer, which the cropped frame can be composed into; equal to ``V4L2_SEL_TGT_CROP`` if the hardware does not support compose/scaling. ``V4L2_SEL_TGT_COMPOSE_DEFAULT`` equal to ``V4L2_SEL_TGT_CROP``. ``V4L2_SEL_TGT_COMPOSE`` the rectangle inside a ``CAPTURE`` buffer into which the cropped frame is written; defaults to ``V4L2_SEL_TGT_COMPOSE_DEFAULT``; read-only on hardware without additional compose/scaling capabilities. ``V4L2_SEL_TGT_COMPOSE_PADDED`` the rectangle inside a ``CAPTURE`` buffer which is overwritten by the hardware; equal to ``V4L2_SEL_TGT_COMPOSE`` if the hardware does not write padding pixels. h](h)}(h=The following selection targets are supported on ``CAPTURE``:h](h1The following selection targets are supported on }(hjhhhNhNubj)}(h ``CAPTURE``h]hCAPTURE}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubh:}(hjhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhMhjubj)}(hhh](j )}(hP``V4L2_SEL_TGT_CROP_BOUNDS`` corresponds to the coded resolution of the stream. h](j)}(h``V4L2_SEL_TGT_CROP_BOUNDS``h]j)}(hjh]hV4L2_SEL_TGT_CROP_BOUNDS}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubah}(h]h ]h"]h$]h&]uh1jhhhMhjubj!)}(hhh]h)}(h2corresponds to the coded resolution of the stream.h]h2corresponds to the coded resolution of the stream.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhjubah}(h]h ]h"]h$]h&]uh1j hjubeh}(h]h ]h"]h$]h&]uh1j hhhMhjubj )}(h``V4L2_SEL_TGT_CROP_DEFAULT`` the rectangle covering the part of the ``CAPTURE`` buffer that contains meaningful picture data (visible area); width and height will be equal to the visible resolution of the stream. h](j)}(h``V4L2_SEL_TGT_CROP_DEFAULT``h]j)}(hjh]hV4L2_SEL_TGT_CROP_DEFAULT}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubah}(h]h ]h"]h$]h&]uh1jhhhMhj ubj!)}(hhh]h)}(hthe rectangle covering the part of the ``CAPTURE`` buffer that contains meaningful picture data (visible area); width and height will be equal to the visible resolution of the stream.h](h'the rectangle covering the part of the }(hj)hhhNhNubj)}(h ``CAPTURE``h]hCAPTURE}(hj1hhhNhNubah}(h]h ]h"]h$]h&]uh1jhj)ubh buffer that contains meaningful picture data (visible area); width and height will be equal to the visible resolution of the stream.}(hj)hhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhMhj&ubah}(h]h ]h"]h$]h&]uh1j hj ubeh}(h]h ]h"]h$]h&]uh1j hhhMhjubj )}(h``V4L2_SEL_TGT_CROP`` the rectangle within the coded resolution to be output to ``CAPTURE``; defaults to ``V4L2_SEL_TGT_CROP_DEFAULT``; read-only on hardware without additional compose/scaling capabilities. h](j)}(h``V4L2_SEL_TGT_CROP``h]j)}(hj[h]hV4L2_SEL_TGT_CROP}(hj]hhhNhNubah}(h]h ]h"]h$]h&]uh1jhjYubah}(h]h ]h"]h$]h&]uh1jhhhMhjUubj!)}(hhh]h)}(hthe rectangle within the coded resolution to be output to ``CAPTURE``; defaults to ``V4L2_SEL_TGT_CROP_DEFAULT``; read-only on hardware without additional compose/scaling capabilities.h](h:the rectangle within the coded resolution to be output to }(hjshhhNhNubj)}(h ``CAPTURE``h]hCAPTURE}(hj{hhhNhNubah}(h]h ]h"]h$]h&]uh1jhjsubh; defaults to }(hjshhhNhNubj)}(h``V4L2_SEL_TGT_CROP_DEFAULT``h]hV4L2_SEL_TGT_CROP_DEFAULT}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjsubhH; read-only on hardware without additional compose/scaling capabilities.}(hjshhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhMhjpubah}(h]h ]h"]h$]h&]uh1j hjUubeh}(h]h ]h"]h$]h&]uh1j hhhMhjubj )}(h``V4L2_SEL_TGT_COMPOSE_BOUNDS`` the maximum rectangle within a ``CAPTURE`` buffer, which the cropped frame can be composed into; equal to ``V4L2_SEL_TGT_CROP`` if the hardware does not support compose/scaling. h](j)}(h``V4L2_SEL_TGT_COMPOSE_BOUNDS``h]j)}(hjh]hV4L2_SEL_TGT_COMPOSE_BOUNDS}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubah}(h]h ]h"]h$]h&]uh1jhhhMhjubj!)}(hhh]h)}(hthe maximum rectangle within a ``CAPTURE`` buffer, which the cropped frame can be composed into; equal to ``V4L2_SEL_TGT_CROP`` if the hardware does not support compose/scaling.h](hthe maximum rectangle within a }(hjhhhNhNubj)}(h ``CAPTURE``h]hCAPTURE}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubh@ buffer, which the cropped frame can be composed into; equal to }(hjhhhNhNubj)}(h``V4L2_SEL_TGT_CROP``h]hV4L2_SEL_TGT_CROP}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubh2 if the hardware does not support compose/scaling.}(hjhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhMhjubah}(h]h ]h"]h$]h&]uh1j hjubeh}(h]h ]h"]h$]h&]uh1j hhhMhjubj )}(hA``V4L2_SEL_TGT_COMPOSE_DEFAULT`` equal to ``V4L2_SEL_TGT_CROP``. h](j)}(h ``V4L2_SEL_TGT_COMPOSE_DEFAULT``h]j)}(hjh]hV4L2_SEL_TGT_COMPOSE_DEFAULT}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubah}(h]h ]h"]h$]h&]uh1jhhhMhj ubj!)}(hhh]h)}(hequal to ``V4L2_SEL_TGT_CROP``.h](h equal to }(hj+hhhNhNubj)}(h``V4L2_SEL_TGT_CROP``h]hV4L2_SEL_TGT_CROP}(hj3hhhNhNubah}(h]h ]h"]h$]h&]uh1jhj+ubh.}(hj+hhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhMhj(ubah}(h]h ]h"]h$]h&]uh1j hj ubeh}(h]h ]h"]h$]h&]uh1j hhhMhjubj )}(h``V4L2_SEL_TGT_COMPOSE`` the rectangle inside a ``CAPTURE`` buffer into which the cropped frame is written; defaults to ``V4L2_SEL_TGT_COMPOSE_DEFAULT``; read-only on hardware without additional compose/scaling capabilities. h](j)}(h``V4L2_SEL_TGT_COMPOSE``h]j)}(hj]h]hV4L2_SEL_TGT_COMPOSE}(hj_hhhNhNubah}(h]h ]h"]h$]h&]uh1jhj[ubah}(h]h ]h"]h$]h&]uh1jhhhMhjWubj!)}(hhh]h)}(hthe rectangle inside a ``CAPTURE`` buffer into which the cropped frame is written; defaults to ``V4L2_SEL_TGT_COMPOSE_DEFAULT``; read-only on hardware without additional compose/scaling capabilities.h](hthe rectangle inside a }(hjuhhhNhNubj)}(h ``CAPTURE``h]hCAPTURE}(hj}hhhNhNubah}(h]h ]h"]h$]h&]uh1jhjuubh= buffer into which the cropped frame is written; defaults to }(hjuhhhNhNubj)}(h ``V4L2_SEL_TGT_COMPOSE_DEFAULT``h]hV4L2_SEL_TGT_COMPOSE_DEFAULT}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjuubhH; read-only on hardware without additional compose/scaling capabilities.}(hjuhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhMhjrubah}(h]h ]h"]h$]h&]uh1j hjWubeh}(h]h ]h"]h$]h&]uh1j hhhMhjubj )}(h``V4L2_SEL_TGT_COMPOSE_PADDED`` the rectangle inside a ``CAPTURE`` buffer which is overwritten by the hardware; equal to ``V4L2_SEL_TGT_COMPOSE`` if the hardware does not write padding pixels. h](j)}(h``V4L2_SEL_TGT_COMPOSE_PADDED``h]j)}(hjh]hV4L2_SEL_TGT_COMPOSE_PADDED}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubah}(h]h ]h"]h$]h&]uh1jhhhMhjubj!)}(hhh]h)}(hthe rectangle inside a ``CAPTURE`` buffer which is overwritten by the hardware; equal to ``V4L2_SEL_TGT_COMPOSE`` if the hardware does not write padding pixels.h](hthe rectangle inside a }(hjhhhNhNubj)}(h ``CAPTURE``h]hCAPTURE}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubh7 buffer which is overwritten by the hardware; equal to }(hjhhhNhNubj)}(h``V4L2_SEL_TGT_COMPOSE``h]hV4L2_SEL_TGT_COMPOSE}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubh/ if the hardware does not write padding pixels.}(hjhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhMhjubah}(h]h ]h"]h$]h&]uh1j hjubeh}(h]h ]h"]h$]h&]uh1j hhhMhjubeh}(h]h ]h"]h$]h&]uh1jhjubeh}(h]h ]h"]h$]h&]uh1jhj ubeh}(h]h ]h"]h$]h&]jA jB uh1j hhhMhjubj)}(hThe values are guaranteed to be meaningful only after the decoder successfully parses the stream metadata. The client must not rely on the query before that happens.h]h)}(hThe values are guaranteed to be meaningful only after the decoder successfully parses the stream metadata. The client must not rely on the query before that happens.h]hThe values are guaranteed to be meaningful only after the decoder successfully parses the stream metadata. The client must not rely on the query before that happens.}(hj%hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhj!ubah}(h]h ]h"]h$]h&]uh1jhjubeh}(h]h ]h"]h$]h&]uh1jhjxhhhNhNubj )}(hXS**Optional.** Enumerate ``CAPTURE`` formats via :c:func:`VIDIOC_ENUM_FMT` on the ``CAPTURE`` queue. Once the stream information is parsed and known, the client may use this ioctl to discover which raw formats are supported for given stream and select one of them via :c:func:`VIDIOC_S_FMT`. .. important:: The decoder will return only formats supported for the currently established coded format, as per the ``OUTPUT`` format and/or stream metadata parsed in this initialization sequence, even if more formats may be supported by the decoder in general. In other words, the set returned will be a subset of the initial query mentioned in the `Querying Capabilities` section. For example, a decoder may support YUV and RGB formats for resolutions 1920x1088 and lower, but only YUV for higher resolutions (due to hardware limitations). After parsing a resolution of 1920x1088 or lower, :c:func:`VIDIOC_ENUM_FMT` may return a set of YUV and RGB pixel formats, but after parsing resolution higher than 1920x1088, the decoder will not return RGB, unsupported for this resolution. However, subsequent resolution change event triggered after discovering a resolution change within the same stream may switch the stream into a lower resolution and :c:func:`VIDIOC_ENUM_FMT` would return RGB formats again in that case. h](h)}(hX"**Optional.** Enumerate ``CAPTURE`` formats via :c:func:`VIDIOC_ENUM_FMT` on the ``CAPTURE`` queue. Once the stream information is parsed and known, the client may use this ioctl to discover which raw formats are supported for given stream and select one of them via :c:func:`VIDIOC_S_FMT`.h](j )}(h **Optional.**h]h Optional.}(hjGhhhNhNubah}(h]h ]h"]h$]h&]uh1j hjCubh Enumerate }(hjChhhNhNubj)}(h ``CAPTURE``h]hCAPTURE}(hjYhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjCubh formats via }(hjChhhNhNubh)}(h:c:func:`VIDIOC_ENUM_FMT`h]j)}(hjmh]hVIDIOC_ENUM_FMT()}(hjohhhNhNubah}(h]h ](jjc-funceh"]h$]h&]uh1jhjkubah}(h]h ]h"]h$]h&]refdocj refdomainjreftypefunc refexplicitrefwarnjjjVIDIOC_ENUM_FMTuh1hhhhMhjCubh on the }(hjChhhNhNubj)}(h ``CAPTURE``h]hCAPTURE}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjCubh queue. Once the stream information is parsed and known, the client may use this ioctl to discover which raw formats are supported for given stream and select one of them via }(hjChhhNhNubh)}(h:c:func:`VIDIOC_S_FMT`h]j)}(hjh]hVIDIOC_S_FMT()}(hjhhhNhNubah}(h]h ](jjc-funceh"]h$]h&]uh1jhjubah}(h]h ]h"]h$]h&]refdocj refdomainjreftypefunc refexplicitrefwarnjjj VIDIOC_S_FMTuh1hhhhMhjCubh.}(hjChhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhMhj?ubj)}(hXThe decoder will return only formats supported for the currently established coded format, as per the ``OUTPUT`` format and/or stream metadata parsed in this initialization sequence, even if more formats may be supported by the decoder in general. In other words, the set returned will be a subset of the initial query mentioned in the `Querying Capabilities` section. For example, a decoder may support YUV and RGB formats for resolutions 1920x1088 and lower, but only YUV for higher resolutions (due to hardware limitations). After parsing a resolution of 1920x1088 or lower, :c:func:`VIDIOC_ENUM_FMT` may return a set of YUV and RGB pixel formats, but after parsing resolution higher than 1920x1088, the decoder will not return RGB, unsupported for this resolution. However, subsequent resolution change event triggered after discovering a resolution change within the same stream may switch the stream into a lower resolution and :c:func:`VIDIOC_ENUM_FMT` would return RGB formats again in that case.h](h)}(hXpThe decoder will return only formats supported for the currently established coded format, as per the ``OUTPUT`` format and/or stream metadata parsed in this initialization sequence, even if more formats may be supported by the decoder in general. In other words, the set returned will be a subset of the initial query mentioned in the `Querying Capabilities` section.h](hfThe decoder will return only formats supported for the currently established coded format, as per the }(hjhhhNhNubj)}(h ``OUTPUT``h]hOUTPUT}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubh format and/or stream metadata parsed in this initialization sequence, even if more formats may be supported by the decoder in general. In other words, the set returned will be a subset of the initial query mentioned in the }(hjhhhNhNubj)}(h`Querying Capabilities`h]hQuerying Capabilities}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubh section.}(hjhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhMhjubh)}(hXFor example, a decoder may support YUV and RGB formats for resolutions 1920x1088 and lower, but only YUV for higher resolutions (due to hardware limitations). After parsing a resolution of 1920x1088 or lower, :c:func:`VIDIOC_ENUM_FMT` may return a set of YUV and RGB pixel formats, but after parsing resolution higher than 1920x1088, the decoder will not return RGB, unsupported for this resolution.h](hFor example, a decoder may support YUV and RGB formats for resolutions 1920x1088 and lower, but only YUV for higher resolutions (due to hardware limitations). After parsing a resolution of 1920x1088 or lower, }(hjhhhNhNubh)}(h:c:func:`VIDIOC_ENUM_FMT`h]j)}(hj h]hVIDIOC_ENUM_FMT()}(hj hhhNhNubah}(h]h ](jjc-funceh"]h$]h&]uh1jhjubah}(h]h ]h"]h$]h&]refdocj refdomainjreftypefunc refexplicitrefwarnjjjVIDIOC_ENUM_FMTuh1hhhhMhjubh may return a set of YUV and RGB pixel formats, but after parsing resolution higher than 1920x1088, the decoder will not return RGB, unsupported for this resolution.}(hjhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhMhjubh)}(hHowever, subsequent resolution change event triggered after discovering a resolution change within the same stream may switch the stream into a lower resolution and :c:func:`VIDIOC_ENUM_FMT` would return RGB formats again in that case.h](hHowever, subsequent resolution change event triggered after discovering a resolution change within the same stream may switch the stream into a lower resolution and }(hj0hhhNhNubh)}(h:c:func:`VIDIOC_ENUM_FMT`h]j)}(hj:h]hVIDIOC_ENUM_FMT()}(hj<hhhNhNubah}(h]h ](jjc-funceh"]h$]h&]uh1jhj8ubah}(h]h ]h"]h$]h&]refdocj refdomainjreftypefunc refexplicitrefwarnjjjVIDIOC_ENUM_FMTuh1hhhhMhj0ubh- would return RGB formats again in that case.}(hj0hhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhMhjubeh}(h]h ]h"]h$]h&]uh1jhj?ubeh}(h]h ]h"]h$]h&]uh1jhjxhhhNhNubj )}(hXD**Optional.** Set the ``CAPTURE`` format via :c:func:`VIDIOC_S_FMT` on the ``CAPTURE`` queue. The client may choose a different format than selected/suggested by the decoder in :c:func:`VIDIOC_G_FMT`. * **Required fields:** ``type`` a ``V4L2_BUF_TYPE_*`` enum appropriate for ``CAPTURE``. ``pixelformat`` a raw pixel format. ``width``, ``height`` frame buffer resolution of the decoded stream; typically unchanged from what was returned with :c:func:`VIDIOC_G_FMT`, but it may be different if the hardware supports composition and/or scaling. h](h)}(h**Optional.** Set the ``CAPTURE`` format via :c:func:`VIDIOC_S_FMT` on the ``CAPTURE`` queue. The client may choose a different format than selected/suggested by the decoder in :c:func:`VIDIOC_G_FMT`.h](j )}(h **Optional.**h]h Optional.}(hjuhhhNhNubah}(h]h ]h"]h$]h&]uh1j hjqubh Set the }(hjqhhhNhNubj)}(h ``CAPTURE``h]hCAPTURE}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjqubh format via }(hjqhhhNhNubh)}(h:c:func:`VIDIOC_S_FMT`h]j)}(hjh]hVIDIOC_S_FMT()}(hjhhhNhNubah}(h]h ](jjc-funceh"]h$]h&]uh1jhjubah}(h]h ]h"]h$]h&]refdocj refdomainjreftypefunc refexplicitrefwarnjjj VIDIOC_S_FMTuh1hhhhMhjqubh on the }(hjqhhhNhNubj)}(h ``CAPTURE``h]hCAPTURE}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjqubh[ queue. The client may choose a different format than selected/suggested by the decoder in }(hjqhhhNhNubh)}(h:c:func:`VIDIOC_G_FMT`h]j)}(hjh]hVIDIOC_G_FMT()}(hjhhhNhNubah}(h]h ](jjc-funceh"]h$]h&]uh1jhjubah}(h]h ]h"]h$]h&]refdocj refdomainjreftypefunc refexplicitrefwarnjjj VIDIOC_G_FMTuh1hhhhMhjqubh.}(hjqhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhMhjmubj )}(hhh]j )}(hXh**Required fields:** ``type`` a ``V4L2_BUF_TYPE_*`` enum appropriate for ``CAPTURE``. ``pixelformat`` a raw pixel format. ``width``, ``height`` frame buffer resolution of the decoded stream; typically unchanged from what was returned with :c:func:`VIDIOC_G_FMT`, but it may be different if the hardware supports composition and/or scaling. h](h)}(h**Required fields:**h]j )}(hjh]hRequired fields:}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1j hjubah}(h]h ]h"]h$]h&]uh1hhhhM hjubj)}(hhh](j )}(hA``type`` a ``V4L2_BUF_TYPE_*`` enum appropriate for ``CAPTURE``. h](j)}(h``type``h]j)}(hjh]htype}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubah}(h]h ]h"]h$]h&]uh1jhhhM hjubj!)}(hhh]h)}(h7a ``V4L2_BUF_TYPE_*`` enum appropriate for ``CAPTURE``.h](ha }(hj6hhhNhNubj)}(h``V4L2_BUF_TYPE_*``h]hV4L2_BUF_TYPE_*}(hj>hhhNhNubah}(h]h ]h"]h$]h&]uh1jhj6ubh enum appropriate for }(hj6hhhNhNubj)}(h ``CAPTURE``h]hCAPTURE}(hjPhhhNhNubah}(h]h ]h"]h$]h&]uh1jhj6ubh.}(hj6hhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhM hj3ubah}(h]h ]h"]h$]h&]uh1j hjubeh}(h]h ]h"]h$]h&]uh1j hhhM hjubj )}(h$``pixelformat`` a raw pixel format. h](j)}(h``pixelformat``h]j)}(hjzh]h pixelformat}(hj|hhhNhNubah}(h]h ]h"]h$]h&]uh1jhjxubah}(h]h ]h"]h$]h&]uh1jhhhMhjtubj!)}(hhh]h)}(ha raw pixel format.h]ha raw pixel format.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhjubah}(h]h ]h"]h$]h&]uh1j hjtubeh}(h]h ]h"]h$]h&]uh1j hhhMhjubj )}(h``width``, ``height`` frame buffer resolution of the decoded stream; typically unchanged from what was returned with :c:func:`VIDIOC_G_FMT`, but it may be different if the hardware supports composition and/or scaling. h](j)}(h``width``, ``height``h](j)}(h ``width``h]hwidth}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubh, }(hjhhhNhNubj)}(h ``height``h]hheight}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubeh}(h]h ]h"]h$]h&]uh1jhhhMhjubj!)}(hhh]h)}(hframe buffer resolution of the decoded stream; typically unchanged from what was returned with :c:func:`VIDIOC_G_FMT`, but it may be different if the hardware supports composition and/or scaling.h](h_frame buffer resolution of the decoded stream; typically unchanged from what was returned with }(hjhhhNhNubh)}(h:c:func:`VIDIOC_G_FMT`h]j)}(hjh]hVIDIOC_G_FMT()}(hjhhhNhNubah}(h]h ](jjc-funceh"]h$]h&]uh1jhjubah}(h]h ]h"]h$]h&]refdocj refdomainjreftypefunc refexplicitrefwarnjjj VIDIOC_G_FMTuh1hhhhMhjubhN, but it may be different if the hardware supports composition and/or scaling.}(hjhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhMhjubah}(h]h ]h"]h$]h&]uh1j hjubeh}(h]h ]h"]h$]h&]uh1j hhhMhjubeh}(h]h ]h"]h$]h&]uh1jhjubeh}(h]h ]h"]h$]h&]uh1jhjubah}(h]h ]h"]h$]h&]jA jB uh1j hhhM hjmubeh}(h]h ]h"]h$]h&]uh1jhjxhhhNhNubeh}(h]h ]h"]h$]h&]jjjhjjuh1jhjghhhhhMubh block_quote)}(h* Setting the ``CAPTURE`` format will reset the compose selection rectangles to their default values, based on the new resolution, as described in the previous step. h]j )}(hhh]j )}(hSetting the ``CAPTURE`` format will reset the compose selection rectangles to their default values, based on the new resolution, as described in the previous step. h]h)}(hSetting the ``CAPTURE`` format will reset the compose selection rectangles to their default values, based on the new resolution, as described in the previous step.h](h Setting the }(hjE hhhNhNubj)}(h ``CAPTURE``h]hCAPTURE}(hjM hhhNhNubah}(h]h ]h"]h$]h&]uh1jhjE ubh format will reset the compose selection rectangles to their default values, based on the new resolution, as described in the previous step.}(hjE hhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhMhjA ubah}(h]h ]h"]h$]h&]uh1jhj> ubah}(h]h ]h"]h$]h&]jA jB uh1j hhhMhj: ubah}(h]h ]h"]h$]h&]uh1j8 hhhMhjghhubj)}(hhh](j )}(hX **Optional.** Set the compose rectangle via :c:func:`VIDIOC_S_SELECTION` on the ``CAPTURE`` queue if it is desired and if the decoder has compose and/or scaling capabilities. * **Required fields:** ``type`` a ``V4L2_BUF_TYPE_*`` enum appropriate for ``CAPTURE``. ``target`` set to ``V4L2_SEL_TGT_COMPOSE``. ``r.left``, ``r.top``, ``r.width``, ``r.height`` the rectangle inside a ``CAPTURE`` buffer into which the cropped frame is written; defaults to ``V4L2_SEL_TGT_COMPOSE_DEFAULT``; read-only on hardware without additional compose/scaling capabilities. * **Returned fields:** ``r.left``, ``r.top``, ``r.width``, ``r.height`` the visible rectangle; it must fit within the frame buffer resolution returned by :c:func:`VIDIOC_G_FMT` on ``CAPTURE``. .. warning:: The decoder may adjust the compose rectangle to the nearest supported one to meet codec and hardware requirements. The client needs to check the adjusted rectangle returned by :c:func:`VIDIOC_S_SELECTION`. h](h)}(h**Optional.** Set the compose rectangle via :c:func:`VIDIOC_S_SELECTION` on the ``CAPTURE`` queue if it is desired and if the decoder has compose and/or scaling capabilities.h](j )}(h **Optional.**h]h Optional.}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1j hj~ ubh Set the compose rectangle via }(hj~ hhhNhNubh)}(h:c:func:`VIDIOC_S_SELECTION`h]j)}(hj h]hVIDIOC_S_SELECTION()}(hj hhhNhNubah}(h]h ](jjc-funceh"]h$]h&]uh1jhj ubah}(h]h ]h"]h$]h&]refdocj refdomainjreftypefunc refexplicitrefwarnjjjVIDIOC_S_SELECTIONuh1hhhhMhj~ ubh on the }(hj~ hhhNhNubj)}(h ``CAPTURE``h]hCAPTURE}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1jhj~ ubhS queue if it is desired and if the decoder has compose and/or scaling capabilities.}(hj~ hhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhMhjz ubj )}(hhh](j )}(hX**Required fields:** ``type`` a ``V4L2_BUF_TYPE_*`` enum appropriate for ``CAPTURE``. ``target`` set to ``V4L2_SEL_TGT_COMPOSE``. ``r.left``, ``r.top``, ``r.width``, ``r.height`` the rectangle inside a ``CAPTURE`` buffer into which the cropped frame is written; defaults to ``V4L2_SEL_TGT_COMPOSE_DEFAULT``; read-only on hardware without additional compose/scaling capabilities. h](h)}(h**Required fields:**h]j )}(hj h]hRequired fields:}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1j hj ubah}(h]h ]h"]h$]h&]uh1hhhhMhj ubj)}(hhh](j )}(hA``type`` a ``V4L2_BUF_TYPE_*`` enum appropriate for ``CAPTURE``. h](j)}(h``type``h]j)}(hj h]htype}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1jhj ubah}(h]h ]h"]h$]h&]uh1jhhhM"hj ubj!)}(hhh]h)}(h7a ``V4L2_BUF_TYPE_*`` enum appropriate for ``CAPTURE``.h](ha }(hj!hhhNhNubj)}(h``V4L2_BUF_TYPE_*``h]hV4L2_BUF_TYPE_*}(hj!hhhNhNubah}(h]h ]h"]h$]h&]uh1jhj!ubh enum appropriate for }(hj!hhhNhNubj)}(h ``CAPTURE``h]hCAPTURE}(hj(!hhhNhNubah}(h]h ]h"]h$]h&]uh1jhj!ubh.}(hj!hhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhM"hj !ubah}(h]h ]h"]h$]h&]uh1j hj ubeh}(h]h ]h"]h$]h&]uh1j hhhM"hj ubj )}(h,``target`` set to ``V4L2_SEL_TGT_COMPOSE``. h](j)}(h ``target``h]j)}(hjR!h]htarget}(hjT!hhhNhNubah}(h]h ]h"]h$]h&]uh1jhjP!ubah}(h]h ]h"]h$]h&]uh1jhhhM%hjL!ubj!)}(hhh]h)}(h set to ``V4L2_SEL_TGT_COMPOSE``.h](hset to }(hjj!hhhNhNubj)}(h``V4L2_SEL_TGT_COMPOSE``h]hV4L2_SEL_TGT_COMPOSE}(hjr!hhhNhNubah}(h]h ]h"]h$]h&]uh1jhjj!ubh.}(hjj!hhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhM%hjg!ubah}(h]h ]h"]h$]h&]uh1j hjL!ubeh}(h]h ]h"]h$]h&]uh1j hhhM%hj ubj )}(h``r.left``, ``r.top``, ``r.width``, ``r.height`` the rectangle inside a ``CAPTURE`` buffer into which the cropped frame is written; defaults to ``V4L2_SEL_TGT_COMPOSE_DEFAULT``; read-only on hardware without additional compose/scaling capabilities. h](j)}(h0``r.left``, ``r.top``, ``r.width``, ``r.height``h](j)}(h ``r.left``h]hr.left}(hj!hhhNhNubah}(h]h ]h"]h$]h&]uh1jhj!ubh, }(hj!hhhNhNubj)}(h ``r.top``h]hr.top}(hj!hhhNhNubah}(h]h ]h"]h$]h&]uh1jhj!ubh, }hj!sbj)}(h ``r.width``h]hr.width}(hj!hhhNhNubah}(h]h ]h"]h$]h&]uh1jhj!ubh, }hj!sbj)}(h ``r.height``h]hr.height}(hj!hhhNhNubah}(h]h ]h"]h$]h&]uh1jhj!ubeh}(h]h ]h"]h$]h&]uh1jhhhM*hj!ubj!)}(hhh]h)}(hthe rectangle inside a ``CAPTURE`` buffer into which the cropped frame is written; defaults to ``V4L2_SEL_TGT_COMPOSE_DEFAULT``; read-only on hardware without additional compose/scaling capabilities.h](hthe rectangle inside a }(hj!hhhNhNubj)}(h ``CAPTURE``h]hCAPTURE}(hj!hhhNhNubah}(h]h ]h"]h$]h&]uh1jhj!ubh= buffer into which the cropped frame is written; defaults to }(hj!hhhNhNubj)}(h ``V4L2_SEL_TGT_COMPOSE_DEFAULT``h]hV4L2_SEL_TGT_COMPOSE_DEFAULT}(hj"hhhNhNubah}(h]h ]h"]h$]h&]uh1jhj!ubhH; read-only on hardware without additional compose/scaling capabilities.}(hj!hhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhM(hj!ubah}(h]h ]h"]h$]h&]uh1j hj!ubeh}(h]h ]h"]h$]h&]uh1j hhhM*hj ubeh}(h]h ]h"]h$]h&]uh1jhj ubeh}(h]h ]h"]h$]h&]uh1jhj ubj )}(h**Returned fields:** ``r.left``, ``r.top``, ``r.width``, ``r.height`` the visible rectangle; it must fit within the frame buffer resolution returned by :c:func:`VIDIOC_G_FMT` on ``CAPTURE``. h](h)}(h**Returned fields:**h]j )}(hj;"h]hReturned fields:}(hj="hhhNhNubah}(h]h ]h"]h$]h&]uh1j hj9"ubah}(h]h ]h"]h$]h&]uh1hhhhM,hj5"ubj)}(hhh]j )}(h``r.left``, ``r.top``, ``r.width``, ``r.height`` the visible rectangle; it must fit within the frame buffer resolution returned by :c:func:`VIDIOC_G_FMT` on ``CAPTURE``. h](j)}(h0``r.left``, ``r.top``, ``r.width``, ``r.height``h](j)}(h ``r.left``h]hr.left}(hj["hhhNhNubah}(h]h ]h"]h$]h&]uh1jhjW"ubh, }(hjW"hhhNhNubj)}(h ``r.top``h]hr.top}(hjm"hhhNhNubah}(h]h ]h"]h$]h&]uh1jhjW"ubh, }hjW"sbj)}(h ``r.width``h]hr.width}(hj"hhhNhNubah}(h]h ]h"]h$]h&]uh1jhjW"ubh, }hjW"sbj)}(h ``r.height``h]hr.height}(hj"hhhNhNubah}(h]h ]h"]h$]h&]uh1jhjW"ubeh}(h]h ]h"]h$]h&]uh1jhhhM0hjS"ubj!)}(hhh]h)}(hxthe visible rectangle; it must fit within the frame buffer resolution returned by :c:func:`VIDIOC_G_FMT` on ``CAPTURE``.h](hRthe visible rectangle; it must fit within the frame buffer resolution returned by }(hj"hhhNhNubh)}(h:c:func:`VIDIOC_G_FMT`h]j)}(hj"h]hVIDIOC_G_FMT()}(hj"hhhNhNubah}(h]h ](jjc-funceh"]h$]h&]uh1jhj"ubah}(h]h ]h"]h$]h&]refdocj refdomainjreftypefunc refexplicitrefwarnjjj VIDIOC_G_FMTuh1hhhhM/hj"ubh on }(hj"hhhNhNubj)}(h ``CAPTURE``h]hCAPTURE}(hj"hhhNhNubah}(h]h ]h"]h$]h&]uh1jhj"ubh.}(hj"hhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhM/hj"ubah}(h]h ]h"]h$]h&]uh1j hjS"ubeh}(h]h ]h"]h$]h&]uh1j hhhM0hjP"ubah}(h]h ]h"]h$]h&]uh1jhj5"ubeh}(h]h ]h"]h$]h&]uh1jhj ubeh}(h]h ]h"]h$]h&]jA jB uh1j hhhMhjz ubj)}(hThe decoder may adjust the compose rectangle to the nearest supported one to meet codec and hardware requirements. The client needs to check the adjusted rectangle returned by :c:func:`VIDIOC_S_SELECTION`.h]h)}(hThe decoder may adjust the compose rectangle to the nearest supported one to meet codec and hardware requirements. The client needs to check the adjusted rectangle returned by :c:func:`VIDIOC_S_SELECTION`.h](hThe decoder may adjust the compose rectangle to the nearest supported one to meet codec and hardware requirements. The client needs to check the adjusted rectangle returned by }(hj #hhhNhNubh)}(h:c:func:`VIDIOC_S_SELECTION`h]j)}(hj#h]hVIDIOC_S_SELECTION()}(hj#hhhNhNubah}(h]h ](jjc-funceh"]h$]h&]uh1jhj#ubah}(h]h ]h"]h$]h&]refdocj refdomainjreftypefunc refexplicitrefwarnjjjVIDIOC_S_SELECTIONuh1hhhhM4hj #ubh.}(hj #hhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhM4hj #ubah}(h]h ]h"]h$]h&]uh1jhjz ubeh}(h]h ]h"]h$]h&]uh1jhjw hhhNhNubj )}(hXIf all the following conditions are met, the client may resume the decoding instantly: * ``sizeimage`` of the new format (determined in previous steps) is less than or equal to the size of currently allocated buffers, * the number of buffers currently allocated is greater than or equal to the minimum number of buffers acquired in previous steps. To fulfill this requirement, the client may use :c:func:`VIDIOC_CREATE_BUFS` to add new buffers. In that case, the remaining steps do not apply and the client may resume the decoding by one of the following actions: * if the ``CAPTURE`` queue is streaming, call :c:func:`VIDIOC_DECODER_CMD` with the ``V4L2_DEC_CMD_START`` command, * if the ``CAPTURE`` queue is not streaming, call :c:func:`VIDIOC_STREAMON` on the ``CAPTURE`` queue. However, if the client intends to change the buffer set, to lower memory usage or for any other reasons, it may be achieved by following the steps below. h](h)}(hVIf all the following conditions are met, the client may resume the decoding instantly:h]hVIf all the following conditions are met, the client may resume the decoding instantly:}(hjN#hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhM8hjJ#ubj )}(hhh](j )}(h``sizeimage`` of the new format (determined in previous steps) is less than or equal to the size of currently allocated buffers, h]h)}(h``sizeimage`` of the new format (determined in previous steps) is less than or equal to the size of currently allocated buffers,h](j)}(h ``sizeimage``h]h sizeimage}(hjg#hhhNhNubah}(h]h ]h"]h$]h&]uh1jhjc#ubhs of the new format (determined in previous steps) is less than or equal to the size of currently allocated buffers,}(hjc#hhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhM;hj_#ubah}(h]h ]h"]h$]h&]uh1jhj\#ubj )}(hthe number of buffers currently allocated is greater than or equal to the minimum number of buffers acquired in previous steps. To fulfill this requirement, the client may use :c:func:`VIDIOC_CREATE_BUFS` to add new buffers. h]h)}(hthe number of buffers currently allocated is greater than or equal to the minimum number of buffers acquired in previous steps. To fulfill this requirement, the client may use :c:func:`VIDIOC_CREATE_BUFS` to add new buffers.h](hthe number of buffers currently allocated is greater than or equal to the minimum number of buffers acquired in previous steps. To fulfill this requirement, the client may use }(hj#hhhNhNubh)}(h:c:func:`VIDIOC_CREATE_BUFS`h]j)}(hj#h]hVIDIOC_CREATE_BUFS()}(hj#hhhNhNubah}(h]h ](jjc-funceh"]h$]h&]uh1jhj#ubah}(h]h ]h"]h$]h&]refdocj refdomainjreftypefunc refexplicitrefwarnjjjVIDIOC_CREATE_BUFSuh1hhhhM>hj#ubh to add new buffers.}(hj#hhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhM>hj#ubah}(h]h ]h"]h$]h&]uh1jhj\#ubeh}(h]h ]h"]h$]h&]jA jB uh1j hhhM;hjJ#ubh)}(hvIn that case, the remaining steps do not apply and the client may resume the decoding by one of the following actions:h]hvIn that case, the remaining steps do not apply and the client may resume the decoding by one of the following actions:}(hj#hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMChjJ#ubj )}(hhh](j )}(hrif the ``CAPTURE`` queue is streaming, call :c:func:`VIDIOC_DECODER_CMD` with the ``V4L2_DEC_CMD_START`` command, h]h)}(hqif the ``CAPTURE`` queue is streaming, call :c:func:`VIDIOC_DECODER_CMD` with the ``V4L2_DEC_CMD_START`` command,h](hif the }(hj#hhhNhNubj)}(h ``CAPTURE``h]hCAPTURE}(hj#hhhNhNubah}(h]h ]h"]h$]h&]uh1jhj#ubh queue is streaming, call }(hj#hhhNhNubh)}(h:c:func:`VIDIOC_DECODER_CMD`h]j)}(hj#h]hVIDIOC_DECODER_CMD()}(hj#hhhNhNubah}(h]h ](jjc-funceh"]h$]h&]uh1jhj#ubah}(h]h ]h"]h$]h&]refdocj refdomainjreftypefunc refexplicitrefwarnjjjVIDIOC_DECODER_CMDuh1hhhhMFhj#ubh with the }(hj#hhhNhNubj)}(h``V4L2_DEC_CMD_START``h]hV4L2_DEC_CMD_START}(hj$hhhNhNubah}(h]h ]h"]h$]h&]uh1jhj#ubh command,}(hj#hhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhMFhj#ubah}(h]h ]h"]h$]h&]uh1jhj#ubj )}(hdif the ``CAPTURE`` queue is not streaming, call :c:func:`VIDIOC_STREAMON` on the ``CAPTURE`` queue. h]h)}(hcif the ``CAPTURE`` queue is not streaming, call :c:func:`VIDIOC_STREAMON` on the ``CAPTURE`` queue.h](hif the }(hj:$hhhNhNubj)}(h ``CAPTURE``h]hCAPTURE}(hjB$hhhNhNubah}(h]h ]h"]h$]h&]uh1jhj:$ubh queue is not streaming, call }(hj:$hhhNhNubh)}(h:c:func:`VIDIOC_STREAMON`h]j)}(hjV$h]hVIDIOC_STREAMON()}(hjX$hhhNhNubah}(h]h ](jjc-funceh"]h$]h&]uh1jhjT$ubah}(h]h ]h"]h$]h&]refdocj refdomainjreftypefunc refexplicitrefwarnjjjVIDIOC_STREAMONuh1hhhhMIhj:$ubh on the }(hj:$hhhNhNubj)}(h ``CAPTURE``h]hCAPTURE}(hjw$hhhNhNubah}(h]h ]h"]h$]h&]uh1jhj:$ubh queue.}(hj:$hhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhMIhj6$ubah}(h]h ]h"]h$]h&]uh1jhj#ubeh}(h]h ]h"]h$]h&]jA jB uh1j hhhMFhjJ#ubh)}(hHowever, if the client intends to change the buffer set, to lower memory usage or for any other reasons, it may be achieved by following the steps below.h]hHowever, if the client intends to change the buffer set, to lower memory usage or for any other reasons, it may be achieved by following the steps below.}(hj$hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMLhjJ#ubeh}(h]h ]h"]h$]h&]uh1jhjw hhhhhNubj )}(h**If the** ``CAPTURE`` **queue is streaming,** keep queuing and dequeuing buffers on the ``CAPTURE`` queue until a buffer marked with the ``V4L2_BUF_FLAG_LAST`` flag is dequeued. h]h)}(h**If the** ``CAPTURE`` **queue is streaming,** keep queuing and dequeuing buffers on the ``CAPTURE`` queue until a buffer marked with the ``V4L2_BUF_FLAG_LAST`` flag is dequeued.h](j )}(h **If the**h]hIf the}(hj$hhhNhNubah}(h]h ]h"]h$]h&]uh1j hj$ubh }(hj$hhhNhNubj)}(h ``CAPTURE``h]hCAPTURE}(hj$hhhNhNubah}(h]h ]h"]h$]h&]uh1jhj$ubh }hj$sbj )}(h**queue is streaming,**h]hqueue is streaming,}(hj$hhhNhNubah}(h]h ]h"]h$]h&]uh1j hj$ubh+ keep queuing and dequeuing buffers on the }(hj$hhhNhNubj)}(h ``CAPTURE``h]hCAPTURE}(hj$hhhNhNubah}(h]h ]h"]h$]h&]uh1jhj$ubh& queue until a buffer marked with the }(hj$hhhNhNubj)}(h``V4L2_BUF_FLAG_LAST``h]hV4L2_BUF_FLAG_LAST}(hj$hhhNhNubah}(h]h ]h"]h$]h&]uh1jhj$ubh flag is dequeued.}(hj$hhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhMPhj$ubah}(h]h ]h"]h$]h&]uh1jhjw hhhhhNubj )}(hX**If the** ``CAPTURE`` **queue is streaming,** call :c:func:`VIDIOC_STREAMOFF` on the ``CAPTURE`` queue to stop streaming. .. warning:: The ``OUTPUT`` queue must remain streaming. Calling :c:func:`VIDIOC_STREAMOFF` on it would abort the sequence and trigger a seek. h](h)}(hz**If the** ``CAPTURE`` **queue is streaming,** call :c:func:`VIDIOC_STREAMOFF` on the ``CAPTURE`` queue to stop streaming.h](j )}(h **If the**h]hIf the}(hj%%hhhNhNubah}(h]h ]h"]h$]h&]uh1j hj!%ubh }(hj!%hhhNhNubj)}(h ``CAPTURE``h]hCAPTURE}(hj7%hhhNhNubah}(h]h ]h"]h$]h&]uh1jhj!%ubh }hj!%sbj )}(h**queue is streaming,**h]hqueue is streaming,}(hjI%hhhNhNubah}(h]h ]h"]h$]h&]uh1j hj!%ubh call }(hj!%hhhNhNubh)}(h:c:func:`VIDIOC_STREAMOFF`h]j)}(hj]%h]hVIDIOC_STREAMOFF()}(hj_%hhhNhNubah}(h]h ](jjc-funceh"]h$]h&]uh1jhj[%ubah}(h]h ]h"]h$]h&]refdocj refdomainjreftypefunc refexplicitrefwarnjjjVIDIOC_STREAMOFFuh1hhhhMThj!%ubh on the }(hj!%hhhNhNubj)}(h ``CAPTURE``h]hCAPTURE}(hj~%hhhNhNubah}(h]h ]h"]h$]h&]uh1jhj!%ubh queue to stop streaming.}(hj!%hhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhMThj%ubj)}(hThe ``OUTPUT`` queue must remain streaming. Calling :c:func:`VIDIOC_STREAMOFF` on it would abort the sequence and trigger a seek.h]h)}(hThe ``OUTPUT`` queue must remain streaming. Calling :c:func:`VIDIOC_STREAMOFF` on it would abort the sequence and trigger a seek.h](hThe }(hj%hhhNhNubj)}(h ``OUTPUT``h]hOUTPUT}(hj%hhhNhNubah}(h]h ]h"]h$]h&]uh1jhj%ubh& queue must remain streaming. Calling }(hj%hhhNhNubh)}(h:c:func:`VIDIOC_STREAMOFF`h]j)}(hj%h]hVIDIOC_STREAMOFF()}(hj%hhhNhNubah}(h]h ](jjc-funceh"]h$]h&]uh1jhj%ubah}(h]h ]h"]h$]h&]refdocj refdomainjreftypefunc refexplicitrefwarnjjjVIDIOC_STREAMOFFuh1hhhhMYhj%ubh3 on it would abort the sequence and trigger a seek.}(hj%hhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhMYhj%ubah}(h]h ]h"]h$]h&]uh1jhj%ubeh}(h]h ]h"]h$]h&]uh1jhjw hhhNhNubj )}(hX$**If the** ``CAPTURE`` **queue has buffers allocated,** free the ``CAPTURE`` buffers using :c:func:`VIDIOC_REQBUFS`. * **Required fields:** ``count`` set to 0. ``type`` a ``V4L2_BUF_TYPE_*`` enum appropriate for ``CAPTURE``. ``memory`` follows standard semantics. h](h)}(ht**If the** ``CAPTURE`` **queue has buffers allocated,** free the ``CAPTURE`` buffers using :c:func:`VIDIOC_REQBUFS`.h](j )}(h **If the**h]hIf the}(hj%hhhNhNubah}(h]h ]h"]h$]h&]uh1j hj%ubh }(hj%hhhNhNubj)}(h ``CAPTURE``h]hCAPTURE}(hj&hhhNhNubah}(h]h ]h"]h$]h&]uh1jhj%ubh }hj%sbj )}(h **queue has buffers allocated,**h]hqueue has buffers allocated,}(hj&hhhNhNubah}(h]h ]h"]h$]h&]uh1j hj%ubh free the }(hj%hhhNhNubj)}(h ``CAPTURE``h]hCAPTURE}(hj'&hhhNhNubah}(h]h ]h"]h$]h&]uh1jhj%ubh buffers using }(hj%hhhNhNubh)}(h:c:func:`VIDIOC_REQBUFS`h]j)}(hj;&h]hVIDIOC_REQBUFS()}(hj=&hhhNhNubah}(h]h ](jjc-funceh"]h$]h&]uh1jhj9&ubah}(h]h ]h"]h$]h&]refdocj refdomainjreftypefunc refexplicitrefwarnjjjVIDIOC_REQBUFSuh1hhhhM]hj%ubh.}(hj%hhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhM]hj%ubj )}(hhh]j )}(h**Required fields:** ``count`` set to 0. ``type`` a ``V4L2_BUF_TYPE_*`` enum appropriate for ``CAPTURE``. ``memory`` follows standard semantics. h](h)}(h**Required fields:**h]j )}(hjk&h]hRequired fields:}(hjm&hhhNhNubah}(h]h ]h"]h$]h&]uh1j hji&ubah}(h]h ]h"]h$]h&]uh1hhhhM`hje&ubj)}(hhh](j )}(h``count`` set to 0. h](j)}(h ``count``h]j)}(hj&h]hcount}(hj&hhhNhNubah}(h]h ]h"]h$]h&]uh1jhj&ubah}(h]h ]h"]h$]h&]uh1jhhhMchj&ubj!)}(hhh]h)}(h set to 0.h]h set to 0.}(hj&hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMchj&ubah}(h]h ]h"]h$]h&]uh1j hj&ubeh}(h]h ]h"]h$]h&]uh1j hhhMchj&ubj )}(hA``type`` a ``V4L2_BUF_TYPE_*`` enum appropriate for ``CAPTURE``. h](j)}(h``type``h]j)}(hj&h]htype}(hj&hhhNhNubah}(h]h ]h"]h$]h&]uh1jhj&ubah}(h]h ]h"]h$]h&]uh1jhhhMfhj&ubj!)}(hhh]h)}(h7a ``V4L2_BUF_TYPE_*`` enum appropriate for ``CAPTURE``.h](ha }(hj&hhhNhNubj)}(h``V4L2_BUF_TYPE_*``h]hV4L2_BUF_TYPE_*}(hj&hhhNhNubah}(h]h ]h"]h$]h&]uh1jhj&ubh enum appropriate for }(hj&hhhNhNubj)}(h ``CAPTURE``h]hCAPTURE}(hj&hhhNhNubah}(h]h ]h"]h$]h&]uh1jhj&ubh.}(hj&hhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhMfhj&ubah}(h]h ]h"]h$]h&]uh1j hj&ubeh}(h]h ]h"]h$]h&]uh1j hhhMfhj&ubj )}(h'``memory`` follows standard semantics. h](j)}(h ``memory``h]j)}(hj'h]hmemory}(hj'hhhNhNubah}(h]h ]h"]h$]h&]uh1jhj'ubah}(h]h ]h"]h$]h&]uh1jhhhMihj'ubj!)}(hhh]h)}(hfollows standard semantics.h]hfollows standard semantics.}(hj5'hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMihj2'ubah}(h]h ]h"]h$]h&]uh1j hj'ubeh}(h]h ]h"]h$]h&]uh1j hhhMihj&ubeh}(h]h ]h"]h$]h&]uh1jhje&ubeh}(h]h ]h"]h$]h&]uh1jhjb&ubah}(h]h ]h"]h$]h&]jA jB uh1j hhhM`hj%ubeh}(h]h ]h"]h$]h&]uh1jhjw hhhNhNubj )}(hX' Allocate ``CAPTURE`` buffers via :c:func:`VIDIOC_REQBUFS` on the ``CAPTURE`` queue. * **Required fields:** ``count`` requested number of buffers to allocate; greater than zero. ``type`` a ``V4L2_BUF_TYPE_*`` enum appropriate for ``CAPTURE``. ``memory`` follows standard semantics. * **Returned fields:** ``count`` actual number of buffers allocated. .. warning:: The actual number of allocated buffers may differ from the ``count`` given. The client must check the updated value of ``count`` after the call returns. .. note:: To allocate more than the minimum number of buffers (for pipeline depth), the client may query the ``V4L2_CID_MIN_BUFFERS_FOR_CAPTURE`` control to get the minimum number of buffers required, and pass the obtained value plus the number of additional buffers needed in the ``count`` field to :c:func:`VIDIOC_REQBUFS`. Alternatively, :c:func:`VIDIOC_CREATE_BUFS` on the ``CAPTURE`` queue can be used to have more control over buffer allocation. For example, by allocating buffers larger than the current ``CAPTURE`` format, future resolution changes can be accommodated. * **Required fields:** ``count`` requested number of buffers to allocate; greater than zero. ``type`` a ``V4L2_BUF_TYPE_*`` enum appropriate for ``CAPTURE``. ``memory`` follows standard semantics. ``format`` a format representing the maximum framebuffer resolution to be accommodated by newly allocated buffers. * **Returned fields:** ``count`` adjusted to the number of allocated buffers. .. warning:: The actual number of allocated buffers may differ from the ``count`` given. The client must check the updated value of ``count`` after the call returns. .. note:: To allocate buffers for a format different than parsed from the stream metadata, the client must proceed as follows, before the metadata parsing is initiated: * set width and height of the ``OUTPUT`` format to desired coded resolution to let the decoder configure the ``CAPTURE`` format appropriately, * query the ``CAPTURE`` format using :c:func:`VIDIOC_G_FMT` and save it until this step. The format obtained in the query may be then used with :c:func:`VIDIOC_CREATE_BUFS` in this step to allocate the buffers. h](h)}(hSAllocate ``CAPTURE`` buffers via :c:func:`VIDIOC_REQBUFS` on the ``CAPTURE`` queue.h](h Allocate }(hjk'hhhNhNubj)}(h ``CAPTURE``h]hCAPTURE}(hjs'hhhNhNubah}(h]h ]h"]h$]h&]uh1jhjk'ubh buffers via }(hjk'hhhNhNubh)}(h:c:func:`VIDIOC_REQBUFS`h]j)}(hj'h]hVIDIOC_REQBUFS()}(hj'hhhNhNubah}(h]h ](jjc-funceh"]h$]h&]uh1jhj'ubah}(h]h ]h"]h$]h&]refdocj refdomainjreftypefunc refexplicitrefwarnjjjVIDIOC_REQBUFSuh1hhhhMkhjk'ubh on the }(hjk'hhhNhNubj)}(h ``CAPTURE``h]hCAPTURE}(hj'hhhNhNubah}(h]h ]h"]h$]h&]uh1jhjk'ubh queue.}(hjk'hhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhMkhjg'ubj )}(hhh](j )}(h**Required fields:** ``count`` requested number of buffers to allocate; greater than zero. ``type`` a ``V4L2_BUF_TYPE_*`` enum appropriate for ``CAPTURE``. ``memory`` follows standard semantics. h](h)}(h**Required fields:**h]j )}(hj'h]hRequired fields:}(hj'hhhNhNubah}(h]h ]h"]h$]h&]uh1j hj'ubah}(h]h ]h"]h$]h&]uh1hhhhMnhj'ubj)}(hhh](j )}(hF``count`` requested number of buffers to allocate; greater than zero. h](j)}(h ``count``h]j)}(hj'h]hcount}(hj'hhhNhNubah}(h]h ]h"]h$]h&]uh1jhj'ubah}(h]h ]h"]h$]h&]uh1jhhhMqhj'ubj!)}(hhh]h)}(h;requested number of buffers to allocate; greater than zero.h]h;requested number of buffers to allocate; greater than zero.}(hj'hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMqhj'ubah}(h]h ]h"]h$]h&]uh1j hj'ubeh}(h]h ]h"]h$]h&]uh1j hhhMqhj'ubj )}(hA``type`` a ``V4L2_BUF_TYPE_*`` enum appropriate for ``CAPTURE``. h](j)}(h``type``h]j)}(hj(h]htype}(hj!(hhhNhNubah}(h]h ]h"]h$]h&]uh1jhj(ubah}(h]h ]h"]h$]h&]uh1jhhhMthj(ubj!)}(hhh]h)}(h7a ``V4L2_BUF_TYPE_*`` enum appropriate for ``CAPTURE``.h](ha }(hj7(hhhNhNubj)}(h``V4L2_BUF_TYPE_*``h]hV4L2_BUF_TYPE_*}(hj?(hhhNhNubah}(h]h ]h"]h$]h&]uh1jhj7(ubh enum appropriate for }(hj7(hhhNhNubj)}(h ``CAPTURE``h]hCAPTURE}(hjQ(hhhNhNubah}(h]h ]h"]h$]h&]uh1jhj7(ubh.}(hj7(hhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhMthj4(ubah}(h]h ]h"]h$]h&]uh1j hj(ubeh}(h]h ]h"]h$]h&]uh1j hhhMthj'ubj )}(h'``memory`` follows standard semantics. h](j)}(h ``memory``h]j)}(hj{(h]hmemory}(hj}(hhhNhNubah}(h]h ]h"]h$]h&]uh1jhjy(ubah}(h]h ]h"]h$]h&]uh1jhhhMwhju(ubj!)}(hhh]h)}(hfollows standard semantics.h]hfollows standard semantics.}(hj(hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMwhj(ubah}(h]h ]h"]h$]h&]uh1j hju(ubeh}(h]h ]h"]h$]h&]uh1j hhhMwhj'ubeh}(h]h ]h"]h$]h&]uh1jhj'ubeh}(h]h ]h"]h$]h&]uh1jhj'ubj )}(hH**Returned fields:** ``count`` actual number of buffers allocated. h](h)}(h**Returned fields:**h]j )}(hj(h]hReturned fields:}(hj(hhhNhNubah}(h]h ]h"]h$]h&]uh1j hj(ubah}(h]h ]h"]h$]h&]uh1hhhhMyhj(ubj)}(hhh]j )}(h.``count`` actual number of buffers allocated. h](j)}(h ``count``h]j)}(hj(h]hcount}(hj(hhhNhNubah}(h]h ]h"]h$]h&]uh1jhj(ubah}(h]h ]h"]h$]h&]uh1jhhhM|hj(ubj!)}(hhh]h)}(h#actual number of buffers allocated.h]h#actual number of buffers allocated.}(hj(hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhM|hj(ubah}(h]h ]h"]h$]h&]uh1j hj(ubeh}(h]h ]h"]h$]h&]uh1j hhhM|hj(ubah}(h]h ]h"]h$]h&]uh1jhj(ubeh}(h]h ]h"]h$]h&]uh1jhj'ubeh}(h]h ]h"]h$]h&]jA jB uh1j hhhMnhjg'ubj)}(hThe actual number of allocated buffers may differ from the ``count`` given. The client must check the updated value of ``count`` after the call returns.h]h)}(hThe actual number of allocated buffers may differ from the ``count`` given. The client must check the updated value of ``count`` after the call returns.h](h;The actual number of allocated buffers may differ from the }(hj%)hhhNhNubj)}(h ``count``h]hcount}(hj-)hhhNhNubah}(h]h ]h"]h$]h&]uh1jhj%)ubh3 given. The client must check the updated value of }(hj%)hhhNhNubj)}(h ``count``h]hcount}(hj?)hhhNhNubah}(h]h ]h"]h$]h&]uh1jhj%)ubh after the call returns.}(hj%)hhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhMhj!)ubah}(h]h ]h"]h$]h&]uh1jhjg'ubj)}(hX;To allocate more than the minimum number of buffers (for pipeline depth), the client may query the ``V4L2_CID_MIN_BUFFERS_FOR_CAPTURE`` control to get the minimum number of buffers required, and pass the obtained value plus the number of additional buffers needed in the ``count`` field to :c:func:`VIDIOC_REQBUFS`.h]h)}(hX;To allocate more than the minimum number of buffers (for pipeline depth), the client may query the ``V4L2_CID_MIN_BUFFERS_FOR_CAPTURE`` control to get the minimum number of buffers required, and pass the obtained value plus the number of additional buffers needed in the ``count`` field to :c:func:`VIDIOC_REQBUFS`.h](hcTo allocate more than the minimum number of buffers (for pipeline depth), the client may query the }(hja)hhhNhNubj)}(h$``V4L2_CID_MIN_BUFFERS_FOR_CAPTURE``h]h V4L2_CID_MIN_BUFFERS_FOR_CAPTURE}(hji)hhhNhNubah}(h]h ]h"]h$]h&]uh1jhja)ubh control to get the minimum number of buffers required, and pass the obtained value plus the number of additional buffers needed in the }(hja)hhhNhNubj)}(h ``count``h]hcount}(hj{)hhhNhNubah}(h]h ]h"]h$]h&]uh1jhja)ubh field to }(hja)hhhNhNubh)}(h:c:func:`VIDIOC_REQBUFS`h]j)}(hj)h]hVIDIOC_REQBUFS()}(hj)hhhNhNubah}(h]h ](jjc-funceh"]h$]h&]uh1jhj)ubah}(h]h ]h"]h$]h&]refdocj refdomainjreftypefunc refexplicitrefwarnjjjVIDIOC_REQBUFSuh1hhhhMhja)ubh.}(hja)hhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhMhj])ubah}(h]h ]h"]h$]h&]uh1jhjg'ubh)}(hAlternatively, :c:func:`VIDIOC_CREATE_BUFS` on the ``CAPTURE`` queue can be used to have more control over buffer allocation. For example, by allocating buffers larger than the current ``CAPTURE`` format, future resolution changes can be accommodated.h](hAlternatively, }(hj)hhhNhNubh)}(h:c:func:`VIDIOC_CREATE_BUFS`h]j)}(hj)h]hVIDIOC_CREATE_BUFS()}(hj)hhhNhNubah}(h]h ](jjc-funceh"]h$]h&]uh1jhj)ubah}(h]h ]h"]h$]h&]refdocj refdomainjreftypefunc refexplicitrefwarnjjjVIDIOC_CREATE_BUFSuh1hhhhMhj)ubh on the }(hj)hhhNhNubj)}(h ``CAPTURE``h]hCAPTURE}(hj)hhhNhNubah}(h]h ]h"]h$]h&]uh1jhj)ubh{ queue can be used to have more control over buffer allocation. For example, by allocating buffers larger than the current }(hj)hhhNhNubj)}(h ``CAPTURE``h]hCAPTURE}(hj)hhhNhNubah}(h]h ]h"]h$]h&]uh1jhj)ubh7 format, future resolution changes can be accommodated.}(hj)hhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhMhjg'ubj )}(hhh](j )}(hXN**Required fields:** ``count`` requested number of buffers to allocate; greater than zero. ``type`` a ``V4L2_BUF_TYPE_*`` enum appropriate for ``CAPTURE``. ``memory`` follows standard semantics. ``format`` a format representing the maximum framebuffer resolution to be accommodated by newly allocated buffers. h](h)}(h**Required fields:**h]j )}(hj*h]hRequired fields:}(hj*hhhNhNubah}(h]h ]h"]h$]h&]uh1j hj*ubah}(h]h ]h"]h$]h&]uh1hhhhMhj*ubj)}(hhh](j )}(hF``count`` requested number of buffers to allocate; greater than zero. h](j)}(h ``count``h]j)}(hj8*h]hcount}(hj:*hhhNhNubah}(h]h ]h"]h$]h&]uh1jhj6*ubah}(h]h ]h"]h$]h&]uh1jhhhMhj2*ubj!)}(hhh]h)}(h;requested number of buffers to allocate; greater than zero.h]h;requested number of buffers to allocate; greater than zero.}(hjP*hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhjM*ubah}(h]h ]h"]h$]h&]uh1j hj2*ubeh}(h]h ]h"]h$]h&]uh1j hhhMhj/*ubj )}(hA``type`` a ``V4L2_BUF_TYPE_*`` enum appropriate for ``CAPTURE``. h](j)}(h``type``h]j)}(hjp*h]htype}(hjr*hhhNhNubah}(h]h ]h"]h$]h&]uh1jhjn*ubah}(h]h ]h"]h$]h&]uh1jhhhMhjj*ubj!)}(hhh]h)}(h7a ``V4L2_BUF_TYPE_*`` enum appropriate for ``CAPTURE``.h](ha }(hj*hhhNhNubj)}(h``V4L2_BUF_TYPE_*``h]hV4L2_BUF_TYPE_*}(hj*hhhNhNubah}(h]h ]h"]h$]h&]uh1jhj*ubh enum appropriate for }(hj*hhhNhNubj)}(h ``CAPTURE``h]hCAPTURE}(hj*hhhNhNubah}(h]h ]h"]h$]h&]uh1jhj*ubh.}(hj*hhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhMhj*ubah}(h]h ]h"]h$]h&]uh1j hjj*ubeh}(h]h ]h"]h$]h&]uh1j hhhMhj/*ubj )}(h'``memory`` follows standard semantics. h](j)}(h ``memory``h]j)}(hj*h]hmemory}(hj*hhhNhNubah}(h]h ]h"]h$]h&]uh1jhj*ubah}(h]h ]h"]h$]h&]uh1jhhhMhj*ubj!)}(hhh]h)}(hfollows standard semantics.h]hfollows standard semantics.}(hj*hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhj*ubah}(h]h ]h"]h$]h&]uh1j hj*ubeh}(h]h ]h"]h$]h&]uh1j hhhMhj/*ubj )}(hs``format`` a format representing the maximum framebuffer resolution to be accommodated by newly allocated buffers. h](j)}(h ``format``h]j)}(hj+h]hformat}(hj+hhhNhNubah}(h]h ]h"]h$]h&]uh1jhj+ubah}(h]h ]h"]h$]h&]uh1jhhhMhj*ubj!)}(hhh]h)}(hga format representing the maximum framebuffer resolution to be accommodated by newly allocated buffers.h]hga format representing the maximum framebuffer resolution to be accommodated by newly allocated buffers.}(hj+hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhj+ubah}(h]h ]h"]h$]h&]uh1j hj*ubeh}(h]h ]h"]h$]h&]uh1j hhhMhj/*ubeh}(h]h ]h"]h$]h&]uh1jhj*ubeh}(h]h ]h"]h$]h&]uh1jhj*ubj )}(hQ**Returned fields:** ``count`` adjusted to the number of allocated buffers. h](h)}(h**Returned fields:**h]j )}(hjH+h]hReturned fields:}(hjJ+hhhNhNubah}(h]h ]h"]h$]h&]uh1j hjF+ubah}(h]h ]h"]h$]h&]uh1hhhhMhjB+ubj)}(hhh]j )}(h7``count`` adjusted to the number of allocated buffers. h](j)}(h ``count``h]j)}(hjf+h]hcount}(hjh+hhhNhNubah}(h]h ]h"]h$]h&]uh1jhjd+ubah}(h]h ]h"]h$]h&]uh1jhhhMhj`+ubj!)}(hhh]h)}(h,adjusted to the number of allocated buffers.h]h,adjusted to the number of allocated buffers.}(hj~+hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhj{+ubah}(h]h ]h"]h$]h&]uh1j hj`+ubeh}(h]h ]h"]h$]h&]uh1j hhhMhj]+ubah}(h]h ]h"]h$]h&]uh1jhjB+ubeh}(h]h ]h"]h$]h&]uh1jhj*ubeh}(h]h ]h"]h$]h&]jA jB uh1j hhhMhjg'ubj)}(hThe actual number of allocated buffers may differ from the ``count`` given. The client must check the updated value of ``count`` after the call returns.h]h)}(hThe actual number of allocated buffers may differ from the ``count`` given. The client must check the updated value of ``count`` after the call returns.h](h;The actual number of allocated buffers may differ from the }(hj+hhhNhNubj)}(h ``count``h]hcount}(hj+hhhNhNubah}(h]h ]h"]h$]h&]uh1jhj+ubh3 given. The client must check the updated value of }(hj+hhhNhNubj)}(h ``count``h]hcount}(hj+hhhNhNubah}(h]h ]h"]h$]h&]uh1jhj+ubh after the call returns.}(hj+hhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhMhj+ubah}(h]h ]h"]h$]h&]uh1jhjg'ubj)}(hXTo allocate buffers for a format different than parsed from the stream metadata, the client must proceed as follows, before the metadata parsing is initiated: * set width and height of the ``OUTPUT`` format to desired coded resolution to let the decoder configure the ``CAPTURE`` format appropriately, * query the ``CAPTURE`` format using :c:func:`VIDIOC_G_FMT` and save it until this step. The format obtained in the query may be then used with :c:func:`VIDIOC_CREATE_BUFS` in this step to allocate the buffers.h](h)}(hTo allocate buffers for a format different than parsed from the stream metadata, the client must proceed as follows, before the metadata parsing is initiated:h]hTo allocate buffers for a format different than parsed from the stream metadata, the client must proceed as follows, before the metadata parsing is initiated:}(hj+hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhj+ubj )}(hhh](j )}(hset width and height of the ``OUTPUT`` format to desired coded resolution to let the decoder configure the ``CAPTURE`` format appropriately, h]h)}(hset width and height of the ``OUTPUT`` format to desired coded resolution to let the decoder configure the ``CAPTURE`` format appropriately,h](hset width and height of the }(hj+hhhNhNubj)}(h ``OUTPUT``h]hOUTPUT}(hj,hhhNhNubah}(h]h ]h"]h$]h&]uh1jhj+ubhE format to desired coded resolution to let the decoder configure the }(hj+hhhNhNubj)}(h ``CAPTURE``h]hCAPTURE}(hj,hhhNhNubah}(h]h ]h"]h$]h&]uh1jhj+ubh format appropriately,}(hj+hhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhMhj+ubah}(h]h ]h"]h$]h&]uh1jhj+ubj )}(hWquery the ``CAPTURE`` format using :c:func:`VIDIOC_G_FMT` and save it until this step. h]h)}(hVquery the ``CAPTURE`` format using :c:func:`VIDIOC_G_FMT` and save it until this step.h](h query the }(hj;,hhhNhNubj)}(h ``CAPTURE``h]hCAPTURE}(hjC,hhhNhNubah}(h]h ]h"]h$]h&]uh1jhj;,ubh format using }(hj;,hhhNhNubh)}(h:c:func:`VIDIOC_G_FMT`h]j)}(hjW,h]hVIDIOC_G_FMT()}(hjY,hhhNhNubah}(h]h ](jjc-funceh"]h$]h&]uh1jhjU,ubah}(h]h ]h"]h$]h&]refdocj refdomainjreftypefunc refexplicitrefwarnjjj VIDIOC_G_FMTuh1hhhhMhj;,ubh and save it until this step.}(hj;,hhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhMhj7,ubah}(h]h ]h"]h$]h&]uh1jhj+ubeh}(h]h ]h"]h$]h&]jA jB uh1j hhhMhj+ubh)}(hyThe format obtained in the query may be then used with :c:func:`VIDIOC_CREATE_BUFS` in this step to allocate the buffers.h](h7The format obtained in the query may be then used with }(hj,hhhNhNubh)}(h:c:func:`VIDIOC_CREATE_BUFS`h]j)}(hj,h]hVIDIOC_CREATE_BUFS()}(hj,hhhNhNubah}(h]h ](jjc-funceh"]h$]h&]uh1jhj,ubah}(h]h ]h"]h$]h&]refdocj refdomainjreftypefunc refexplicitrefwarnjjjVIDIOC_CREATE_BUFSuh1hhhhMhj,ubh& in this step to allocate the buffers.}(hj,hhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhMhj+ubeh}(h]h ]h"]h$]h&]uh1jhjg'ubeh}(h]h ]h"]h$]h&]uh1jhjw hhhNhNubj )}(hRCall :c:func:`VIDIOC_STREAMON` on the ``CAPTURE`` queue to start decoding frames. h]h)}(hQCall :c:func:`VIDIOC_STREAMON` on the ``CAPTURE`` queue to start decoding frames.h](hCall }(hj,hhhNhNubh)}(h:c:func:`VIDIOC_STREAMON`h]j)}(hj,h]hVIDIOC_STREAMON()}(hj,hhhNhNubah}(h]h ](jjc-funceh"]h$]h&]uh1jhj,ubah}(h]h ]h"]h$]h&]refdocj refdomainjreftypefunc refexplicitrefwarnjjjVIDIOC_STREAMONuh1hhhhMhj,ubh on the }(hj,hhhNhNubj)}(h ``CAPTURE``h]hCAPTURE}(hj,hhhNhNubah}(h]h ]h"]h$]h&]uh1jhj,ubh queue to start decoding frames.}(hj,hhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhMhj,ubah}(h]h ]h"]h$]h&]uh1jhjw hhhhhNubeh}(h]h ]h"]h$]h&]jjjhjjstartKuh1jhjghhhhhMubeh}(h] capture-setupah ]h"] capture setupah$]h&]uh1hhhhhhhhMubh)}(hhh](h)}(hDecodingh]hDecoding}(hj&-hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj#-hhhhhMubh)}(hThis state is reached after the `Capture Setup` sequence finishes successfully. In this state, the client queues and dequeues buffers to both queues via :c:func:`VIDIOC_QBUF` and :c:func:`VIDIOC_DQBUF`, following the standard semantics.h](h This state is reached after the }(hj4-hhhNhNubj)}(h`Capture Setup`h]h Capture Setup}(hj<-hhhNhNubah}(h]h ]h"]h$]h&]uh1jhj4-ubhj sequence finishes successfully. In this state, the client queues and dequeues buffers to both queues via }(hj4-hhhNhNubh)}(h:c:func:`VIDIOC_QBUF`h]j)}(hjP-h]h VIDIOC_QBUF()}(hjR-hhhNhNubah}(h]h ](jjc-funceh"]h$]h&]uh1jhjN-ubah}(h]h ]h"]h$]h&]refdocj refdomainjreftypefunc refexplicitrefwarnjjj VIDIOC_QBUFuh1hhhhMhj4-ubh and }(hj4-hhhNhNubh)}(h:c:func:`VIDIOC_DQBUF`h]j)}(hjs-h]hVIDIOC_DQBUF()}(hju-hhhNhNubah}(h]h ](jjc-funceh"]h$]h&]uh1jhjq-ubah}(h]h ]h"]h$]h&]refdocj refdomainjreftypefunc refexplicitrefwarnjjj VIDIOC_DQBUFuh1hhhhMhj4-ubh#, following the standard semantics.}(hj4-hhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhMhj#-hhubh)}(hThe content of the source ``OUTPUT`` buffers depends on the active coded pixel format and may be affected by codec-specific extended controls, as stated in the documentation of each format.h](hThe content of the source }(hj-hhhNhNubj)}(h ``OUTPUT``h]hOUTPUT}(hj-hhhNhNubah}(h]h ]h"]h$]h&]uh1jhj-ubh buffers depends on the active coded pixel format and may be affected by codec-specific extended controls, as stated in the documentation of each format.}(hj-hhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhMhj#-hhubh)}(hXUBoth queues operate independently, following the standard behavior of V4L2 buffer queues and memory-to-memory devices. In addition, the order of decoded frames dequeued from the ``CAPTURE`` queue may differ from the order of queuing coded frames to the ``OUTPUT`` queue, due to properties of the selected coded format, e.g. frame reordering.h](hBoth queues operate independently, following the standard behavior of V4L2 buffer queues and memory-to-memory devices. In addition, the order of decoded frames dequeued from the }(hj-hhhNhNubj)}(h ``CAPTURE``h]hCAPTURE}(hj-hhhNhNubah}(h]h ]h"]h$]h&]uh1jhj-ubh@ queue may differ from the order of queuing coded frames to the }(hj-hhhNhNubj)}(h ``OUTPUT``h]hOUTPUT}(hj-hhhNhNubah}(h]h ]h"]h$]h&]uh1jhj-ubhN queue, due to properties of the selected coded format, e.g. frame reordering.}(hj-hhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhMhj#-hhubh)}(hThe client must not assume any direct relationship between ``CAPTURE`` and ``OUTPUT`` buffers and any specific timing of buffers becoming available to dequeue. Specifically:h](h;The client must not assume any direct relationship between }(hj-hhhNhNubj)}(h ``CAPTURE``h]hCAPTURE}(hj-hhhNhNubah}(h]h ]h"]h$]h&]uh1jhj-ubh and }(hj-hhhNhNubj)}(h ``OUTPUT``h]hOUTPUT}(hj.hhhNhNubah}(h]h ]h"]h$]h&]uh1jhj-ubhX buffers and any specific timing of buffers becoming available to dequeue. Specifically:}(hj-hhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhMhj#-hhubj )}(hhh](j )}(ha buffer queued to ``OUTPUT`` may result in no buffers being produced on ``CAPTURE`` (e.g. if it does not contain encoded data, or if only metadata syntax structures are present in it), h]h)}(ha buffer queued to ``OUTPUT`` may result in no buffers being produced on ``CAPTURE`` (e.g. if it does not contain encoded data, or if only metadata syntax structures are present in it),h](ha buffer queued to }(hj%.hhhNhNubj)}(h ``OUTPUT``h]hOUTPUT}(hj-.hhhNhNubah}(h]h ]h"]h$]h&]uh1jhj%.ubh, may result in no buffers being produced on }(hj%.hhhNhNubj)}(h ``CAPTURE``h]hCAPTURE}(hj?.hhhNhNubah}(h]h ]h"]h$]h&]uh1jhj%.ubhe (e.g. if it does not contain encoded data, or if only metadata syntax structures are present in it),}(hj%.hhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhMhj!.ubah}(h]h ]h"]h$]h&]uh1jhj.hhhhhNubj )}(hXa buffer queued to ``OUTPUT`` may result in more than one buffer produced on ``CAPTURE`` (if the encoded data contained more than one frame, or if returning a decoded frame allowed the decoder to return a frame that preceded it in decode, but succeeded it in the display order), h]h)}(hXa buffer queued to ``OUTPUT`` may result in more than one buffer produced on ``CAPTURE`` (if the encoded data contained more than one frame, or if returning a decoded frame allowed the decoder to return a frame that preceded it in decode, but succeeded it in the display order),h](ha buffer queued to }(hja.hhhNhNubj)}(h ``OUTPUT``h]hOUTPUT}(hji.hhhNhNubah}(h]h ]h"]h$]h&]uh1jhja.ubh0 may result in more than one buffer produced on }(hja.hhhNhNubj)}(h ``CAPTURE``h]hCAPTURE}(hj{.hhhNhNubah}(h]h ]h"]h$]h&]uh1jhja.ubh (if the encoded data contained more than one frame, or if returning a decoded frame allowed the decoder to return a frame that preceded it in decode, but succeeded it in the display order),}(hja.hhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhMhj].ubah}(h]h ]h"]h$]h&]uh1jhj.hhhhhNubj )}(ha buffer queued to ``OUTPUT`` may result in a buffer being produced on ``CAPTURE`` later into decode process, and/or after processing further ``OUTPUT`` buffers, or be returned out of order, e.g. if display reordering is used, h]h)}(ha buffer queued to ``OUTPUT`` may result in a buffer being produced on ``CAPTURE`` later into decode process, and/or after processing further ``OUTPUT`` buffers, or be returned out of order, e.g. if display reordering is used,h](ha buffer queued to }(hj.hhhNhNubj)}(h ``OUTPUT``h]hOUTPUT}(hj.hhhNhNubah}(h]h ]h"]h$]h&]uh1jhj.ubh* may result in a buffer being produced on }(hj.hhhNhNubj)}(h ``CAPTURE``h]hCAPTURE}(hj.hhhNhNubah}(h]h ]h"]h$]h&]uh1jhj.ubh< later into decode process, and/or after processing further }(hj.hhhNhNubj)}(h ``OUTPUT``h]hOUTPUT}(hj.hhhNhNubah}(h]h ]h"]h$]h&]uh1jhj.ubhJ buffers, or be returned out of order, e.g. if display reordering is used,}(hj.hhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhMhj.ubah}(h]h ]h"]h$]h&]uh1jhj.hhhhhNubj )}(hXbuffers may become available on the ``CAPTURE`` queue without additional buffers queued to ``OUTPUT`` (e.g. during drain or ``EOS``), because of the ``OUTPUT`` buffers queued in the past whose decoding results are only available at later time, due to specifics of the decoding process. h]h)}(hXbuffers may become available on the ``CAPTURE`` queue without additional buffers queued to ``OUTPUT`` (e.g. during drain or ``EOS``), because of the ``OUTPUT`` buffers queued in the past whose decoding results are only available at later time, due to specifics of the decoding process.h](h$buffers may become available on the }(hj.hhhNhNubj)}(h ``CAPTURE``h]hCAPTURE}(hj.hhhNhNubah}(h]h ]h"]h$]h&]uh1jhj.ubh, queue without additional buffers queued to }(hj.hhhNhNubj)}(h ``OUTPUT``h]hOUTPUT}(hj/hhhNhNubah}(h]h ]h"]h$]h&]uh1jhj.ubh (e.g. during drain or }(hj.hhhNhNubj)}(h``EOS``h]hEOS}(hj/hhhNhNubah}(h]h ]h"]h$]h&]uh1jhj.ubh), because of the }(hj.hhhNhNubj)}(h ``OUTPUT``h]hOUTPUT}(hj)/hhhNhNubah}(h]h ]h"]h$]h&]uh1jhj.ubh~ buffers queued in the past whose decoding results are only available at later time, due to specifics of the decoding process.}(hj.hhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhMhj.ubah}(h]h ]h"]h$]h&]uh1jhj.hhhhhNubeh}(h]h ]h"]h$]h&]jA jB uh1j hhhMhj#-hhubj)}(hXTo allow matching decoded ``CAPTURE`` buffers with ``OUTPUT`` buffers they originated from, the client can set the ``timestamp`` field of the :c:type:`v4l2_buffer` struct when queuing an ``OUTPUT`` buffer. The ``CAPTURE`` buffer(s), which resulted from decoding that ``OUTPUT`` buffer will have their ``timestamp`` field set to the same value when dequeued. In addition to the straightforward case of one ``OUTPUT`` buffer producing one ``CAPTURE`` buffer, the following cases are defined: * one ``OUTPUT`` buffer generates multiple ``CAPTURE`` buffers: the same ``OUTPUT`` timestamp will be copied to multiple ``CAPTURE`` buffers. * multiple ``OUTPUT`` buffers generate one ``CAPTURE`` buffer: timestamp of the ``OUTPUT`` buffer queued first will be copied. * the decoding order differs from the display order (i.e. the ``CAPTURE`` buffers are out-of-order compared to the ``OUTPUT`` buffers): ``CAPTURE`` timestamps will not retain the order of ``OUTPUT`` timestamps.h](h)}(hXeTo allow matching decoded ``CAPTURE`` buffers with ``OUTPUT`` buffers they originated from, the client can set the ``timestamp`` field of the :c:type:`v4l2_buffer` struct when queuing an ``OUTPUT`` buffer. The ``CAPTURE`` buffer(s), which resulted from decoding that ``OUTPUT`` buffer will have their ``timestamp`` field set to the same value when dequeued.h](hTo allow matching decoded }(hjQ/hhhNhNubj)}(h ``CAPTURE``h]hCAPTURE}(hjY/hhhNhNubah}(h]h ]h"]h$]h&]uh1jhjQ/ubh buffers with }(hjQ/hhhNhNubj)}(h ``OUTPUT``h]hOUTPUT}(hjk/hhhNhNubah}(h]h ]h"]h$]h&]uh1jhjQ/ubh6 buffers they originated from, the client can set the }(hjQ/hhhNhNubj)}(h ``timestamp``h]h timestamp}(hj}/hhhNhNubah}(h]h ]h"]h$]h&]uh1jhjQ/ubh field of the }(hjQ/hhhNhNubh)}(h:c:type:`v4l2_buffer`h]j)}(hj/h]h v4l2_buffer}(hj/hhhNhNubah}(h]h ](jjc-typeeh"]h$]h&]uh1jhj/ubah}(h]h ]h"]h$]h&]refdocj refdomainjreftypetype refexplicitrefwarnjjj v4l2_bufferuh1hhhhMhjQ/ubh struct when queuing an }(hjQ/hhhNhNubj)}(h ``OUTPUT``h]hOUTPUT}(hj/hhhNhNubah}(h]h ]h"]h$]h&]uh1jhjQ/ubh buffer. The }(hjQ/hhhNhNubj)}(h ``CAPTURE``h]hCAPTURE}(hj/hhhNhNubah}(h]h ]h"]h$]h&]uh1jhjQ/ubh. buffer(s), which resulted from decoding that }(hjQ/hhhNhNubj)}(h ``OUTPUT``h]hOUTPUT}(hj/hhhNhNubah}(h]h ]h"]h$]h&]uh1jhjQ/ubh buffer will have their }(hjQ/hhhNhNubj)}(h ``timestamp``h]h timestamp}(hj/hhhNhNubah}(h]h ]h"]h$]h&]uh1jhjQ/ubh+ field set to the same value when dequeued.}(hjQ/hhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhMhjM/ubh)}(hIn addition to the straightforward case of one ``OUTPUT`` buffer producing one ``CAPTURE`` buffer, the following cases are defined:h](h/In addition to the straightforward case of one }(hj0hhhNhNubj)}(h ``OUTPUT``h]hOUTPUT}(hj0hhhNhNubah}(h]h ]h"]h$]h&]uh1jhj0ubh buffer producing one }(hj0hhhNhNubj)}(h ``CAPTURE``h]hCAPTURE}(hj0hhhNhNubah}(h]h ]h"]h$]h&]uh1jhj0ubh) buffer, the following cases are defined:}(hj0hhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhMhjM/ubj )}(hhh](j )}(hone ``OUTPUT`` buffer generates multiple ``CAPTURE`` buffers: the same ``OUTPUT`` timestamp will be copied to multiple ``CAPTURE`` buffers. h]h)}(hone ``OUTPUT`` buffer generates multiple ``CAPTURE`` buffers: the same ``OUTPUT`` timestamp will be copied to multiple ``CAPTURE`` buffers.h](hone }(hj90hhhNhNubj)}(h ``OUTPUT``h]hOUTPUT}(hjA0hhhNhNubah}(h]h ]h"]h$]h&]uh1jhj90ubh buffer generates multiple }(hj90hhhNhNubj)}(h ``CAPTURE``h]hCAPTURE}(hjS0hhhNhNubah}(h]h ]h"]h$]h&]uh1jhj90ubh buffers: the same }(hj90hhhNhNubj)}(h ``OUTPUT``h]hOUTPUT}(hje0hhhNhNubah}(h]h ]h"]h$]h&]uh1jhj90ubh& timestamp will be copied to multiple }(hj90hhhNhNubj)}(h ``CAPTURE``h]hCAPTURE}(hjw0hhhNhNubah}(h]h ]h"]h$]h&]uh1jhj90ubh buffers.}(hj90hhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhMhj50ubah}(h]h ]h"]h$]h&]uh1jhj20ubj )}(h}multiple ``OUTPUT`` buffers generate one ``CAPTURE`` buffer: timestamp of the ``OUTPUT`` buffer queued first will be copied. h]h)}(h|multiple ``OUTPUT`` buffers generate one ``CAPTURE`` buffer: timestamp of the ``OUTPUT`` buffer queued first will be copied.h](h multiple }(hj0hhhNhNubj)}(h ``OUTPUT``h]hOUTPUT}(hj0hhhNhNubah}(h]h ]h"]h$]h&]uh1jhj0ubh buffers generate one }(hj0hhhNhNubj)}(h ``CAPTURE``h]hCAPTURE}(hj0hhhNhNubah}(h]h ]h"]h$]h&]uh1jhj0ubh buffer: timestamp of the }(hj0hhhNhNubj)}(h ``OUTPUT``h]hOUTPUT}(hj0hhhNhNubah}(h]h ]h"]h$]h&]uh1jhj0ubh$ buffer queued first will be copied.}(hj0hhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhMhj0ubah}(h]h ]h"]h$]h&]uh1jhj20ubj )}(hthe decoding order differs from the display order (i.e. the ``CAPTURE`` buffers are out-of-order compared to the ``OUTPUT`` buffers): ``CAPTURE`` timestamps will not retain the order of ``OUTPUT`` timestamps.h]h)}(hthe decoding order differs from the display order (i.e. the ``CAPTURE`` buffers are out-of-order compared to the ``OUTPUT`` buffers): ``CAPTURE`` timestamps will not retain the order of ``OUTPUT`` timestamps.h](h queues are streaming. For compatibility reasons, the call to }(hj=hhhNhNubh)}(h:c:func:`VIDIOC_DECODER_CMD`h]j)}(hj=h]hVIDIOC_DECODER_CMD()}(hj=hhhNhNubah}(h]h ](jjc-funceh"]h$]h&]uh1jhj=ubah}(h]h ]h"]h$]h&]refdocj refdomainjreftypefunc refexplicitrefwarnjjjVIDIOC_DECODER_CMDuh1hhhhMhj=ubhi will not fail even if any of the queues is not streaming, but at the same time it will not initiate the }(hj=hhhNhNubj)}(h`Drain`h]hDrain}(hj>hhhNhNubah}(h]h ]h"]h$]h&]uh1jhj=ubhC sequence and so the steps described below would not be applicable.}(hj=hhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhMhj=ubah}(h]h ]h"]h$]h&]uh1jhj<ubeh}(h]h ]h"]h$]h&]uh1jhj<hhhNhNubj )}(hXAny ``OUTPUT`` buffers queued by the client before the :c:func:`VIDIOC_DECODER_CMD` was issued will be processed and decoded as normal. The client must continue to handle both queues independently, similarly to normal decode operation. This includes: * handling any operations triggered as a result of processing those buffers, such as the `Dynamic Resolution Change` sequence, before continuing with the drain sequence, * queuing and dequeuing ``CAPTURE`` buffers, until a buffer marked with the ``V4L2_BUF_FLAG_LAST`` flag is dequeued, .. warning:: The last buffer may be empty (with :c:type:`v4l2_buffer` ``bytesused`` = 0) and in that case it must be ignored by the client, as it does not contain a decoded frame. .. note:: Any attempt to dequeue more ``CAPTURE`` buffers beyond the buffer marked with ``V4L2_BUF_FLAG_LAST`` will result in a -EPIPE error from :c:func:`VIDIOC_DQBUF`. * dequeuing processed ``OUTPUT`` buffers, until all the buffers queued before the ``V4L2_DEC_CMD_STOP`` command are dequeued, * dequeuing the ``V4L2_EVENT_EOS`` event, if the client subscribed to it. .. note:: For backwards compatibility, the decoder will signal a ``V4L2_EVENT_EOS`` event when the last frame has been decoded and all frames are ready to be dequeued. It is a deprecated behavior and the client must not rely on it. The ``V4L2_BUF_FLAG_LAST`` buffer flag should be used instead. h](h)}(hAny ``OUTPUT`` buffers queued by the client before the :c:func:`VIDIOC_DECODER_CMD` was issued will be processed and decoded as normal. The client must continue to handle both queues independently, similarly to normal decode operation. This includes:h](hAny }(hjD>hhhNhNubj)}(h ``OUTPUT``h]hOUTPUT}(hjL>hhhNhNubah}(h]h ]h"]h$]h&]uh1jhjD>ubh) buffers queued by the client before the }(hjD>hhhNhNubh)}(h:c:func:`VIDIOC_DECODER_CMD`h]j)}(hj`>h]hVIDIOC_DECODER_CMD()}(hjb>hhhNhNubah}(h]h ](jjc-funceh"]h$]h&]uh1jhj^>ubah}(h]h ]h"]h$]h&]refdocj refdomainjreftypefunc refexplicitrefwarnjjjVIDIOC_DECODER_CMDuh1hhhhMhjD>ubh was issued will be processed and decoded as normal. The client must continue to handle both queues independently, similarly to normal decode operation. This includes:}(hjD>hhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhMhj@>ubj )}(hhh](j )}(hhandling any operations triggered as a result of processing those buffers, such as the `Dynamic Resolution Change` sequence, before continuing with the drain sequence, h]h)}(hhandling any operations triggered as a result of processing those buffers, such as the `Dynamic Resolution Change` sequence, before continuing with the drain sequence,h](hWhandling any operations triggered as a result of processing those buffers, such as the }(hj>hhhNhNubj)}(h`Dynamic Resolution Change`h]hDynamic Resolution Change}(hj>hhhNhNubah}(h]h ]h"]h$]h&]uh1jhj>ubh5 sequence, before continuing with the drain sequence,}(hj>hhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhM hj>ubah}(h]h ]h"]h$]h&]uh1jhj>ubj )}(hXqueuing and dequeuing ``CAPTURE`` buffers, until a buffer marked with the ``V4L2_BUF_FLAG_LAST`` flag is dequeued, .. warning:: The last buffer may be empty (with :c:type:`v4l2_buffer` ``bytesused`` = 0) and in that case it must be ignored by the client, as it does not contain a decoded frame. .. note:: Any attempt to dequeue more ``CAPTURE`` buffers beyond the buffer marked with ``V4L2_BUF_FLAG_LAST`` will result in a -EPIPE error from :c:func:`VIDIOC_DQBUF`. h](h)}(hrqueuing and dequeuing ``CAPTURE`` buffers, until a buffer marked with the ``V4L2_BUF_FLAG_LAST`` flag is dequeued,h](hqueuing and dequeuing }(hj>hhhNhNubj)}(h ``CAPTURE``h]hCAPTURE}(hj>hhhNhNubah}(h]h ]h"]h$]h&]uh1jhj>ubh) buffers, until a buffer marked with the }(hj>hhhNhNubj)}(h``V4L2_BUF_FLAG_LAST``h]hV4L2_BUF_FLAG_LAST}(hj>hhhNhNubah}(h]h ]h"]h$]h&]uh1jhj>ubh flag is dequeued,}(hj>hhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhMhj>ubj)}(hThe last buffer may be empty (with :c:type:`v4l2_buffer` ``bytesused`` = 0) and in that case it must be ignored by the client, as it does not contain a decoded frame.h]h)}(hThe last buffer may be empty (with :c:type:`v4l2_buffer` ``bytesused`` = 0) and in that case it must be ignored by the client, as it does not contain a decoded frame.h](h#The last buffer may be empty (with }(hj>hhhNhNubh)}(h:c:type:`v4l2_buffer`h]j)}(hj>h]h v4l2_buffer}(hj>hhhNhNubah}(h]h ](jjc-typeeh"]h$]h&]uh1jhj>ubah}(h]h ]h"]h$]h&]refdocj refdomainjreftypetype refexplicitrefwarnjjj v4l2_bufferuh1hhhhMhj>ubh }(hj>hhhNhNubj)}(h ``bytesused``h]h bytesused}(hj?hhhNhNubah}(h]h ]h"]h$]h&]uh1jhj>ubh` = 0) and in that case it must be ignored by the client, as it does not contain a decoded frame.}(hj>hhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhMhj>ubah}(h]h ]h"]h$]h&]uh1jhj>ubj)}(hAny attempt to dequeue more ``CAPTURE`` buffers beyond the buffer marked with ``V4L2_BUF_FLAG_LAST`` will result in a -EPIPE error from :c:func:`VIDIOC_DQBUF`.h]h)}(hAny attempt to dequeue more ``CAPTURE`` buffers beyond the buffer marked with ``V4L2_BUF_FLAG_LAST`` will result in a -EPIPE error from :c:func:`VIDIOC_DQBUF`.h](hAny attempt to dequeue more }(hj;?hhhNhNubj)}(h ``CAPTURE``h]hCAPTURE}(hjC?hhhNhNubah}(h]h ]h"]h$]h&]uh1jhj;?ubh' buffers beyond the buffer marked with }(hj;?hhhNhNubj)}(h``V4L2_BUF_FLAG_LAST``h]hV4L2_BUF_FLAG_LAST}(hjU?hhhNhNubah}(h]h ]h"]h$]h&]uh1jhj;?ubh$ will result in a -EPIPE error from }(hj;?hhhNhNubh)}(h:c:func:`VIDIOC_DQBUF`h]j)}(hji?h]hVIDIOC_DQBUF()}(hjk?hhhNhNubah}(h]h ](jjc-funceh"]h$]h&]uh1jhjg?ubah}(h]h ]h"]h$]h&]refdocj refdomainjreftypefunc refexplicitrefwarnjjj VIDIOC_DQBUFuh1hhhhMhj;?ubh.}(hj;?hhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhMhj7?ubah}(h]h ]h"]h$]h&]uh1jhj>ubeh}(h]h ]h"]h$]h&]uh1jhj>ubj )}(h|dequeuing processed ``OUTPUT`` buffers, until all the buffers queued before the ``V4L2_DEC_CMD_STOP`` command are dequeued, h]h)}(h{dequeuing processed ``OUTPUT`` buffers, until all the buffers queued before the ``V4L2_DEC_CMD_STOP`` command are dequeued,h](hdequeuing processed }(hj?hhhNhNubj)}(h ``OUTPUT``h]hOUTPUT}(hj?hhhNhNubah}(h]h ]h"]h$]h&]uh1jhj?ubh2 buffers, until all the buffers queued before the }(hj?hhhNhNubj)}(h``V4L2_DEC_CMD_STOP``h]hV4L2_DEC_CMD_STOP}(hj?hhhNhNubah}(h]h ]h"]h$]h&]uh1jhj?ubh command are dequeued,}(hj?hhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhMhj?ubah}(h]h ]h"]h$]h&]uh1jhj>ubj )}(hHdequeuing the ``V4L2_EVENT_EOS`` event, if the client subscribed to it. h]h)}(hGdequeuing the ``V4L2_EVENT_EOS`` event, if the client subscribed to it.h](hdequeuing the }(hj?hhhNhNubj)}(h``V4L2_EVENT_EOS``h]hV4L2_EVENT_EOS}(hj?hhhNhNubah}(h]h ]h"]h$]h&]uh1jhj?ubh' event, if the client subscribed to it.}(hj?hhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhM!hj?ubah}(h]h ]h"]h$]h&]uh1jhj>ubeh}(h]h ]h"]h$]h&]jA jB uh1j hhhM hj@>ubj)}(hXFor backwards compatibility, the decoder will signal a ``V4L2_EVENT_EOS`` event when the last frame has been decoded and all frames are ready to be dequeued. It is a deprecated behavior and the client must not rely on it. The ``V4L2_BUF_FLAG_LAST`` buffer flag should be used instead.h]h)}(hXFor backwards compatibility, the decoder will signal a ``V4L2_EVENT_EOS`` event when the last frame has been decoded and all frames are ready to be dequeued. It is a deprecated behavior and the client must not rely on it. The ``V4L2_BUF_FLAG_LAST`` buffer flag should be used instead.h](h7For backwards compatibility, the decoder will signal a }(hj @hhhNhNubj)}(h``V4L2_EVENT_EOS``h]hV4L2_EVENT_EOS}(hj@hhhNhNubah}(h]h ]h"]h$]h&]uh1jhj @ubh event when the last frame has been decoded and all frames are ready to be dequeued. It is a deprecated behavior and the client must not rely on it. The }(hj @hhhNhNubj)}(h``V4L2_BUF_FLAG_LAST``h]hV4L2_BUF_FLAG_LAST}(hj&@hhhNhNubah}(h]h ]h"]h$]h&]uh1jhj @ubh$ buffer flag should be used instead.}(hj @hhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhM%hj@ubah}(h]h ]h"]h$]h&]uh1jhj@>ubeh}(h]h ]h"]h$]h&]uh1jhj<hhhNhNubj )}(hX]Once all the ``OUTPUT`` buffers queued before the ``V4L2_DEC_CMD_STOP`` call are dequeued and the last ``CAPTURE`` buffer is dequeued, the decoder is stopped and it will accept, but not process, any newly queued ``OUTPUT`` buffers until the client issues any of the following operations: * ``V4L2_DEC_CMD_START`` - the decoder will not be reset and will resume operation normally, with all the state from before the drain, * a pair of :c:func:`VIDIOC_STREAMOFF` and :c:func:`VIDIOC_STREAMON` on the ``CAPTURE`` queue - the decoder will resume the operation normally, however any ``CAPTURE`` buffers still in the queue will be returned to the client, * a pair of :c:func:`VIDIOC_STREAMOFF` and :c:func:`VIDIOC_STREAMON` on the ``OUTPUT`` queue - any pending source buffers will be returned to the client and the `Seek` sequence will be triggered. h](h)}(hXOnce all the ``OUTPUT`` buffers queued before the ``V4L2_DEC_CMD_STOP`` call are dequeued and the last ``CAPTURE`` buffer is dequeued, the decoder is stopped and it will accept, but not process, any newly queued ``OUTPUT`` buffers until the client issues any of the following operations:h](h Once all the }(hjN@hhhNhNubj)}(h ``OUTPUT``h]hOUTPUT}(hjV@hhhNhNubah}(h]h ]h"]h$]h&]uh1jhjN@ubh buffers queued before the }(hjN@hhhNhNubj)}(h``V4L2_DEC_CMD_STOP``h]hV4L2_DEC_CMD_STOP}(hjh@hhhNhNubah}(h]h ]h"]h$]h&]uh1jhjN@ubh call are dequeued and the last }(hjN@hhhNhNubj)}(h ``CAPTURE``h]hCAPTURE}(hjz@hhhNhNubah}(h]h ]h"]h$]h&]uh1jhjN@ubhb buffer is dequeued, the decoder is stopped and it will accept, but not process, any newly queued }(hjN@hhhNhNubj)}(h ``OUTPUT``h]hOUTPUT}(hj@hhhNhNubah}(h]h ]h"]h$]h&]uh1jhjN@ubhA buffers until the client issues any of the following operations:}(hjN@hhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhM*hjJ@ubj )}(hhh](j )}(h``V4L2_DEC_CMD_START`` - the decoder will not be reset and will resume operation normally, with all the state from before the drain, h]h)}(h``V4L2_DEC_CMD_START`` - the decoder will not be reset and will resume operation normally, with all the state from before the drain,h](j)}(h``V4L2_DEC_CMD_START``h]hV4L2_DEC_CMD_START}(hj@hhhNhNubah}(h]h ]h"]h$]h&]uh1jhj@ubhn - the decoder will not be reset and will resume operation normally, with all the state from before the drain,}(hj@hhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhM/hj@ubah}(h]h ]h"]h$]h&]uh1jhj@ubj )}(ha pair of :c:func:`VIDIOC_STREAMOFF` and :c:func:`VIDIOC_STREAMON` on the ``CAPTURE`` queue - the decoder will resume the operation normally, however any ``CAPTURE`` buffers still in the queue will be returned to the client, h]h)}(ha pair of :c:func:`VIDIOC_STREAMOFF` and :c:func:`VIDIOC_STREAMON` on the ``CAPTURE`` queue - the decoder will resume the operation normally, however any ``CAPTURE`` buffers still in the queue will be returned to the client,h](h a pair of }(hj@hhhNhNubh)}(h:c:func:`VIDIOC_STREAMOFF`h]j)}(hj@h]hVIDIOC_STREAMOFF()}(hj@hhhNhNubah}(h]h ](jjc-funceh"]h$]h&]uh1jhj@ubah}(h]h ]h"]h$]h&]refdocj refdomainjreftypefunc refexplicitrefwarnjjjVIDIOC_STREAMOFFuh1hhhhM2hj@ubh and }(hj@hhhNhNubh)}(h:c:func:`VIDIOC_STREAMON`h]j)}(hj@h]hVIDIOC_STREAMON()}(hjAhhhNhNubah}(h]h ](jjc-funceh"]h$]h&]uh1jhj@ubah}(h]h ]h"]h$]h&]refdocj refdomainjreftypefunc refexplicitrefwarnjjjVIDIOC_STREAMONuh1hhhhM2hj@ubh on the }(hj@hhhNhNubj)}(h ``CAPTURE``h]hCAPTURE}(hjAhhhNhNubah}(h]h ]h"]h$]h&]uh1jhj@ubhE queue - the decoder will resume the operation normally, however any }(hj@hhhNhNubj)}(h ``CAPTURE``h]hCAPTURE}(hj1AhhhNhNubah}(h]h ]h"]h$]h&]uh1jhj@ubh; buffers still in the queue will be returned to the client,}(hj@hhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhM2hj@ubah}(h]h ]h"]h$]h&]uh1jhj@ubj )}(ha pair of :c:func:`VIDIOC_STREAMOFF` and :c:func:`VIDIOC_STREAMON` on the ``OUTPUT`` queue - any pending source buffers will be returned to the client and the `Seek` sequence will be triggered. h]h)}(ha pair of :c:func:`VIDIOC_STREAMOFF` and :c:func:`VIDIOC_STREAMON` on the ``OUTPUT`` queue - any pending source buffers will be returned to the client and the `Seek` sequence will be triggered.h](h a pair of }(hjSAhhhNhNubh)}(h:c:func:`VIDIOC_STREAMOFF`h]j)}(hj]Ah]hVIDIOC_STREAMOFF()}(hj_AhhhNhNubah}(h]h ](jjc-funceh"]h$]h&]uh1jhj[Aubah}(h]h ]h"]h$]h&]refdocj refdomainjreftypefunc refexplicitrefwarnjjjVIDIOC_STREAMOFFuh1hhhhM7hjSAubh and }(hjSAhhhNhNubh)}(h:c:func:`VIDIOC_STREAMON`h]j)}(hjAh]hVIDIOC_STREAMON()}(hjAhhhNhNubah}(h]h ](jjc-funceh"]h$]h&]uh1jhj~Aubah}(h]h ]h"]h$]h&]refdocj refdomainjreftypefunc refexplicitrefwarnjjjVIDIOC_STREAMONuh1hhhhM7hjSAubh on the }(hjSAhhhNhNubj)}(h ``OUTPUT``h]hOUTPUT}(hjAhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjSAubhK queue - any pending source buffers will be returned to the client and the }(hjSAhhhNhNubj)}(h`Seek`h]hSeek}(hjAhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjSAubh sequence will be triggered.}(hjSAhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhM7hjOAubah}(h]h ]h"]h$]h&]uh1jhj@ubeh}(h]h ]h"]h$]h&]jA jB uh1j hhhM/hjJ@ubeh}(h]h ]h"]h$]h&]uh1jhj<hhhNhNubeh}(h]h ]h"]h$]h&]jjjhjjuh1jhjO<hhhhhMubj)}(hXOnce the drain sequence is initiated, the client needs to drive it to completion, as described by the steps above, unless it aborts the process by issuing :c:func:`VIDIOC_STREAMOFF` on any of the ``OUTPUT`` or ``CAPTURE`` queues. The client is not allowed to issue ``V4L2_DEC_CMD_START`` or ``V4L2_DEC_CMD_STOP`` again while the drain sequence is in progress and they will fail with -EBUSY error code if attempted. Although not mandatory, the availability of decoder commands may be queried using :c:func:`VIDIOC_TRY_DECODER_CMD`.h](h)}(hXOnce the drain sequence is initiated, the client needs to drive it to completion, as described by the steps above, unless it aborts the process by issuing :c:func:`VIDIOC_STREAMOFF` on any of the ``OUTPUT`` or ``CAPTURE`` queues. The client is not allowed to issue ``V4L2_DEC_CMD_START`` or ``V4L2_DEC_CMD_STOP`` again while the drain sequence is in progress and they will fail with -EBUSY error code if attempted.7h](hOnce the drain sequence is initiated, the client needs to drive it to completion, as described by the steps above, unless it aborts the process by issuing }(hjAhhhNhNubh)}(h:c:func:`VIDIOC_STREAMOFF`h]j)}(hjAh]hVIDIOC_STREAMOFF()}(hjAhhhNhNubah}(h]h ](jjc-funceh"]h$]h&]uh1jhjAubah}(h]h ]h"]h$]h&]refdocj refdomainjreftypefunc refexplicitrefwarnjjjVIDIOC_STREAMOFFuh1hhhhM=hjAubh on any of the }(hjAhhhNhNubj)}(h ``OUTPUT``h]hOUTPUT}(hjBhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjAubh or }(hjAhhhNhNubj)}(h ``CAPTURE``h]hCAPTURE}(hj$BhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjAubh- queues. The client is not allowed to issue }(hjAhhhNhNubj)}(h``V4L2_DEC_CMD_START``h]hV4L2_DEC_CMD_START}(hj6BhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjAubh or }(hjAhhhNhNubj)}(h``V4L2_DEC_CMD_STOP``h]hV4L2_DEC_CMD_STOP}(hjHBhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjAubhf again while the drain sequence is in progress and they will fail with -EBUSY error code if attempted.}(hjAhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhM=hjAubh)}(hsAlthough not mandatory, the availability of decoder commands may be queried using :c:func:`VIDIOC_TRY_DECODER_CMD`.h](hRAlthough not mandatory, the availability of decoder commands may be queried using }(hj`BhhhNhNubh)}(h :c:func:`VIDIOC_TRY_DECODER_CMD`h]j)}(hjjBh]hVIDIOC_TRY_DECODER_CMD()}(hjlBhhhNhNubah}(h]h ](jjc-funceh"]h$]h&]uh1jhjhBubah}(h]h ]h"]h$]h&]refdocj refdomainjreftypefunc refexplicitrefwarnjjjVIDIOC_TRY_DECODER_CMDuh1hhhhMDhj`Bubh.}(hj`BhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhMDhjAubeh}(h]h ]h"]h$]h&]uh1jhjO<hhhhhNubeh}(h]drainah ]h"]drainah$]h&]uh1hhhhhhhhMubh)}(hhh](h)}(h End of Streamh]h End of Stream}(hjBhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjBhhhhhMHubh)}(hIf the decoder encounters an end of stream marking in the stream, the decoder will initiate the `Drain` sequence, which the client must handle as described above, skipping the initial :c:func:`VIDIOC_DECODER_CMD`.h](h`If the decoder encounters an end of stream marking in the stream, the decoder will initiate the }(hjBhhhNhNubj)}(h`Drain`h]hDrain}(hjBhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjBubhQ sequence, which the client must handle as described above, skipping the initial }(hjBhhhNhNubh)}(h:c:func:`VIDIOC_DECODER_CMD`h]j)}(hjBh]hVIDIOC_DECODER_CMD()}(hjBhhhNhNubah}(h]h ](jjc-funceh"]h$]h&]uh1jhjBubah}(h]h ]h"]h$]h&]refdocj refdomainjreftypefunc refexplicitrefwarnjjjVIDIOC_DECODER_CMDuh1hhhhMJhjBubh.}(hjBhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhMJhjBhhubeh}(h] end-of-streamah ]h"] end of streamah$]h&]uh1hhhhhhhhMHubh)}(hhh](h)}(h Commit Pointsh]h Commit Points}(hjBhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjBhhhhhMOubh)}(hVSetting formats and allocating buffers trigger changes in the behavior of the decoder.h]hVSetting formats and allocating buffers trigger changes in the behavior of the decoder.}(hj ChhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMQhjBhhubj)}(hhh](j )}(hX Setting the format on the ``OUTPUT`` queue may change the set of formats supported/advertised on the ``CAPTURE`` queue. In particular, it also means that the ``CAPTURE`` format may be reset and the client must not rely on the previously set format being preserved. h]h)}(hXSetting the format on the ``OUTPUT`` queue may change the set of formats supported/advertised on the ``CAPTURE`` queue. In particular, it also means that the ``CAPTURE`` format may be reset and the client must not rely on the previously set format being preserved.h](hSetting the format on the }(hj!ChhhNhNubj)}(h ``OUTPUT``h]hOUTPUT}(hj)ChhhNhNubah}(h]h ]h"]h$]h&]uh1jhj!CubhA queue may change the set of formats supported/advertised on the }(hj!ChhhNhNubj)}(h ``CAPTURE``h]hCAPTURE}(hj;ChhhNhNubah}(h]h ]h"]h$]h&]uh1jhj!Cubh. queue. In particular, it also means that the }(hj!ChhhNhNubj)}(h ``CAPTURE``h]hCAPTURE}(hjMChhhNhNubah}(h]h ]h"]h$]h&]uh1jhj!Cubh_ format may be reset and the client must not rely on the previously set format being preserved.}(hj!ChhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhMThjCubah}(h]h ]h"]h$]h&]uh1jhjChhhhhNubj )}(hvEnumerating formats on the ``CAPTURE`` queue always returns only formats supported for the current ``OUTPUT`` format. h]h)}(huEnumerating formats on the ``CAPTURE`` queue always returns only formats supported for the current ``OUTPUT`` format.h](hEnumerating formats on the }(hjoChhhNhNubj)}(h ``CAPTURE``h]hCAPTURE}(hjwChhhNhNubah}(h]h ]h"]h$]h&]uh1jhjoCubh= queue always returns only formats supported for the current }(hjoChhhNhNubj)}(h ``OUTPUT``h]hOUTPUT}(hjChhhNhNubah}(h]h ]h"]h$]h&]uh1jhjoCubh format.}(hjoChhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhMYhjkCubah}(h]h ]h"]h$]h&]uh1jhjChhhhhNubj )}(hX7Setting the format on the ``CAPTURE`` queue does not change the list of formats available on the ``OUTPUT`` queue. An attempt to set a ``CAPTURE`` format that is not supported for the currently selected ``OUTPUT`` format will result in the decoder adjusting the requested ``CAPTURE`` format to a supported one. h]h)}(hX6Setting the format on the ``CAPTURE`` queue does not change the list of formats available on the ``OUTPUT`` queue. An attempt to set a ``CAPTURE`` format that is not supported for the currently selected ``OUTPUT`` format will result in the decoder adjusting the requested ``CAPTURE`` format to a supported one.h](hSetting the format on the }(hjChhhNhNubj)}(h ``CAPTURE``h]hCAPTURE}(hjChhhNhNubah}(h]h ]h"]h$]h&]uh1jhjCubh< queue does not change the list of formats available on the }(hjChhhNhNubj)}(h ``OUTPUT``h]hOUTPUT}(hjChhhNhNubah}(h]h ]h"]h$]h&]uh1jhjCubh queue. An attempt to set a }(hjChhhNhNubj)}(h ``CAPTURE``h]hCAPTURE}(hjChhhNhNubah}(h]h ]h"]h$]h&]uh1jhjCubh9 format that is not supported for the currently selected }(hjChhhNhNubj)}(h ``OUTPUT``h]hOUTPUT}(hjChhhNhNubah}(h]h ]h"]h$]h&]uh1jhjCubh; format will result in the decoder adjusting the requested }(hjChhhNhNubj)}(h ``CAPTURE``h]hCAPTURE}(hjChhhNhNubah}(h]h ]h"]h$]h&]uh1jhjCubh format to a supported one.}(hjChhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhM\hjCubah}(h]h ]h"]h$]h&]uh1jhjChhhhhNubj )}(hEnumerating formats on the ``OUTPUT`` queue always returns the full set of supported coded formats, irrespectively of the current ``CAPTURE`` format. h]h)}(hEnumerating formats on the ``OUTPUT`` queue always returns the full set of supported coded formats, irrespectively of the current ``CAPTURE`` format.h](hEnumerating formats on the }(hjDhhhNhNubj)}(h ``OUTPUT``h]hOUTPUT}(hj%DhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjDubh] queue always returns the full set of supported coded formats, irrespectively of the current }(hjDhhhNhNubj)}(h ``CAPTURE``h]hCAPTURE}(hj7DhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjDubh format.}(hjDhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhMbhjDubah}(h]h ]h"]h$]h&]uh1jhjChhhhhNubj )}(hWhile buffers are allocated on any of the ``OUTPUT`` or ``CAPTURE`` queues, the client must not change the format on the ``OUTPUT`` queue. Drivers will return the -EBUSY error code for any such format change attempt. h]h)}(hWhile buffers are allocated on any of the ``OUTPUT`` or ``CAPTURE`` queues, the client must not change the format on the ``OUTPUT`` queue. Drivers will return the -EBUSY error code for any such format change attempt.h](h*While buffers are allocated on any of the }(hjYDhhhNhNubj)}(h ``OUTPUT``h]hOUTPUT}(hjaDhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjYDubh or }(hjYDhhhNhNubj)}(h ``CAPTURE``h]hCAPTURE}(hjsDhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjYDubh6 queues, the client must not change the format on the }(hjYDhhhNhNubj)}(h ``OUTPUT``h]hOUTPUT}(hjDhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjYDubhU queue. Drivers will return the -EBUSY error code for any such format change attempt.}(hjYDhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhMehjUDubah}(h]h ]h"]h$]h&]uh1jhjChhhhhNubeh}(h]h ]h"]h$]h&]jjjhjjuh1jhjBhhhhhMTubh)}(hTo summarize, setting formats and allocation must always start with the ``OUTPUT`` queue and the ``OUTPUT`` queue is the master that governs the set of supported formats for the ``CAPTURE`` queue.h](hHTo summarize, setting formats and allocation must always start with the }(hjDhhhNhNubj)}(h ``OUTPUT``h]hOUTPUT}(hjDhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjDubh queue and the }(hjDhhhNhNubj)}(h ``OUTPUT``h]hOUTPUT}(hjDhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjDubhG queue is the master that governs the set of supported formats for the }(hjDhhhNhNubj)}(h ``CAPTURE``h]hCAPTURE}(hjDhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjDubh queue.}(hjDhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhMihjBhhubeh}(h] commit-pointsah ]h"] commit pointsah$]h&]uh1hhhhhhhhMOubeh}(h](1memory-to-memory-stateful-video-decoder-interfaceheh ]h"](1memory-to-memory stateful video decoder interfacedecodereh$]h&]uh1hhhhhhhhKj }jDhsj }hhsubeh}(h]h ]h"]h$]h&]sourcehuh1hcurrent_sourceN current_lineNsettingsdocutils.frontendValues)}(hN generatorN datestampN source_linkN source_urlN toc_backlinksentryfootnote_backlinksK sectnum_xformKstrip_commentsNstrip_elements_with_classesN strip_classesN report_levelK halt_levelKexit_status_levelKdebugNwarning_streamN tracebackinput_encoding utf-8-siginput_encoding_error_handlerstrictoutput_encodingutf-8output_encoding_error_handlerj#Eerror_encodingutf-8error_encoding_error_handlerbackslashreplace language_codeenrecord_dependenciesNconfigN id_prefixhauto_id_prefixid dump_settingsNdump_internalsNdump_transformsNdump_pseudo_xmlNexpose_internalsNstrict_visitorN_disable_configN_sourcehnj _destinationN _config_files]7/var/lib/git/docbuild/linux/Documentation/docutils.confafile_insertion_enabled raw_enabledKline_length_limitM'pep_referencesN pep_base_urlhttps://peps.python.org/pep_file_url_templatepep-%04drfc_referencesN rfc_base_url&https://datatracker.ietf.org/doc/html/ tab_widthKtrim_footnote_reference_spacesyntax_highlightlong smart_quotessmartquotes_locales]character_level_inline_markupdoctitle_xform docinfo_xformKsectsubtitle_xform image_loadinglinkembed_stylesheetcloak_email_addressessection_self_linkenvNubreporterNindirect_targets]substitution_defs}substitution_names}refnames}refids}(h]haj]jaunameids}(jDhjDjDjjjbj_j jj j js jp j^ j[ jdjaj -j-j 3j3j7j7jL<jI<jBjBjBjBjDjDu nametypes}(jDjDjjbj j js j^ jdj -j 3j7jL<jBjBjDuh}(hhjDhjj j_jYjjj jjp j j[ jv jaja j-jgj3j#-j7j#3jI<j7jBjO<jBjBjDjBjg j2 u footnote_refs} citation_refs} autofootnotes]autofootnote_refs]symbol_footnotes]symbol_footnote_refs] footnotes] citations]autofootnote_startKsymbol_footnote_startK id_counter collectionsCounter}j1EKsRparse_messages]hsystem_message)}(hhh]h)}(h:Enumerated list start value not ordinal-1: "5" (ordinal 5)h]h>Enumerated list start value not ordinal-1: “5” (ordinal 5)}(hjEhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjEubah}(h]h ]h"]h$]h&]levelKtypeINFOsourcehnjlineKuh1jEhjghhhhhMubatransform_messages](jE)}(hhh]h)}(hhh]h-Hyperlink target "decoder" is not referenced.}hjEsbah}(h]h ]h"]h$]h&]uh1hhjEubah}(h]h ]h"]h$]h&]levelKtypejEsourcehnjlineKuh1jEubjE)}(hhh]h)}(hhh]h6Hyperlink target "decoder-glossary" is not referenced.}hjEsbah}(h]h ]h"]h$]h&]uh1hhjEubah}(h]h ]h"]h$]h&]levelKtypejEsourcehnjlineK-uh1jEube transformerN include_log] decorationNhhub.