2020-08-26 10:03:09 +03:00
|
|
|
.. SPDX-License-Identifier: GFDL-1.1-no-invariants-or-later
|
2020-09-24 15:04:26 +03:00
|
|
|
.. c:namespace:: V4L
|
2018-08-30 17:15:26 +03:00
|
|
|
|
2016-07-01 19:42:29 +03:00
|
|
|
.. _VIDIOC_PREPARE_BUF:
|
2016-06-30 16:18:56 +03:00
|
|
|
|
|
|
|
************************
|
|
|
|
ioctl VIDIOC_PREPARE_BUF
|
|
|
|
************************
|
|
|
|
|
2016-07-05 21:14:35 +03:00
|
|
|
Name
|
2016-07-05 13:58:48 +03:00
|
|
|
====
|
2016-06-30 16:18:56 +03:00
|
|
|
|
2016-07-05 13:58:48 +03:00
|
|
|
VIDIOC_PREPARE_BUF - Prepare a buffer for I/O
|
2016-06-30 16:18:56 +03:00
|
|
|
|
2016-07-05 21:14:35 +03:00
|
|
|
Synopsis
|
2016-06-30 16:18:56 +03:00
|
|
|
========
|
|
|
|
|
2020-09-24 15:04:26 +03:00
|
|
|
.. c:macro:: VIDIOC_PREPARE_BUF
|
2016-06-30 16:18:56 +03:00
|
|
|
|
2020-09-24 15:04:26 +03:00
|
|
|
``int ioctl(int fd, VIDIOC_PREPARE_BUF, struct v4l2_buffer *argp)``
|
2016-07-05 13:58:48 +03:00
|
|
|
|
2016-07-05 21:14:35 +03:00
|
|
|
Arguments
|
2016-06-30 16:18:56 +03:00
|
|
|
=========
|
|
|
|
|
|
|
|
``fd``
|
2020-09-24 15:04:26 +03:00
|
|
|
File descriptor returned by :c:func:`open()`.
|
2016-06-30 16:18:56 +03:00
|
|
|
|
|
|
|
``argp``
|
2017-09-02 16:54:48 +03:00
|
|
|
Pointer to struct :c:type:`v4l2_buffer`.
|
2016-06-30 16:18:56 +03:00
|
|
|
|
2016-07-05 21:14:35 +03:00
|
|
|
Description
|
2016-06-30 16:18:56 +03:00
|
|
|
===========
|
|
|
|
|
2016-07-01 20:33:56 +03:00
|
|
|
Applications can optionally call the :ref:`VIDIOC_PREPARE_BUF` ioctl to
|
2016-06-30 16:18:56 +03:00
|
|
|
pass ownership of the buffer to the driver before actually enqueuing it,
|
2018-02-05 05:24:43 +03:00
|
|
|
using the :ref:`VIDIOC_QBUF <VIDIOC_QBUF>` ioctl, and to prepare it for future I/O. Such
|
2016-06-30 16:18:56 +03:00
|
|
|
preparations may include cache invalidation or cleaning. Performing them
|
2019-01-16 14:46:26 +03:00
|
|
|
in advance saves time during the actual I/O.
|
2016-06-30 16:18:56 +03:00
|
|
|
|
2016-09-08 11:43:01 +03:00
|
|
|
The struct :c:type:`v4l2_buffer` structure is specified in
|
2016-06-30 16:18:56 +03:00
|
|
|
:ref:`buffer`.
|
|
|
|
|
2016-07-05 21:14:35 +03:00
|
|
|
Return Value
|
2016-06-30 16:18:56 +03:00
|
|
|
============
|
|
|
|
|
|
|
|
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.
|
|
|
|
|
|
|
|
EBUSY
|
|
|
|
File I/O is in progress.
|
|
|
|
|
|
|
|
EINVAL
|
|
|
|
The buffer ``type`` is not supported, or the ``index`` is out of
|
|
|
|
bounds, or no buffers have been allocated yet, or the ``userptr`` or
|
|
|
|
``length`` are invalid.
|