Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

[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: Mauro Carvalho Chehab <mchehab@s-opensource.com>

+71 -29
+6 -1
Documentation/media/uapi/dvb/dvbproperty.rst
··· 48 48 49 49 - :ref:`DTV_TUNE <DTV-TUNE>` 50 50 51 - The code that would do the above is: 51 + The code that would that would do the above is show in 52 + :ref:`dtv-prop-example`. 52 53 54 + .. _dtv-prop-example: 55 + 56 + Example: Setting digital TV frontend properties 57 + =============================================== 53 58 54 59 .. code-block:: c 55 60
+4 -4
Documentation/media/uapi/dvb/examples.rst
··· 17 17 18 18 .. _tuning: 19 19 20 - Tuning 21 - ====== 20 + Example: Tuning 21 + =============== 22 22 23 23 We will start with a generic tuning subroutine that uses the frontend 24 24 and SEC, as well as the demux devices. The example is given for QPSK ··· 238 238 239 239 .. _the_dvr_device: 240 240 241 - The DVR device 242 - ============== 241 + Example: The DVR device 242 + ======================== 243 243 244 244 The following program code shows how to use the DVR device for 245 245 recording.
+6 -2
Documentation/media/uapi/v4l/audio.rst
··· 54 54 the :ref:`VIDIOC_QUERYCAP` ioctl. 55 55 56 56 57 + Example: Information about the current audio input 58 + ================================================== 59 + 57 60 .. code-block:: c 58 - :caption: Example 1.3. Information about the current audio input 59 61 60 62 struct v4l2_audio audio; 61 63 ··· 71 69 printf("Current input: %s\\n", audio.name); 72 70 73 71 72 + Example: Switching to the first audio input 73 + =========================================== 74 + 74 75 .. code-block:: c 75 - :caption: Example 1.4. Switching to the first audio input 76 76 77 77 struct v4l2_audio audio; 78 78
+8 -3
Documentation/media/uapi/v4l/control.rst
··· 373 373 374 374 .. _enum_all_controls: 375 375 376 + Example: Enumerating all user controls 377 + ====================================== 378 + 376 379 .. code-block:: c 377 - :caption: Example 1.8. Enumerating all user controls 378 380 379 381 380 382 struct v4l2_queryctrl queryctrl; ··· 440 438 } 441 439 442 440 441 + Example: Enumerating all user controls (alternative) 442 + ==================================================== 443 + 443 444 .. code-block:: c 444 - :caption: Example 1.9. Enumerating all user controls (alternative) 445 445 446 446 memset(&queryctrl, 0, sizeof(queryctrl)); 447 447 ··· 466 462 exit(EXIT_FAILURE); 467 463 } 468 464 465 + Example: Changing controls 466 + ========================== 469 467 470 468 .. code-block:: c 471 - :caption: Example 1.10. Changing controls 472 469 473 470 struct v4l2_queryctrl queryctrl; 474 471 struct v4l2_control control;
+13 -4
Documentation/media/uapi/v4l/crop.rst
··· 147 147 **NOTE:** on the next two examples, a video capture device is assumed; 148 148 change ``V4L2_BUF_TYPE_VIDEO_CAPTURE`` for other types of device. 149 149 150 + Example: Resetting the cropping parameters 151 + ========================================== 152 + 150 153 .. code-block:: c 151 - :caption: Example 1.11. Resetting the cropping parameters 152 154 153 155 struct v4l2_cropcap cropcap; 154 156 struct v4l2_crop crop; ··· 175 173 exit (EXIT_FAILURE); 176 174 } 177 175 176 + 177 + Example: Simple downscaling 178 + =========================== 179 + 178 180 .. code-block:: c 179 - :caption: Example 1.12. Simple downscaling 180 181 181 182 struct v4l2_cropcap cropcap; 182 183 struct v4l2_format format; ··· 204 199 /* We could check the actual image size now, the actual scaling factor 205 200 or if the driver can scale at all. */ 206 201 202 + Example: Selecting an output area 203 + ================================= 204 + 207 205 **NOTE:** This example assumes an output device. 208 206 209 207 .. code-block:: c 210 - :caption: Example 1.13. Selecting an output area 211 208 212 209 struct v4l2_cropcap cropcap; 213 210 struct v4l2_crop crop; ··· 243 236 exit (EXIT_FAILURE); 244 237 } 245 238 239 + Example: Current scaling factor and pixel aspect 240 + ================================================ 241 + 246 242 **NOTE:** This example assumes a video capture device. 247 243 248 244 .. code-block:: c 249 - :caption: Example 1.14. Current scaling factor and pixel aspect 250 245 251 246 struct v4l2_cropcap cropcap; 252 247 struct v4l2_crop crop;
+2 -1
Documentation/media/uapi/v4l/dev-osd.rst
··· 50 50 (or any other ioctl which would imply a framebuffer size change) with an 51 51 ``EBUSY`` error code until all applications closed the framebuffer device. 52 52 53 + Example: Finding a framebuffer device for OSD 54 + --------------------------------------------- 53 55 54 56 .. code-block:: c 55 - :caption: Example 4.1. Finding a framebuffer device for OSD 56 57 57 58 #include <linux/fb.h> 58 59
+7 -3
Documentation/media/uapi/v4l/dmabuf.rst
··· 37 37 :ref:`VIDIOC_REQBUFS <VIDIOC_REQBUFS>` with the desired buffer type. 38 38 39 39 40 + Example: Initiating streaming I/O with DMABUF file descriptors 41 + ============================================================== 42 + 40 43 .. code-block:: c 41 - :caption: Example 3.4. Initiating streaming I/O with DMABUF file descriptors 42 44 43 45 struct v4l2_requestbuffers reqbuf; 44 46 ··· 64 62 descriptor. Although buffers are commonly cycled, applications can pass 65 63 a different DMABUF descriptor at each :ref:`VIDIOC_QBUF <VIDIOC_QBUF>` call. 66 64 65 + Example: Queueing DMABUF using single plane API 66 + =============================================== 67 67 68 68 .. code-block:: c 69 - :caption: Example 3.5. Queueing DMABUF using single plane API 70 69 71 70 int buffer_queue(int v4lfd, int index, int dmafd) 72 71 { ··· 87 84 return 0; 88 85 } 89 86 87 + Example 3.6. Queueing DMABUF using multi plane API 88 + ================================================== 90 89 91 90 .. code-block:: c 92 - :caption: Example 3.6. Queueing DMABUF using multi plane API 93 91 94 92 int buffer_queue_mp(int v4lfd, int index, int dmafd[], int n_planes) 95 93 {
+5 -2
Documentation/media/uapi/v4l/mmap.rst
··· 52 52 swapped out to disk. Applications should free the buffers as soon as 53 53 possible with the :ref:`munmap() <func-munmap>` function. 54 54 55 + Example: Mapping buffers in the single-planar API 56 + ================================================= 55 57 56 58 .. code-block:: c 57 - :caption: Example 3.1. Mapping buffers in the single-planar API 58 59 59 60 struct v4l2_requestbuffers reqbuf; 60 61 struct { ··· 123 122 munmap(buffers[i].start, buffers[i].length); 124 123 125 124 125 + Example: Mapping buffers in the multi-planar API 126 + ================================================ 127 + 126 128 .. code-block:: c 127 - :caption: Example 3.2. Mapping buffers in the multi-planar API 128 129 129 130 struct v4l2_requestbuffers reqbuf; 130 131 /* Our current format uses 3 planes per buffer */
+6 -3
Documentation/media/uapi/v4l/selection-api-006.rst
··· 8 8 ``V4L2_BUF_TYPE_VIDEO_CAPTURE`` for other devices; change target to 9 9 ``V4L2_SEL_TGT_COMPOSE_*`` family to configure composing area) 10 10 11 + Example: Resetting the cropping parameters 12 + ========================================== 11 13 12 14 .. code-block:: c 13 - :caption: Example 1.15. Resetting the cropping parameters 14 15 15 16 struct v4l2_selection sel = { 16 17 .type = V4L2_BUF_TYPE_VIDEO_CAPTURE, ··· 28 27 Setting a composing area on output of size of *at most* half of limit 29 28 placed at a center of a display. 30 29 30 + Example: Simple downscaling 31 + =========================== 31 32 32 33 .. code-block:: c 33 - :caption: Example 1.16. Simple downscaling 34 34 35 35 struct v4l2_selection sel = { 36 36 .type = V4L2_BUF_TYPE_VIDEO_OUTPUT, ··· 57 55 A video output device is assumed; change ``V4L2_BUF_TYPE_VIDEO_OUTPUT`` 58 56 for other devices 59 57 58 + Example: Querying for scaling factors 59 + ===================================== 60 60 61 61 .. code-block:: c 62 - :caption: Example 1.17. Querying for scaling factors 63 62 64 63 struct v4l2_selection compose = { 65 64 .type = V4L2_BUF_TYPE_VIDEO_OUTPUT,
+6 -3
Documentation/media/uapi/v4l/standard.rst
··· 64 64 :ref:`output-capabilities` flags to determine whether the video 65 65 standard ioctls can be used with the given input or output. 66 66 67 + Example: Information about the current video standard 68 + ===================================================== 67 69 68 70 .. code-block:: c 69 - :caption: Example 1.5. Information about the current video standard 70 71 71 72 v4l2_std_id std_id; 72 73 struct v4l2_standard standard; ··· 101 100 exit(EXIT_FAILURE); 102 101 } 103 102 103 + Example: Listing the video standards supported by the current input 104 + =================================================================== 104 105 105 106 .. code-block:: c 106 - :caption: Example 1.6. Listing the video standards supported by the current input 107 107 108 108 struct v4l2_input input; 109 109 struct v4l2_standard standard; ··· 141 139 exit(EXIT_FAILURE); 142 140 } 143 141 142 + Example: Selecting a new video standard 143 + ======================================= 144 144 145 145 .. code-block:: c 146 - :caption: Example 1.7. Selecting a new video standard 147 146 148 147 struct v4l2_input input; 149 148 v4l2_std_id std_id;
+2 -1
Documentation/media/uapi/v4l/userp.rst
··· 26 26 indexed and cannot be queried like mapped buffers with the 27 27 :ref:`VIDIOC_QUERYBUF <VIDIOC_QUERYBUF>` ioctl. 28 28 29 + Example: Initiating streaming I/O with user pointers 30 + ==================================================== 29 31 30 32 .. code-block:: c 31 - :caption: Example 3.3. Initiating streaming I/O with user pointers 32 33 33 34 struct v4l2_requestbuffers reqbuf; 34 35
+6 -2
Documentation/media/uapi/v4l/video.rst
··· 28 28 implement all the input ioctls when the device has one or more inputs, 29 29 all the output ioctls when the device has one or more outputs. 30 30 31 + Example: Information about the current video input 32 + ================================================== 33 + 31 34 .. code-block:: c 32 - :caption: Example 1.1. Information about the current video input 33 35 34 36 struct v4l2_input input; 35 37 int index; ··· 52 50 printf("Current input: %s\\n", input.name); 53 51 54 52 53 + Example: Switching to the first video input 54 + =========================================== 55 + 55 56 .. code-block:: c 56 - :caption: Example 1.2. Switching to the first video input 57 57 58 58 int index; 59 59