Commit 282f02cb authored by Mauro Carvalho Chehab's avatar Mauro Carvalho Chehab
Browse files

[media] doc-rst: Don't use captions for examples



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: default avatarMauro Carvalho Chehab <mchehab@s-opensource.com>
parent 30339339
Loading
Loading
Loading
Loading
+6 −1
Original line number Original line Diff line number Diff line
@@ -48,8 +48,13 @@ symbol rate of 5.217 Mbauds, those properties should be sent to


-  :ref:`DTV_TUNE <DTV-TUNE>`
-  :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
.. code-block:: c


+4 −4
Original line number Original line Diff line number Diff line
@@ -17,8 +17,8 @@ updated/recommended examples.


.. _tuning:
.. _tuning:


Tuning
Example: Tuning
======
===============


We will start with a generic tuning subroutine that uses the frontend
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
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:


The DVR device
Example: The DVR device
==============
========================


The following program code shows how to use the DVR device for
The following program code shows how to use the DVR device for
recording.
recording.
+6 −2
Original line number Original line Diff line number Diff line
@@ -54,8 +54,10 @@ in the struct :ref:`v4l2_capability <v4l2-capability>` returned by
the :ref:`VIDIOC_QUERYCAP` ioctl.
the :ref:`VIDIOC_QUERYCAP` ioctl.




Example: Information about the current audio input
==================================================

.. code-block:: c
.. code-block:: c
    :caption: Example 1.3. Information about the current audio input


    struct v4l2_audio audio;
    struct v4l2_audio audio;


@@ -69,8 +71,10 @@ the :ref:`VIDIOC_QUERYCAP` ioctl.
    printf("Current input: %s\\n", audio.name);
    printf("Current input: %s\\n", audio.name);




Example: Switching to the first audio input
===========================================

.. code-block:: c
.. code-block:: c
    :caption: Example 1.4. Switching to the first audio input


    struct v4l2_audio audio;
    struct v4l2_audio audio;


+8 −3
Original line number Original line Diff line number Diff line
@@ -373,8 +373,10 @@ more menu type controls.


.. _enum_all_controls:
.. _enum_all_controls:


Example: Enumerating all user controls
======================================

.. code-block:: c
.. code-block:: c
    :caption: Example 1.8. Enumerating all user controls




    struct v4l2_queryctrl queryctrl;
    struct v4l2_queryctrl queryctrl;
@@ -438,8 +440,10 @@ more menu type controls.
    }
    }




Example: Enumerating all user controls (alternative)
====================================================

.. code-block:: c
.. code-block:: c
    :caption: Example 1.9. Enumerating all user controls (alternative)


    memset(&queryctrl, 0, sizeof(queryctrl));
    memset(&queryctrl, 0, sizeof(queryctrl));


@@ -462,9 +466,10 @@ more menu type controls.
	exit(EXIT_FAILURE);
	exit(EXIT_FAILURE);
    }
    }


Example: Changing controls
==========================


.. code-block:: c
.. code-block:: c
    :caption: Example 1.10. Changing controls


    struct v4l2_queryctrl queryctrl;
    struct v4l2_queryctrl queryctrl;
    struct v4l2_control control;
    struct v4l2_control control;
+13 −4
Original line number Original line Diff line number Diff line
@@ -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;
**NOTE:** on the next two examples, a video capture device is assumed;
change ``V4L2_BUF_TYPE_VIDEO_CAPTURE`` for other types of device.
change ``V4L2_BUF_TYPE_VIDEO_CAPTURE`` for other types of device.


Example: Resetting the cropping parameters
==========================================

.. code-block:: c
.. code-block:: c
    :caption: Example 1.11. Resetting the cropping parameters


    struct v4l2_cropcap cropcap;
    struct v4l2_cropcap cropcap;
    struct v4l2_crop crop;
    struct v4l2_crop crop;
@@ -173,8 +175,11 @@ change ``V4L2_BUF_TYPE_VIDEO_CAPTURE`` for other types of device.
	exit (EXIT_FAILURE);
	exit (EXIT_FAILURE);
    }
    }



Example: Simple downscaling
===========================

.. code-block:: c
.. code-block:: c
    :caption: Example 1.12. Simple downscaling


    struct v4l2_cropcap cropcap;
    struct v4l2_cropcap cropcap;
    struct v4l2_format format;
    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
    /* We could check the actual image size now, the actual scaling factor
       or if the driver can scale at all. */
       or if the driver can scale at all. */


Example: Selecting an output area
=================================

**NOTE:** This example assumes an output device.
**NOTE:** This example assumes an output device.


.. code-block:: c
.. code-block:: c
    :caption: Example 1.13. Selecting an output area


    struct v4l2_cropcap cropcap;
    struct v4l2_cropcap cropcap;
    struct v4l2_crop crop;
    struct v4l2_crop crop;
@@ -236,10 +243,12 @@ change ``V4L2_BUF_TYPE_VIDEO_CAPTURE`` for other types of device.
	exit (EXIT_FAILURE);
	exit (EXIT_FAILURE);
    }
    }


Example: Current scaling factor and pixel aspect
================================================

**NOTE:** This example assumes a video capture device.
**NOTE:** This example assumes a video capture device.


.. code-block:: c
.. code-block:: c
    :caption: Example 1.14. Current scaling factor and pixel aspect


    struct v4l2_cropcap cropcap;
    struct v4l2_cropcap cropcap;
    struct v4l2_crop crop;
    struct v4l2_crop crop;
Loading