Documentation/userspace-api/media/v4l/vidioc-expbuf.rst
Source file repositories/reference/linux-study-clean/Documentation/userspace-api/media/v4l/vidioc-expbuf.rst
File Facts
- System
- Linux kernel
- Corpus path
Documentation/userspace-api/media/v4l/vidioc-expbuf.rst- Extension
.rst- Size
- 4709 bytes
- Lines
- 163
- 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.
- 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
function openfunction buffer_export_mp
Annotated Snippet
if (ioctl(v4lfd, VIDIOC_EXPBUF, &expbuf) == -1) {
perror("VIDIOC_EXPBUF");
while (i)
close(dmafd[--i]);
return -1;
}
dmafd[i] = expbuf.fd;
}
return 0;
}
.. c:type:: v4l2_exportbuffer
.. tabularcolumns:: |p{4.4cm}|p{4.4cm}|p{8.5cm}|
.. flat-table:: struct v4l2_exportbuffer
:header-rows: 0
:stub-columns: 0
:widths: 1 1 2
* - __u32
- ``type``
- Type of the buffer, same as struct
:c:type:`v4l2_format` ``type`` or struct
:c:type:`v4l2_requestbuffers` ``type``, set
by the application. See :c:type:`v4l2_buf_type`
* - __u32
- ``index``
- Number of the buffer, set by the application. This field is only
used for :ref:`memory mapping <mmap>` I/O and can range from
zero to the number of buffers allocated with the
:ref:`VIDIOC_REQBUFS` and/or
:ref:`VIDIOC_CREATE_BUFS` ioctls.
* - __u32
- ``plane``
- Index of the plane to be exported when using the multi-planar API.
Otherwise this value must be set to zero.
* - __u32
- ``flags``
- Flags for the newly created file, currently only ``O_CLOEXEC``,
``O_RDONLY``, ``O_WRONLY``, and ``O_RDWR`` are supported, refer to
the manual of open() for more details.
* - __s32
- ``fd``
- The DMABUF file descriptor associated with a buffer. Set by the
driver.
* - __u32
- ``reserved[11]``
- Reserved field for future use. Drivers and applications must set
the array to zero.
Return Value
============
On success 0 is returned, on error -1 and the ``errno`` variable is set
appropriately. The generic error codes are described at the
:ref:`Generic Error Codes <gen-errors>` chapter.
EINVAL
A queue is not in MMAP mode or DMABUF exporting is not supported or
``flags`` or ``type`` or ``index`` or ``plane`` fields are invalid.
Annotation
- Detected declarations: `function open`, `function buffer_export_mp`.
- Atlas domain: Support Tooling And Documentation / Documentation.
- Implementation status: atlas-only.
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.