Merge tag 'drivers-5.10-2020-10-12' of git://git.kernel.dk/linux-block
[linux-2.6-block.git] / Documentation / userspace-api / media / v4l / vidioc-g-priority.rst
CommitLineData
059b1c5b 1.. SPDX-License-Identifier: GFDL-1.1-no-invariants-or-later
82559ac0 2
af4a4d0d 3.. _VIDIOC_G_PRIORITY:
5377d91f
MH
4
5******************************************
6ioctl VIDIOC_G_PRIORITY, VIDIOC_S_PRIORITY
7******************************************
8
15e7d615 9Name
586027ce 10====
5377d91f 11
586027ce 12VIDIOC_G_PRIORITY - VIDIOC_S_PRIORITY - Query or request the access priority associated with a file descriptor
5377d91f 13
15e7d615
MCC
14
15Synopsis
5377d91f
MH
16========
17
41d80465
MCC
18.. c:function:: int ioctl( int fd, VIDIOC_G_PRIORITY, enum v4l2_priority *argp )
19 :name: VIDIOC_G_PRIORITY
5377d91f 20
41d80465
MCC
21.. c:function:: int ioctl( int fd, VIDIOC_S_PRIORITY, const enum v4l2_priority *argp )
22 :name: VIDIOC_S_PRIORITY
5377d91f 23
586027ce 24
15e7d615 25Arguments
5377d91f
MH
26=========
27
28``fd``
29 File descriptor returned by :ref:`open() <func-open>`.
30
5377d91f 31``argp``
1473c75e 32 Pointer to an enum :c:type:`v4l2_priority` type.
5377d91f
MH
33
34
15e7d615 35Description
5377d91f
MH
36===========
37
38To query the current access priority applications call the
4e03cb76 39:ref:`VIDIOC_G_PRIORITY <VIDIOC_G_PRIORITY>` ioctl with a pointer to an enum v4l2_priority
5377d91f
MH
40variable where the driver stores the current priority.
41
42To request an access priority applications store the desired priority in
2212ff25 43an enum v4l2_priority variable and call :ref:`VIDIOC_S_PRIORITY <VIDIOC_G_PRIORITY>` ioctl
5377d91f
MH
44with a pointer to this variable.
45
46
ffa0441e 47.. c:type:: v4l2_priority
5377d91f 48
5bd4bb78
MCC
49.. tabularcolumns:: |p{6.6cm}|p{2.2cm}|p{8.7cm}|
50
5377d91f
MH
51.. flat-table:: enum v4l2_priority
52 :header-rows: 0
53 :stub-columns: 0
54 :widths: 3 1 4
55
c2b66caf
LP
56 * - ``V4L2_PRIORITY_UNSET``
57 - 0
58 -
59 * - ``V4L2_PRIORITY_BACKGROUND``
60 - 1
61 - Lowest priority, usually applications running in background, for
62 example monitoring VBI transmissions. A proxy application running
63 in user space will be necessary if multiple applications want to
64 read from a device at this priority.
65 * - ``V4L2_PRIORITY_INTERACTIVE``
66 - 2
67 -
68 * - ``V4L2_PRIORITY_DEFAULT``
69 - 2
70 - Medium priority, usually applications started and interactively
71 controlled by the user. For example TV viewers, Teletext browsers,
72 or just "panel" applications to change the channel or video
73 controls. This is the default priority unless an application
74 requests another.
75 * - ``V4L2_PRIORITY_RECORD``
76 - 3
77 - Highest priority. Only one file descriptor can have this priority,
78 it blocks any other fd from changing device properties. Usually
79 applications which must not be interrupted, like video recording.
5377d91f
MH
80
81
15e7d615 82Return Value
5377d91f
MH
83============
84
85On success 0 is returned, on error -1 and the ``errno`` variable is set
86appropriately. The generic error codes are described at the
87:ref:`Generic Error Codes <gen-errors>` chapter.
88
89EINVAL
90 The requested priority value is invalid.
91
92EBUSY
93 Another application already requested higher priority.