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_QUERY_DV_TIMINGS: |
Markus Heiser | 5377d91 | 2016-06-30 15:18:56 +0200 | [diff] [blame] | 4 | |
| 5 | ***************************** |
| 6 | ioctl VIDIOC_QUERY_DV_TIMINGS |
| 7 | ***************************** |
| 8 | |
| 9 | *man VIDIOC_QUERY_DV_TIMINGS(2)* |
| 10 | |
| 11 | VIDIOC_SUBDEV_QUERY_DV_TIMINGS |
| 12 | Sense the DV preset received by the current input |
| 13 | |
| 14 | |
| 15 | Synopsis |
| 16 | ======== |
| 17 | |
| 18 | .. c:function:: int ioctl( int fd, int request, struct v4l2_dv_timings *argp ) |
| 19 | |
| 20 | Arguments |
| 21 | ========= |
| 22 | |
| 23 | ``fd`` |
| 24 | File descriptor returned by :ref:`open() <func-open>`. |
| 25 | |
| 26 | ``request`` |
| 27 | VIDIOC_QUERY_DV_TIMINGS, VIDIOC_SUBDEV_QUERY_DV_TIMINGS |
| 28 | |
| 29 | ``argp`` |
| 30 | |
| 31 | |
| 32 | Description |
| 33 | =========== |
| 34 | |
| 35 | The hardware may be able to detect the current DV timings automatically, |
| 36 | similar to sensing the video standard. To do so, applications call |
Mauro Carvalho Chehab | 2212ff2 | 2016-07-01 14:33:56 -0300 | [diff] [blame^] | 37 | :ref:`VIDIOC_QUERY_DV_TIMINGS` with a pointer to a struct |
Markus Heiser | 5377d91 | 2016-06-30 15:18:56 +0200 | [diff] [blame] | 38 | :ref:`v4l2_dv_timings <v4l2-dv-timings>`. Once the hardware detects |
| 39 | the timings, it will fill in the timings structure. |
| 40 | |
| 41 | Please note that drivers shall *not* switch timings automatically if new |
| 42 | timings are detected. Instead, drivers should send the |
| 43 | ``V4L2_EVENT_SOURCE_CHANGE`` event (if they support this) and expect |
Mauro Carvalho Chehab | 2212ff2 | 2016-07-01 14:33:56 -0300 | [diff] [blame^] | 44 | that userspace will take action by calling :ref:`VIDIOC_QUERY_DV_TIMINGS`. |
Markus Heiser | 5377d91 | 2016-06-30 15:18:56 +0200 | [diff] [blame] | 45 | The reason is that new timings usually mean different buffer sizes as |
| 46 | well, and you cannot change buffer sizes on the fly. In general, |
| 47 | applications that receive the Source Change event will have to call |
Mauro Carvalho Chehab | 2212ff2 | 2016-07-01 14:33:56 -0300 | [diff] [blame^] | 48 | :ref:`VIDIOC_QUERY_DV_TIMINGS`, and if the detected timings are valid they |
Markus Heiser | 5377d91 | 2016-06-30 15:18:56 +0200 | [diff] [blame] | 49 | will have to stop streaming, set the new timings, allocate new buffers |
| 50 | and start streaming again. |
| 51 | |
| 52 | If the timings could not be detected because there was no signal, then |
| 53 | ENOLINK is returned. If a signal was detected, but it was unstable and |
| 54 | the receiver could not lock to the signal, then ENOLCK is returned. If |
| 55 | the receiver could lock to the signal, but the format is unsupported |
| 56 | (e.g. because the pixelclock is out of range of the hardware |
| 57 | capabilities), then the driver fills in whatever timings it could find |
| 58 | and returns ERANGE. In that case the application can call |
Mauro Carvalho Chehab | 7347081 | 2016-07-01 13:58:44 -0300 | [diff] [blame] | 59 | :ref:`VIDIOC_DV_TIMINGS_CAP` to compare the |
Markus Heiser | 5377d91 | 2016-06-30 15:18:56 +0200 | [diff] [blame] | 60 | found timings with the hardware's capabilities in order to give more |
| 61 | precise feedback to the user. |
| 62 | |
| 63 | |
| 64 | Return Value |
| 65 | ============ |
| 66 | |
| 67 | On success 0 is returned, on error -1 and the ``errno`` variable is set |
| 68 | appropriately. The generic error codes are described at the |
| 69 | :ref:`Generic Error Codes <gen-errors>` chapter. |
| 70 | |
| 71 | ENODATA |
| 72 | Digital video timings are not supported for this input or output. |
| 73 | |
| 74 | ENOLINK |
| 75 | No timings could be detected because no signal was found. |
| 76 | |
| 77 | ENOLCK |
| 78 | The signal was unstable and the hardware could not lock on to it. |
| 79 | |
| 80 | ERANGE |
| 81 | Timings were found, but they are out of range of the hardware |
| 82 | capabilities. |
| 83 | |
| 84 | |
| 85 | .. ------------------------------------------------------------------------------ |
| 86 | .. This file was automatically converted from DocBook-XML with the dbxml |
| 87 | .. library (https://github.com/return42/sphkerneldoc). The origin XML comes |
| 88 | .. from the linux kernel, refer to: |
| 89 | .. |
| 90 | .. * https://github.com/torvalds/linux/tree/master/Documentation/DocBook |
| 91 | .. ------------------------------------------------------------------------------ |