vidioc-streamon.xml 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128
  1. <refentry id="vidioc-streamon">
  2. <refmeta>
  3. <refentrytitle>ioctl VIDIOC_STREAMON, VIDIOC_STREAMOFF</refentrytitle>
  4. &manvol;
  5. </refmeta>
  6. <refnamediv>
  7. <refname>VIDIOC_STREAMON</refname>
  8. <refname>VIDIOC_STREAMOFF</refname>
  9. <refpurpose>Start or stop streaming I/O</refpurpose>
  10. </refnamediv>
  11. <refsynopsisdiv>
  12. <funcsynopsis>
  13. <funcprototype>
  14. <funcdef>int <function>ioctl</function></funcdef>
  15. <paramdef>int <parameter>fd</parameter></paramdef>
  16. <paramdef>int <parameter>request</parameter></paramdef>
  17. <paramdef>const int *<parameter>argp</parameter></paramdef>
  18. </funcprototype>
  19. </funcsynopsis>
  20. </refsynopsisdiv>
  21. <refsect1>
  22. <title>Arguments</title>
  23. <variablelist>
  24. <varlistentry>
  25. <term><parameter>fd</parameter></term>
  26. <listitem>
  27. <para>&fd;</para>
  28. </listitem>
  29. </varlistentry>
  30. <varlistentry>
  31. <term><parameter>request</parameter></term>
  32. <listitem>
  33. <para>VIDIOC_STREAMON, VIDIOC_STREAMOFF</para>
  34. </listitem>
  35. </varlistentry>
  36. <varlistentry>
  37. <term><parameter>argp</parameter></term>
  38. <listitem>
  39. <para></para>
  40. </listitem>
  41. </varlistentry>
  42. </variablelist>
  43. </refsect1>
  44. <refsect1>
  45. <title>Description</title>
  46. <para>The <constant>VIDIOC_STREAMON</constant> and
  47. <constant>VIDIOC_STREAMOFF</constant> ioctl start and stop the capture
  48. or output process during streaming (<link linkend="mmap">memory
  49. mapping</link>, <link linkend="userp">user pointer</link> or
  50. <link linkend="dmabuf">DMABUF</link>) I/O.</para>
  51. <para>Capture hardware is disabled and no input
  52. buffers are filled (if there are any empty buffers in the incoming
  53. queue) until <constant>VIDIOC_STREAMON</constant> has been called.
  54. Output hardware is disabled and no video signal is
  55. produced until <constant>VIDIOC_STREAMON</constant> has been called.
  56. The ioctl will succeed when at least one output buffer is in the
  57. incoming queue.</para>
  58. <para>Memory-to-memory devices will not start until
  59. <constant>VIDIOC_STREAMON</constant> has been called for both the capture
  60. and output stream types.</para>
  61. <para>If <constant>VIDIOC_STREAMON</constant> fails then any already
  62. queued buffers will remain queued.</para>
  63. <para>The <constant>VIDIOC_STREAMOFF</constant> ioctl, apart of
  64. aborting or finishing any DMA in progress, unlocks any user pointer
  65. buffers locked in physical memory, and it removes all buffers from the
  66. incoming and outgoing queues. That means all images captured but not
  67. dequeued yet will be lost, likewise all images enqueued for output but
  68. not transmitted yet. I/O returns to the same state as after calling
  69. &VIDIOC-REQBUFS; and can be restarted accordingly.</para>
  70. <para>If buffers have been queued with &VIDIOC-QBUF; and
  71. <constant>VIDIOC_STREAMOFF</constant> is called without ever having
  72. called <constant>VIDIOC_STREAMON</constant>, then those queued buffers
  73. will also be removed from the incoming queue and all are returned to the
  74. same state as after calling &VIDIOC-REQBUFS; and can be restarted
  75. accordingly.</para>
  76. <para>Both ioctls take a pointer to an integer, the desired buffer or
  77. stream type. This is the same as &v4l2-requestbuffers;
  78. <structfield>type</structfield>.</para>
  79. <para>If <constant>VIDIOC_STREAMON</constant> is called when streaming
  80. is already in progress, or if <constant>VIDIOC_STREAMOFF</constant> is called
  81. when streaming is already stopped, then 0 is returned. Nothing happens in the
  82. case of <constant>VIDIOC_STREAMON</constant>, but <constant>VIDIOC_STREAMOFF</constant>
  83. will return queued buffers to their starting state as mentioned above.</para>
  84. <para>Note that applications can be preempted for unknown periods right
  85. before or after the <constant>VIDIOC_STREAMON</constant> or
  86. <constant>VIDIOC_STREAMOFF</constant> calls, there is no notion of
  87. starting or stopping "now". Buffer timestamps can be used to
  88. synchronize with other events.</para>
  89. </refsect1>
  90. <refsect1>
  91. &return-value;
  92. <variablelist>
  93. <varlistentry>
  94. <term><errorcode>EINVAL</errorcode></term>
  95. <listitem>
  96. <para>The buffer <structfield>type</structfield> is not supported,
  97. or no buffers have been allocated (memory mapping) or enqueued
  98. (output) yet.</para>
  99. </listitem>
  100. </varlistentry>
  101. <varlistentry>
  102. <term><errorcode>EPIPE</errorcode></term>
  103. <listitem>
  104. <para>The driver implements <link
  105. linkend="pad-level-formats">pad-level format configuration</link> and
  106. the pipeline configuration is invalid.
  107. </para>
  108. </listitem>
  109. </varlistentry>
  110. </variablelist>
  111. </refsect1>
  112. </refentry>