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.

Dependency Surface

Detected Declarations

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

Implementation Notes