vidioc-g-priority.rst 2.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  1. .. SPDX-License-Identifier: GFDL-1.1-no-invariants-or-later
  2. .. c:namespace:: V4L
  3. .. _VIDIOC_G_PRIORITY:
  4. ******************************************
  5. ioctl VIDIOC_G_PRIORITY, VIDIOC_S_PRIORITY
  6. ******************************************
  7. Name
  8. ====
  9. VIDIOC_G_PRIORITY - VIDIOC_S_PRIORITY - Query or request the access priority associated with a file descriptor
  10. Synopsis
  11. ========
  12. .. c:macro:: VIDIOC_G_PRIORITY
  13. ``int ioctl(int fd, VIDIOC_G_PRIORITY, enum v4l2_priority *argp)``
  14. .. c:macro:: VIDIOC_S_PRIORITY
  15. ``int ioctl(int fd, VIDIOC_S_PRIORITY, const enum v4l2_priority *argp)``
  16. Arguments
  17. =========
  18. ``fd``
  19. File descriptor returned by :c:func:`open()`.
  20. ``argp``
  21. Pointer to an enum :c:type:`v4l2_priority` type.
  22. Description
  23. ===========
  24. To query the current access priority applications call the
  25. :ref:`VIDIOC_G_PRIORITY <VIDIOC_G_PRIORITY>` ioctl with a pointer to an enum v4l2_priority
  26. variable where the driver stores the current priority.
  27. To request an access priority applications store the desired priority in
  28. an enum v4l2_priority variable and call :ref:`VIDIOC_S_PRIORITY <VIDIOC_G_PRIORITY>` ioctl
  29. with a pointer to this variable.
  30. .. c:type:: v4l2_priority
  31. .. tabularcolumns:: |p{6.6cm}|p{2.2cm}|p{8.5cm}|
  32. .. flat-table:: enum v4l2_priority
  33. :header-rows: 0
  34. :stub-columns: 0
  35. :widths: 3 1 4
  36. * - ``V4L2_PRIORITY_UNSET``
  37. - 0
  38. -
  39. * - ``V4L2_PRIORITY_BACKGROUND``
  40. - 1
  41. - Lowest priority, usually applications running in background, for
  42. example monitoring VBI transmissions. A proxy application running
  43. in user space will be necessary if multiple applications want to
  44. read from a device at this priority.
  45. * - ``V4L2_PRIORITY_INTERACTIVE``
  46. - 2
  47. -
  48. * - ``V4L2_PRIORITY_DEFAULT``
  49. - 2
  50. - Medium priority, usually applications started and interactively
  51. controlled by the user. For example TV viewers, Teletext browsers,
  52. or just "panel" applications to change the channel or video
  53. controls. This is the default priority unless an application
  54. requests another.
  55. * - ``V4L2_PRIORITY_RECORD``
  56. - 3
  57. - Highest priority. Only one file descriptor can have this priority,
  58. it blocks any other fd from changing device properties. Usually
  59. applications which must not be interrupted, like video recording.
  60. Return Value
  61. ============
  62. On success 0 is returned, on error -1 and the ``errno`` variable is set
  63. appropriately. The generic error codes are described at the
  64. :ref:`Generic Error Codes <gen-errors>` chapter.
  65. EINVAL
  66. The requested priority value is invalid.
  67. EBUSY
  68. Another application already requested higher priority.