Lines Matching +full:enum +full:- +full:as +full:- +full:flags
1 .. SPDX-License-Identifier: GFDL-1.1-no-invariants-or-later
13 VIDIOC_EXPBUF - Export a buffer as a DMABUF file descriptor.
36 It can be used to export a buffer as a DMABUF file at any time after
42 set to the same buffer type as was previously used with struct
48 one. For the multi-planar API, applications set the ``plane`` field to
51 the single-planar API, applications must set ``plane`` to zero.
52 Additional flags may be posted in the ``flags`` field. Refer to a manual
55 case of multi-planar API, every plane is exported separately using
60 other DMABUF-aware devices. Refer to :ref:`DMABUF importing <dmabuf>`
68 .. code-block:: c
70 int buffer_export(int v4lfd, enum v4l2_buf_type bt, int index, int *dmafd)
77 if (ioctl(v4lfd, VIDIOC_EXPBUF, &expbuf) == -1) {
79 return -1;
87 .. code-block:: c
89 int buffer_export_mp(int v4lfd, enum v4l2_buf_type bt, int index,
101 if (ioctl(v4lfd, VIDIOC_EXPBUF, &expbuf) == -1) {
104 close(dmafd[--i]);
105 return -1;
117 .. flat-table:: struct v4l2_exportbuffer
118 :header-rows: 0
119 :stub-columns: 0
122 * - __u32
123 - ``type``
124 - Type of the buffer, same as struct
128 * - __u32
129 - ``index``
130 - Number of the buffer, set by the application. This field is only
135 * - __u32
136 - ``plane``
137 - Index of the plane to be exported when using the multi-planar API.
139 * - __u32
140 - ``flags``
141 - Flags for the newly created file, currently only ``O_CLOEXEC``,
144 * - __s32
145 - ``fd``
146 - The DMABUF file descriptor associated with a buffer. Set by the
148 * - __u32
149 - ``reserved[11]``
150 - Reserved field for future use. Drivers and applications must set
156 On success 0 is returned, on error -1 and the ``errno`` variable is set
158 :ref:`Generic Error Codes <gen-errors>` chapter.
162 ``flags`` or ``type`` or ``index`` or ``plane`` fields are invalid.