]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
[media] doc-rst: Don't use captions for examples
authorMauro Carvalho Chehab <mchehab@s-opensource.com>
Sun, 10 Jul 2016 11:22:19 +0000 (08:22 -0300)
committerMauro Carvalho Chehab <mchehab@s-opensource.com>
Sun, 10 Jul 2016 11:31:24 +0000 (08:31 -0300)
Unfortunately, captions are new on Sphinx for c blocks: it was
added only on version 1.3. Also, it were already bad enough
not being able to auto-numerate them.

So, let's give up and use, instead, titles before the examples.
Not much is lost, and, as a side track, we don't need to
numerate them anymore.

Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
12 files changed:
Documentation/media/uapi/dvb/dvbproperty.rst
Documentation/media/uapi/dvb/examples.rst
Documentation/media/uapi/v4l/audio.rst
Documentation/media/uapi/v4l/control.rst
Documentation/media/uapi/v4l/crop.rst
Documentation/media/uapi/v4l/dev-osd.rst
Documentation/media/uapi/v4l/dmabuf.rst
Documentation/media/uapi/v4l/mmap.rst
Documentation/media/uapi/v4l/selection-api-006.rst
Documentation/media/uapi/v4l/standard.rst
Documentation/media/uapi/v4l/userp.rst
Documentation/media/uapi/v4l/video.rst

index 9b3782c5bb44c5feb2a9c298553487799f96b4f8..3c348e585729e7e204c58dd0e9df671a3753b465 100644 (file)
@@ -48,8 +48,13 @@ symbol rate of 5.217 Mbauds, those properties should be sent to
 
 -  :ref:`DTV_TUNE <DTV-TUNE>`
 
-The code that would do the above is:
+The code that would that would do the above is show in
+:ref:`dtv-prop-example`.
 
+.. _dtv-prop-example:
+
+Example: Setting digital TV frontend properties
+===============================================
 
 .. code-block:: c
 
index 64e029ecd0478ae35f49a4b7b627f6ed3f665967..ead3ddf764c0ad5aea9d04d2f759894093eb655b 100644 (file)
@@ -17,8 +17,8 @@ updated/recommended examples.
 
 .. _tuning:
 
-Tuning
-======
+Example: Tuning
+===============
 
 We will start with a generic tuning subroutine that uses the frontend
 and SEC, as well as the demux devices. The example is given for QPSK
@@ -238,8 +238,8 @@ switch, and weather conditions this may be necessary.
 
 .. _the_dvr_device:
 
-The DVR device
-==============
+Example: The DVR device
+========================
 
 The following program code shows how to use the DVR device for
 recording.
index 71502f0bf8bd87c4da1e743e541bc72da8dcffcb..47f8334f071e907991f94b76ff8b08c25a09f95e 100644 (file)
@@ -54,8 +54,10 @@ in the struct :ref:`v4l2_capability <v4l2-capability>` returned by
 the :ref:`VIDIOC_QUERYCAP` ioctl.
 
 
+Example: Information about the current audio input
+==================================================
+
 .. code-block:: c
-    :caption: Example 1.3. Information about the current audio input
 
     struct v4l2_audio audio;
 
@@ -69,8 +71,10 @@ the :ref:`VIDIOC_QUERYCAP` ioctl.
     printf("Current input: %s\\n", audio.name);
 
 
+Example: Switching to the first audio input
+===========================================
+
 .. code-block:: c
-    :caption: Example 1.4. Switching to the first audio input
 
     struct v4l2_audio audio;
 
index 6cf218ab36fb10fde44e450e855f786efc35986f..feb55ac14377e33916b8f1e0c459252b2d5ada6a 100644 (file)
@@ -373,8 +373,10 @@ more menu type controls.
 
 .. _enum_all_controls:
 
+Example: Enumerating all user controls
+======================================
+
 .. code-block:: c
-    :caption: Example 1.8. Enumerating all user controls
 
 
     struct v4l2_queryctrl queryctrl;
@@ -438,8 +440,10 @@ more menu type controls.
     }
 
 
+Example: Enumerating all user controls (alternative)
+====================================================
+
 .. code-block:: c
-    :caption: Example 1.9. Enumerating all user controls (alternative)
 
     memset(&queryctrl, 0, sizeof(queryctrl));
 
@@ -462,9 +466,10 @@ more menu type controls.
        exit(EXIT_FAILURE);
     }
 
+Example: Changing controls
+==========================
 
 .. code-block:: c
-    :caption: Example 1.10. Changing controls
 
     struct v4l2_queryctrl queryctrl;
     struct v4l2_control control;
index ed43b36c51d80601d6f0d109acc0f3168c91b442..51b19491c3021a269e7ab9395e5f919b69d895ac 100644 (file)
@@ -147,8 +147,10 @@ ensure the parameters are suitable before starting I/O.
 **NOTE:** on the next two examples, a video capture device is assumed;
 change ``V4L2_BUF_TYPE_VIDEO_CAPTURE`` for other types of device.
 
+Example: Resetting the cropping parameters
+==========================================
+
 .. code-block:: c
-    :caption: Example 1.11. Resetting the cropping parameters
 
     struct v4l2_cropcap cropcap;
     struct v4l2_crop crop;
@@ -173,8 +175,11 @@ change ``V4L2_BUF_TYPE_VIDEO_CAPTURE`` for other types of device.
        exit (EXIT_FAILURE);
     }
 
+
+Example: Simple downscaling
+===========================
+
 .. code-block:: c
-    :caption: Example 1.12. Simple downscaling
 
     struct v4l2_cropcap cropcap;
     struct v4l2_format format;
@@ -199,10 +204,12 @@ change ``V4L2_BUF_TYPE_VIDEO_CAPTURE`` for other types of device.
     /* We could check the actual image size now, the actual scaling factor
        or if the driver can scale at all. */
 
+Example: Selecting an output area
+=================================
+
 **NOTE:** This example assumes an output device.
 
 .. code-block:: c
-    :caption: Example 1.13. Selecting an output area
 
     struct v4l2_cropcap cropcap;
     struct v4l2_crop crop;
@@ -236,10 +243,12 @@ change ``V4L2_BUF_TYPE_VIDEO_CAPTURE`` for other types of device.
        exit (EXIT_FAILURE);
     }
 
+Example: Current scaling factor and pixel aspect
+================================================
+
 **NOTE:** This example assumes a video capture device.
 
 .. code-block:: c
-    :caption: Example 1.14. Current scaling factor and pixel aspect
 
     struct v4l2_cropcap cropcap;
     struct v4l2_crop crop;
index b9b53fd7eb5df65dcff13b883dcc3d6946ff0593..98570cea63a5b6d01353bfab1438f81992c4103e 100644 (file)
@@ -50,9 +50,10 @@ standard. A V4L2 driver may reject attempts to change the video standard
 (or any other ioctl which would imply a framebuffer size change) with an
 ``EBUSY`` error code until all applications closed the framebuffer device.
 
+Example: Finding a framebuffer device for OSD
+---------------------------------------------
 
 .. code-block:: c
-    :caption: Example 4.1. Finding a framebuffer device for OSD
 
     #include <linux/fb.h>
 
index 474d8c02150763f0bf4b38cbc3594b541cbd1c9a..57917fb98c7a29afdebca6f5c85cb290582949eb 100644 (file)
@@ -37,8 +37,10 @@ driver must be switched into DMABUF I/O mode by calling the
 :ref:`VIDIOC_REQBUFS <VIDIOC_REQBUFS>` with the desired buffer type.
 
 
+Example: Initiating streaming I/O with DMABUF file descriptors
+==============================================================
+
 .. code-block:: c
-    :caption: Example 3.4. Initiating streaming I/O with DMABUF file descriptors
 
     struct v4l2_requestbuffers reqbuf;
 
@@ -62,9 +64,10 @@ buffers, every plane can be associated with a different DMABUF
 descriptor. Although buffers are commonly cycled, applications can pass
 a different DMABUF descriptor at each :ref:`VIDIOC_QBUF <VIDIOC_QBUF>` call.
 
+Example: Queueing DMABUF using single plane API
+===============================================
 
 .. code-block:: c
-    :caption: Example 3.5. Queueing DMABUF using single plane API
 
     int buffer_queue(int v4lfd, int index, int dmafd)
     {
@@ -84,9 +87,10 @@ a different DMABUF descriptor at each :ref:`VIDIOC_QBUF <VIDIOC_QBUF>` call.
        return 0;
     }
 
+Example 3.6. Queueing DMABUF using multi plane API
+==================================================
 
 .. code-block:: c
-    :caption: Example 3.6. Queueing DMABUF using multi plane API
 
     int buffer_queue_mp(int v4lfd, int index, int dmafd[], int n_planes)
     {
index f7fe26e7ca43e12f6d8f3179615cc50717143f40..b01f4486499a3999a968011199dc0210adb0d8f7 100644 (file)
@@ -52,9 +52,10 @@ allocated in physical memory, as opposed to virtual memory, which can be
 swapped out to disk. Applications should free the buffers as soon as
 possible with the :ref:`munmap() <func-munmap>` function.
 
+Example: Mapping buffers in the single-planar API
+=================================================
 
 .. code-block:: c
-    :caption: Example 3.1. Mapping buffers in the single-planar API
 
     struct v4l2_requestbuffers reqbuf;
     struct {
@@ -122,8 +123,10 @@ possible with the :ref:`munmap() <func-munmap>` function.
        munmap(buffers[i].start, buffers[i].length);
 
 
+Example: Mapping buffers in the multi-planar API
+================================================
+
 .. code-block:: c
-    :caption: Example 3.2. Mapping buffers in the multi-planar API
 
     struct v4l2_requestbuffers reqbuf;
     /* Our current format uses 3 planes per buffer */
index b2ac12f2e3d4af9fb0d103c445c01b1b20e4c315..67e0e9aed9e82f8ba346158370027a1d66e08fe2 100644 (file)
@@ -8,9 +8,10 @@ Examples
 ``V4L2_BUF_TYPE_VIDEO_CAPTURE`` for other devices; change target to
 ``V4L2_SEL_TGT_COMPOSE_*`` family to configure composing area)
 
+Example: Resetting the cropping parameters
+==========================================
 
 .. code-block:: c
-       :caption: Example 1.15. Resetting the cropping parameters
 
        struct v4l2_selection sel = {
            .type = V4L2_BUF_TYPE_VIDEO_CAPTURE,
@@ -27,9 +28,10 @@ Examples
 Setting a composing area on output of size of *at most* half of limit
 placed at a center of a display.
 
+Example: Simple downscaling
+===========================
 
 .. code-block:: c
-   :caption: Example 1.16. Simple downscaling
 
        struct v4l2_selection sel = {
            .type = V4L2_BUF_TYPE_VIDEO_OUTPUT,
@@ -55,9 +57,10 @@ placed at a center of a display.
 A video output device is assumed; change ``V4L2_BUF_TYPE_VIDEO_OUTPUT``
 for other devices
 
+Example: Querying for scaling factors
+=====================================
 
 .. code-block:: c
-   :caption: Example 1.17. Querying for scaling factors
 
        struct v4l2_selection compose = {
            .type = V4L2_BUF_TYPE_VIDEO_OUTPUT,
index 538588eef317d13e9434099b71401dc3b92508c9..529891cf3af2c44dc7e925749f8e614c02e4add2 100644 (file)
@@ -64,9 +64,10 @@ Applications can make use of the :ref:`input-capabilities` and
 :ref:`output-capabilities` flags to determine whether the video
 standard ioctls can be used with the given input or output.
 
+Example: Information about the current video standard
+=====================================================
 
 .. code-block:: c
-    :caption: Example 1.5. Information about the current video standard
 
     v4l2_std_id std_id;
     struct v4l2_standard standard;
@@ -100,9 +101,10 @@ standard ioctls can be used with the given input or output.
        exit(EXIT_FAILURE);
     }
 
+Example: Listing the video standards supported by the current input
+===================================================================
 
 .. code-block:: c
-    :caption: Example 1.6. Listing the video standards supported by the current input
 
     struct v4l2_input input;
     struct v4l2_standard standard;
@@ -139,9 +141,10 @@ standard ioctls can be used with the given input or output.
        exit(EXIT_FAILURE);
     }
 
+Example: Selecting a new video standard
+=======================================
 
 .. code-block:: c
-    :caption: Example 1.7. Selecting a new video standard
 
     struct v4l2_input input;
     v4l2_std_id std_id;
index 2f0002bfbc3fc5cbb3abdda6ea5c84eda802d55c..0871c204dc6c97fdd56a34a04a25d415ba1a890a 100644 (file)
@@ -26,9 +26,10 @@ No buffers (planes) are allocated beforehand, consequently they are not
 indexed and cannot be queried like mapped buffers with the
 :ref:`VIDIOC_QUERYBUF <VIDIOC_QUERYBUF>` ioctl.
 
+Example: Initiating streaming I/O with user pointers
+====================================================
 
 .. code-block:: c
-    :caption: Example 3.3. Initiating streaming I/O with user pointers
 
     struct v4l2_requestbuffers reqbuf;
 
index e38ebe19261425abfe1acb1c63ce0fc000575a37..d3f00715fbc16e2adc468aa0f2c02210f1454370 100644 (file)
@@ -28,8 +28,10 @@ applications call the :ref:`VIDIOC_S_INPUT <VIDIOC_G_INPUT>` and
 implement all the input ioctls when the device has one or more inputs,
 all the output ioctls when the device has one or more outputs.
 
+Example: Information about the current video input
+==================================================
+
 .. code-block:: c
-    :caption: Example 1.1. Information about the current video input
 
     struct v4l2_input input;
     int index;
@@ -50,8 +52,10 @@ all the output ioctls when the device has one or more outputs.
     printf("Current input: %s\\n", input.name);
 
 
+Example: Switching to the first video input
+===========================================
+
 .. code-block:: c
-    :caption: Example 1.2. Switching to the first video input
 
     int index;