vidioc-prepare-buf.rst 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. .. SPDX-License-Identifier: GFDL-1.1-no-invariants-or-later
  2. .. c:namespace:: V4L
  3. .. _VIDIOC_PREPARE_BUF:
  4. ************************
  5. ioctl VIDIOC_PREPARE_BUF
  6. ************************
  7. Name
  8. ====
  9. VIDIOC_PREPARE_BUF - Prepare a buffer for I/O
  10. Synopsis
  11. ========
  12. .. c:macro:: VIDIOC_PREPARE_BUF
  13. ``int ioctl(int fd, VIDIOC_PREPARE_BUF, struct v4l2_buffer *argp)``
  14. Arguments
  15. =========
  16. ``fd``
  17. File descriptor returned by :c:func:`open()`.
  18. ``argp``
  19. Pointer to struct :c:type:`v4l2_buffer`.
  20. Description
  21. ===========
  22. Applications can optionally call the :ref:`VIDIOC_PREPARE_BUF` ioctl to
  23. pass ownership of the buffer to the driver before actually enqueuing it,
  24. using the :ref:`VIDIOC_QBUF <VIDIOC_QBUF>` ioctl, and to prepare it for future I/O. Such
  25. preparations may include cache invalidation or cleaning. Performing them
  26. in advance saves time during the actual I/O.
  27. The struct :c:type:`v4l2_buffer` structure is specified in
  28. :ref:`buffer`.
  29. Return Value
  30. ============
  31. On success 0 is returned, on error -1 and the ``errno`` variable is set
  32. appropriately. The generic error codes are described at the
  33. :ref:`Generic Error Codes <gen-errors>` chapter.
  34. EBUSY
  35. File I/O is in progress.
  36. EINVAL
  37. The buffer ``type`` is not supported, or the ``index`` is out of
  38. bounds, or no buffers have been allocated yet, or the ``userptr`` or
  39. ``length`` are invalid.