Markus Heiser | 5377d91 | 2016-06-30 15:18:56 +0200 | [diff] [blame] | 1 | .. -*- coding: utf-8; mode: rst -*- |
| 2 | |
Mauro Carvalho Chehab | af4a4d0 | 2016-07-01 13:42:29 -0300 | [diff] [blame] | 3 | .. _VIDIOC_G_PRIORITY: |
Markus Heiser | 5377d91 | 2016-06-30 15:18:56 +0200 | [diff] [blame] | 4 | |
| 5 | ****************************************** |
| 6 | ioctl VIDIOC_G_PRIORITY, VIDIOC_S_PRIORITY |
| 7 | ****************************************** |
| 8 | |
Mauro Carvalho Chehab | 15e7d61 | 2016-07-05 15:14:35 -0300 | [diff] [blame] | 9 | Name |
Mauro Carvalho Chehab | 586027c | 2016-07-05 07:58:48 -0300 | [diff] [blame] | 10 | ==== |
Markus Heiser | 5377d91 | 2016-06-30 15:18:56 +0200 | [diff] [blame] | 11 | |
Mauro Carvalho Chehab | 586027c | 2016-07-05 07:58:48 -0300 | [diff] [blame] | 12 | VIDIOC_G_PRIORITY - VIDIOC_S_PRIORITY - Query or request the access priority associated with a file descriptor |
Markus Heiser | 5377d91 | 2016-06-30 15:18:56 +0200 | [diff] [blame] | 13 | |
Mauro Carvalho Chehab | 15e7d61 | 2016-07-05 15:14:35 -0300 | [diff] [blame] | 14 | |
| 15 | Synopsis |
Markus Heiser | 5377d91 | 2016-06-30 15:18:56 +0200 | [diff] [blame] | 16 | ======== |
| 17 | |
Mauro Carvalho Chehab | 5929cb1 | 2016-07-05 15:22:59 -0300 | [diff] [blame] | 18 | .. cpp:function:: int ioctl( int fd, int request, enum v4l2_priority *argp ) |
Markus Heiser | 5377d91 | 2016-06-30 15:18:56 +0200 | [diff] [blame] | 19 | |
Mauro Carvalho Chehab | 5929cb1 | 2016-07-05 15:22:59 -0300 | [diff] [blame] | 20 | .. cpp:function:: int ioctl( int fd, int request, const enum v4l2_priority *argp ) |
Markus Heiser | 5377d91 | 2016-06-30 15:18:56 +0200 | [diff] [blame] | 21 | |
Mauro Carvalho Chehab | 586027c | 2016-07-05 07:58:48 -0300 | [diff] [blame] | 22 | |
Mauro Carvalho Chehab | 15e7d61 | 2016-07-05 15:14:35 -0300 | [diff] [blame] | 23 | Arguments |
Markus Heiser | 5377d91 | 2016-06-30 15:18:56 +0200 | [diff] [blame] | 24 | ========= |
| 25 | |
| 26 | ``fd`` |
| 27 | File descriptor returned by :ref:`open() <func-open>`. |
| 28 | |
| 29 | ``request`` |
| 30 | VIDIOC_G_PRIORITY, VIDIOC_S_PRIORITY |
| 31 | |
| 32 | ``argp`` |
| 33 | Pointer to an enum v4l2_priority type. |
| 34 | |
| 35 | |
Mauro Carvalho Chehab | 15e7d61 | 2016-07-05 15:14:35 -0300 | [diff] [blame] | 36 | Description |
Markus Heiser | 5377d91 | 2016-06-30 15:18:56 +0200 | [diff] [blame] | 37 | =========== |
| 38 | |
| 39 | To query the current access priority applications call the |
Mauro Carvalho Chehab | 4e03cb7 | 2016-07-03 10:02:29 -0300 | [diff] [blame] | 40 | :ref:`VIDIOC_G_PRIORITY <VIDIOC_G_PRIORITY>` ioctl with a pointer to an enum v4l2_priority |
Markus Heiser | 5377d91 | 2016-06-30 15:18:56 +0200 | [diff] [blame] | 41 | variable where the driver stores the current priority. |
| 42 | |
| 43 | To request an access priority applications store the desired priority in |
Mauro Carvalho Chehab | 2212ff2 | 2016-07-01 14:33:56 -0300 | [diff] [blame] | 44 | an enum v4l2_priority variable and call :ref:`VIDIOC_S_PRIORITY <VIDIOC_G_PRIORITY>` ioctl |
Markus Heiser | 5377d91 | 2016-06-30 15:18:56 +0200 | [diff] [blame] | 45 | with a pointer to this variable. |
| 46 | |
| 47 | |
| 48 | .. _v4l2-priority: |
| 49 | |
Mauro Carvalho Chehab | 5bd4bb7 | 2016-08-17 08:14:19 -0300 | [diff] [blame^] | 50 | .. tabularcolumns:: |p{6.6cm}|p{2.2cm}|p{8.7cm}| |
| 51 | |
Markus Heiser | 5377d91 | 2016-06-30 15:18:56 +0200 | [diff] [blame] | 52 | .. flat-table:: enum v4l2_priority |
| 53 | :header-rows: 0 |
| 54 | :stub-columns: 0 |
| 55 | :widths: 3 1 4 |
| 56 | |
| 57 | |
| 58 | - .. row 1 |
| 59 | |
| 60 | - ``V4L2_PRIORITY_UNSET`` |
| 61 | |
| 62 | - 0 |
| 63 | |
Mauro Carvalho Chehab | 0579e6e | 2016-07-04 16:25:48 -0300 | [diff] [blame] | 64 | - |
Markus Heiser | 5377d91 | 2016-06-30 15:18:56 +0200 | [diff] [blame] | 65 | |
| 66 | - .. row 2 |
| 67 | |
| 68 | - ``V4L2_PRIORITY_BACKGROUND`` |
| 69 | |
| 70 | - 1 |
| 71 | |
| 72 | - Lowest priority, usually applications running in background, for |
Mauro Carvalho Chehab | 0579e6e | 2016-07-04 16:25:48 -0300 | [diff] [blame] | 73 | example monitoring VBI transmissions. A proxy application running |
| 74 | in user space will be necessary if multiple applications want to |
| 75 | read from a device at this priority. |
Markus Heiser | 5377d91 | 2016-06-30 15:18:56 +0200 | [diff] [blame] | 76 | |
| 77 | - .. row 3 |
| 78 | |
| 79 | - ``V4L2_PRIORITY_INTERACTIVE`` |
| 80 | |
| 81 | - 2 |
| 82 | |
Mauro Carvalho Chehab | 0579e6e | 2016-07-04 16:25:48 -0300 | [diff] [blame] | 83 | - |
Markus Heiser | 5377d91 | 2016-06-30 15:18:56 +0200 | [diff] [blame] | 84 | |
| 85 | - .. row 4 |
| 86 | |
| 87 | - ``V4L2_PRIORITY_DEFAULT`` |
| 88 | |
| 89 | - 2 |
| 90 | |
| 91 | - Medium priority, usually applications started and interactively |
Mauro Carvalho Chehab | 0579e6e | 2016-07-04 16:25:48 -0300 | [diff] [blame] | 92 | controlled by the user. For example TV viewers, Teletext browsers, |
| 93 | or just "panel" applications to change the channel or video |
| 94 | controls. This is the default priority unless an application |
| 95 | requests another. |
Markus Heiser | 5377d91 | 2016-06-30 15:18:56 +0200 | [diff] [blame] | 96 | |
| 97 | - .. row 5 |
| 98 | |
| 99 | - ``V4L2_PRIORITY_RECORD`` |
| 100 | |
| 101 | - 3 |
| 102 | |
| 103 | - Highest priority. Only one file descriptor can have this priority, |
Mauro Carvalho Chehab | 0579e6e | 2016-07-04 16:25:48 -0300 | [diff] [blame] | 104 | it blocks any other fd from changing device properties. Usually |
| 105 | applications which must not be interrupted, like video recording. |
Markus Heiser | 5377d91 | 2016-06-30 15:18:56 +0200 | [diff] [blame] | 106 | |
| 107 | |
Mauro Carvalho Chehab | 15e7d61 | 2016-07-05 15:14:35 -0300 | [diff] [blame] | 108 | Return Value |
Markus Heiser | 5377d91 | 2016-06-30 15:18:56 +0200 | [diff] [blame] | 109 | ============ |
| 110 | |
| 111 | On success 0 is returned, on error -1 and the ``errno`` variable is set |
| 112 | appropriately. The generic error codes are described at the |
| 113 | :ref:`Generic Error Codes <gen-errors>` chapter. |
| 114 | |
| 115 | EINVAL |
| 116 | The requested priority value is invalid. |
| 117 | |
| 118 | EBUSY |
| 119 | Another application already requested higher priority. |