0001 .. SPDX-License-Identifier: GFDL-1.1-no-invariants-or-later
0002 .. c:namespace:: V4L
0003
0004 .. _VIDIOC_G_PRIORITY:
0005
0006 ******************************************
0007 ioctl VIDIOC_G_PRIORITY, VIDIOC_S_PRIORITY
0008 ******************************************
0009
0010 Name
0011 ====
0012
0013 VIDIOC_G_PRIORITY - VIDIOC_S_PRIORITY - Query or request the access priority associated with a file descriptor
0014
0015 Synopsis
0016 ========
0017
0018 .. c:macro:: VIDIOC_G_PRIORITY
0019
0020 ``int ioctl(int fd, VIDIOC_G_PRIORITY, enum v4l2_priority *argp)``
0021
0022 .. c:macro:: VIDIOC_S_PRIORITY
0023
0024 ``int ioctl(int fd, VIDIOC_S_PRIORITY, const enum v4l2_priority *argp)``
0025
0026 Arguments
0027 =========
0028
0029 ``fd``
0030 File descriptor returned by :c:func:`open()`.
0031
0032 ``argp``
0033 Pointer to an enum :c:type:`v4l2_priority` type.
0034
0035 Description
0036 ===========
0037
0038 To query the current access priority applications call the
0039 :ref:`VIDIOC_G_PRIORITY <VIDIOC_G_PRIORITY>` ioctl with a pointer to an enum v4l2_priority
0040 variable where the driver stores the current priority.
0041
0042 To request an access priority applications store the desired priority in
0043 an enum v4l2_priority variable and call :ref:`VIDIOC_S_PRIORITY <VIDIOC_G_PRIORITY>` ioctl
0044 with a pointer to this variable.
0045
0046 .. c:type:: v4l2_priority
0047
0048 .. tabularcolumns:: |p{6.6cm}|p{2.2cm}|p{8.5cm}|
0049
0050 .. flat-table:: enum v4l2_priority
0051 :header-rows: 0
0052 :stub-columns: 0
0053 :widths: 3 1 4
0054
0055 * - ``V4L2_PRIORITY_UNSET``
0056 - 0
0057 -
0058 * - ``V4L2_PRIORITY_BACKGROUND``
0059 - 1
0060 - Lowest priority, usually applications running in background, for
0061 example monitoring VBI transmissions. A proxy application running
0062 in user space will be necessary if multiple applications want to
0063 read from a device at this priority.
0064 * - ``V4L2_PRIORITY_INTERACTIVE``
0065 - 2
0066 -
0067 * - ``V4L2_PRIORITY_DEFAULT``
0068 - 2
0069 - Medium priority, usually applications started and interactively
0070 controlled by the user. For example TV viewers, Teletext browsers,
0071 or just "panel" applications to change the channel or video
0072 controls. This is the default priority unless an application
0073 requests another.
0074 * - ``V4L2_PRIORITY_RECORD``
0075 - 3
0076 - Highest priority. Only one file descriptor can have this priority,
0077 it blocks any other fd from changing device properties. Usually
0078 applications which must not be interrupted, like video recording.
0079
0080 Return Value
0081 ============
0082
0083 On success 0 is returned, on error -1 and the ``errno`` variable is set
0084 appropriately. The generic error codes are described at the
0085 :ref:`Generic Error Codes <gen-errors>` chapter.
0086
0087 EINVAL
0088 The requested priority value is invalid.
0089
0090 EBUSY
0091 Another application already requested higher priority.