Orange Pi5 kernel

Deprecated Linux kernel 5.10.110 for OrangePi 5/5B/5+ boards

3 Commits   0 Branches   0 Tags
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  1) .. SPDX-License-Identifier: GFDL-1.1-no-invariants-or-later
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  2) .. c:namespace:: V4L
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  3) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  4) .. _VIDIOC_QUERYBUF:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  5) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  6) *********************
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  7) ioctl VIDIOC_QUERYBUF
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  8) *********************
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  9) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 10) Name
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 11) ====
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 12) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 13) VIDIOC_QUERYBUF - Query the status of a buffer
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 14) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 15) Synopsis
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 16) ========
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 17) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 18) .. c:macro:: VIDIOC_QUERYBUF
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 19) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 20) ``int ioctl(int fd, VIDIOC_QUERYBUF, struct v4l2_buffer *argp)``
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 21) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 22) Arguments
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 23) =========
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 24) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 25) ``fd``
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 26)     File descriptor returned by :c:func:`open()`.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 27) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 28) ``argp``
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 29)     Pointer to struct :c:type:`v4l2_buffer`.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 30) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 31) Description
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 32) ===========
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 33) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 34) This ioctl is part of the :ref:`streaming <mmap>` I/O method. It can
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 35) be used to query the status of a buffer at any time after buffers have
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 36) been allocated with the :ref:`VIDIOC_REQBUFS` ioctl.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 37) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 38) Applications set the ``type`` field of a struct
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 39) :c:type:`v4l2_buffer` to the same buffer type as was
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 40) previously used with struct :c:type:`v4l2_format` ``type``
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 41) and struct :c:type:`v4l2_requestbuffers` ``type``,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 42) and the ``index`` field. Valid index numbers range from zero to the
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 43) number of buffers allocated with
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 44) :ref:`VIDIOC_REQBUFS` (struct
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 45) :c:type:`v4l2_requestbuffers` ``count``) minus
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 46) one. The ``reserved`` and ``reserved2`` fields must be set to 0. When
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 47) using the :ref:`multi-planar API <planar-apis>`, the ``m.planes``
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 48) field must contain a userspace pointer to an array of struct
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 49) :c:type:`v4l2_plane` and the ``length`` field has to be set
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 50) to the number of elements in that array. After calling
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 51) :ref:`VIDIOC_QUERYBUF` with a pointer to this structure drivers return an
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 52) error code or fill the rest of the structure.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 53) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 54) In the ``flags`` field the ``V4L2_BUF_FLAG_MAPPED``,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 55) ``V4L2_BUF_FLAG_PREPARED``, ``V4L2_BUF_FLAG_QUEUED`` and
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 56) ``V4L2_BUF_FLAG_DONE`` flags will be valid. The ``memory`` field will be
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 57) set to the current I/O method. For the single-planar API, the
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 58) ``m.offset`` contains the offset of the buffer from the start of the
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 59) device memory, the ``length`` field its size. For the multi-planar API,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 60) fields ``m.mem_offset`` and ``length`` in the ``m.planes`` array
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 61) elements will be used instead and the ``length`` field of struct
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 62) :c:type:`v4l2_buffer` is set to the number of filled-in
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 63) array elements. The driver may or may not set the remaining fields and
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 64) flags, they are meaningless in this context.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 65) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 66) The struct :c:type:`v4l2_buffer` structure is specified in
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 67) :ref:`buffer`.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 68) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 69) Return Value
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 70) ============
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 71) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 72) On success 0 is returned, on error -1 and the ``errno`` variable is set
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 73) appropriately. The generic error codes are described at the
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 74) :ref:`Generic Error Codes <gen-errors>` chapter.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 75) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 76) EINVAL
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 77)     The buffer ``type`` is not supported, or the ``index`` is out of
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 78)     bounds.