Documentation/userspace-api/media/v4l/vidioc-enum-framesizes.rst
Source file repositories/reference/linux-study-clean/Documentation/userspace-api/media/v4l/vidioc-enum-framesizes.rst
File Facts
- System
- Linux kernel
- Corpus path
Documentation/userspace-api/media/v4l/vidioc-enum-framesizes.rst- Extension
.rst- Size
- 5424 bytes
- Lines
- 195
- 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.
- Repository support layer: documentation, build tooling, samples, user-space helper tools, generated initramfs support, licenses, and validation utilities.
- Touches IRQ or DMA behavior; this matters for the representative real-device path.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
- No C-style include directives detected by the generator.
Detected Declarations
- No top-level syscall, struct, function, initcall, or export declaration detected by the generator.
Annotated Snippet
.. SPDX-License-Identifier: GFDL-1.1-no-invariants-or-later
.. c:namespace:: V4L
.. _VIDIOC_ENUM_FRAMESIZES:
****************************
ioctl VIDIOC_ENUM_FRAMESIZES
****************************
Name
====
VIDIOC_ENUM_FRAMESIZES - Enumerate frame sizes
Synopsis
========
.. c:macro:: VIDIOC_ENUM_FRAMESIZES
``int ioctl(int fd, VIDIOC_ENUM_FRAMESIZES, struct v4l2_frmsizeenum *argp)``
Arguments
=========
``fd``
File descriptor returned by :c:func:`open()`.
``argp``
Pointer to struct :c:type:`v4l2_frmsizeenum`
that contains an index and pixel format and receives a frame width
and height.
Description
===========
This ioctl allows applications to enumerate all frame sizes (i. e. width
and height in pixels) that the device supports for the given pixel
format.
The supported pixel formats can be obtained by using the
:ref:`VIDIOC_ENUM_FMT` function.
The return value and the content of the ``v4l2_frmsizeenum.type`` field
depend on the type of frame sizes the device supports. Here are the
semantics of the function for the different cases:
- **Discrete:** The function returns success if the given index value
(zero-based) is valid. The application should increase the index by
one for each call until ``EINVAL`` is returned. The
``v4l2_frmsizeenum.type`` field is set to
``V4L2_FRMSIZE_TYPE_DISCRETE`` by the driver. Of the union only the
``discrete`` member is valid.
- **Step-wise:** The function returns success if the given index value
is zero and ``EINVAL`` for any other index value. The
``v4l2_frmsizeenum.type`` field is set to
``V4L2_FRMSIZE_TYPE_STEPWISE`` by the driver. Of the union only the
``stepwise`` member is valid.
- **Continuous:** This is a special case of the step-wise type above.
The function returns success if the given index value is zero and
``EINVAL`` for any other index value. The ``v4l2_frmsizeenum.type``
field is set to ``V4L2_FRMSIZE_TYPE_CONTINUOUS`` by the driver. Of
the union only the ``stepwise`` member is valid and the
``step_width`` and ``step_height`` values are set to 1.
When the application calls the function with index zero, it must check
the ``type`` field to determine the type of frame size enumeration the
device supports. Only for the ``V4L2_FRMSIZE_TYPE_DISCRETE`` type does
it make sense to increase the index value to receive more frame sizes.
Annotation
- Atlas domain: Support Tooling And Documentation / Documentation.
- Implementation status: atlas-only.
- IRQ or DMA behavior appears here, which is relevant to the selected PCIe/NVMe device path.
Implementation Notes
- This generated page is the file-by-file coverage layer; curated subsystem chapters should link here when they synthesize a multi-file control flow.
- Core OS pages should be promoted from atlas-only to deep-reviewed when they explain data structures, invariants, locking, lifecycle, and C implementation snippets.
- Driver-family pages are intentionally pattern-oriented unless they are part of the selected PCIe/NVMe representative device path.