doc-rst: linux_tv: remove whitespaces
[deliverable/linux.git] / Documentation / linux_tv / media / v4l / selection-api-006.rst
index 54b769e2fd73976176098447b231dd670b07d58b..b2ac12f2e3d4af9fb0d103c445c01b1b20e4c315 100644 (file)
@@ -12,17 +12,17 @@ Examples
 .. code-block:: c
        :caption: Example 1.15. Resetting the cropping parameters
 
-        struct v4l2_selection sel = {
-            .type = V4L2_BUF_TYPE_VIDEO_CAPTURE,
-            .target = V4L2_SEL_TGT_CROP_DEFAULT,
-        };
-        ret = ioctl(fd, VIDIOC_G_SELECTION, &sel);
-        if (ret)
-            exit(-1);
-        sel.target = V4L2_SEL_TGT_CROP;
-        ret = ioctl(fd, VIDIOC_S_SELECTION, &sel);
-        if (ret)
-            exit(-1);
+       struct v4l2_selection sel = {
+           .type = V4L2_BUF_TYPE_VIDEO_CAPTURE,
+           .target = V4L2_SEL_TGT_CROP_DEFAULT,
+       };
+       ret = ioctl(fd, VIDIOC_G_SELECTION, &sel);
+       if (ret)
+           exit(-1);
+       sel.target = V4L2_SEL_TGT_CROP;
+       ret = ioctl(fd, VIDIOC_S_SELECTION, &sel);
+       if (ret)
+           exit(-1);
 
 Setting a composing area on output of size of *at most* half of limit
 placed at a center of a display.
@@ -31,26 +31,26 @@ placed at a center of a display.
 .. code-block:: c
    :caption: Example 1.16. Simple downscaling
 
-        struct v4l2_selection sel = {
-            .type = V4L2_BUF_TYPE_VIDEO_OUTPUT,
-            .target = V4L2_SEL_TGT_COMPOSE_BOUNDS,
-        };
-        struct v4l2_rect r;
-
-        ret = ioctl(fd, VIDIOC_G_SELECTION, &sel);
-        if (ret)
-            exit(-1);
-        /* setting smaller compose rectangle */
-        r.width = sel.r.width / 2;
-        r.height = sel.r.height / 2;
-        r.left = sel.r.width / 4;
-        r.top = sel.r.height / 4;
-        sel.r = r;
-        sel.target = V4L2_SEL_TGT_COMPOSE;
-        sel.flags = V4L2_SEL_FLAG_LE;
-        ret = ioctl(fd, VIDIOC_S_SELECTION, &sel);
-        if (ret)
-            exit(-1);
+       struct v4l2_selection sel = {
+           .type = V4L2_BUF_TYPE_VIDEO_OUTPUT,
+           .target = V4L2_SEL_TGT_COMPOSE_BOUNDS,
+       };
+       struct v4l2_rect r;
+
+       ret = ioctl(fd, VIDIOC_G_SELECTION, &sel);
+       if (ret)
+           exit(-1);
+       /* setting smaller compose rectangle */
+       r.width = sel.r.width / 2;
+       r.height = sel.r.height / 2;
+       r.left = sel.r.width / 4;
+       r.top = sel.r.height / 4;
+       sel.r = r;
+       sel.target = V4L2_SEL_TGT_COMPOSE;
+       sel.flags = V4L2_SEL_FLAG_LE;
+       ret = ioctl(fd, VIDIOC_S_SELECTION, &sel);
+       if (ret)
+           exit(-1);
 
 A video output device is assumed; change ``V4L2_BUF_TYPE_VIDEO_OUTPUT``
 for other devices
@@ -59,23 +59,23 @@ for other devices
 .. code-block:: c
    :caption: Example 1.17. Querying for scaling factors
 
-        struct v4l2_selection compose = {
-            .type = V4L2_BUF_TYPE_VIDEO_OUTPUT,
-            .target = V4L2_SEL_TGT_COMPOSE,
-        };
-        struct v4l2_selection crop = {
-            .type = V4L2_BUF_TYPE_VIDEO_OUTPUT,
-            .target = V4L2_SEL_TGT_CROP,
-        };
-        double hscale, vscale;
-
-        ret = ioctl(fd, VIDIOC_G_SELECTION, &compose);
-        if (ret)
-            exit(-1);
-        ret = ioctl(fd, VIDIOC_G_SELECTION, &crop);
-        if (ret)
-            exit(-1);
-
-        /* computing scaling factors */
-        hscale = (double)compose.r.width / crop.r.width;
-        vscale = (double)compose.r.height / crop.r.height;
+       struct v4l2_selection compose = {
+           .type = V4L2_BUF_TYPE_VIDEO_OUTPUT,
+           .target = V4L2_SEL_TGT_COMPOSE,
+       };
+       struct v4l2_selection crop = {
+           .type = V4L2_BUF_TYPE_VIDEO_OUTPUT,
+           .target = V4L2_SEL_TGT_CROP,
+       };
+       double hscale, vscale;
+
+       ret = ioctl(fd, VIDIOC_G_SELECTION, &compose);
+       if (ret)
+           exit(-1);
+       ret = ioctl(fd, VIDIOC_G_SELECTION, &crop);
+       if (ret)
+           exit(-1);
+
+       /* computing scaling factors */
+       hscale = (double)compose.r.width / crop.r.width;
+       vscale = (double)compose.r.height / crop.r.height;
This page took 0.029644 seconds and 5 git commands to generate.