Commit 6970f299 authored by Mauro Carvalho Chehab's avatar Mauro Carvalho Chehab

doc-rst: mmap: Add ioctl cross references

There are lots of ioctls mentioned there that aren't cross-referenced.

Convert the const to cross references. That makes it visually
better, and improves navigation along the document.

While here, remove bad whitespaces.
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@s-opensource.com>
parent 5c591aa1
......@@ -224,37 +224,38 @@ mapped buffers, then to start capturing and enter the read loop. Here
the application waits until a filled buffer can be dequeued, and
re-enqueues the buffer when the data is no longer needed. Output
applications fill and enqueue buffers, when enough buffers are stacked
up the output is started with ``VIDIOC_STREAMON``. In the write loop,
when the application runs out of free buffers, it must wait until an
empty buffer can be dequeued and reused.
To enqueue and dequeue a buffer applications use the
:ref:`VIDIOC_QBUF` and
:ref:`VIDIOC_DQBUF <VIDIOC_QBUF>` ioctl. The status of a buffer being
mapped, enqueued, full or empty can be determined at any time using the
:ref:`VIDIOC_QUERYBUF` ioctl. Two methods exist to
suspend execution of the application until one or more buffers can be
dequeued. By default ``VIDIOC_DQBUF`` blocks when no buffer is in the
outgoing queue. When the ``O_NONBLOCK`` flag was given to the
:ref:`open() <func-open>` function, ``VIDIOC_DQBUF`` returns
immediately with an ``EAGAIN`` error code when no buffer is available. The
:ref:`select() <func-select>` or :ref:`poll() <func-poll>` functions
are always available.
up the output is started with :ref:`VIDIOC_STREAMON <VIDIOC_STREAMON>`.
In the write loop, when the application runs out of free buffers, it
must wait until an empty buffer can be dequeued and reused.
To enqueue and dequeue a buffer applications use the :ref:`VIDIOC_QBUF`
and :ref:`VIDIOC_DQBUF <VIDIOC_QBUF>` ioctl. The status of a buffer
being mapped, enqueued, full or empty can be determined at any time
using the :ref:`VIDIOC_QUERYBUF` ioctl. Two methods exist to suspend
execution of the application until one or more buffers can be dequeued.
By default :ref:`VIDIOC_DQBUF <VIDIOC_QBUF>` blocks when no buffer is
in the outgoing queue. When the ``O_NONBLOCK`` flag was given to the
:ref:`open() <func-open>` function, :ref:`VIDIOC_DQBUF <VIDIOC_QBUF>`
returns immediately with an ``EAGAIN`` error code when no buffer is
available. The :ref:`select() <func-select>` or :ref:`poll()
<func-poll>` functions are always available.
To start and stop capturing or output applications call the
:ref:`VIDIOC_STREAMON` and
:ref:`VIDIOC_STREAMOFF <VIDIOC_STREAMON>` ioctl. Note
``VIDIOC_STREAMOFF`` removes all buffers from both queues as a side
effect. Since there is no notion of doing anything "now" on a
multitasking system, if an application needs to synchronize with another
event it should examine the struct :ref:`v4l2_buffer <v4l2-buffer>`
``timestamp`` of captured or outputted buffers.
:ref:`VIDIOC_STREAMON <VIDIOC_STREAMON>` and :ref:`VIDIOC_STREAMOFF
<VIDIOC_STREAMON>` ioctl. Note :ref:`VIDIOC_STREAMOFF <VIDIOC_STREAMON>`
removes all buffers from both queues as a side effect. Since there is
no notion of doing anything "now" on a multitasking system, if an
application needs to synchronize with another event it should examine
the struct ::ref:`v4l2_buffer <v4l2-buffer>` ``timestamp`` of captured
or outputted buffers.
Drivers implementing memory mapping I/O must support the
``VIDIOC_REQBUFS``, ``VIDIOC_QUERYBUF``, ``VIDIOC_QBUF``,
``VIDIOC_DQBUF``, ``VIDIOC_STREAMON`` and ``VIDIOC_STREAMOFF`` ioctl,
the :ref:`mmap() <func-mmap>`, :ref:`munmap() <func-munmap>`, :ref:`select() <func-select>` and
:ref:`poll() <func-poll>` function. [3]_
:ref:`VIDIOC_REQBUFS <VIDIOC_REQBUFS>`, :ref:`VIDIOC_QUERYBUF
<VIDIOC_QUERYBUF>`, :ref:`VIDIOC_QBUF <VIDIOC_QBUF>`, :ref:`VIDIOC_DQBUF
<VIDIOC_QBUF>`, :ref:`VIDIOC_STREAMON <VIDIOC_STREAMON>`
and :ref:`VIDIOC_STREAMOFF <VIDIOC_STREAMON>` ioctls, the :ref:`mmap()
<func-mmap>`, :ref:`munmap() <func-munmap>`, :ref:`select()
<func-select>` and :ref:`poll() <func-poll>` function. [3]_
[capture example]
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment