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 | 41d8046 | 2016-08-19 16:53:38 -0300 | [diff] [blame] | 18 | .. c:function:: int ioctl( int fd, VIDIOC_G_PRIORITY, enum v4l2_priority *argp ) |
| 19 | :name: VIDIOC_G_PRIORITY |
Markus Heiser | 5377d91 | 2016-06-30 15:18:56 +0200 | [diff] [blame] | 20 | |
Mauro Carvalho Chehab | 41d8046 | 2016-08-19 16:53:38 -0300 | [diff] [blame] | 21 | .. c:function:: int ioctl( int fd, VIDIOC_S_PRIORITY, const enum v4l2_priority *argp ) |
| 22 | :name: VIDIOC_S_PRIORITY |
Markus Heiser | 5377d91 | 2016-06-30 15:18:56 +0200 | [diff] [blame] | 23 | |
Mauro Carvalho Chehab | 586027c | 2016-07-05 07:58:48 -0300 | [diff] [blame] | 24 | |
Mauro Carvalho Chehab | 15e7d61 | 2016-07-05 15:14:35 -0300 | [diff] [blame] | 25 | Arguments |
Markus Heiser | 5377d91 | 2016-06-30 15:18:56 +0200 | [diff] [blame] | 26 | ========= |
| 27 | |
| 28 | ``fd`` |
| 29 | File descriptor returned by :ref:`open() <func-open>`. |
| 30 | |
Markus Heiser | 5377d91 | 2016-06-30 15:18:56 +0200 | [diff] [blame] | 31 | ``argp`` |
Mauro Carvalho Chehab | 1473c75 | 2017-09-02 09:54:48 -0400 | [diff] [blame] | 32 | Pointer to an enum :c:type:`v4l2_priority` type. |
Markus Heiser | 5377d91 | 2016-06-30 15:18:56 +0200 | [diff] [blame] | 33 | |
| 34 | |
Mauro Carvalho Chehab | 15e7d61 | 2016-07-05 15:14:35 -0300 | [diff] [blame] | 35 | Description |
Markus Heiser | 5377d91 | 2016-06-30 15:18:56 +0200 | [diff] [blame] | 36 | =========== |
| 37 | |
| 38 | To query the current access priority applications call the |
Mauro Carvalho Chehab | 4e03cb7 | 2016-07-03 10:02:29 -0300 | [diff] [blame] | 39 | :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] | 40 | variable where the driver stores the current priority. |
| 41 | |
| 42 | To request an access priority applications store the desired priority in |
Mauro Carvalho Chehab | 2212ff2 | 2016-07-01 14:33:56 -0300 | [diff] [blame] | 43 | 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] | 44 | with a pointer to this variable. |
| 45 | |
| 46 | |
Mauro Carvalho Chehab | ffa0441 | 2016-08-29 18:40:21 -0300 | [diff] [blame] | 47 | .. c:type:: v4l2_priority |
Markus Heiser | 5377d91 | 2016-06-30 15:18:56 +0200 | [diff] [blame] | 48 | |
Mauro Carvalho Chehab | 5bd4bb7 | 2016-08-17 08:14:19 -0300 | [diff] [blame] | 49 | .. tabularcolumns:: |p{6.6cm}|p{2.2cm}|p{8.7cm}| |
| 50 | |
Markus Heiser | 5377d91 | 2016-06-30 15:18:56 +0200 | [diff] [blame] | 51 | .. flat-table:: enum v4l2_priority |
| 52 | :header-rows: 0 |
| 53 | :stub-columns: 0 |
| 54 | :widths: 3 1 4 |
| 55 | |
Laurent Pinchart | c2b66ca | 2016-09-05 08:44:34 -0300 | [diff] [blame] | 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. |
Markus Heiser | 5377d91 | 2016-06-30 15:18:56 +0200 | [diff] [blame] | 80 | |
| 81 | |
Mauro Carvalho Chehab | 15e7d61 | 2016-07-05 15:14:35 -0300 | [diff] [blame] | 82 | Return Value |
Markus Heiser | 5377d91 | 2016-06-30 15:18:56 +0200 | [diff] [blame] | 83 | ============ |
| 84 | |
| 85 | On success 0 is returned, on error -1 and the ``errno`` variable is set |
| 86 | appropriately. The generic error codes are described at the |
| 87 | :ref:`Generic Error Codes <gen-errors>` chapter. |
| 88 | |
| 89 | EINVAL |
| 90 | The requested priority value is invalid. |
| 91 | |
| 92 | EBUSY |
| 93 | Another application already requested higher priority. |