vidioc-query-dv-timings.rst 2.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586
  1. .. -*- coding: utf-8; mode: rst -*-
  2. .. _VIDIOC_QUERY_DV_TIMINGS:
  3. *****************************
  4. ioctl VIDIOC_QUERY_DV_TIMINGS
  5. *****************************
  6. Name
  7. ====
  8. VIDIOC_QUERY_DV_TIMINGS - VIDIOC_SUBDEV_QUERY_DV_TIMINGS - Sense the DV preset received by the current input
  9. Synopsis
  10. ========
  11. .. c:function:: int ioctl( int fd, VIDIOC_QUERY_DV_TIMINGS, struct v4l2_dv_timings *argp )
  12. :name: VIDIOC_QUERY_DV_TIMINGS
  13. .. c:function:: int ioctl( int fd, VIDIOC_SUBDEV_QUERY_DV_TIMINGS, struct v4l2_dv_timings *argp )
  14. :name: VIDIOC_SUBDEV_QUERY_DV_TIMINGS
  15. Arguments
  16. =========
  17. ``fd``
  18. File descriptor returned by :ref:`open() <func-open>`.
  19. ``argp``
  20. Description
  21. ===========
  22. The hardware may be able to detect the current DV timings automatically,
  23. similar to sensing the video standard. To do so, applications call
  24. :ref:`VIDIOC_QUERY_DV_TIMINGS` with a pointer to a struct
  25. :c:type:`v4l2_dv_timings`. Once the hardware detects
  26. the timings, it will fill in the timings structure.
  27. .. note::
  28. Drivers shall *not* switch timings automatically if new
  29. timings are detected. Instead, drivers should send the
  30. ``V4L2_EVENT_SOURCE_CHANGE`` event (if they support this) and expect
  31. that userspace will take action by calling :ref:`VIDIOC_QUERY_DV_TIMINGS`.
  32. The reason is that new timings usually mean different buffer sizes as
  33. well, and you cannot change buffer sizes on the fly. In general,
  34. applications that receive the Source Change event will have to call
  35. :ref:`VIDIOC_QUERY_DV_TIMINGS`, and if the detected timings are valid they
  36. will have to stop streaming, set the new timings, allocate new buffers
  37. and start streaming again.
  38. If the timings could not be detected because there was no signal, then
  39. ENOLINK is returned. If a signal was detected, but it was unstable and
  40. the receiver could not lock to the signal, then ``ENOLCK`` is returned. If
  41. the receiver could lock to the signal, but the format is unsupported
  42. (e.g. because the pixelclock is out of range of the hardware
  43. capabilities), then the driver fills in whatever timings it could find
  44. and returns ``ERANGE``. In that case the application can call
  45. :ref:`VIDIOC_DV_TIMINGS_CAP` to compare the
  46. found timings with the hardware's capabilities in order to give more
  47. precise feedback to the user.
  48. Return Value
  49. ============
  50. On success 0 is returned, on error -1 and the ``errno`` variable is set
  51. appropriately. The generic error codes are described at the
  52. :ref:`Generic Error Codes <gen-errors>` chapter.
  53. ENODATA
  54. Digital video timings are not supported for this input or output.
  55. ENOLINK
  56. No timings could be detected because no signal was found.
  57. ENOLCK
  58. The signal was unstable and the hardware could not lock on to it.
  59. ERANGE
  60. Timings were found, but they are out of range of the hardware
  61. capabilities.