Documentation/userspace-api/media/v4l/pixfmt-v4l2.rst

Source file repositories/reference/linux-study-clean/Documentation/userspace-api/media/v4l/pixfmt-v4l2.rst

File Facts

System
Linux kernel
Corpus path
Documentation/userspace-api/media/v4l/pixfmt-v4l2.rst
Extension
.rst
Size
11356 bytes
Lines
242
Domain
Support Tooling And Documentation
Bucket
Documentation
Inferred role
Support Tooling And Documentation: documentation
Status
atlas-only

Why This File Exists

Repository support layer: documentation, build tooling, samples, user-space helper tools, generated initramfs support, licenses, and validation utilities.

Dependency Surface

Detected Declarations

Annotated Snippet

.. SPDX-License-Identifier: GFDL-1.1-no-invariants-or-later
.. c:namespace:: V4L

******************************
Single-planar format structure
******************************

.. tabularcolumns:: |p{4.0cm}|p{2.6cm}|p{10.7cm}|

.. c:type:: v4l2_pix_format

.. cssclass:: longtable

.. flat-table:: struct v4l2_pix_format
    :header-rows:  0
    :stub-columns: 0
    :widths:       1 1 2

    * - __u32
      - ``width``
      - Image width in pixels.
    * - __u32
      - ``height``
      - Image height in pixels. If ``field`` is one of ``V4L2_FIELD_TOP``,
	``V4L2_FIELD_BOTTOM`` or ``V4L2_FIELD_ALTERNATE`` then height
	refers to the number of lines in the field, otherwise it refers to
	the number of lines in the frame (which is twice the field height
	for interlaced formats).
    * - :cspan:`2` Applications set these fields to request an image
	size, drivers return the closest possible values. In case of
	planar formats the ``width`` and ``height`` applies to the largest
	plane. To avoid ambiguities drivers must return values rounded up
	to a multiple of the scale factor of any smaller planes. For
	example when the image format is YUV 4:2:0, ``width`` and
	``height`` must be multiples of two.

	For compressed formats that contain the resolution information encoded
	inside the stream, when fed to a stateful mem2mem decoder, the fields
	may be zero to rely on the decoder to detect the right values. For more
	details see :ref:`decoder` and format descriptions.

	For compressed formats on the CAPTURE side of a stateful mem2mem
	encoder, the fields must be zero, since the coded size is expected to
	be calculated internally by the encoder itself, based on the OUTPUT
	side. For more details see :ref:`encoder` and format descriptions.
    * - __u32
      - ``pixelformat``
      - The pixel format or type of compression, set by the application.
	This is a little endian
	:ref:`four character code <v4l2-fourcc>`. V4L2 defines standard
	RGB formats in :ref:`pixfmt-rgb`, YUV formats in
	:ref:`yuv-formats`, and reserved codes in
	:ref:`reserved-formats`
    * - __u32
      - ``field``
      - Field order, from enum :c:type:`v4l2_field`.
        Video images are typically interlaced. Applications can request to
	capture or output only the top or bottom field, or both fields
	interlaced or sequentially stored in one buffer or alternating in
	separate buffers. Drivers return the actual field order selected.
	For more details on fields see :ref:`field-order`.
    * - __u32
      - ``bytesperline``
      - Distance in bytes between the leftmost pixels in two adjacent
	lines.
    * - :cspan:`2`

	Both applications and drivers can set this field to request
	padding bytes at the end of each line. Drivers however may ignore
	the value requested by the application, returning ``width`` times

Annotation

Implementation Notes