vidioc-g-input.rst 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. .. -*- coding: utf-8; mode: rst -*-
  2. .. _VIDIOC_G_INPUT:
  3. ************************************
  4. ioctl VIDIOC_G_INPUT, VIDIOC_S_INPUT
  5. ************************************
  6. Name
  7. ====
  8. VIDIOC_G_INPUT - VIDIOC_S_INPUT - Query or select the current video input
  9. Synopsis
  10. ========
  11. .. c:function:: int ioctl( int fd, VIDIOC_G_INPUT, int *argp )
  12. :name: VIDIOC_G_INPUT
  13. .. c:function:: int ioctl( int fd, VIDIOC_S_INPUT, int *argp )
  14. :name: VIDIOC_S_INPUT
  15. Arguments
  16. =========
  17. ``fd``
  18. File descriptor returned by :ref:`open() <func-open>`.
  19. ``argp``
  20. Description
  21. ===========
  22. To query the current video input applications call the
  23. :ref:`VIDIOC_G_INPUT <VIDIOC_G_INPUT>` ioctl with a pointer to an integer where the driver
  24. stores the number of the input, as in the struct
  25. :c:type:`v4l2_input` ``index`` field. This ioctl will fail
  26. only when there are no video inputs, returning ``EINVAL``.
  27. To select a video input applications store the number of the desired
  28. input in an integer and call the :ref:`VIDIOC_S_INPUT <VIDIOC_G_INPUT>` ioctl with a pointer
  29. to this integer. Side effects are possible. For example inputs may
  30. support different video standards, so the driver may implicitly switch
  31. the current standard. Because of these possible side effects
  32. applications must select an input before querying or negotiating any
  33. other parameters.
  34. Information about video inputs is available using the
  35. :ref:`VIDIOC_ENUMINPUT` ioctl.
  36. Return Value
  37. ============
  38. On success 0 is returned, on error -1 and the ``errno`` variable is set
  39. appropriately. The generic error codes are described at the
  40. :ref:`Generic Error Codes <gen-errors>` chapter.
  41. EINVAL
  42. The number of the video input is out of bounds.