blob: cbd2a3cbb18ea37fe3e13bd29bde9b6aabeb0d26 [file] [log] [blame]
Markus Heiser5377d912016-06-30 15:18:56 +02001.. -*- coding: utf-8; mode: rst -*-
2
Mauro Carvalho Chehabaf4a4d02016-07-01 13:42:29 -03003.. _VIDIOC_G_PRIORITY:
Markus Heiser5377d912016-06-30 15:18:56 +02004
5******************************************
6ioctl VIDIOC_G_PRIORITY, VIDIOC_S_PRIORITY
7******************************************
8
Mauro Carvalho Chehab15e7d612016-07-05 15:14:35 -03009Name
Mauro Carvalho Chehab586027c2016-07-05 07:58:48 -030010====
Markus Heiser5377d912016-06-30 15:18:56 +020011
Mauro Carvalho Chehab586027c2016-07-05 07:58:48 -030012VIDIOC_G_PRIORITY - VIDIOC_S_PRIORITY - Query or request the access priority associated with a file descriptor
Markus Heiser5377d912016-06-30 15:18:56 +020013
Mauro Carvalho Chehab15e7d612016-07-05 15:14:35 -030014
15Synopsis
Markus Heiser5377d912016-06-30 15:18:56 +020016========
17
Mauro Carvalho Chehab41d80462016-08-19 16:53:38 -030018.. c:function:: int ioctl( int fd, VIDIOC_G_PRIORITY, enum v4l2_priority *argp )
19 :name: VIDIOC_G_PRIORITY
Markus Heiser5377d912016-06-30 15:18:56 +020020
Mauro Carvalho Chehab41d80462016-08-19 16:53:38 -030021.. c:function:: int ioctl( int fd, VIDIOC_S_PRIORITY, const enum v4l2_priority *argp )
22 :name: VIDIOC_S_PRIORITY
Markus Heiser5377d912016-06-30 15:18:56 +020023
Mauro Carvalho Chehab586027c2016-07-05 07:58:48 -030024
Mauro Carvalho Chehab15e7d612016-07-05 15:14:35 -030025Arguments
Markus Heiser5377d912016-06-30 15:18:56 +020026=========
27
28``fd``
29 File descriptor returned by :ref:`open() <func-open>`.
30
Markus Heiser5377d912016-06-30 15:18:56 +020031``argp``
32 Pointer to an enum v4l2_priority type.
33
34
Mauro Carvalho Chehab15e7d612016-07-05 15:14:35 -030035Description
Markus Heiser5377d912016-06-30 15:18:56 +020036===========
37
38To query the current access priority applications call the
Mauro Carvalho Chehab4e03cb72016-07-03 10:02:29 -030039:ref:`VIDIOC_G_PRIORITY <VIDIOC_G_PRIORITY>` ioctl with a pointer to an enum v4l2_priority
Markus Heiser5377d912016-06-30 15:18:56 +020040variable where the driver stores the current priority.
41
42To request an access priority applications store the desired priority in
Mauro Carvalho Chehab2212ff22016-07-01 14:33:56 -030043an enum v4l2_priority variable and call :ref:`VIDIOC_S_PRIORITY <VIDIOC_G_PRIORITY>` ioctl
Markus Heiser5377d912016-06-30 15:18:56 +020044with a pointer to this variable.
45
46
Mauro Carvalho Chehabffa04412016-08-29 18:40:21 -030047.. c:type:: v4l2_priority
Markus Heiser5377d912016-06-30 15:18:56 +020048
Mauro Carvalho Chehab5bd4bb72016-08-17 08:14:19 -030049.. tabularcolumns:: |p{6.6cm}|p{2.2cm}|p{8.7cm}|
50
Markus Heiser5377d912016-06-30 15:18:56 +020051.. flat-table:: enum v4l2_priority
52 :header-rows: 0
53 :stub-columns: 0
54 :widths: 3 1 4
55
56
57 - .. row 1
58
59 - ``V4L2_PRIORITY_UNSET``
60
61 - 0
62
Mauro Carvalho Chehab0579e6e2016-07-04 16:25:48 -030063 -
Markus Heiser5377d912016-06-30 15:18:56 +020064
65 - .. row 2
66
67 - ``V4L2_PRIORITY_BACKGROUND``
68
69 - 1
70
71 - Lowest priority, usually applications running in background, for
Mauro Carvalho Chehab0579e6e2016-07-04 16:25:48 -030072 example monitoring VBI transmissions. A proxy application running
73 in user space will be necessary if multiple applications want to
74 read from a device at this priority.
Markus Heiser5377d912016-06-30 15:18:56 +020075
76 - .. row 3
77
78 - ``V4L2_PRIORITY_INTERACTIVE``
79
80 - 2
81
Mauro Carvalho Chehab0579e6e2016-07-04 16:25:48 -030082 -
Markus Heiser5377d912016-06-30 15:18:56 +020083
84 - .. row 4
85
86 - ``V4L2_PRIORITY_DEFAULT``
87
88 - 2
89
90 - Medium priority, usually applications started and interactively
Mauro Carvalho Chehab0579e6e2016-07-04 16:25:48 -030091 controlled by the user. For example TV viewers, Teletext browsers,
92 or just "panel" applications to change the channel or video
93 controls. This is the default priority unless an application
94 requests another.
Markus Heiser5377d912016-06-30 15:18:56 +020095
96 - .. row 5
97
98 - ``V4L2_PRIORITY_RECORD``
99
100 - 3
101
102 - Highest priority. Only one file descriptor can have this priority,
Mauro Carvalho Chehab0579e6e2016-07-04 16:25:48 -0300103 it blocks any other fd from changing device properties. Usually
104 applications which must not be interrupted, like video recording.
Markus Heiser5377d912016-06-30 15:18:56 +0200105
106
Mauro Carvalho Chehab15e7d612016-07-05 15:14:35 -0300107Return Value
Markus Heiser5377d912016-06-30 15:18:56 +0200108============
109
110On success 0 is returned, on error -1 and the ``errno`` variable is set
111appropriately. The generic error codes are described at the
112:ref:`Generic Error Codes <gen-errors>` chapter.
113
114EINVAL
115 The requested priority value is invalid.
116
117EBUSY
118 Another application already requested higher priority.