vidioc-streamon.xml 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112
  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> or <link linkend="userp">user pointer</link>) I/O.</para>
  50. <para>Specifically the capture hardware is disabled and no input
  51. buffers are filled (if there are any empty buffers in the incoming
  52. queue) until <constant>VIDIOC_STREAMON</constant> has been called.
  53. Accordingly the output hardware is disabled, no video signal is
  54. produced until <constant>VIDIOC_STREAMON</constant> has been called.
  55. The ioctl will succeed only when at least one output buffer is in the
  56. incoming queue.</para>
  57. <para>The <constant>VIDIOC_STREAMOFF</constant> ioctl, apart of
  58. aborting or finishing any DMA in progress, unlocks any user pointer
  59. buffers locked in physical memory, and it removes all buffers from the
  60. incoming and outgoing queues. That means all images captured but not
  61. dequeued yet will be lost, likewise all images enqueued for output but
  62. not transmitted yet. I/O returns to the same state as after calling
  63. &VIDIOC-REQBUFS; and can be restarted accordingly.</para>
  64. <para>Both ioctls take a pointer to an integer, the desired buffer or
  65. stream type. This is the same as &v4l2-requestbuffers;
  66. <structfield>type</structfield>.</para>
  67. <para>If <constant>VIDIOC_STREAMON</constant> is called when streaming
  68. is already in progress, or if <constant>VIDIOC_STREAMOFF</constant> is called
  69. when streaming is already stopped, then the ioctl does nothing and 0 is
  70. returned.</para>
  71. <para>Note that applications can be preempted for unknown periods right
  72. before or after the <constant>VIDIOC_STREAMON</constant> or
  73. <constant>VIDIOC_STREAMOFF</constant> calls, there is no notion of
  74. starting or stopping "now". Buffer timestamps can be used to
  75. synchronize with other events.</para>
  76. </refsect1>
  77. <refsect1>
  78. &return-value;
  79. <variablelist>
  80. <varlistentry>
  81. <term><errorcode>EINVAL</errorcode></term>
  82. <listitem>
  83. <para>The buffer<structfield>type</structfield> is not supported,
  84. or no buffers have been allocated (memory mapping) or enqueued
  85. (output) yet.</para>
  86. </listitem>
  87. </varlistentry>
  88. <varlistentry>
  89. <term><errorcode>EPIPE</errorcode></term>
  90. <listitem>
  91. <para>The driver implements <link
  92. linkend="pad-level-formats">pad-level format configuration</link> and
  93. the pipeline configuration is invalid.
  94. </para>
  95. </listitem>
  96. </varlistentry>
  97. </variablelist>
  98. </refsect1>
  99. </refentry>