1 .. SPDX-License-Identifier: GFDL-1.1-no-invari 1 .. SPDX-License-Identifier: GFDL-1.1-no-invariants-or-later 2 .. c:namespace:: V4L 2 .. c:namespace:: V4L 3 3 4 .. _VIDIOC_REMOVE_BUFS: 4 .. _VIDIOC_REMOVE_BUFS: 5 5 6 ************************ 6 ************************ 7 ioctl VIDIOC_REMOVE_BUFS 7 ioctl VIDIOC_REMOVE_BUFS 8 ************************ 8 ************************ 9 9 10 Name 10 Name 11 ==== 11 ==== 12 12 13 VIDIOC_REMOVE_BUFS - Removes buffers from a qu 13 VIDIOC_REMOVE_BUFS - Removes buffers from a queue 14 14 15 Synopsis 15 Synopsis 16 ======== 16 ======== 17 17 18 .. c:macro:: VIDIOC_REMOVE_BUFS 18 .. c:macro:: VIDIOC_REMOVE_BUFS 19 19 20 ``int ioctl(int fd, VIDIOC_REMOVE_BUFS, struct 20 ``int ioctl(int fd, VIDIOC_REMOVE_BUFS, struct v4l2_remove_buffers *argp)`` 21 21 22 Arguments 22 Arguments 23 ========= 23 ========= 24 24 25 ``fd`` 25 ``fd`` 26 File descriptor returned by :c:func:`open( 26 File descriptor returned by :c:func:`open()`. 27 27 28 ``argp`` 28 ``argp`` 29 Pointer to struct :c:type:`v4l2_remove_buf 29 Pointer to struct :c:type:`v4l2_remove_buffers`. 30 30 31 Description 31 Description 32 =========== 32 =========== 33 33 34 Applications can optionally call the :ref:`VID 34 Applications can optionally call the :ref:`VIDIOC_REMOVE_BUFS` ioctl to 35 remove buffers from a queue. 35 remove buffers from a queue. 36 :ref:`VIDIOC_CREATE_BUFS` ioctl support is man 36 :ref:`VIDIOC_CREATE_BUFS` ioctl support is mandatory to enable :ref:`VIDIOC_REMOVE_BUFS`. 37 This ioctl is available if the ``V4L2_BUF_CAP_ 37 This ioctl is available if the ``V4L2_BUF_CAP_SUPPORTS_REMOVE_BUFS`` capability 38 is set on the queue when :c:func:`VIDIOC_REQBU 38 is set on the queue when :c:func:`VIDIOC_REQBUFS` or :c:func:`VIDIOC_CREATE_BUFS` 39 are invoked. 39 are invoked. 40 40 41 .. c:type:: v4l2_remove_buffers 41 .. c:type:: v4l2_remove_buffers 42 42 43 .. tabularcolumns:: |p{4.4cm}|p{4.4cm}|p{8.5cm 43 .. tabularcolumns:: |p{4.4cm}|p{4.4cm}|p{8.5cm}| 44 44 45 .. flat-table:: struct v4l2_remove_buffers 45 .. flat-table:: struct v4l2_remove_buffers 46 :header-rows: 0 46 :header-rows: 0 47 :stub-columns: 0 47 :stub-columns: 0 48 :widths: 1 1 2 48 :widths: 1 1 2 49 49 50 * - __u32 50 * - __u32 51 - ``index`` 51 - ``index`` 52 - The starting buffer index to remove. T 52 - The starting buffer index to remove. This field is ignored if count == 0. 53 * - __u32 53 * - __u32 54 - ``count`` 54 - ``count`` 55 - The number of buffers to be removed wi 55 - The number of buffers to be removed with indices 'index' until 'index + count - 1'. 56 All buffers in this range must be vali 56 All buffers in this range must be valid and in DEQUEUED state. 57 :ref:`VIDIOC_REMOVE_BUFS` will always 57 :ref:`VIDIOC_REMOVE_BUFS` will always check the validity of ``type`, if it is 58 invalid it returns ``EINVAL`` error co 58 invalid it returns ``EINVAL`` error code. 59 If count is set to 0 :ref:`VIDIOC_REMO 59 If count is set to 0 :ref:`VIDIOC_REMOVE_BUFS` will do nothing and return 0. 60 * - __u32 60 * - __u32 61 - ``type`` 61 - ``type`` 62 - Type of the stream or buffers, this is 62 - Type of the stream or buffers, this is the same as the struct 63 :c:type:`v4l2_format` ``type`` field. 63 :c:type:`v4l2_format` ``type`` field. See 64 :c:type:`v4l2_buf_type` for valid valu 64 :c:type:`v4l2_buf_type` for valid values. 65 * - __u32 65 * - __u32 66 - ``reserved``\ [13] 66 - ``reserved``\ [13] 67 - A place holder for future extensions. 67 - A place holder for future extensions. Drivers and applications 68 must set the array to zero. 68 must set the array to zero. 69 69 70 Return Value 70 Return Value 71 ============ 71 ============ 72 72 73 On success 0 is returned, on error -1 and the 73 On success 0 is returned, on error -1 and the ``errno`` variable is set 74 appropriately. The generic error codes are des 74 appropriately. The generic error codes are described at the 75 :ref:`Generic Error Codes <gen-errors>` chapte 75 :ref:`Generic Error Codes <gen-errors>` chapter. If an error occurs, no 76 buffers will be freed and one of the error cod 76 buffers will be freed and one of the error codes below will be returned: 77 77 78 EBUSY 78 EBUSY 79 File I/O is in progress. 79 File I/O is in progress. 80 One or more of the buffers in the range `` 80 One or more of the buffers in the range ``index`` to ``index + count - 1`` are not 81 in DEQUEUED state. 81 in DEQUEUED state. 82 82 83 EINVAL 83 EINVAL 84 One or more of the buffers in the range `` 84 One or more of the buffers in the range ``index`` to ``index + count - 1`` do not 85 exist in the queue. 85 exist in the queue. 86 The buffer type (``type`` field) is not va 86 The buffer type (``type`` field) is not valid.
Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.