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]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}(hhhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhhhhhKubhenumerated_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.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhj ubah}(h]h ]h"]h$]h&]uh1j hjhhhhhNubj )}(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}(hj3hhhNhNubah}(h]h ]h"]h$]h&]nameRFC 2119refuri#https://tools.ietf.org/html/rfc2119uh1j1hj)ubh)}(h& h]h}(h]rfc-2119ah ]h"]rfc 2119ah$]h&]refurijDuh1h referencedKhj)ubh.}(hj)hhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhKhj%ubah}(h]h ]h"]h$]h&]uh1j hjhhhhhNubj )}(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.}(hjghhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjcubah}(h]h ]h"]h$]h&]uh1j hjhhhhhNubj )}(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&]uh1hhhhKhj{ubah}(h]h ]h"]h$]h&]uh1j hjhhhhhNubj )}(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 }(hj4hhhNhNubh)}(h:ref:`planar-apis`h]hinline)}(hj>h]h planar-apis}(hjBhhhNhNubah}(h]h ](jstdstd-refeh"]h$]h&]uh1j@hj<ubah}(h]h ]h"]h$]h&]refdocj refdomainjLreftyperef refexplicitrefwarnj planar-apisuh1hhhhK#hj4ubh) and applicable structures may be used interchangeably with multi-planar API, unless specified otherwise, depending on decoder capabilities and following the general V4L2 guidelines.}(hj4hhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhK#hj0ubah}(h]h ]h"]h$]h&]uh1j hjhhhhhNubj )}(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.}(hjrhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK'hjnubah}(h]h ]h"]h$]h&]uh1j hjhhhhhNubj )}(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&]uh1j hjhhhhhNubeh}(h]h ]h"]h$]h&]enumtypearabicprefixhsuffix.uh1jhhhhhhhKubh)}(h.. _decoder-glossary:h]h}(h]h ]h"]h$]h&]hdecoder-glossaryuh1hhK-hhhhhhubeh}(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&]uh1jhhhK7hjubh 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; }(hjhhhNhNubj)}(h``V4L2_BUF_TYPE_VIDEO_CAPTURE``h]hV4L2_BUF_TYPE_VIDEO_CAPTURE}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubh or }(hjhhhNhNubj)}(h&``V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE``h]h"V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE}(hj+hhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubh*; data is captured from the hardware into }(hjhhhNhNubj)}(h ``CAPTURE``h]hCAPTURE}(hj=hhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubh buffers.}(hjhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhK3hjubah}(h]h ]h"]h$]h&]uh1j hjubeh}(h]h ]h"]h$]h&]uh1jhhhK7hjubj)}(h^client the application communicating with the decoder or encoder implementing this interface. h](j)}(hclienth]hclient}(hjehhhNhNubah}(h]h ]h"]h$]h&]uh1jhhhK;hjaubj )}(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.}(hjvhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK:hjsubah}(h]h ]h"]h$]h&]uh1j hjaubeh}(h]h ]h"]h$]h&]uh1jhhhK;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&]uh1jhhhK?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&]uh1jhhhKBhjhhubj)}(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&]uh1jhhhKGhjhhubj)}(h.coded width width for given coded resolution. h](j)}(h coded widthh]h coded width}(hj!hhhNhNubah}(h]h ]h"]h$]h&]uh1jhhhKJhjubj )}(hhh]h)}(h!width for given coded resolution.h]h!width for given coded resolution.}(hj2hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKJhj/ubah}(h]h ]h"]h$]h&]uh1j hjubeh}(h]h ]h"]h$]h&]uh1jhhhKJhjhhubj)}(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}(hjPhhhNhNubah}(h]h ]h"]h$]h&]uh1jhhhKPhjLubj )}(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.}(hjahhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKMhj^ubah}(h]h ]h"]h$]h&]uh1j hjLubeh}(h]h ]h"]h$]h&]uh1jhhhKPhjhhubj)}(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&]uh1jhhhKVhj{ubj )}(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 hj{ubeh}(h]h ]h"]h$]h&]uh1jhhhKVhjhhubj)}(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&]uh1jhhhKYhjhhubj)}(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}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhhhK^hjubj )}(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, }(hj$hhhNhNubj)}(h ``OUTPUT``h]hOUTPUT}(hj,hhhNhNubah}(h]h ]h"]h$]h&]uh1jhj$ubhF buffers must be queued by the client in display order; for decoders, }(hj$hhhNhNubj)}(h ``CAPTURE``h]hCAPTURE}(hj>hhhNhNubah}(h]h ]h"]h$]h&]uh1jhj$ubh: buffers must be returned by the decoder in display order.}(hj$hhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhK\hj!ubah}(h]h ]h"]h$]h&]uh1j hjubeh}(h]h ]h"]h$]h&]uh1jhhhK^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}(hjfhhhNhNubah}(h]h ]h"]h$]h&]uh1jhhhKbhjbubj )}(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.}(hjwhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKahjtubah}(h]h ]h"]h$]h&]uh1j hjbubeh}(h]h ]h"]h$]h&]uh1jhhhKbhjhhubj)}(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&]uh1jhhhKehjhhubj)}(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&]uh1jhhhKihjhhubj)}(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&]uh1jhhhKmhjhhubj)}(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}(hj"hhhNhNubah}(h]h ]h"]h$]h&]uh1jhhhKshjubj )}(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).}(hj3hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKphj0ubah}(h]h ]h"]h$]h&]uh1j hjubeh}(h]h ]h"]h$]h&]uh1jhhhKshjhhubj)}(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}(hjQhhhNhNubah}(h]h ]h"]h$]h&]uh1jhhhKzhjMubj )}(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; }(hjbhhhNhNubj)}(h``V4L2_BUF_TYPE_VIDEO_OUTPUT``h]hV4L2_BUF_TYPE_VIDEO_OUTPUT}(hjjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjbubh or }(hjbhhhNhNubj)}(h%``V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE``h]h!V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE}(hj|hhhNhNubah}(h]h ]h"]h$]h&]uh1jhjbubh%; the hardware is fed with data from }(hjbhhhNhNubj)}(h ``OUTPUT``h]hOUTPUT}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjbubh buffers.}(hjbhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhKvhj_ubah}(h]h ]h"]h$]h&]uh1j hjMubeh}(h]h ]h"]h$]h&]uh1jhhhKzhjhhubj)}(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&]uh1jhhhK}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).}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjubah}(h]h ]h"]h$]h&]uh1j hjubeh}(h]h ]h"]h$]h&]uh1jhhhKhjhhubj)}(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}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhhhKhjubj )}(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.}(hj%hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhj"ubah}(h]h ]h"]h$]h&]uh1j hjubeh}(h]h ]h"]h$]h&]uh1jhhhKhjhhubj)}(h;source data fed to the decoder or encoder; see ``OUTPUT``. h](j)}(hsourceh]hsource}(hjChhhNhNubah}(h]h ]h"]h$]h&]uh1jhhhKhj?ubj )}(hhh]h)}(h3data fed to the decoder or encoder; see ``OUTPUT``.h](h(data fed to the decoder or encoder; see }(hjThhhNhNubj)}(h ``OUTPUT``h]hOUTPUT}(hj\hhhNhNubah}(h]h ]h"]h$]h&]uh1jhjTubh.}(hjThhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhKhjQubah}(h]h ]h"]h$]h&]uh1j hj?ubeh}(h]h ]h"]h$]h&]uh1jhhhKhjhhubj)}(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&]uh1jhhhKhjhhubj)}(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&]uh1jhhhKhjhhubj)}(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&]uh1jhhhKhjhhubj)}(hSSPS Sequence Parameter Set; a type of metadata entity in an H.264/HEVC bytestream. h](j)}(hSPSh]hSPS}(hjhhhNhNubah}(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.}(hj"hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjubah}(h]h ]h"]h$]h&]uh1j hj ubeh}(h]h ]h"]h$]h&]uh1jhhhKhjhhubj)}(hstream metadata additional (non-visual) information contained inside encoded bytestream; for example: coded resolution, visible resolution, codec profile. h](j)}(hstream metadatah]hstream metadata}(hj@hhhNhNubah}(h]h ]h"]h$]h&]uh1jhhhKhj<ubj )}(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.}(hjQhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjNubah}(h]h ]h"]h$]h&]uh1j hj<ubeh}(h]h ]h"]h$]h&]uh1jhhhKhjhhubj)}(hDvisible height height for given visible resolution; display height. h](j)}(hvisible heighth]hvisible height}(hjohhhNhNubah}(h]h ]h"]h$]h&]uh1jhhhKhjkubj )}(hhh]h)}(h4height for given visible resolution; display height.h]h4height for given visible resolution; display height.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhj}ubah}(h]h ]h"]h$]h&]uh1j hjkubeh}(h]h ]h"]h$]h&]uh1jhhhKhjhhubj)}(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&]uh1jhhhKhjhhubj)}(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&]uh1jhhhKhjhhubeh}(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' hj$ hhubah}(h]h ]h"]h$]h&]alt$DOT digraph of decoder state machinesrclangDOTuh1j" hj ubhcaption)}(hDecoder State Machineh]hDecoder State Machine}(hjC hhhNhNubah}(h]h ]h"]h$]h&]uh1jA hhhKhj ubeh}(h]id1ah ]h"]h$]h&]altj> captionjE uh1j hj hhhhhNubeh}(h] state-machineah ]h"] state machineah$]h&]uh1hhhhhhhhKubh)}(hhh](h)}(hQuerying Capabilitiesh]hQuerying Capabilities}(hje hhhNhNubah}(h]h ]h"]h$]h&]uh1hhjb 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 }(hjz 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_FMTuh1hhhhKhjz ubh on }(hjz hhhNhNubj)}(h ``OUTPUT``h]hOUTPUT}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1jhjz ubh.}(hjz hhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhKhjv 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&]uh1j hj 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&]uh1j hj ubeh}(h]h ]h"]h$]h&]bullet*uh1j hhhKhjv ubeh}(h]h ]h"]h$]h&]uh1j hjs 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 }(hj9 hhhNhNubh)}(h:c:func:`VIDIOC_ENUM_FMT`h]j)}(hjC h]hVIDIOC_ENUM_FMT()}(hjE hhhNhNubah}(h]h ](jjc-funceh"]h$]h&]uh1jhjA ubah}(h]h ]h"]h$]h&]refdocj refdomainjreftypefunc refexplicitrefwarnjjjVIDIOC_ENUM_FMTuh1hhhhKhj9 ubh on }(hj9 hhhNhNubj)}(h ``CAPTURE``h]hCAPTURE}(hjd hhhNhNubah}(h]h ]h"]h$]h&]uh1jhj9 ubh.}(hj9 hhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhKhj5 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&]uh1j hj| 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&]uh1j hj| ubeh}(h]h ]h"]h$]h&]j- j. uh1j hhhKhj5 ubeh}(h]h ]h"]h$]h&]uh1j hjs 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)}(hj" h]hv4l2_frmsizeenum}(hj$ hhhNhNubah}(h]h ](jjc-typeeh"]h$]h&]uh1jhj ubah}(h]h ]h"]h$]h&]refdocj refdomainjreftypetype refexplicitrefwarnjjjv4l2_frmsizeenumuh1hhhhKhj ubh }(hj hhhNhNubj)}(h``pixel_format``h]h pixel_format}(hjC 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 }(hjb hhhNhNubh)}(h :c:func:`VIDIOC_ENUM_FRAMESIZES`h]j)}(hjl h]hVIDIOC_ENUM_FRAMESIZES()}(hjn hhhNhNubah}(h]h ](jjc-funceh"]h$]h&]uh1jhjj ubah}(h]h ]h"]h$]h&]refdocj refdomainjreftypefunc refexplicitrefwarnjjjVIDIOC_ENUM_FRAMESIZESuh1hhhhKhjb ubh| for a coded pixel format will include all possible coded resolutions supported by the decoder for given coded pixel format.}(hjb hhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhKhj^ ubah}(h]h ]h"]h$]h&]uh1j hj[ 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&]uh1j hj[ ubeh}(h]h ]h"]h$]h&]j- j. uh1j hhhKhj ubeh}(h]h ]h"]h$]h&]uh1j hjs 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&]uh1j hjs hhhhhNubeh}(h]h ]h"]h$]h&]jjjhjjuh1jhjb hhhhhKubeh}(h]querying-capabilitiesah ]h"]querying capabilitiesah$]h&]uh1hhhhhhhhKubh)}(hhh](h)}(hInitializationh]hInitialization}(hjP hhhNhNubah}(h]h ]h"]h$]h&]uh1hhjM 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 }(hje hhhNhNubj)}(h ``OUTPUT``h]hOUTPUT}(hjm hhhNhNubah}(h]h ]h"]h$]h&]uh1jhje ubh via }(hje 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_FMTuh1hhhhMhje ubh.}(hje hhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhMhja 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&]uh1jhhhMhj ubj)}(h&``pixelformat`` a coded pixel format. h](j)}(h``pixelformat``h]j)}(hj- h]h pixelformat}(hj/ 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.}(hjE hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhM hjB ubah}(h]h ]h"]h$]h&]uh1j hj' ubeh}(h]h ]h"]h$]h&]uh1jhhhM 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}(hjg hhhNhNubah}(h]h ]h"]h$]h&]uh1jhjc ubh, }(hjc hhhNhNubj)}(h ``height``h]hheight}(hjy hhhNhNubah}(h]h ]h"]h$]h&]uh1jhjc ubeh}(h]h ]h"]h$]h&]uh1jhhhMhj_ 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 hj_ ubeh}(h]h ]h"]h$]h&]uh1jhhhMhj 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&]uh1jhhhMhj ubj)}(h(other fields follow standard semantics. h](j)}(h other fieldsh]h other fields}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1jhhhMhj ubj )}(hhh]h)}(hfollow standard semantics.h]hfollow standard semantics.}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhjubah}(h]h ]h"]h$]h&]uh1j hj ubeh}(h]h ]h"]h$]h&]uh1jhhhMhj ubeh}(h]h ]h"]h$]h&]uh1jhj ubeh}(h]h ]h"]h$]h&]uh1j hj ubj )}(hM**Returned fields:** ``sizeimage`` adjusted size of ``OUTPUT`` buffers. h](h)}(h**Returned fields:**h]j )}(hj5h]hReturned fields:}(hj7hhhNhNubah}(h]h ]h"]h$]h&]uh1j hj3ubah}(h]h ]h"]h$]h&]uh1hhhhMhj/ubj)}(hhh]j)}(h3``sizeimage`` adjusted size of ``OUTPUT`` buffers. h](j)}(h ``sizeimage``h]j)}(hjSh]h sizeimage}(hjUhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjQubah}(h]h ]h"]h$]h&]uh1jhhhMhjMubj )}(hhh]h)}(h$adjusted size of ``OUTPUT`` buffers.h](hadjusted size of }(hjkhhhNhNubj)}(h ``OUTPUT``h]hOUTPUT}(hjshhhNhNubah}(h]h ]h"]h$]h&]uh1jhjkubh buffers.}(hjkhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhMhjhubah}(h]h ]h"]h$]h&]uh1j hjMubeh}(h]h ]h"]h$]h&]uh1jhhhMhjJubah}(h]h ]h"]h$]h&]uh1jhj/ubeh}(h]h ]h"]h$]h&]uh1j hj 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&]uh1j hj ubeh}(h]h ]h"]h$]h&]j- j. uh1j hhhMhja 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 }(hjhhhNhNubj)}(h ``OUTPUT``h]hOUTPUT}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubh% format may change the currently set }(hjhhhNhNubj)}(h ``CAPTURE``h]hCAPTURE}(hj(hhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubh format. How the new }(hjhhhNhNubj)}(h ``CAPTURE``h]hCAPTURE}(hj:hhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubhf format is determined is up to the decoder and the client must ensure it matches its needs afterwards.}(hjhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhM)hj ubah}(h]h ]h"]h$]h&]uh1jhja ubeh}(h]h ]h"]h$]h&]uh1j hj^ 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 }(hjbhhhNhNubh)}(h:c:func:`VIDIOC_REQBUFS`h]j)}(hjlh]hVIDIOC_REQBUFS()}(hjnhhhNhNubah}(h]h ](jjc-funceh"]h$]h&]uh1jhjjubah}(h]h ]h"]h$]h&]refdocj refdomainjreftypefunc refexplicitrefwarnjjjVIDIOC_REQBUFSuh1hhhhM-hjbubh on }(hjbhhhNhNubj)}(h ``OUTPUT``h]hOUTPUT}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjbubh.}(hjbhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhM-hj^ubj )}(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&]uh1jhhhM3hjubj)}(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 }(hjhhhNhNubj)}(h``V4L2_BUF_TYPE_*``h]hV4L2_BUF_TYPE_*}(hj$hhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubh enum appropriate for }(hjhhhNhNubj)}(h ``OUTPUT``h]hOUTPUT}(hj6hhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubh.}(hjhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhM6hjubah}(h]h ]h"]h$]h&]uh1j hjubeh}(h]h ]h"]h$]h&]uh1jhhhM6hjubj)}(h'``memory`` follows standard semantics. h](j)}(h ``memory``h]j)}(hj`h]hmemory}(hjbhhhNhNubah}(h]h ]h"]h$]h&]uh1jhj^ubah}(h]h ]h"]h$]h&]uh1jhhhM9hjZubj )}(hhh]h)}(hfollows standard semantics.h]hfollows standard semantics.}(hjxhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhM9hjuubah}(h]h ]h"]h$]h&]uh1j hjZubeh}(h]h ]h"]h$]h&]uh1jhhhM9hjubeh}(h]h ]h"]h$]h&]uh1jhjubeh}(h]h ]h"]h$]h&]uh1j hjubj )}(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&]uh1jhhhM>hjubah}(h]h ]h"]h$]h&]uh1jhjubeh}(h]h ]h"]h$]h&]uh1j hjubeh}(h]h ]h"]h$]h&]j- j. uh1j hhhM0hj^ubhwarning)}(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}(hjhhhNhNubah}(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&]uh1jhj^ubh)}(h|Alternatively, :c:func:`VIDIOC_CREATE_BUFS` on the ``OUTPUT`` queue can be used to have more control over buffer allocation.h](hAlternatively, }(hjDhhhNhNubh)}(h:c:func:`VIDIOC_CREATE_BUFS`h]j)}(hjNh]hVIDIOC_CREATE_BUFS()}(hjPhhhNhNubah}(h]h ](jjc-funceh"]h$]h&]uh1jhjLubah}(h]h ]h"]h$]h&]refdocj refdomainjreftypefunc refexplicitrefwarnjjjVIDIOC_CREATE_BUFSuh1hhhhMFhjDubh on the }(hjDhhhNhNubj)}(h ``OUTPUT``h]hOUTPUT}(hjohhhNhNubah}(h]h ]h"]h$]h&]uh1jhjDubh? queue can be used to have more control over buffer allocation.}(hjDhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhMFhj^ubj )}(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&]uh1jhhhMLhjubj)}(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}(hjhhhNhNubah}(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&]uh1jhhhMOhjubj)}(h'``memory`` follows standard semantics. h](j)}(h ``memory``h]j)}(hjBh]hmemory}(hjDhhhNhNubah}(h]h ]h"]h$]h&]uh1jhj@ubah}(h]h ]h"]h$]h&]uh1jhhhMRhj<ubj )}(hhh]h)}(hfollows standard semantics.h]hfollows standard semantics.}(hjZhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMRhjWubah}(h]h ]h"]h$]h&]uh1j hj<ubeh}(h]h ]h"]h$]h&]uh1jhhhMRhjubj)}(h'``format`` follows standard semantics. h](j)}(h ``format``h]j)}(hjzh]hformat}(hj|hhhNhNubah}(h]h ]h"]h$]h&]uh1jhjxubah}(h]h ]h"]h$]h&]uh1jhhhMUhjtubj )}(hhh]h)}(hfollows standard semantics.h]hfollows standard semantics.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMUhjubah}(h]h ]h"]h$]h&]uh1j hjtubeh}(h]h ]h"]h$]h&]uh1jhhhMUhjubeh}(h]h ]h"]h$]h&]uh1jhjubeh}(h]h ]h"]h$]h&]uh1j hjubj )}(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&]uh1jhhhMZhjubah}(h]h ]h"]h$]h&]uh1jhjubeh}(h]h ]h"]h$]h&]uh1j hjubeh}(h]h ]h"]h$]h&]j- j. uh1j hhhMIhj^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&]uh1hhhhM^hj ubah}(h]h ]h"]h$]h&]uh1jhj^ubeh}(h]h ]h"]h$]h&]uh1j hj^ 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 }(hjfhhhNhNubj)}(h ``OUTPUT``h]hOUTPUT}(hjnhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjfubh queue via }(hjfhhhNhNubh)}(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_STREAMONuh1hhhhMbhjfubh.}(hjfhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhMbhjbubah}(h]h ]h"]h$]h&]uh1j hj^ 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}(hj!hhhNhNubah}(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}(hj3hhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubh event with }(hjhhhNhNubj)}(h ``changes``h]hchanges}(hjEhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubh set to }(hjhhhNhNubj)}(h ``V4L2_EVENT_SRC_CH_RESOLUTION``h]hV4L2_EVENT_SRC_CH_RESOLUTION}(hjWhhhNhNubah}(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.}(hjvhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMlhjrubah}(h]h ]h"]h$]h&]uh1j hjoubj )}(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&]uh1j hjoubj )}(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)}(hjh]hVIDIOC_TRY_FMT()}(hjhhhNhNubah}(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)}(hjh]hVIDIOC_REQBUFS()}(hjhhhNhNubah}(h]h ](jjc-funceh"]h$]h&]uh1jhjubah}(h]h ]h"]h$]h&]refdocj refdomainjreftypefunc refexplicitrefwarnjjjVIDIOC_REQBUFSuh1hhhhMthjubh on the }(hjhhhNhNubj)}(h ``CAPTURE``h]hCAPTURE}(hj:hhhNhNubah}(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}(hjLhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubh event with }(hjhhhNhNubj)}(h ``changes``h]hchanges}(hj^hhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubh set to }(hjhhhNhNubj)}(h ``V4L2_EVENT_SRC_CH_RESOLUTION``h]hV4L2_EVENT_SRC_CH_RESOLUTION}(hjphhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubh is signaled.}(hjhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhMthjubah}(h]h ]h"]h$]h&]uh1j hjoubeh}(h]h ]h"]h$]h&]j- j. 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&]uh1j hj^ hhhNhNubj )}(h,Continue with the `Capture Setup` sequence. h]h)}(h+Continue with the `Capture Setup` sequence.h](hContinue with the }(hjhhhNhNubj)}(h`Capture Setup`h]h Capture Setup}(hj'hhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubh sequence.}(hjhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhMhjubah}(h]h ]h"]h$]h&]uh1j hj^ hhhhhNubeh}(h]h ]h"]h$]h&]jjjhjjuh1jhjM hhhhhMubeh}(h]initializationah ]h"]initializationah$]h&]uh1hhhhhhhhMubh)}(hhh](h)}(h Capture Setuph]h Capture Setup}(hjVhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjShhhhhMubj)}(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 }(hjkhhhNhNubh)}(h:c:func:`VIDIOC_G_FMT`h]j)}(hjuh]hVIDIOC_G_FMT()}(hjwhhhNhNubah}(h]h ](jjc-funceh"]h$]h&]uh1jhjsubah}(h]h ]h"]h$]h&]refdocj refdomainjreftypefunc refexplicitrefwarnjjj VIDIOC_G_FMTuh1hhhhMhjkubh on the }(hjkhhhNhNubj)}(h ``CAPTURE``h]hCAPTURE}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjkubhT queue to get format for the destination buffers parsed/decoded from the bytestream.}(hjkhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhMhjgubj )}(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_*}(hjhhhNhNubah}(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&]uh1jhhhMhjubah}(h]h ]h"]h$]h&]uh1jhjubeh}(h]h ]h"]h$]h&]uh1j hjubj )}(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 )}(hj=h]hReturned fields:}(hj?hhhNhNubah}(h]h ]h"]h$]h&]uh1j hj;ubah}(h]h ]h"]h$]h&]uh1hhhhMhj7ubj)}(hhh](j)}(hF``width``, ``height`` frame buffer resolution for the decoded frames. h](j)}(h``width``, ``height``h](j)}(h ``width``h]hwidth}(hj]hhhNhNubah}(h]h ]h"]h$]h&]uh1jhjYubh, }(hjYhhhNhNubj)}(h ``height``h]hheight}(hjohhhNhNubah}(h]h ]h"]h$]h&]uh1jhjYubeh}(h]h ]h"]h$]h&]uh1jhhhMhjUubj )}(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 hjUubeh}(h]h ]h"]h$]h&]uh1jhhhMhjRubj)}(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&]uh1jhhhMhjRubj)}(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&]uh1hhhhMhj ubah}(h]h ]h"]h$]h&]uh1j hjubeh}(h]h ]h"]h$]h&]uh1jhhhMhjRubj)}(hY``sizeimage``, ``bytesperline`` as per standard semantics; matching frame buffer format. h](j)}(h``sizeimage``, ``bytesperline``h](j)}(h ``sizeimage``h]h sizeimage}(hj/hhhNhNubah}(h]h ]h"]h$]h&]uh1jhj+ubh, }(hj+hhhNhNubj)}(h``bytesperline``h]h bytesperline}(hjAhhhNhNubah}(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.}(hjXhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhjUubah}(h]h ]h"]h$]h&]uh1j hj'ubeh}(h]h ]h"]h$]h&]uh1jhhhMhjRubeh}(h]h ]h"]h$]h&]uh1jhj7ubeh}(h]h ]h"]h$]h&]uh1j hjubeh}(h]h ]h"]h$]h&]j- j. uh1j hhhMhjgubj)}(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&]uh1jhjgubeh}(h]h ]h"]h$]h&]uh1j hjdhhhNhNubj )}(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)}(hjh]htype}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubah}(h]h ]h"]h$]h&]uh1jhhhMhjubj )}(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&]uh1hhhhMhj3ubah}(h]h ]h"]h$]h&]uh1j hjubeh}(h]h ]h"]h$]h&]uh1jhhhMhjubj)}(h,``target`` set to ``V4L2_SEL_TGT_COMPOSE``. h](j)}(h ``target``h]j)}(hjzh]htarget}(hj|hhhNhNubah}(h]h ]h"]h$]h&]uh1jhjxubah}(h]h ]h"]h$]h&]uh1jhhhMhjtubj )}(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 hjtubeh}(h]h ]h"]h$]h&]uh1jhhhMhjubeh}(h]h ]h"]h$]h&]uh1jhjubeh}(h]h ]h"]h$]h&]uh1j hjubj )}(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}(hjhhhNhNubah}(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 }(hj=hhhNhNubh)}(h:c:func:`VIDIOC_G_FMT`h]j)}(hjGh]hVIDIOC_G_FMT()}(hjIhhhNhNubah}(h]h ](jjc-funceh"]h$]h&]uh1jhjEubah}(h]h ]h"]h$]h&]refdocj refdomainjreftypefunc refexplicitrefwarnjjj VIDIOC_G_FMTuh1hhhhMhj=ubh on }(hj=hhhNhNubj)}(h ``CAPTURE``h]hCAPTURE}(hjhhhhNhNubah}(h]h ]h"]h$]h&]uh1jhj=ubh.}(hj=hhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhMhj:ubah}(h]h ]h"]h$]h&]uh1j hjubeh}(h]h ]h"]h$]h&]uh1jhhhMhjubah}(h]h ]h"]h$]h&]uh1jhjubeh}(h]h ]h"]h$]h&]uh1j hjubj )}(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&]uh1jhhhMhjubj)}(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&]uh1jhhhMhjubj )}(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 }(hjhhhNhNubj)}(h ``CAPTURE``h]hCAPTURE}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubh buffer that contains meaningful picture data (visible area); width and height will be equal to the visible resolution of the stream.}(hjhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhMhjubah}(h]h ]h"]h$]h&]uh1j hjubeh}(h]h ]h"]h$]h&]uh1jhhhMhjubj)}(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)}(hjGh]hV4L2_SEL_TGT_CROP}(hjIhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjEubah}(h]h ]h"]h$]h&]uh1jhhhMhjAubj )}(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 }(hj_hhhNhNubj)}(h ``CAPTURE``h]hCAPTURE}(hjghhhNhNubah}(h]h ]h"]h$]h&]uh1jhj_ubh; defaults to }(hj_hhhNhNubj)}(h``V4L2_SEL_TGT_CROP_DEFAULT``h]hV4L2_SEL_TGT_CROP_DEFAULT}(hjyhhhNhNubah}(h]h ]h"]h$]h&]uh1jhj_ubhH; read-only on hardware without additional compose/scaling capabilities.}(hj_hhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhMhj\ubah}(h]h ]h"]h$]h&]uh1j hjAubeh}(h]h ]h"]h$]h&]uh1jhhhMhjubj)}(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&]uh1jhhhMhjubj)}(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&]uh1jhhhMhjubj )}(hhh]h)}(hequal to ``V4L2_SEL_TGT_CROP``.h](h equal to }(hjhhhNhNubj)}(h``V4L2_SEL_TGT_CROP``h]hV4L2_SEL_TGT_CROP}(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&]uh1jhhhMhjubj)}(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)}(hjIh]hV4L2_SEL_TGT_COMPOSE}(hjKhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjGubah}(h]h ]h"]h$]h&]uh1jhhhMhjCubj )}(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 }(hjahhhNhNubj)}(h ``CAPTURE``h]hCAPTURE}(hjihhhNhNubah}(h]h ]h"]h$]h&]uh1jhjaubh= buffer into which the cropped frame is written; defaults to }(hjahhhNhNubj)}(h ``V4L2_SEL_TGT_COMPOSE_DEFAULT``h]hV4L2_SEL_TGT_COMPOSE_DEFAULT}(hj{hhhNhNubah}(h]h ]h"]h$]h&]uh1jhjaubhH; read-only on hardware without additional compose/scaling capabilities.}(hjahhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhMhj^ubah}(h]h ]h"]h$]h&]uh1j hjCubeh}(h]h ]h"]h$]h&]uh1jhhhMhjubj)}(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&]uh1jhhhMhjubeh}(h]h ]h"]h$]h&]uh1jhjubeh}(h]h ]h"]h$]h&]uh1j hjubeh}(h]h ]h"]h$]h&]j- j. 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.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhj ubah}(h]h ]h"]h$]h&]uh1jhjubeh}(h]h ]h"]h$]h&]uh1j hjdhhhNhNubj )}(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.}(hj3hhhNhNubah}(h]h ]h"]h$]h&]uh1j hj/ubh Enumerate }(hj/hhhNhNubj)}(h ``CAPTURE``h]hCAPTURE}(hjEhhhNhNubah}(h]h ]h"]h$]h&]uh1jhj/ubh formats via }(hj/hhhNhNubh)}(h:c:func:`VIDIOC_ENUM_FMT`h]j)}(hjYh]hVIDIOC_ENUM_FMT()}(hj[hhhNhNubah}(h]h ](jjc-funceh"]h$]h&]uh1jhjWubah}(h]h ]h"]h$]h&]refdocj refdomainjreftypefunc refexplicitrefwarnjjjVIDIOC_ENUM_FMTuh1hhhhMhj/ubh on the }(hj/hhhNhNubj)}(h ``CAPTURE``h]hCAPTURE}(hjzhhhNhNubah}(h]h ]h"]h$]h&]uh1jhj/ubh 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 }(hj/hhhNhNubh)}(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_FMTuh1hhhhMhj/ubh.}(hj/hhhNhNubeh}(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)}(hjh]hVIDIOC_ENUM_FMT()}(hjhhhNhNubah}(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 }(hjhhhNhNubh)}(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_FMTuh1hhhhMhjubh- would return RGB formats again in that case.}(hjhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhMhjubeh}(h]h ]h"]h$]h&]uh1jhj+ubeh}(h]h ]h"]h$]h&]uh1j hjdhhhNhNubj )}(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.}(hjahhhNhNubah}(h]h ]h"]h$]h&]uh1j hj]ubh Set the }(hj]hhhNhNubj)}(h ``CAPTURE``h]hCAPTURE}(hjshhhNhNubah}(h]h ]h"]h$]h&]uh1jhj]ubh format via }(hj]hhhNhNubh)}(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_FMTuh1hhhhMhj]ubh on the }(hj]hhhNhNubj)}(h ``CAPTURE``h]hCAPTURE}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhj]ubh[ queue. The client may choose a different format than selected/suggested by the decoder in }(hj]hhhNhNubh)}(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_FMTuh1hhhhMhj]ubh.}(hj]hhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhMhjYubj )}(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)}(hj h]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 }(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 hjubah}(h]h ]h"]h$]h&]uh1j hjubeh}(h]h ]h"]h$]h&]uh1jhhhM hjubj)}(h$``pixelformat`` a raw pixel format. h](j)}(h``pixelformat``h]j)}(hjfh]h pixelformat}(hjhhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjdubah}(h]h ]h"]h$]h&]uh1jhhhMhj`ubj )}(hhh]h)}(ha raw pixel format.h]ha raw pixel format.}(hj~hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhj{ubah}(h]h ]h"]h$]h&]uh1j hj`ubeh}(h]h ]h"]h$]h&]uh1jhhhMhjubj)}(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&]uh1jhhhMhjubeh}(h]h ]h"]h$]h&]uh1jhjubeh}(h]h ]h"]h$]h&]uh1j hjubah}(h]h ]h"]h$]h&]j- j. uh1j hhhM hjYubeh}(h]h ]h"]h$]h&]uh1j hjdhhhNhNubeh}(h]h ]h"]h$]h&]jjjhjjuh1jhjShhhhhMubh 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 }(hj1 hhhNhNubj)}(h ``CAPTURE``h]hCAPTURE}(hj9 hhhNhNubah}(h]h ]h"]h$]h&]uh1jhj1 ubh format will reset the compose selection rectangles to their default values, based on the new resolution, as described in the previous step.}(hj1 hhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhMhj- ubah}(h]h ]h"]h$]h&]uh1j hj* ubah}(h]h ]h"]h$]h&]j- j. uh1j hhhMhj& ubah}(h]h ]h"]h$]h&]uh1j$ hhhMhjShhubj)}(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.}(hjn hhhNhNubah}(h]h ]h"]h$]h&]uh1j hjj ubh Set the compose rectangle via }(hjj 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_SELECTIONuh1hhhhMhjj ubh on the }(hjj hhhNhNubj)}(h ``CAPTURE``h]hCAPTURE}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1jhjj ubhS queue if it is desired and if the decoder has compose and/or scaling capabilities.}(hjj hhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhMhjf 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&]uh1jhhhM"hj ubj)}(h,``target`` set to ``V4L2_SEL_TGT_COMPOSE``. h](j)}(h ``target``h]j)}(hj>!h]htarget}(hj@!hhhNhNubah}(h]h ]h"]h$]h&]uh1jhjhju#ubh to add new buffers.}(hju#hhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhM>hjq#ubah}(h]h ]h"]h$]h&]uh1j hjH#ubeh}(h]h ]h"]h$]h&]j- j. uh1j hhhM;hj6#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&]uh1hhhhMChj6#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&]uh1j hj#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}(hj.$hhhNhNubah}(h]h ]h"]h$]h&]uh1jhj&$ubh queue is not streaming, call }(hj&$hhhNhNubh)}(h:c:func:`VIDIOC_STREAMON`h]j)}(hjB$h]hVIDIOC_STREAMON()}(hjD$hhhNhNubah}(h]h ](jjc-funceh"]h$]h&]uh1jhj@$ubah}(h]h ]h"]h$]h&]refdocj refdomainjreftypefunc refexplicitrefwarnjjjVIDIOC_STREAMONuh1hhhhMIhj&$ubh on the }(hj&$hhhNhNubj)}(h ``CAPTURE``h]hCAPTURE}(hjc$hhhNhNubah}(h]h ]h"]h$]h&]uh1jhj&$ubh queue.}(hj&$hhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhMIhj"$ubah}(h]h ]h"]h$]h&]uh1j hj#ubeh}(h]h ]h"]h$]h&]j- j. uh1j hhhMFhj6#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&]uh1hhhhMLhj6#ubeh}(h]h ]h"]h$]h&]uh1j hjc 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&]uh1j hjc 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}(hj#%hhhNhNubah}(h]h ]h"]h$]h&]uh1jhj %ubh }hj %sbj )}(h**queue is streaming,**h]hqueue is streaming,}(hj5%hhhNhNubah}(h]h ]h"]h$]h&]uh1j hj %ubh call }(hj %hhhNhNubh)}(h:c:func:`VIDIOC_STREAMOFF`h]j)}(hjI%h]hVIDIOC_STREAMOFF()}(hjK%hhhNhNubah}(h]h ](jjc-funceh"]h$]h&]uh1jhjG%ubah}(h]h ]h"]h$]h&]refdocj refdomainjreftypefunc refexplicitrefwarnjjjVIDIOC_STREAMOFFuh1hhhhMThj %ubh on the }(hj %hhhNhNubj)}(h ``CAPTURE``h]hCAPTURE}(hjj%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&]uh1j hjc 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&]uh1jhj%&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 )}(hjW&h]hRequired fields:}(hjY&hhhNhNubah}(h]h ]h"]h$]h&]uh1j hjU&ubah}(h]h ]h"]h$]h&]uh1hhhhM`hjQ&ubj)}(hhh](j)}(h``count`` set to 0. h](j)}(h ``count``h]j)}(hju&h]hcount}(hjw&hhhNhNubah}(h]h ]h"]h$]h&]uh1jhjs&ubah}(h]h ]h"]h$]h&]uh1jhhhMchjo&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 hjo&ubeh}(h]h ]h"]h$]h&]uh1jhhhMchjl&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&]uh1jhhhMfhjl&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.}(hj!'hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMihj'ubah}(h]h ]h"]h$]h&]uh1j hj'ubeh}(h]h ]h"]h$]h&]uh1jhhhMihjl&ubeh}(h]h ]h"]h$]h&]uh1jhjQ&ubeh}(h]h ]h"]h$]h&]uh1j hjN&ubah}(h]h ]h"]h$]h&]j- j. uh1j hhhM`hj%ubeh}(h]h ]h"]h$]h&]uh1j hjc 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 }(hjW'hhhNhNubj)}(h ``CAPTURE``h]hCAPTURE}(hj_'hhhNhNubah}(h]h ]h"]h$]h&]uh1jhjW'ubh buffers via }(hjW'hhhNhNubh)}(h:c:func:`VIDIOC_REQBUFS`h]j)}(hjs'h]hVIDIOC_REQBUFS()}(hju'hhhNhNubah}(h]h ](jjc-funceh"]h$]h&]uh1jhjq'ubah}(h]h ]h"]h$]h&]refdocj refdomainjreftypefunc refexplicitrefwarnjjjVIDIOC_REQBUFSuh1hhhhMkhjW'ubh on the }(hjW'hhhNhNubj)}(h ``CAPTURE``h]hCAPTURE}(hj'hhhNhNubah}(h]h ]h"]h$]h&]uh1jhjW'ubh queue.}(hjW'hhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhMkhjS'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&]uh1jhhhMqhj'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 }(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&]uh1hhhhMthj (ubah}(h]h ]h"]h$]h&]uh1j hj(ubeh}(h]h ]h"]h$]h&]uh1jhhhMthj'ubj)}(h'``memory`` follows standard semantics. h](j)}(h ``memory``h]j)}(hjg(h]hmemory}(hji(hhhNhNubah}(h]h ]h"]h$]h&]uh1jhje(ubah}(h]h ]h"]h$]h&]uh1jhhhMwhja(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 hja(ubeh}(h]h ]h"]h$]h&]uh1jhhhMwhj'ubeh}(h]h ]h"]h$]h&]uh1jhj'ubeh}(h]h ]h"]h$]h&]uh1j hj'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&]uh1jhhhM|hj(ubah}(h]h ]h"]h$]h&]uh1jhj(ubeh}(h]h ]h"]h$]h&]uh1j hj'ubeh}(h]h ]h"]h$]h&]j- j. uh1j hhhMnhjS'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&]uh1jhjS'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 }(hjM)hhhNhNubj)}(h$``V4L2_CID_MIN_BUFFERS_FOR_CAPTURE``h]h V4L2_CID_MIN_BUFFERS_FOR_CAPTURE}(hjU)hhhNhNubah}(h]h ]h"]h$]h&]uh1jhjM)ubh control to get the minimum number of buffers required, and pass the obtained value plus the number of additional buffers needed in the }(hjM)hhhNhNubj)}(h ``count``h]hcount}(hjg)hhhNhNubah}(h]h ]h"]h$]h&]uh1jhjM)ubh field to }(hjM)hhhNhNubh)}(h:c:func:`VIDIOC_REQBUFS`h]j)}(hj{)h]hVIDIOC_REQBUFS()}(hj})hhhNhNubah}(h]h ](jjc-funceh"]h$]h&]uh1jhjy)ubah}(h]h ]h"]h$]h&]refdocj refdomainjreftypefunc refexplicitrefwarnjjjVIDIOC_REQBUFSuh1hhhhMhjM)ubh.}(hjM)hhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhMhjI)ubah}(h]h ]h"]h$]h&]uh1jhjS'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&]uh1hhhhMhjS'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)}(hj$*h]hcount}(hj&*hhhNhNubah}(h]h ]h"]h$]h&]uh1jhj"*ubah}(h]h ]h"]h$]h&]uh1jhhhMhj*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&]uh1hhhhMhj9*ubah}(h]h ]h"]h$]h&]uh1j hj*ubeh}(h]h ]h"]h$]h&]uh1jhhhMhj*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&]uh1jhjZ*ubah}(h]h ]h"]h$]h&]uh1jhhhMhjV*ubj )}(hhh]h)}(h7a ``V4L2_BUF_TYPE_*`` enum appropriate for ``CAPTURE``.h](ha }(hjt*hhhNhNubj)}(h``V4L2_BUF_TYPE_*``h]hV4L2_BUF_TYPE_*}(hj|*hhhNhNubah}(h]h ]h"]h$]h&]uh1jhjt*ubh enum appropriate for }(hjt*hhhNhNubj)}(h ``CAPTURE``h]hCAPTURE}(hj*hhhNhNubah}(h]h ]h"]h$]h&]uh1jhjt*ubh.}(hjt*hhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhMhjq*ubah}(h]h ]h"]h$]h&]uh1j hjV*ubeh}(h]h ]h"]h$]h&]uh1jhhhMhj*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&]uh1jhhhMhj*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&]uh1jhhhMhj*ubeh}(h]h ]h"]h$]h&]uh1jhj*ubeh}(h]h ]h"]h$]h&]uh1j hj)ubj )}(hQ**Returned fields:** ``count`` adjusted to the number of allocated buffers. h](h)}(h**Returned fields:**h]j )}(hj4+h]hReturned fields:}(hj6+hhhNhNubah}(h]h ]h"]h$]h&]uh1j hj2+ubah}(h]h ]h"]h$]h&]uh1hhhhMhj.+ubj)}(hhh]j)}(h7``count`` adjusted to the number of allocated buffers. h](j)}(h ``count``h]j)}(hjR+h]hcount}(hjT+hhhNhNubah}(h]h ]h"]h$]h&]uh1jhjP+ubah}(h]h ]h"]h$]h&]uh1jhhhMhjL+ubj )}(hhh]h)}(h,adjusted to the number of allocated buffers.h]h,adjusted to the number of allocated buffers.}(hjj+hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhjg+ubah}(h]h ]h"]h$]h&]uh1j hjL+ubeh}(h]h ]h"]h$]h&]uh1jhhhMhjI+ubah}(h]h ]h"]h$]h&]uh1jhj.+ubeh}(h]h ]h"]h$]h&]uh1j hj)ubeh}(h]h ]h"]h$]h&]j- j. uh1j hhhMhjS'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&]uh1jhjS'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&]uh1j hj+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}(hj/,hhhNhNubah}(h]h ]h"]h$]h&]uh1jhj',ubh format using }(hj',hhhNhNubh)}(h:c:func:`VIDIOC_G_FMT`h]j)}(hjC,h]hVIDIOC_G_FMT()}(hjE,hhhNhNubah}(h]h ](jjc-funceh"]h$]h&]uh1jhjA,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&]uh1hhhhMhj#,ubah}(h]h ]h"]h$]h&]uh1j hj+ubeh}(h]h ]h"]h$]h&]j- j. 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 }(hjv,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_BUFSuh1hhhhMhjv,ubh& in this step to allocate the buffers.}(hjv,hhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhMhj+ubeh}(h]h ]h"]h$]h&]uh1jhjS'ubeh}(h]h ]h"]h$]h&]uh1j hjc 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&]uh1j hjc hhhhhNubeh}(h]h ]h"]h$]h&]jjjhjjstartKuh1jhjShhhhhMubeh}(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 }(hj -hhhNhNubj)}(h`Capture Setup`h]h Capture Setup}(hj(-hhhNhNubah}(h]h ]h"]h$]h&]uh1jhj -ubhj sequence finishes successfully. In this state, the client queues and dequeues buffers to both queues via }(hj -hhhNhNubh)}(h:c:func:`VIDIOC_QBUF`h]j)}(hj<-h]h VIDIOC_QBUF()}(hj>-hhhNhNubah}(h]h ](jjc-funceh"]h$]h&]uh1jhj:-ubah}(h]h ]h"]h$]h&]refdocj refdomainjreftypefunc refexplicitrefwarnjjj VIDIOC_QBUFuh1hhhhMhj -ubh and }(hj -hhhNhNubh)}(h:c:func:`VIDIOC_DQBUF`h]j)}(hj_-h]hVIDIOC_DQBUF()}(hja-hhhNhNubah}(h]h ](jjc-funceh"]h$]h&]uh1jhj]-ubah}(h]h ]h"]h$]h&]refdocj refdomainjreftypefunc refexplicitrefwarnjjj VIDIOC_DQBUFuh1hhhhMhj -ubh#, following the standard semantics.}(hj -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&]uh1j hj .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 }(hjM.hhhNhNubj)}(h ``OUTPUT``h]hOUTPUT}(hjU.hhhNhNubah}(h]h ]h"]h$]h&]uh1jhjM.ubh0 may result in more than one buffer produced on }(hjM.hhhNhNubj)}(h ``CAPTURE``h]hCAPTURE}(hjg.hhhNhNubah}(h]h ]h"]h$]h&]uh1jhjM.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),}(hjM.hhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhMhjI.ubah}(h]h ]h"]h$]h&]uh1j hj .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&]uh1j hj .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&]uh1j hj .hhhhhNubeh}(h]h ]h"]h$]h&]j- j. 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 }(hj=/hhhNhNubj)}(h ``CAPTURE``h]hCAPTURE}(hjE/hhhNhNubah}(h]h ]h"]h$]h&]uh1jhj=/ubh buffers with }(hj=/hhhNhNubj)}(h ``OUTPUT``h]hOUTPUT}(hjW/hhhNhNubah}(h]h ]h"]h$]h&]uh1jhj=/ubh6 buffers they originated from, the client can set the }(hj=/hhhNhNubj)}(h ``timestamp``h]h timestamp}(hji/hhhNhNubah}(h]h ]h"]h$]h&]uh1jhj=/ubh field of the }(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 struct when queuing an }(hj=/hhhNhNubj)}(h ``OUTPUT``h]hOUTPUT}(hj/hhhNhNubah}(h]h ]h"]h$]h&]uh1jhj=/ubh buffer. The }(hj=/hhhNhNubj)}(h ``CAPTURE``h]hCAPTURE}(hj/hhhNhNubah}(h]h ]h"]h$]h&]uh1jhj=/ubh. buffer(s), which resulted from decoding that }(hj=/hhhNhNubj)}(h ``OUTPUT``h]hOUTPUT}(hj/hhhNhNubah}(h]h ]h"]h$]h&]uh1jhj=/ubh buffer will have their }(hj=/hhhNhNubj)}(h ``timestamp``h]h timestamp}(hj/hhhNhNubah}(h]h ]h"]h$]h&]uh1jhj=/ubh+ field set to the same value when dequeued.}(hj=/hhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhMhj9/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 }(hj/hhhNhNubj)}(h ``OUTPUT``h]hOUTPUT}(hj/hhhNhNubah}(h]h ]h"]h$]h&]uh1jhj/ubh buffer producing one }(hj/hhhNhNubj)}(h ``CAPTURE``h]hCAPTURE}(hj0hhhNhNubah}(h]h ]h"]h$]h&]uh1jhj/ubh) buffer, the following cases are defined:}(hj/hhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhMhj9/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 }(hj%0hhhNhNubj)}(h ``OUTPUT``h]hOUTPUT}(hj-0hhhNhNubah}(h]h ]h"]h$]h&]uh1jhj%0ubh buffer generates multiple }(hj%0hhhNhNubj)}(h ``CAPTURE``h]hCAPTURE}(hj?0hhhNhNubah}(h]h ]h"]h$]h&]uh1jhj%0ubh buffers: the same }(hj%0hhhNhNubj)}(h ``OUTPUT``h]hOUTPUT}(hjQ0hhhNhNubah}(h]h ]h"]h$]h&]uh1jhj%0ubh& timestamp will be copied to multiple }(hj%0hhhNhNubj)}(h ``CAPTURE``h]hCAPTURE}(hjc0hhhNhNubah}(h]h ]h"]h$]h&]uh1jhj%0ubh buffers.}(hj%0hhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhMhj!0ubah}(h]h ]h"]h$]h&]uh1j hj0ubj )}(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&]uh1j hj0ubj )}(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;hhhNhNubj)}(h`Capture Setup`h]h Capture Setup}(hjF;hhhNhNubah}(h]h ]h"]h$]h&]uh1jhj>;ubh sequence.}(hj>;hhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhMhj:;ubah}(h]h ]h"]h$]h&]uh1j hjh:hhhhhNubeh}(h]h ]h"]h$]h&]jjjhjjuh1jhj7hhhhhMubj)}(hXDuring the resolution change sequence, the ``OUTPUT`` queue must remain streaming. Calling :c:func:`VIDIOC_STREAMOFF` on the ``OUTPUT`` queue would abort the sequence and initiate a seek. In principle, the ``OUTPUT`` queue operates separately from the ``CAPTURE`` queue and this remains true for the duration of the entire resolution change sequence as well. The client should, for best performance and simplicity, keep queuing/dequeuing buffers to/from the ``OUTPUT`` queue even while processing this sequence.h](h)}(hDuring the resolution change sequence, the ``OUTPUT`` queue must remain streaming. Calling :c:func:`VIDIOC_STREAMOFF` on the ``OUTPUT`` queue would abort the sequence and initiate a seek.h](h+During the resolution change sequence, the }(hjn;hhhNhNubj)}(h ``OUTPUT``h]hOUTPUT}(hjv;hhhNhNubah}(h]h ]h"]h$]h&]uh1jhjn;ubh& queue must remain streaming. Calling }(hjn;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_STREAMOFFuh1hhhhMhjn;ubh on the }(hjn;hhhNhNubj)}(h ``OUTPUT``h]hOUTPUT}(hj;hhhNhNubah}(h]h ]h"]h$]h&]uh1jhjn;ubh4 queue would abort the sequence and initiate a seek.}(hjn;hhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhMhjj;ubh)}(hIn principle, the ``OUTPUT`` queue operates separately from the ``CAPTURE`` queue and this remains true for the duration of the entire resolution change sequence as well.h](hIn principle, the }(hj;hhhNhNubj)}(h ``OUTPUT``h]hOUTPUT}(hj;hhhNhNubah}(h]h ]h"]h$]h&]uh1jhj;ubh$ queue operates separately from the }(hj;hhhNhNubj)}(h ``CAPTURE``h]hCAPTURE}(hj;hhhNhNubah}(h]h ]h"]h$]h&]uh1jhj;ubh_ queue and this remains true for the duration of the entire resolution change sequence as well.}(hj;hhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhMhjj;ubh)}(hThe client should, for best performance and simplicity, keep queuing/dequeuing buffers to/from the ``OUTPUT`` queue even while processing this sequence.h](hcThe client should, for best performance and simplicity, keep queuing/dequeuing buffers to/from the }(hj;hhhNhNubj)}(h ``OUTPUT``h]hOUTPUT}(hj;hhhNhNubah}(h]h ]h"]h$]h&]uh1jhj;ubh+ queue even while processing this sequence.}(hj;hhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhMhjj;ubeh}(h]h ]h"]h$]h&]uh1jhj7hhhhhNubeh}(h]dynamic-resolution-changeah ]h"]dynamic resolution changeah$]h&]uh1hhhhhhhhMubh)}(hhh](h)}(hDrainh]hDrain}(hj&<hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj#<hhhhhMubh)}(hXATo ensure that all queued ``OUTPUT`` buffers have been processed and related ``CAPTURE`` buffers are given to the client, the client must follow the drain sequence described below. After the drain sequence ends, the client has received all decoded frames for all ``OUTPUT`` buffers queued before the sequence was started.h](hTo ensure that all queued }(hj4<hhhNhNubj)}(h ``OUTPUT``h]hOUTPUT}(hj<<hhhNhNubah}(h]h ]h"]h$]h&]uh1jhj4<ubh) buffers have been processed and related }(hj4<hhhNhNubj)}(h ``CAPTURE``h]hCAPTURE}(hjN<hhhNhNubah}(h]h ]h"]h$]h&]uh1jhj4<ubh buffers are given to the client, the client must follow the drain sequence described below. After the drain sequence ends, the client has received all decoded frames for all }(hj4<hhhNhNubj)}(h ``OUTPUT``h]hOUTPUT}(hj`<hhhNhNubah}(h]h ]h"]h$]h&]uh1jhj4<ubh0 buffers queued before the sequence was started.}(hj4<hhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhMhj#<hhubj)}(hhh](j )}(hX%Begin drain by issuing :c:func:`VIDIOC_DECODER_CMD`. * **Required fields:** ``cmd`` set to ``V4L2_DEC_CMD_STOP``. ``flags`` set to 0. ``pts`` set to 0. .. warning:: The sequence can be only initiated if both ``OUTPUT`` and ``CAPTURE`` queues are streaming. For compatibility reasons, the call to :c:func:`VIDIOC_DECODER_CMD` will not fail even if any of the queues is not streaming, but at the same time it will not initiate the `Drain` sequence and so the steps described below would not be applicable. h](h)}(h4Begin drain by issuing :c:func:`VIDIOC_DECODER_CMD`.h](hBegin drain by issuing }(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<ubh.}(hj<hhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhMhj{<ubj )}(hhh]j )}(hp**Required fields:** ``cmd`` set to ``V4L2_DEC_CMD_STOP``. ``flags`` set to 0. ``pts`` set to 0. 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)}(h&``cmd`` set to ``V4L2_DEC_CMD_STOP``. h](j)}(h``cmd``h]j)}(hj<h]hcmd}(hj<hhhNhNubah}(h]h ]h"]h$]h&]uh1jhj<ubah}(h]h ]h"]h$]h&]uh1jhhhMhj<ubj )}(hhh]h)}(hset to ``V4L2_DEC_CMD_STOP``.h](hset to }(hj<hhhNhNubj)}(h``V4L2_DEC_CMD_STOP``h]hV4L2_DEC_CMD_STOP}(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&]uh1jhhhMhj<ubj)}(h``flags`` set to 0. h](j)}(h ``flags``h]j)}(hj!=h]hflags}(hj#=hhhNhNubah}(h]h ]h"]h$]h&]uh1jhj=ubah}(h]h ]h"]h$]h&]uh1jhhhMhj=ubj )}(hhh]h)}(h set to 0.h]h set to 0.}(hj9=hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhj6=ubah}(h]h ]h"]h$]h&]uh1j hj=ubeh}(h]h ]h"]h$]h&]uh1jhhhMhj<ubj)}(h``pts`` set to 0. h](j)}(h``pts``h]j)}(hjY=h]hpts}(hj[=hhhNhNubah}(h]h ]h"]h$]h&]uh1jhjW=ubah}(h]h ]h"]h$]h&]uh1jhhhMhjS=ubj )}(hhh]h)}(h set to 0.h]h set to 0.}(hjq=hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhjn=ubah}(h]h ]h"]h$]h&]uh1j hjS=ubeh}(h]h ]h"]h$]h&]uh1jhhhMhj<ubeh}(h]h ]h"]h$]h&]uh1jhj<ubeh}(h]h ]h"]h$]h&]uh1j hj<ubah}(h]h ]h"]h$]h&]j- j. uh1j hhhMhj{<ubj)}(hXRThe sequence can be only initiated if both ``OUTPUT`` and ``CAPTURE`` queues are streaming. For compatibility reasons, the call to :c:func:`VIDIOC_DECODER_CMD` will not fail even if any of the queues is not streaming, but at the same time it will not initiate the `Drain` sequence and so the steps described below would not be applicable.h]h)}(hXRThe sequence can be only initiated if both ``OUTPUT`` and ``CAPTURE`` queues are streaming. For compatibility reasons, the call to :c:func:`VIDIOC_DECODER_CMD` will not fail even if any of the queues is not streaming, but at the same time it will not initiate the `Drain` sequence and so the steps described below would not be applicable.h](h+The sequence can be only initiated if both }(hj=hhhNhNubj)}(h ``OUTPUT``h]hOUTPUT}(hj=hhhNhNubah}(h]h ]h"]h$]h&]uh1jhj=ubh and }(hj=hhhNhNubj)}(h ``CAPTURE``h]hCAPTURE}(hj=hhhNhNubah}(h]h ]h"]h$]h&]uh1jhj=ubh> 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&]uh1j hjx<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 }(hj>hhhNhNubj)}(h ``OUTPUT``h]hOUTPUT}(hj >hhhNhNubah}(h]h ]h"]h$]h&]uh1jhj>ubh) buffers queued by the client before the }(hj>hhhNhNubh)}(h:c:func:`VIDIOC_DECODER_CMD`h]j)}(hj4>h]hVIDIOC_DECODER_CMD()}(hj6>hhhNhNubah}(h]h ](jjc-funceh"]h$]h&]uh1jhj2>ubah}(h]h ]h"]h$]h&]refdocj refdomainjreftypefunc refexplicitrefwarnjjjVIDIOC_DECODER_CMDuh1hhhhMhj>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:}(hj>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 }(hjb>hhhNhNubj)}(h`Dynamic Resolution Change`h]hDynamic Resolution Change}(hjj>hhhNhNubah}(h]h ]h"]h$]h&]uh1jhjb>ubh5 sequence, before continuing with the drain sequence,}(hjb>hhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhMhj^>ubah}(h]h ]h"]h$]h&]uh1j hj[>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&]uh1hhhhM hj>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}(hj?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}(hj)?hhhNhNubah}(h]h ]h"]h$]h&]uh1jhj?ubh$ will result in a -EPIPE error from }(hj?hhhNhNubh)}(h:c:func:`VIDIOC_DQBUF`h]j)}(hj=?h]hVIDIOC_DQBUF()}(hj??hhhNhNubah}(h]h ](jjc-funceh"]h$]h&]uh1jhj;?ubah}(h]h ]h"]h$]h&]refdocj refdomainjreftypefunc refexplicitrefwarnjjj VIDIOC_DQBUFuh1hhhhMhj?ubh.}(hj?hhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhMhj ?ubah}(h]h ]h"]h$]h&]uh1jhj>ubeh}(h]h ]h"]h$]h&]uh1j hj[>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 }(hjt?hhhNhNubj)}(h ``OUTPUT``h]hOUTPUT}(hj|?hhhNhNubah}(h]h ]h"]h$]h&]uh1jhjt?ubh2 buffers, until all the buffers queued before the }(hjt?hhhNhNubj)}(h``V4L2_DEC_CMD_STOP``h]hV4L2_DEC_CMD_STOP}(hj?hhhNhNubah}(h]h ]h"]h$]h&]uh1jhjt?ubh command are dequeued,}(hjt?hhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhMhjp?ubah}(h]h ]h"]h$]h&]uh1j hj[>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&]uh1hhhhMhj?ubah}(h]h ]h"]h$]h&]uh1j hj[>ubeh}(h]h ]h"]h$]h&]j- j. uh1j hhhMhj>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&]uh1j hjx<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 }(hj"@hhhNhNubj)}(h ``OUTPUT``h]hOUTPUT}(hj*@hhhNhNubah}(h]h ]h"]h$]h&]uh1jhj"@ubh 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 call are dequeued and the last }(hj"@hhhNhNubj)}(h ``CAPTURE``h]hCAPTURE}(hjN@hhhNhNubah}(h]h ]h"]h$]h&]uh1jhj"@ubhb buffer is dequeued, the decoder is stopped and it will accept, but not process, any newly queued }(hj"@hhhNhNubj)}(h ``OUTPUT``h]hOUTPUT}(hj`@hhhNhNubah}(h]h ]h"]h$]h&]uh1jhj"@ubhA buffers until the client issues any of the following operations:}(hj"@hhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhM'hj@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&]uh1j hjx@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_STREAMOFFuh1hhhhM/hj@ubh and }(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_STREAMONuh1hhhhM/hj@ubh on the }(hj@hhhNhNubj)}(h ``CAPTURE``h]hCAPTURE}(hj@hhhNhNubah}(h]h ]h"]h$]h&]uh1jhj@ubhE queue - the decoder will resume the operation normally, however any }(hj@hhhNhNubj)}(h ``CAPTURE``h]hCAPTURE}(hjAhhhNhNubah}(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&]uh1hhhhM/hj@ubah}(h]h ]h"]h$]h&]uh1j hjx@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 }(hj'AhhhNhNubh)}(h:c:func:`VIDIOC_STREAMOFF`h]j)}(hj1Ah]hVIDIOC_STREAMOFF()}(hj3AhhhNhNubah}(h]h ](jjc-funceh"]h$]h&]uh1jhj/Aubah}(h]h ]h"]h$]h&]refdocj refdomainjreftypefunc refexplicitrefwarnjjjVIDIOC_STREAMOFFuh1hhhhM4hj'Aubh and }(hj'AhhhNhNubh)}(h:c:func:`VIDIOC_STREAMON`h]j)}(hjTAh]hVIDIOC_STREAMON()}(hjVAhhhNhNubah}(h]h ](jjc-funceh"]h$]h&]uh1jhjRAubah}(h]h ]h"]h$]h&]refdocj refdomainjreftypefunc refexplicitrefwarnjjjVIDIOC_STREAMONuh1hhhhM4hj'Aubh on the }(hj'AhhhNhNubj)}(h ``OUTPUT``h]hOUTPUT}(hjuAhhhNhNubah}(h]h ]h"]h$]h&]uh1jhj'AubhK queue - any pending source buffers will be returned to the client and the }(hj'AhhhNhNubj)}(h`Seek`h]hSeek}(hjAhhhNhNubah}(h]h ]h"]h$]h&]uh1jhj'Aubh sequence will be triggered.}(hj'AhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhM4hj#Aubah}(h]h ]h"]h$]h&]uh1j hjx@ubeh}(h]h ]h"]h$]h&]j- j. uh1j hhhM,hj@ubeh}(h]h ]h"]h$]h&]uh1j hjx<hhhNhNubeh}(h]h ]h"]h$]h&]jjjhjjuh1jhj#<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.h](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()6}(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}(hjAhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjAubh or }(hjAhhhNhNubj)}(h ``CAPTURE``h]hCAPTURE}(hjAhhhNhNubah}(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}(hj BhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjAubh or }(hjAhhhNhNubj)}(h``V4L2_DEC_CMD_STOP``h]hV4L2_DEC_CMD_STOP}(hjBhhhNhNubah}(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 }(hj4BhhhNhNubh)}(h :c:func:`VIDIOC_TRY_DECODER_CMD`h]j)}(hj>Bh]hVIDIOC_TRY_DECODER_CMD()}(hj@BhhhNhNubah}(h]h ](jjc-funceh"]h$]h&]uh1jhjEnumerated list start value not ordinal-1: “5” (ordinal 5)}(hj`EhhhNhNubah}(h]h ]h"]h$]h&]uh1hhj]Eubah}(h]h ]h"]h$]h&]levelKtypeINFOsourcehlineKuh1j[EhjShhhhhMubatransform_messages](j\E)}(hhh]h)}(hhh]h-Hyperlink target "decoder" is not referenced.}hj~Esbah}(h]h ]h"]h$]h&]uh1hhj{Eubah}(h]h ]h"]h$]h&]levelKtypejvEsourcehlineKuh1j[Eubj\E)}(hhh]h)}(hhh]h6Hyperlink target "decoder-glossary" is not referenced.}hjEsbah}(h]h ]h"]h$]h&]uh1hhjEubah}(h]h ]h"]h$]h&]levelKtypejvEsourcehlineK-uh1j[Eube transformerN include_log] decorationNhhub.