87 lines · plain
1.. SPDX-License-Identifier: GFDL-1.1-no-invariants-or-later2.. c:namespace:: V4L3 4.. _VIDIOC_REMOVE_BUFS:5 6************************7ioctl VIDIOC_REMOVE_BUFS8************************9 10Name11====12 13VIDIOC_REMOVE_BUFS - Removes buffers from a queue14 15Synopsis16========17 18.. c:macro:: VIDIOC_REMOVE_BUFS19 20``int ioctl(int fd, VIDIOC_REMOVE_BUFS, struct v4l2_remove_buffers *argp)``21 22Arguments23=========24 25``fd``26 File descriptor returned by :c:func:`open()`.27 28``argp``29 Pointer to struct :c:type:`v4l2_remove_buffers`.30 31Description32===========33 34Applications can optionally call the :ref:`VIDIOC_REMOVE_BUFS` ioctl to35remove buffers from a queue.36:ref:`VIDIOC_CREATE_BUFS` ioctl support is mandatory to enable :ref:`VIDIOC_REMOVE_BUFS`.37This ioctl is available if the ``V4L2_BUF_CAP_SUPPORTS_REMOVE_BUFS`` capability38is set on the queue when :c:func:`VIDIOC_REQBUFS` or :c:func:`VIDIOC_CREATE_BUFS`39are invoked.40 41.. c:type:: v4l2_remove_buffers42 43.. tabularcolumns:: |p{4.4cm}|p{4.4cm}|p{8.5cm}|44 45.. flat-table:: struct v4l2_remove_buffers46 :header-rows: 047 :stub-columns: 048 :widths: 1 1 249 50 * - __u3251 - ``index``52 - The starting buffer index to remove. This field is ignored if count == 0.53 * - __u3254 - ``count``55 - The number of buffers to be removed with indices 'index' until 'index + count - 1'.56 All buffers in this range must be valid and in DEQUEUED state.57 :ref:`VIDIOC_REMOVE_BUFS` will always check the validity of ``type`, if it is58 invalid it returns ``EINVAL`` error code.59 If count is set to 0 :ref:`VIDIOC_REMOVE_BUFS` will do nothing and return 0.60 * - __u3261 - ``type``62 - Type of the stream or buffers, this is the same as the struct63 :c:type:`v4l2_format` ``type`` field. See64 :c:type:`v4l2_buf_type` for valid values.65 * - __u3266 - ``reserved``\ [13]67 - A place holder for future extensions. Drivers and applications68 must set the array to zero.69 70Return Value71============72 73On success 0 is returned, on error -1 and the ``errno`` variable is set74appropriately. The generic error codes are described at the75:ref:`Generic Error Codes <gen-errors>` chapter. If an error occurs, no76buffers will be freed and one of the error codes below will be returned:77 78EBUSY79 File I/O is in progress.80 One or more of the buffers in the range ``index`` to ``index + count - 1`` are not81 in DEQUEUED state.82 83EINVAL84 One or more of the buffers in the range ``index`` to ``index + count - 1`` do not85 exist in the queue.86 The buffer type (``type`` field) is not valid.87