Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit c2b66caf authored by Laurent Pinchart's avatar Laurent Pinchart Committed by Mauro Carvalho Chehab
Browse files

[media] v4l: doc: Remove row numbers from tables



Shorten the tables by removing row numbers in comments, allowing for
later insertion of rows with minimal diffs.

All changes have been generated by the following script.

import io
import re
import sys

def process_table(fname, data):
	if fname.endswith('hist-v4l2.rst'):
		data = re.sub(u'\n{1,2}\t( ?)  -( ?) ?', u'\n\t\\1 -\\2', data, flags = re.MULTILINE)
		data = re.sub(u'\n(\t|       )-  \.\. row [0-9]+\n\t  ?-( ?) ?', u'\\1* -\\2', data, flags = re.MULTILINE)
	else:
		data = re.sub(u'\n{1,2}       -( ?) ?', u'\n      -\\1', data, flags = re.MULTILINE)
		data = re.sub(u'(\n?)(\n\n    -  \.\. row 1\n)', u'\n\\2', data, flags = re.MULTILINE)
		data = re.sub(u'\n    -  \.\. row [0-9]+\n      -( ?) ?', u'    * -\\1', data, flags = re.MULTILINE)
		data = re.sub(u'\n    -  \.\. row [0-9]+\n       \.\. (_[A-Z0-9_`-]*:)', u'\n    -  .. \\1', data, flags = re.MULTILINE)
		data = re.sub(u'\n    -  \.\. (_[A-Z0-9_`-]*:)\n      -', u'    * .. \\1\n\n      -', data, flags = re.MULTILINE)
		data = re.sub(u'^       - ', u'      -', data, flags = re.MULTILINE)
		data = re.sub(u'^(\t{1,2})  ', u'\\1', data, flags = re.MULTILINE)

	return data

def process_file(fname, data):
	buf = io.StringIO(data)
	output = ''
	in_table = False
	table_separator = 0

	for line in buf.readlines():
		if line.find('.. flat-table::') != -1:
			in_table = True
			table = ''
		elif in_table and not re.match('^[\t\n]|(    )', line):
			in_table = False
			output += process_table(fname, table)

		if in_table:
			table += line
		else:
			output += line

	if in_table:
		in_table = False
		output += process_table(fname, table)

	return output

fname = sys.argv[1]

data = file(fname, 'rb').read().decode('utf-8')
data = process_file(fname, data)
file(fname, 'wb').write(data.encode('utf-8'))

Signed-off-by: default avatarLaurent Pinchart <laurent.pinchart@ideasonboard.com>
parent c1958488
Loading
Loading
Loading
Loading
+494 −843
Original line number Original line Diff line number Diff line
@@ -48,13 +48,8 @@ struct v4l2_buffer
    :stub-columns: 0
    :stub-columns: 0
    :widths:       1 2 1 10
    :widths:       1 2 1 10



    * - __u32
    -  .. row 1

       -  __u32

      - ``index``
      - ``index``

      -
      -
      - Number of the buffer, set by the application except when calling
      - Number of the buffer, set by the application except when calling
	:ref:`VIDIOC_DQBUF <VIDIOC_QBUF>`, then it is set by the
	:ref:`VIDIOC_DQBUF <VIDIOC_QBUF>`, then it is set by the
@@ -63,25 +58,15 @@ struct v4l2_buffer
	(struct :c:type:`v4l2_requestbuffers`
	(struct :c:type:`v4l2_requestbuffers`
	``count``), plus any buffers allocated with
	``count``), plus any buffers allocated with
	:ref:`VIDIOC_CREATE_BUFS` minus one.
	:ref:`VIDIOC_CREATE_BUFS` minus one.

    * - __u32
    -  .. row 2

       -  __u32

      - ``type``
      - ``type``

      -
      -
      - Type of the buffer, same as struct
      - Type of the buffer, same as struct
	:c:type:`v4l2_format` ``type`` or struct
	:c:type:`v4l2_format` ``type`` or struct
	:c:type:`v4l2_requestbuffers` ``type``, set
	:c:type:`v4l2_requestbuffers` ``type``, set
	by the application. See :c:type:`v4l2_buf_type`
	by the application. See :c:type:`v4l2_buf_type`

    * - __u32
    -  .. row 3

       -  __u32

      - ``bytesused``
      - ``bytesused``

      -
      -
      - The number of bytes occupied by the data in the buffer. It depends
      - The number of bytes occupied by the data in the buffer. It depends
	on the negotiated data format and may change with each buffer for
	on the negotiated data format and may change with each buffer for
@@ -92,34 +77,19 @@ struct v4l2_buffer
	size of the buffer (see the ``length`` field of this struct) by
	size of the buffer (see the ``length`` field of this struct) by
	the driver. For multiplanar formats this field is ignored and the
	the driver. For multiplanar formats this field is ignored and the
	``planes`` pointer is used instead.
	``planes`` pointer is used instead.

    * - __u32
    -  .. row 4

       -  __u32

      - ``flags``
      - ``flags``

      -
      -
      - Flags set by the application or driver, see :ref:`buffer-flags`.
      - Flags set by the application or driver, see :ref:`buffer-flags`.

    * - __u32
    -  .. row 5

       -  __u32

      - ``field``
      - ``field``

      -
      -
      - Indicates the field order of the image in the buffer, see
      - Indicates the field order of the image in the buffer, see
	:c:type:`v4l2_field`. This field is not used when the buffer
	:c:type:`v4l2_field`. This field is not used when the buffer
	contains VBI data. Drivers must set it when ``type`` refers to a
	contains VBI data. Drivers must set it when ``type`` refers to a
	capture stream, applications when it refers to an output stream.
	capture stream, applications when it refers to an output stream.

    * - struct timeval
    -  .. row 6

       -  struct timeval

      - ``timestamp``
      - ``timestamp``

      -
      -
      - For capture streams this is time when the first data byte was
      - For capture streams this is time when the first data byte was
	captured, as returned by the :c:func:`clock_gettime()` function
	captured, as returned by the :c:func:`clock_gettime()` function
@@ -131,13 +101,8 @@ struct v4l2_buffer
	use ``V4L2_BUF_FLAG_TIMESTAMP_COPY`` the application has to fill
	use ``V4L2_BUF_FLAG_TIMESTAMP_COPY`` the application has to fill
	in the timestamp which will be copied by the driver to the capture
	in the timestamp which will be copied by the driver to the capture
	stream.
	stream.

    * - struct :c:type:`v4l2_timecode`
    -  .. row 7

       -  struct :c:type:`v4l2_timecode`

      - ``timecode``
      - ``timecode``

      -
      -
      - When ``type`` is ``V4L2_BUF_TYPE_VIDEO_CAPTURE`` and the
      - When ``type`` is ``V4L2_BUF_TYPE_VIDEO_CAPTURE`` and the
	``V4L2_BUF_FLAG_TIMECODE`` flag is set in ``flags``, this
	``V4L2_BUF_FLAG_TIMECODE`` flag is set in ``flags``, this
@@ -147,20 +112,12 @@ struct v4l2_buffer
	help video editing and are typically recorded on video tapes, but
	help video editing and are typically recorded on video tapes, but
	also embedded in compressed formats like MPEG. This field is
	also embedded in compressed formats like MPEG. This field is
	independent of the ``timestamp`` and ``sequence`` fields.
	independent of the ``timestamp`` and ``sequence`` fields.

    * - __u32
    -  .. row 8

       -  __u32

      - ``sequence``
      - ``sequence``

      -
      -
      - Set by the driver, counting the frames (not fields!) in sequence.
      - Set by the driver, counting the frames (not fields!) in sequence.
	This field is set for both input and output devices.
	This field is set for both input and output devices.

    * - :cspan:`3`
    -  .. row 9

       -  :cspan:`3`


	In :c:type:`V4L2_FIELD_ALTERNATE <v4l2_field>` mode the top and
	In :c:type:`V4L2_FIELD_ALTERNATE <v4l2_field>` mode the top and
	bottom field have the same sequence number. The count starts at
	bottom field have the same sequence number. The count starts at
@@ -178,78 +135,44 @@ struct v4l2_buffer
	   identify by not enumerating any video standards, see
	   identify by not enumerating any video standards, see
	   :ref:`standard`.
	   :ref:`standard`.



    * - __u32
    -  .. row 10

       -  __u32

      - ``memory``
      - ``memory``

      -
      -
      - This field must be set by applications and/or drivers in
      - This field must be set by applications and/or drivers in
	accordance with the selected I/O method. See :c:type:`v4l2_memory`
	accordance with the selected I/O method. See :c:type:`v4l2_memory`

    * - union
    -  .. row 11

       -  union

      - ``m``
      - ``m``

    * -
    -  .. row 12

       -
      - __u32
      - __u32

      - ``offset``
      - ``offset``

      - For the single-planar API and when ``memory`` is
      - For the single-planar API and when ``memory`` is
	``V4L2_MEMORY_MMAP`` this is the offset of the buffer from the
	``V4L2_MEMORY_MMAP`` this is the offset of the buffer from the
	start of the device memory. The value is returned by the driver
	start of the device memory. The value is returned by the driver
	and apart of serving as parameter to the
	and apart of serving as parameter to the
	:ref:`mmap() <func-mmap>` function not useful for applications.
	:ref:`mmap() <func-mmap>` function not useful for applications.
	See :ref:`mmap` for details
	See :ref:`mmap` for details

    * -
    -  .. row 13

       -
      - unsigned long
      - unsigned long

      - ``userptr``
      - ``userptr``

      - For the single-planar API and when ``memory`` is
      - For the single-planar API and when ``memory`` is
	``V4L2_MEMORY_USERPTR`` this is a pointer to the buffer (casted to
	``V4L2_MEMORY_USERPTR`` this is a pointer to the buffer (casted to
	unsigned long type) in virtual memory, set by the application. See
	unsigned long type) in virtual memory, set by the application. See
	:ref:`userp` for details.
	:ref:`userp` for details.

    * -
    -  .. row 14

       -
      - struct v4l2_plane
      - struct v4l2_plane

      - ``*planes``
      - ``*planes``

      - When using the multi-planar API, contains a userspace pointer to
      - When using the multi-planar API, contains a userspace pointer to
	an array of struct :c:type:`v4l2_plane`. The size of
	an array of struct :c:type:`v4l2_plane`. The size of
	the array should be put in the ``length`` field of this
	the array should be put in the ``length`` field of this
	struct :c:type:`v4l2_buffer` structure.
	struct :c:type:`v4l2_buffer` structure.

    * -
    -  .. row 15

       -
      - int
      - int

      - ``fd``
      - ``fd``

      - For the single-plane API and when ``memory`` is
      - For the single-plane API and when ``memory`` is
	``V4L2_MEMORY_DMABUF`` this is the file descriptor associated with
	``V4L2_MEMORY_DMABUF`` this is the file descriptor associated with
	a DMABUF buffer.
	a DMABUF buffer.

    * - __u32
    -  .. row 16

       -  __u32

      - ``length``
      - ``length``

      -
      -
      - Size of the buffer (not the payload) in bytes for the
      - Size of the buffer (not the payload) in bytes for the
	single-planar API. This is set by the driver based on the calls to
	single-planar API. This is set by the driver based on the calls to
@@ -258,23 +181,13 @@ struct v4l2_buffer
	multi-planar API the application sets this to the number of
	multi-planar API the application sets this to the number of
	elements in the ``planes`` array. The driver will fill in the
	elements in the ``planes`` array. The driver will fill in the
	actual number of valid elements in that array.
	actual number of valid elements in that array.

    * - __u32
    -  .. row 17

       -  __u32

      - ``reserved2``
      - ``reserved2``

      -
      -
      - A place holder for future extensions. Drivers and applications
      - A place holder for future extensions. Drivers and applications
	must set this to 0.
	must set this to 0.

    * - __u32
    -  .. row 18

       -  __u32

      - ``reserved``
      - ``reserved``

      -
      -
      - A place holder for future extensions. Drivers and applications
      - A place holder for future extensions. Drivers and applications
	must set this to 0.
	must set this to 0.
@@ -295,13 +208,8 @@ struct v4l2_plane
    :stub-columns: 0
    :stub-columns: 0
    :widths:       1 1 1 2
    :widths:       1 1 1 2



    * - __u32
    -  .. row 1

       -  __u32

      - ``bytesused``
      - ``bytesused``

      -
      -
      - The number of bytes occupied by data in the plane (its payload).
      - The number of bytes occupied by data in the plane (its payload).
	Drivers must set this field when ``type`` refers to a capture
	Drivers must set this field when ``type`` refers to a capture
@@ -314,71 +222,41 @@ struct v4l2_plane


	   Note that the actual image data starts at ``data_offset``
	   Note that the actual image data starts at ``data_offset``
	   which may not be 0.
	   which may not be 0.

    * - __u32
    -  .. row 2

       -  __u32

      - ``length``
      - ``length``

      -
      -
      - Size in bytes of the plane (not its payload). This is set by the
      - Size in bytes of the plane (not its payload). This is set by the
	driver based on the calls to
	driver based on the calls to
	:ref:`VIDIOC_REQBUFS` and/or
	:ref:`VIDIOC_REQBUFS` and/or
	:ref:`VIDIOC_CREATE_BUFS`.
	:ref:`VIDIOC_CREATE_BUFS`.

    * - union
    -  .. row 3

       -  union

      - ``m``
      - ``m``

      -
      -
      -
      -

    * -
    -  .. row 4

       -
      - __u32
      - __u32

      - ``mem_offset``
      - ``mem_offset``

      - When the memory type in the containing struct
      - When the memory type in the containing struct
	:c:type:`v4l2_buffer` is ``V4L2_MEMORY_MMAP``, this
	:c:type:`v4l2_buffer` is ``V4L2_MEMORY_MMAP``, this
	is the value that should be passed to :ref:`mmap() <func-mmap>`,
	is the value that should be passed to :ref:`mmap() <func-mmap>`,
	similar to the ``offset`` field in struct
	similar to the ``offset`` field in struct
	:c:type:`v4l2_buffer`.
	:c:type:`v4l2_buffer`.

    * -
    -  .. row 5

       -
      - unsigned long
      - unsigned long

      - ``userptr``
      - ``userptr``

      - When the memory type in the containing struct
      - When the memory type in the containing struct
	:c:type:`v4l2_buffer` is ``V4L2_MEMORY_USERPTR``,
	:c:type:`v4l2_buffer` is ``V4L2_MEMORY_USERPTR``,
	this is a userspace pointer to the memory allocated for this plane
	this is a userspace pointer to the memory allocated for this plane
	by an application.
	by an application.

    * -
    -  .. row 6

       -
      - int
      - int

      - ``fd``
      - ``fd``

      - When the memory type in the containing struct
      - When the memory type in the containing struct
	:c:type:`v4l2_buffer` is ``V4L2_MEMORY_DMABUF``,
	:c:type:`v4l2_buffer` is ``V4L2_MEMORY_DMABUF``,
	this is a file descriptor associated with a DMABUF buffer, similar
	this is a file descriptor associated with a DMABUF buffer, similar
	to the ``fd`` field in struct :c:type:`v4l2_buffer`.
	to the ``fd`` field in struct :c:type:`v4l2_buffer`.

    * - __u32
    -  .. row 7

       -  __u32

      - ``data_offset``
      - ``data_offset``

      -
      -
      - Offset in bytes to video data in the plane. Drivers must set this
      - Offset in bytes to video data in the plane. Drivers must set this
	field when ``type`` refers to a capture stream, applications when
	field when ``type`` refers to a capture stream, applications when
@@ -389,13 +267,8 @@ struct v4l2_plane
	   That data_offset is included  in ``bytesused``. So the
	   That data_offset is included  in ``bytesused``. So the
	   size of the image in the plane is ``bytesused``-``data_offset``
	   size of the image in the plane is ``bytesused``-``data_offset``
	   at offset ``data_offset`` from the start of the plane.
	   at offset ``data_offset`` from the start of the plane.

    * - __u32
    -  .. row 8

       -  __u32

      - ``reserved[11]``
      - ``reserved[11]``

      -
      -
      - Reserved for future use. Should be zeroed by drivers and
      - Reserved for future use. Should be zeroed by drivers and
	applications.
	applications.
@@ -416,105 +289,45 @@ enum v4l2_buf_type
    :stub-columns: 0
    :stub-columns: 0
    :widths:       4 1 9
    :widths:       4 1 9



    * - ``V4L2_BUF_TYPE_VIDEO_CAPTURE``
    -  .. row 1

       -  ``V4L2_BUF_TYPE_VIDEO_CAPTURE``

      - 1
      - 1

      - Buffer of a single-planar video capture stream, see
      - Buffer of a single-planar video capture stream, see
	:ref:`capture`.
	:ref:`capture`.

    * - ``V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE``
    -  .. row 2

       -  ``V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE``

      - 9
      - 9

      - Buffer of a multi-planar video capture stream, see
      - Buffer of a multi-planar video capture stream, see
	:ref:`capture`.
	:ref:`capture`.

    * - ``V4L2_BUF_TYPE_VIDEO_OUTPUT``
    -  .. row 3

       -  ``V4L2_BUF_TYPE_VIDEO_OUTPUT``

      - 2
      - 2

      - Buffer of a single-planar video output stream, see
      - Buffer of a single-planar video output stream, see
	:ref:`output`.
	:ref:`output`.

    * - ``V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE``
    -  .. row 4

       -  ``V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE``

      - 10
      - 10

      - Buffer of a multi-planar video output stream, see :ref:`output`.
      - Buffer of a multi-planar video output stream, see :ref:`output`.

    * - ``V4L2_BUF_TYPE_VIDEO_OVERLAY``
    -  .. row 5

       -  ``V4L2_BUF_TYPE_VIDEO_OVERLAY``

      - 3
      - 3

      - Buffer for video overlay, see :ref:`overlay`.
      - Buffer for video overlay, see :ref:`overlay`.

    * - ``V4L2_BUF_TYPE_VBI_CAPTURE``
    -  .. row 6

       -  ``V4L2_BUF_TYPE_VBI_CAPTURE``

      - 4
      - 4

      - Buffer of a raw VBI capture stream, see :ref:`raw-vbi`.
      - Buffer of a raw VBI capture stream, see :ref:`raw-vbi`.

    * - ``V4L2_BUF_TYPE_VBI_OUTPUT``
    -  .. row 7

       -  ``V4L2_BUF_TYPE_VBI_OUTPUT``

      - 5
      - 5

      - Buffer of a raw VBI output stream, see :ref:`raw-vbi`.
      - Buffer of a raw VBI output stream, see :ref:`raw-vbi`.

    * - ``V4L2_BUF_TYPE_SLICED_VBI_CAPTURE``
    -  .. row 8

       -  ``V4L2_BUF_TYPE_SLICED_VBI_CAPTURE``

      - 6
      - 6

      - Buffer of a sliced VBI capture stream, see :ref:`sliced`.
      - Buffer of a sliced VBI capture stream, see :ref:`sliced`.

    * - ``V4L2_BUF_TYPE_SLICED_VBI_OUTPUT``
    -  .. row 9

       -  ``V4L2_BUF_TYPE_SLICED_VBI_OUTPUT``

      - 7
      - 7

      - Buffer of a sliced VBI output stream, see :ref:`sliced`.
      - Buffer of a sliced VBI output stream, see :ref:`sliced`.

    * - ``V4L2_BUF_TYPE_VIDEO_OUTPUT_OVERLAY``
    -  .. row 10

       -  ``V4L2_BUF_TYPE_VIDEO_OUTPUT_OVERLAY``

      - 8
      - 8

      - Buffer for video output overlay (OSD), see :ref:`osd`.
      - Buffer for video output overlay (OSD), see :ref:`osd`.

    * - ``V4L2_BUF_TYPE_SDR_CAPTURE``
    -  .. row 11

       -  ``V4L2_BUF_TYPE_SDR_CAPTURE``

      - 11
      - 11

      - Buffer for Software Defined Radio (SDR) capture stream, see
      - Buffer for Software Defined Radio (SDR) capture stream, see
	:ref:`sdr`.
	:ref:`sdr`.

    * - ``V4L2_BUF_TYPE_SDR_OUTPUT``
    -  .. row 12

       -  ``V4L2_BUF_TYPE_SDR_OUTPUT``

      - 12
      - 12

      - Buffer for Software Defined Radio (SDR) output stream, see
      - Buffer for Software Defined Radio (SDR) output stream, see
	:ref:`sdr`.
	:ref:`sdr`.


@@ -534,13 +347,10 @@ Buffer Flags
    :stub-columns: 0
    :stub-columns: 0
    :widths:       3 1 4
    :widths:       3 1 4



    * .. _`V4L2-BUF-FLAG-MAPPED`:
    -  .. _`V4L2-BUF-FLAG-MAPPED`:


      - ``V4L2_BUF_FLAG_MAPPED``
      - ``V4L2_BUF_FLAG_MAPPED``

      - 0x00000001
      - 0x00000001

      - The buffer resides in device memory and has been mapped into the
      - The buffer resides in device memory and has been mapped into the
	application's address space, see :ref:`mmap` for details.
	application's address space, see :ref:`mmap` for details.
	Drivers set or clear this flag when the
	Drivers set or clear this flag when the
@@ -548,13 +358,10 @@ Buffer Flags
	:ref:`VIDIOC_QBUF` or
	:ref:`VIDIOC_QBUF` or
	:ref:`VIDIOC_DQBUF <VIDIOC_QBUF>` ioctl is called. Set by the
	:ref:`VIDIOC_DQBUF <VIDIOC_QBUF>` ioctl is called. Set by the
	driver.
	driver.

    * .. _`V4L2-BUF-FLAG-QUEUED`:
    -  .. _`V4L2-BUF-FLAG-QUEUED`:


      - ``V4L2_BUF_FLAG_QUEUED``
      - ``V4L2_BUF_FLAG_QUEUED``

      - 0x00000002
      - 0x00000002

      - Internally drivers maintain two buffer queues, an incoming and
      - Internally drivers maintain two buffer queues, an incoming and
	outgoing queue. When this flag is set, the buffer is currently on
	outgoing queue. When this flag is set, the buffer is currently on
	the incoming queue. It automatically moves to the outgoing queue
	the incoming queue. It automatically moves to the outgoing queue
@@ -563,13 +370,10 @@ Buffer Flags
	``VIDIOC_QUERYBUF`` ioctl is called. After (successful) calling
	``VIDIOC_QUERYBUF`` ioctl is called. After (successful) calling
	the ``VIDIOC_QBUF``\ ioctl it is always set and after
	the ``VIDIOC_QBUF``\ ioctl it is always set and after
	``VIDIOC_DQBUF`` always cleared.
	``VIDIOC_DQBUF`` always cleared.

    * .. _`V4L2-BUF-FLAG-DONE`:
    -  .. _`V4L2-BUF-FLAG-DONE`:


      - ``V4L2_BUF_FLAG_DONE``
      - ``V4L2_BUF_FLAG_DONE``

      - 0x00000004
      - 0x00000004

      - When this flag is set, the buffer is currently on the outgoing
      - When this flag is set, the buffer is currently on the outgoing
	queue, ready to be dequeued from the driver. Drivers set or clear
	queue, ready to be dequeued from the driver. Drivers set or clear
	this flag when the ``VIDIOC_QUERYBUF`` ioctl is called. After
	this flag when the ``VIDIOC_QUERYBUF`` ioctl is called. After
@@ -579,108 +383,81 @@ Buffer Flags
	are mutually exclusive. They can be both cleared however, then the
	are mutually exclusive. They can be both cleared however, then the
	buffer is in "dequeued" state, in the application domain so to
	buffer is in "dequeued" state, in the application domain so to
	say.
	say.

    * .. _`V4L2-BUF-FLAG-ERROR`:
    -  .. _`V4L2-BUF-FLAG-ERROR`:


      - ``V4L2_BUF_FLAG_ERROR``
      - ``V4L2_BUF_FLAG_ERROR``

      - 0x00000040
      - 0x00000040

      - When this flag is set, the buffer has been dequeued successfully,
      - When this flag is set, the buffer has been dequeued successfully,
	although the data might have been corrupted. This is recoverable,
	although the data might have been corrupted. This is recoverable,
	streaming may continue as normal and the buffer may be reused
	streaming may continue as normal and the buffer may be reused
	normally. Drivers set this flag when the ``VIDIOC_DQBUF`` ioctl is
	normally. Drivers set this flag when the ``VIDIOC_DQBUF`` ioctl is
	called.
	called.

    * .. _`V4L2-BUF-FLAG-KEYFRAME`:
    -  .. _`V4L2-BUF-FLAG-KEYFRAME`:


      - ``V4L2_BUF_FLAG_KEYFRAME``
      - ``V4L2_BUF_FLAG_KEYFRAME``

      - 0x00000008
      - 0x00000008

      - Drivers set or clear this flag when calling the ``VIDIOC_DQBUF``
      - Drivers set or clear this flag when calling the ``VIDIOC_DQBUF``
	ioctl. It may be set by video capture devices when the buffer
	ioctl. It may be set by video capture devices when the buffer
	contains a compressed image which is a key frame (or field), i. e.
	contains a compressed image which is a key frame (or field), i. e.
	can be decompressed on its own. Also known as an I-frame.
	can be decompressed on its own. Also known as an I-frame.
	Applications can set this bit when ``type`` refers to an output
	Applications can set this bit when ``type`` refers to an output
	stream.
	stream.

    * .. _`V4L2-BUF-FLAG-PFRAME`:
    -  .. _`V4L2-BUF-FLAG-PFRAME`:


      - ``V4L2_BUF_FLAG_PFRAME``
      - ``V4L2_BUF_FLAG_PFRAME``

      - 0x00000010
      - 0x00000010

      - Similar to ``V4L2_BUF_FLAG_KEYFRAME`` this flags predicted frames
      - Similar to ``V4L2_BUF_FLAG_KEYFRAME`` this flags predicted frames
	or fields which contain only differences to a previous key frame.
	or fields which contain only differences to a previous key frame.
	Applications can set this bit when ``type`` refers to an output
	Applications can set this bit when ``type`` refers to an output
	stream.
	stream.

    * .. _`V4L2-BUF-FLAG-BFRAME`:
    -  .. _`V4L2-BUF-FLAG-BFRAME`:


      - ``V4L2_BUF_FLAG_BFRAME``
      - ``V4L2_BUF_FLAG_BFRAME``

      - 0x00000020
      - 0x00000020

      - Similar to ``V4L2_BUF_FLAG_KEYFRAME`` this flags a bi-directional
      - Similar to ``V4L2_BUF_FLAG_KEYFRAME`` this flags a bi-directional
	predicted frame or field which contains only the differences
	predicted frame or field which contains only the differences
	between the current frame and both the preceding and following key
	between the current frame and both the preceding and following key
	frames to specify its content. Applications can set this bit when
	frames to specify its content. Applications can set this bit when
	``type`` refers to an output stream.
	``type`` refers to an output stream.

    * .. _`V4L2-BUF-FLAG-TIMECODE`:
    -  .. _`V4L2-BUF-FLAG-TIMECODE`:


      - ``V4L2_BUF_FLAG_TIMECODE``
      - ``V4L2_BUF_FLAG_TIMECODE``

      - 0x00000100
      - 0x00000100

      - The ``timecode`` field is valid. Drivers set or clear this flag
      - The ``timecode`` field is valid. Drivers set or clear this flag
	when the ``VIDIOC_DQBUF`` ioctl is called. Applications can set
	when the ``VIDIOC_DQBUF`` ioctl is called. Applications can set
	this bit and the corresponding ``timecode`` structure when
	this bit and the corresponding ``timecode`` structure when
	``type`` refers to an output stream.
	``type`` refers to an output stream.

    * .. _`V4L2-BUF-FLAG-PREPARED`:
    -  .. _`V4L2-BUF-FLAG-PREPARED`:


      - ``V4L2_BUF_FLAG_PREPARED``
      - ``V4L2_BUF_FLAG_PREPARED``

      - 0x00000400
      - 0x00000400

      - The buffer has been prepared for I/O and can be queued by the
      - The buffer has been prepared for I/O and can be queued by the
	application. Drivers set or clear this flag when the
	application. Drivers set or clear this flag when the
	:ref:`VIDIOC_QUERYBUF`,
	:ref:`VIDIOC_QUERYBUF`,
	:ref:`VIDIOC_PREPARE_BUF <VIDIOC_QBUF>`,
	:ref:`VIDIOC_PREPARE_BUF <VIDIOC_QBUF>`,
	:ref:`VIDIOC_QBUF` or
	:ref:`VIDIOC_QBUF` or
	:ref:`VIDIOC_DQBUF <VIDIOC_QBUF>` ioctl is called.
	:ref:`VIDIOC_DQBUF <VIDIOC_QBUF>` ioctl is called.

    * .. _`V4L2-BUF-FLAG-NO-CACHE-INVALIDATE`:
    -  .. _`V4L2-BUF-FLAG-NO-CACHE-INVALIDATE`:


      - ``V4L2_BUF_FLAG_NO_CACHE_INVALIDATE``
      - ``V4L2_BUF_FLAG_NO_CACHE_INVALIDATE``

      - 0x00000800
      - 0x00000800

      - Caches do not have to be invalidated for this buffer. Typically
      - Caches do not have to be invalidated for this buffer. Typically
	applications shall use this flag if the data captured in the
	applications shall use this flag if the data captured in the
	buffer is not going to be touched by the CPU, instead the buffer
	buffer is not going to be touched by the CPU, instead the buffer
	will, probably, be passed on to a DMA-capable hardware unit for
	will, probably, be passed on to a DMA-capable hardware unit for
	further processing or output.
	further processing or output.

    * .. _`V4L2-BUF-FLAG-NO-CACHE-CLEAN`:
    -  .. _`V4L2-BUF-FLAG-NO-CACHE-CLEAN`:


      - ``V4L2_BUF_FLAG_NO_CACHE_CLEAN``
      - ``V4L2_BUF_FLAG_NO_CACHE_CLEAN``

      - 0x00001000
      - 0x00001000

      - Caches do not have to be cleaned for this buffer. Typically
      - Caches do not have to be cleaned for this buffer. Typically
	applications shall use this flag for output buffers if the data in
	applications shall use this flag for output buffers if the data in
	this buffer has not been created by the CPU but by some
	this buffer has not been created by the CPU but by some
	DMA-capable unit, in which case caches have not been used.
	DMA-capable unit, in which case caches have not been used.

    * .. _`V4L2-BUF-FLAG-LAST`:
    -  .. _`V4L2-BUF-FLAG-LAST`:


      - ``V4L2_BUF_FLAG_LAST``
      - ``V4L2_BUF_FLAG_LAST``

      - 0x00100000
      - 0x00100000

      - Last buffer produced by the hardware. mem2mem codec drivers set
      - Last buffer produced by the hardware. mem2mem codec drivers set
	this flag on the capture queue for the last buffer when the
	this flag on the capture queue for the last buffer when the
	:ref:`VIDIOC_QUERYBUF` or
	:ref:`VIDIOC_QUERYBUF` or
@@ -690,23 +467,17 @@ Buffer Flags
	the format. Any Any subsequent call to the
	the format. Any Any subsequent call to the
	:ref:`VIDIOC_DQBUF <VIDIOC_QBUF>` ioctl will not block anymore,
	:ref:`VIDIOC_DQBUF <VIDIOC_QBUF>` ioctl will not block anymore,
	but return an ``EPIPE`` error code.
	but return an ``EPIPE`` error code.

    * .. _`V4L2-BUF-FLAG-TIMESTAMP-MASK`:
    -  .. _`V4L2-BUF-FLAG-TIMESTAMP-MASK`:


      - ``V4L2_BUF_FLAG_TIMESTAMP_MASK``
      - ``V4L2_BUF_FLAG_TIMESTAMP_MASK``

      - 0x0000e000
      - 0x0000e000

      - Mask for timestamp types below. To test the timestamp type, mask
      - Mask for timestamp types below. To test the timestamp type, mask
	out bits not belonging to timestamp type by performing a logical
	out bits not belonging to timestamp type by performing a logical
	and operation with buffer flags and timestamp mask.
	and operation with buffer flags and timestamp mask.

    * .. _`V4L2-BUF-FLAG-TIMESTAMP-UNKNOWN`:
    -  .. _`V4L2-BUF-FLAG-TIMESTAMP-UNKNOWN`:


      - ``V4L2_BUF_FLAG_TIMESTAMP_UNKNOWN``
      - ``V4L2_BUF_FLAG_TIMESTAMP_UNKNOWN``

      - 0x00000000
      - 0x00000000

      - Unknown timestamp type. This type is used by drivers before Linux
      - Unknown timestamp type. This type is used by drivers before Linux
	3.9 and may be either monotonic (see below) or realtime (wall
	3.9 and may be either monotonic (see below) or realtime (wall
	clock). Monotonic clock has been favoured in embedded systems
	clock). Monotonic clock has been favoured in embedded systems
@@ -714,32 +485,23 @@ Buffer Flags
	of timestamps are available in user space via
	of timestamps are available in user space via
	:c:func:`clock_gettime` using clock IDs ``CLOCK_MONOTONIC``
	:c:func:`clock_gettime` using clock IDs ``CLOCK_MONOTONIC``
	and ``CLOCK_REALTIME``, respectively.
	and ``CLOCK_REALTIME``, respectively.

    * .. _`V4L2-BUF-FLAG-TIMESTAMP-MONOTONIC`:
    -  .. _`V4L2-BUF-FLAG-TIMESTAMP-MONOTONIC`:


      - ``V4L2_BUF_FLAG_TIMESTAMP_MONOTONIC``
      - ``V4L2_BUF_FLAG_TIMESTAMP_MONOTONIC``

      - 0x00002000
      - 0x00002000

      - The buffer timestamp has been taken from the ``CLOCK_MONOTONIC``
      - The buffer timestamp has been taken from the ``CLOCK_MONOTONIC``
	clock. To access the same clock outside V4L2, use
	clock. To access the same clock outside V4L2, use
	:c:func:`clock_gettime`.
	:c:func:`clock_gettime`.

    * .. _`V4L2-BUF-FLAG-TIMESTAMP-COPY`:
    -  .. _`V4L2-BUF-FLAG-TIMESTAMP-COPY`:


      - ``V4L2_BUF_FLAG_TIMESTAMP_COPY``
      - ``V4L2_BUF_FLAG_TIMESTAMP_COPY``

      - 0x00004000
      - 0x00004000

      - The CAPTURE buffer timestamp has been taken from the corresponding
      - The CAPTURE buffer timestamp has been taken from the corresponding
	OUTPUT buffer. This flag applies only to mem2mem devices.
	OUTPUT buffer. This flag applies only to mem2mem devices.

    * .. _`V4L2-BUF-FLAG-TSTAMP-SRC-MASK`:
    -  .. _`V4L2-BUF-FLAG-TSTAMP-SRC-MASK`:


      - ``V4L2_BUF_FLAG_TSTAMP_SRC_MASK``
      - ``V4L2_BUF_FLAG_TSTAMP_SRC_MASK``

      - 0x00070000
      - 0x00070000

      - Mask for timestamp sources below. The timestamp source defines the
      - Mask for timestamp sources below. The timestamp source defines the
	point of time the timestamp is taken in relation to the frame.
	point of time the timestamp is taken in relation to the frame.
	Logical 'and' operation between the ``flags`` field and
	Logical 'and' operation between the ``flags`` field and
@@ -747,26 +509,20 @@ Buffer Flags
	timestamp source. Applications must set the timestamp source when
	timestamp source. Applications must set the timestamp source when
	``type`` refers to an output stream and
	``type`` refers to an output stream and
	``V4L2_BUF_FLAG_TIMESTAMP_COPY`` is set.
	``V4L2_BUF_FLAG_TIMESTAMP_COPY`` is set.

    * .. _`V4L2-BUF-FLAG-TSTAMP-SRC-EOF`:
    -  .. _`V4L2-BUF-FLAG-TSTAMP-SRC-EOF`:


      - ``V4L2_BUF_FLAG_TSTAMP_SRC_EOF``
      - ``V4L2_BUF_FLAG_TSTAMP_SRC_EOF``

      - 0x00000000
      - 0x00000000

      - End Of Frame. The buffer timestamp has been taken when the last
      - End Of Frame. The buffer timestamp has been taken when the last
	pixel of the frame has been received or the last pixel of the
	pixel of the frame has been received or the last pixel of the
	frame has been transmitted. In practice, software generated
	frame has been transmitted. In practice, software generated
	timestamps will typically be read from the clock a small amount of
	timestamps will typically be read from the clock a small amount of
	time after the last pixel has been received or transmitten,
	time after the last pixel has been received or transmitten,
	depending on the system and other activity in it.
	depending on the system and other activity in it.

    * .. _`V4L2-BUF-FLAG-TSTAMP-SRC-SOE`:
    -  .. _`V4L2-BUF-FLAG-TSTAMP-SRC-SOE`:


      - ``V4L2_BUF_FLAG_TSTAMP_SRC_SOE``
      - ``V4L2_BUF_FLAG_TSTAMP_SRC_SOE``

      - 0x00010000
      - 0x00010000

      - Start Of Exposure. The buffer timestamp has been taken when the
      - Start Of Exposure. The buffer timestamp has been taken when the
	exposure of the frame has begun. This is only valid for the
	exposure of the frame has begun. This is only valid for the
	``V4L2_BUF_TYPE_VIDEO_CAPTURE`` buffer type.
	``V4L2_BUF_TYPE_VIDEO_CAPTURE`` buffer type.
@@ -785,37 +541,17 @@ enum v4l2_memory
    :stub-columns: 0
    :stub-columns: 0
    :widths:       3 1 4
    :widths:       3 1 4



    * - ``V4L2_MEMORY_MMAP``
    -  .. row 1

       -  ``V4L2_MEMORY_MMAP``

      - 1
      - 1

      - The buffer is used for :ref:`memory mapping <mmap>` I/O.
      - The buffer is used for :ref:`memory mapping <mmap>` I/O.

    * - ``V4L2_MEMORY_USERPTR``
    -  .. row 2

       -  ``V4L2_MEMORY_USERPTR``

      - 2
      - 2

      - The buffer is used for :ref:`user pointer <userp>` I/O.
      - The buffer is used for :ref:`user pointer <userp>` I/O.

    * - ``V4L2_MEMORY_OVERLAY``
    -  .. row 3

       -  ``V4L2_MEMORY_OVERLAY``

      - 3
      - 3

      - [to do]
      - [to do]

    * - ``V4L2_MEMORY_DMABUF``
    -  .. row 4

       -  ``V4L2_MEMORY_DMABUF``

      - 4
      - 4

      - The buffer is used for :ref:`DMA shared buffer <dmabuf>` I/O.
      - The buffer is used for :ref:`DMA shared buffer <dmabuf>` I/O.




@@ -841,62 +577,27 @@ struct v4l2_timecode
    :stub-columns: 0
    :stub-columns: 0
    :widths:       1 1 2
    :widths:       1 1 2



    * - __u32
    -  .. row 1

       -  __u32

      - ``type``
      - ``type``

      - Frame rate the timecodes are based on, see :ref:`timecode-type`.
      - Frame rate the timecodes are based on, see :ref:`timecode-type`.

    * - __u32
    -  .. row 2

       -  __u32

      - ``flags``
      - ``flags``

      - Timecode flags, see :ref:`timecode-flags`.
      - Timecode flags, see :ref:`timecode-flags`.

    * - __u8
    -  .. row 3

       -  __u8

      - ``frames``
      - ``frames``

      - Frame count, 0 ... 23/24/29/49/59, depending on the type of
      - Frame count, 0 ... 23/24/29/49/59, depending on the type of
	timecode.
	timecode.

    * - __u8
    -  .. row 4

       -  __u8

      - ``seconds``
      - ``seconds``

      - Seconds count, 0 ... 59. This is a binary, not BCD number.
      - Seconds count, 0 ... 59. This is a binary, not BCD number.

    * - __u8
    -  .. row 5

       -  __u8

      - ``minutes``
      - ``minutes``

      - Minutes count, 0 ... 59. This is a binary, not BCD number.
      - Minutes count, 0 ... 59. This is a binary, not BCD number.

    * - __u8
    -  .. row 6

       -  __u8

      - ``hours``
      - ``hours``

      - Hours count, 0 ... 29. This is a binary, not BCD number.
      - Hours count, 0 ... 29. This is a binary, not BCD number.

    * - __u8
    -  .. row 7

       -  __u8

      - ``userbits``\ [4]
      - ``userbits``\ [4]

      - The "user group" bits from the timecode.
      - The "user group" bits from the timecode.




@@ -913,45 +614,20 @@ Timecode Types
    :stub-columns: 0
    :stub-columns: 0
    :widths:       3 1 4
    :widths:       3 1 4



    * - ``V4L2_TC_TYPE_24FPS``
    -  .. row 1

       -  ``V4L2_TC_TYPE_24FPS``

      - 1
      - 1

      - 24 frames per second, i. e. film.
      - 24 frames per second, i. e. film.

    * - ``V4L2_TC_TYPE_25FPS``
    -  .. row 2

       -  ``V4L2_TC_TYPE_25FPS``

      - 2
      - 2

      - 25 frames per second, i. e. PAL or SECAM video.
      - 25 frames per second, i. e. PAL or SECAM video.

    * - ``V4L2_TC_TYPE_30FPS``
    -  .. row 3

       -  ``V4L2_TC_TYPE_30FPS``

      - 3
      - 3

      - 30 frames per second, i. e. NTSC video.
      - 30 frames per second, i. e. NTSC video.

    * - ``V4L2_TC_TYPE_50FPS``
    -  .. row 4

       -  ``V4L2_TC_TYPE_50FPS``

      - 4
      - 4

      -
      -

    * - ``V4L2_TC_TYPE_60FPS``
    -  .. row 5

       -  ``V4L2_TC_TYPE_60FPS``

      - 5
      - 5

      -
      -




@@ -968,46 +644,21 @@ Timecode Flags
    :stub-columns: 0
    :stub-columns: 0
    :widths:       3 1 4
    :widths:       3 1 4



    * - ``V4L2_TC_FLAG_DROPFRAME``
    -  .. row 1

       -  ``V4L2_TC_FLAG_DROPFRAME``

      - 0x0001
      - 0x0001

      - Indicates "drop frame" semantics for counting frames in 29.97 fps
      - Indicates "drop frame" semantics for counting frames in 29.97 fps
	material. When set, frame numbers 0 and 1 at the start of each
	material. When set, frame numbers 0 and 1 at the start of each
	minute, except minutes 0, 10, 20, 30, 40, 50 are omitted from the
	minute, except minutes 0, 10, 20, 30, 40, 50 are omitted from the
	count.
	count.

    * - ``V4L2_TC_FLAG_COLORFRAME``
    -  .. row 2

       -  ``V4L2_TC_FLAG_COLORFRAME``

      - 0x0002
      - 0x0002

      - The "color frame" flag.
      - The "color frame" flag.

    * - ``V4L2_TC_USERBITS_field``
    -  .. row 3

       -  ``V4L2_TC_USERBITS_field``

      - 0x000C
      - 0x000C

      - Field mask for the "binary group flags".
      - Field mask for the "binary group flags".

    * - ``V4L2_TC_USERBITS_USERDEFINED``
    -  .. row 4

       -  ``V4L2_TC_USERBITS_USERDEFINED``

      - 0x0000
      - 0x0000

      - Unspecified format.
      - Unspecified format.

    * - ``V4L2_TC_USERBITS_8BITCHARS``
    -  .. row 5

       -  ``V4L2_TC_USERBITS_8BITCHARS``

      - 0x0008
      - 0x0008

      - 8-bit ISO characters.
      - 8-bit ISO characters.
+35 −98
Original line number Original line Diff line number Diff line
@@ -198,102 +198,39 @@ Control IDs
    :stub-columns: 0
    :stub-columns: 0
    :widths: 11 24
    :widths: 11 24


    -  .. row 1
    * - ``V4L2_COLORFX_NONE``

       -  ``V4L2_COLORFX_NONE``

      - Color effect is disabled.
      - Color effect is disabled.

    * - ``V4L2_COLORFX_ANTIQUE``
    -  .. row 2

       -  ``V4L2_COLORFX_ANTIQUE``

      - An aging (old photo) effect.
      - An aging (old photo) effect.

    * - ``V4L2_COLORFX_ART_FREEZE``
    -  .. row 3

       -  ``V4L2_COLORFX_ART_FREEZE``

      - Frost color effect.
      - Frost color effect.

    * - ``V4L2_COLORFX_AQUA``
    -  .. row 4

       -  ``V4L2_COLORFX_AQUA``

      - Water color, cool tone.
      - Water color, cool tone.

    * - ``V4L2_COLORFX_BW``
    -  .. row 5

       -  ``V4L2_COLORFX_BW``

      - Black and white.
      - Black and white.

    * - ``V4L2_COLORFX_EMBOSS``
    -  .. row 6

       -  ``V4L2_COLORFX_EMBOSS``

      - Emboss, the highlights and shadows replace light/dark boundaries
      - Emboss, the highlights and shadows replace light/dark boundaries
	and low contrast areas are set to a gray background.
	and low contrast areas are set to a gray background.

    * - ``V4L2_COLORFX_GRASS_GREEN``
    -  .. row 7

       -  ``V4L2_COLORFX_GRASS_GREEN``

      - Grass green.
      - Grass green.

    * - ``V4L2_COLORFX_NEGATIVE``
    -  .. row 8

       -  ``V4L2_COLORFX_NEGATIVE``

      - Negative.
      - Negative.

    * - ``V4L2_COLORFX_SEPIA``
    -  .. row 9

       -  ``V4L2_COLORFX_SEPIA``

      - Sepia tone.
      - Sepia tone.

    * - ``V4L2_COLORFX_SKETCH``
    -  .. row 10

       -  ``V4L2_COLORFX_SKETCH``

      - Sketch.
      - Sketch.

    * - ``V4L2_COLORFX_SKIN_WHITEN``
    -  .. row 11

       -  ``V4L2_COLORFX_SKIN_WHITEN``

      - Skin whiten.
      - Skin whiten.

    * - ``V4L2_COLORFX_SKY_BLUE``
    -  .. row 12

       -  ``V4L2_COLORFX_SKY_BLUE``

      - Sky blue.
      - Sky blue.

    * - ``V4L2_COLORFX_SOLARIZATION``
    -  .. row 13

       -  ``V4L2_COLORFX_SOLARIZATION``

      - Solarization, the image is partially reversed in tone, only color
      - Solarization, the image is partially reversed in tone, only color
	values above or below a certain threshold are inverted.
	values above or below a certain threshold are inverted.

    * - ``V4L2_COLORFX_SILHOUETTE``
    -  .. row 14

       -  ``V4L2_COLORFX_SILHOUETTE``

      - Silhouette (outline).
      - Silhouette (outline).

    * - ``V4L2_COLORFX_VIVID``
    -  .. row 15

       -  ``V4L2_COLORFX_VIVID``

      - Vivid colors.
      - Vivid colors.

    * - ``V4L2_COLORFX_SET_CBCR``
    -  .. row 16

       -  ``V4L2_COLORFX_SET_CBCR``

      - The Cb and Cr chroma components are replaced by fixed coefficients
      - The Cb and Cr chroma components are replaced by fixed coefficients
	determined by ``V4L2_CID_COLORFX_CBCR`` control.
	determined by ``V4L2_CID_COLORFX_CBCR`` control.


Loading