~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

TOMOYO Linux Cross Reference
Linux/Documentation/userspace-api/media/v4l/vidioc-streamon.rst

Version: ~ [ linux-6.12-rc7 ] ~ [ linux-6.11.7 ] ~ [ linux-6.10.14 ] ~ [ linux-6.9.12 ] ~ [ linux-6.8.12 ] ~ [ linux-6.7.12 ] ~ [ linux-6.6.60 ] ~ [ linux-6.5.13 ] ~ [ linux-6.4.16 ] ~ [ linux-6.3.13 ] ~ [ linux-6.2.16 ] ~ [ linux-6.1.116 ] ~ [ linux-6.0.19 ] ~ [ linux-5.19.17 ] ~ [ linux-5.18.19 ] ~ [ linux-5.17.15 ] ~ [ linux-5.16.20 ] ~ [ linux-5.15.171 ] ~ [ linux-5.14.21 ] ~ [ linux-5.13.19 ] ~ [ linux-5.12.19 ] ~ [ linux-5.11.22 ] ~ [ linux-5.10.229 ] ~ [ linux-5.9.16 ] ~ [ linux-5.8.18 ] ~ [ linux-5.7.19 ] ~ [ linux-5.6.19 ] ~ [ linux-5.5.19 ] ~ [ linux-5.4.285 ] ~ [ linux-5.3.18 ] ~ [ linux-5.2.21 ] ~ [ linux-5.1.21 ] ~ [ linux-5.0.21 ] ~ [ linux-4.20.17 ] ~ [ linux-4.19.323 ] ~ [ linux-4.18.20 ] ~ [ linux-4.17.19 ] ~ [ linux-4.16.18 ] ~ [ linux-4.15.18 ] ~ [ linux-4.14.336 ] ~ [ linux-4.13.16 ] ~ [ linux-4.12.14 ] ~ [ linux-4.11.12 ] ~ [ linux-4.10.17 ] ~ [ linux-4.9.337 ] ~ [ linux-4.4.302 ] ~ [ linux-3.10.108 ] ~ [ linux-2.6.32.71 ] ~ [ linux-2.6.0 ] ~ [ linux-2.4.37.11 ] ~ [ unix-v6-master ] ~ [ ccs-tools-1.8.12 ] ~ [ policy-sample ] ~
Architecture: ~ [ i386 ] ~ [ alpha ] ~ [ m68k ] ~ [ mips ] ~ [ ppc ] ~ [ sparc ] ~ [ sparc64 ] ~

  1 .. SPDX-License-Identifier: GFDL-1.1-no-invariants-or-later
  2 .. c:namespace:: V4L
  3 
  4 .. _VIDIOC_STREAMON:
  5 
  6 ***************************************
  7 ioctl VIDIOC_STREAMON, VIDIOC_STREAMOFF
  8 ***************************************
  9 
 10 Name
 11 ====
 12 
 13 VIDIOC_STREAMON - VIDIOC_STREAMOFF - Start or stop streaming I/O
 14 
 15 Synopsis
 16 ========
 17 
 18 .. c:macro:: VIDIOC_STREAMON
 19 
 20 ``int ioctl(int fd, VIDIOC_STREAMON, const int *argp)``
 21 
 22 .. c:macro:: VIDIOC_STREAMOFF
 23 
 24 ``int ioctl(int fd, VIDIOC_STREAMOFF, const int *argp)``
 25 
 26 Arguments
 27 =========
 28 
 29 ``fd``
 30     File descriptor returned by :c:func:`open()`.
 31 
 32 ``argp``
 33     Pointer to an integer.
 34 
 35 Description
 36 ===========
 37 
 38 The ``VIDIOC_STREAMON`` and ``VIDIOC_STREAMOFF`` ioctl start and stop
 39 the capture or output process during streaming
 40 (:ref:`memory mapping <mmap>`, :ref:`user pointer <userp>` or
 41 :ref:`DMABUF <dmabuf>`) I/O.
 42 
 43 Capture hardware is disabled and no input buffers are filled (if there
 44 are any empty buffers in the incoming queue) until ``VIDIOC_STREAMON``
 45 has been called. Output hardware is disabled and no video signal is
 46 produced until ``VIDIOC_STREAMON`` has been called.
 47 
 48 Memory-to-memory devices will not start until ``VIDIOC_STREAMON`` has
 49 been called for both the capture and output stream types.
 50 
 51 If ``VIDIOC_STREAMON`` fails then any already queued buffers will remain
 52 queued.
 53 
 54 The ``VIDIOC_STREAMOFF`` ioctl, apart of aborting or finishing any DMA
 55 in progress, unlocks any user pointer buffers locked in physical memory,
 56 and it removes all buffers from the incoming and outgoing queues. That
 57 means all images captured but not dequeued yet will be lost, likewise
 58 all images enqueued for output but not transmitted yet. I/O returns to
 59 the same state as after calling
 60 :ref:`VIDIOC_REQBUFS` and can be restarted
 61 accordingly.
 62 
 63 If buffers have been queued with :ref:`VIDIOC_QBUF` and
 64 ``VIDIOC_STREAMOFF`` is called without ever having called
 65 ``VIDIOC_STREAMON``, then those queued buffers will also be removed from
 66 the incoming queue and all are returned to the same state as after
 67 calling :ref:`VIDIOC_REQBUFS` and can be restarted
 68 accordingly.
 69 
 70 Both ioctls take a pointer to an integer, the desired buffer or stream
 71 type. This is the same as struct
 72 :c:type:`v4l2_requestbuffers` ``type``.
 73 
 74 If ``VIDIOC_STREAMON`` is called when streaming is already in progress,
 75 or if ``VIDIOC_STREAMOFF`` is called when streaming is already stopped,
 76 then 0 is returned. Nothing happens in the case of ``VIDIOC_STREAMON``,
 77 but ``VIDIOC_STREAMOFF`` will return queued buffers to their starting
 78 state as mentioned above.
 79 
 80 .. note::
 81 
 82    Applications can be preempted for unknown periods right before
 83    or after the ``VIDIOC_STREAMON`` or ``VIDIOC_STREAMOFF`` calls, there is
 84    no notion of starting or stopping "now". Buffer timestamps can be used
 85    to synchronize with other events.
 86 
 87 Return Value
 88 ============
 89 
 90 On success 0 is returned, on error -1 and the ``errno`` variable is set
 91 appropriately. The generic error codes are described at the
 92 :ref:`Generic Error Codes <gen-errors>` chapter.
 93 
 94 EINVAL
 95     The buffer ``type`` is not supported, or no buffers have been
 96     allocated (memory mapping) or enqueued (output) yet.
 97 
 98 EPIPE
 99     The driver implements
100     :ref:`pad-level format configuration <pad-level-formats>` and the
101     pipeline configuration is invalid.
102 
103 ENOLINK
104     The driver implements Media Controller interface and the pipeline
105     link configuration is invalid.

~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

kernel.org | git.kernel.org | LWN.net | Project Home | SVN repository | Mail admin

Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.

sflogo.php