vidioc-querystd.rst 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. .. SPDX-License-Identifier: GFDL-1.1-no-invariants-or-later
  2. .. c:namespace:: V4L
  3. .. _VIDIOC_QUERYSTD:
  4. *********************************************
  5. ioctl VIDIOC_QUERYSTD, VIDIOC_SUBDEV_QUERYSTD
  6. *********************************************
  7. Name
  8. ====
  9. VIDIOC_QUERYSTD - VIDIOC_SUBDEV_QUERYSTD - Sense the video standard received by the current input
  10. Synopsis
  11. ========
  12. .. c:macro:: VIDIOC_QUERYSTD
  13. ``int ioctl(int fd, VIDIOC_QUERYSTD, v4l2_std_id *argp)``
  14. .. c:macro:: VIDIOC_SUBDEV_QUERYSTD
  15. ``int ioctl(int fd, VIDIOC_SUBDEV_QUERYSTD, v4l2_std_id *argp)``
  16. Arguments
  17. =========
  18. ``fd``
  19. File descriptor returned by :c:func:`open()`.
  20. ``argp``
  21. Pointer to :c:type:`v4l2_std_id`.
  22. Description
  23. ===========
  24. The hardware may be able to detect the current video standard
  25. automatically. To do so, applications call :ref:`VIDIOC_QUERYSTD` with a
  26. pointer to a :ref:`v4l2_std_id <v4l2-std-id>` type. The driver
  27. stores here a set of candidates, this can be a single flag or a set of
  28. supported standards if for example the hardware can only distinguish
  29. between 50 and 60 Hz systems. If no signal was detected, then the driver
  30. will return V4L2_STD_UNKNOWN. When detection is not possible or fails,
  31. the set must contain all standards supported by the current video input
  32. or output.
  33. .. note::
  34. Drivers shall *not* switch the video standard
  35. automatically if a new video standard is detected. Instead, drivers
  36. should send the ``V4L2_EVENT_SOURCE_CHANGE`` event (if they support
  37. this) and expect that userspace will take action by calling
  38. :ref:`VIDIOC_QUERYSTD`. The reason is that a new video standard can mean
  39. different buffer sizes as well, and you cannot change buffer sizes on
  40. the fly. In general, applications that receive the Source Change event
  41. will have to call :ref:`VIDIOC_QUERYSTD`, and if the detected video
  42. standard is valid they will have to stop streaming, set the new
  43. standard, allocate new buffers and start streaming again.
  44. Return Value
  45. ============
  46. On success 0 is returned, on error -1 and the ``errno`` variable is set
  47. appropriately. The generic error codes are described at the
  48. :ref:`Generic Error Codes <gen-errors>` chapter.
  49. ENODATA
  50. Standard video timings are not supported for this input or output.