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