7.54. ioctl VIDIOC_STREAMON, VIDIOC_STREAMOFF¶
VIDIOC_STREAMON - VIDIOC_STREAMOFF - Start or stop streaming I/O
Capture hardware is disabled and no input buffers are filled (if there
are any empty buffers in the incoming queue) until
has been called. Output hardware is disabled and no video signal is
VIDIOC_STREAMON has been called. The ioctl will
succeed when at least one output buffer is in the incoming queue.
Memory-to-memory devices will not start until
been called for both the capture and output stream types.
VIDIOC_STREAMON fails then any already queued buffers will remain
VIDIOC_STREAMOFF ioctl, apart of aborting or finishing any DMA
in progress, unlocks any user pointer buffers locked in physical memory,
and it removes all buffers from the incoming and outgoing queues. That
means all images captured but not dequeued yet will be lost, likewise
all images enqueued for output but not transmitted yet. I/O returns to
the same state as after calling
ioctl VIDIOC_REQBUFS and can be restarted
If buffers have been queued with ioctl VIDIOC_QBUF, VIDIOC_DQBUF and
VIDIOC_STREAMOFF is called without ever having called
VIDIOC_STREAMON, then those queued buffers will also be removed from
the incoming queue and all are returned to the same state as after
calling ioctl VIDIOC_REQBUFS and can be restarted
Both ioctls take a pointer to an integer, the desired buffer or stream
type. This is the same as struct
VIDIOC_STREAMON is called when streaming is already in progress,
VIDIOC_STREAMOFF is called when streaming is already stopped,
then 0 is returned. Nothing happens in the case of
VIDIOC_STREAMOFF will return queued buffers to their starting
state as mentioned above.
Applications can be preempted for unknown periods right before
or after the
VIDIOC_STREAMOFF calls, there is
no notion of starting or stopping “now”. Buffer timestamps can be used
to synchronize with other events.
7.54.5. Return Value¶
On success 0 is returned, on error -1 and the
errno variable is set
appropriately. The generic error codes are described at the
Generic Error Codes chapter.
typeis not supported, or no buffers have been allocated (memory mapping) or enqueued (output) yet.
The driver implements pad-level format configuration and the pipeline configuration is invalid.
The driver implements Media Controller interface and the pipeline link configuration is invalid.