Replace V4L2 subdev selection targets with the V4L2 ones
authorSakari Ailus <sakari.ailus@iki.fi>
Tue, 22 May 2012 22:31:00 +0000 (01:31 +0300)
committerLaurent Pinchart <laurent.pinchart@ideasonboard.com>
Tue, 17 Jul 2012 23:50:39 +0000 (01:50 +0200)
V4L2 selection targets will replace V4L2 subdev selection targets in the
near future. As the targets are guaranteed to be the same and the chance is
anticipated very soon, replace the subdev targets with more future-proof
V4L2 targets.

Signed-off-by: Sakari Ailus <sakari.ailus@iki.fi>
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
src/main.c
src/v4l2subdev.c

index dad5a9d..13a458d 100644 (file)
@@ -64,28 +64,28 @@ static void v4l2_subdev_print_format(struct media_entity *entity,
               format.width, format.height);
 
        ret = v4l2_subdev_get_selection(entity, &rect, pad,
               format.width, format.height);
 
        ret = v4l2_subdev_get_selection(entity, &rect, pad,
-                                       V4L2_SUBDEV_SEL_TGT_CROP_BOUNDS,
+                                       V4L2_SEL_TGT_CROP_BOUNDS,
                                        which);
        if (ret == 0)
                printf("\n\t\t crop.bounds:(%u,%u)/%ux%u", rect.left, rect.top,
                       rect.width, rect.height);
 
        ret = v4l2_subdev_get_selection(entity, &rect, pad,
                                        which);
        if (ret == 0)
                printf("\n\t\t crop.bounds:(%u,%u)/%ux%u", rect.left, rect.top,
                       rect.width, rect.height);
 
        ret = v4l2_subdev_get_selection(entity, &rect, pad,
-                                       V4L2_SUBDEV_SEL_TGT_CROP,
+                                       V4L2_SEL_TGT_CROP,
                                        which);
        if (ret == 0)
                printf("\n\t\t crop:(%u,%u)/%ux%u", rect.left, rect.top,
                       rect.width, rect.height);
 
        ret = v4l2_subdev_get_selection(entity, &rect, pad,
                                        which);
        if (ret == 0)
                printf("\n\t\t crop:(%u,%u)/%ux%u", rect.left, rect.top,
                       rect.width, rect.height);
 
        ret = v4l2_subdev_get_selection(entity, &rect, pad,
-                                       V4L2_SUBDEV_SEL_TGT_COMPOSE_BOUNDS,
+                                       V4L2_SEL_TGT_COMPOSE_BOUNDS,
                                        which);
        if (ret == 0)
                printf("\n\t\t compose.bounds:(%u,%u)/%ux%u",
                       rect.left, rect.top, rect.width, rect.height);
 
        ret = v4l2_subdev_get_selection(entity, &rect, pad,
                                        which);
        if (ret == 0)
                printf("\n\t\t compose.bounds:(%u,%u)/%ux%u",
                       rect.left, rect.top, rect.width, rect.height);
 
        ret = v4l2_subdev_get_selection(entity, &rect, pad,
-                                       V4L2_SUBDEV_SEL_TGT_COMPOSE,
+                                       V4L2_SEL_TGT_COMPOSE,
                                        which);
        if (ret == 0)
                printf("\n\t\t compose:(%u,%u)/%ux%u",
                                        which);
        if (ret == 0)
                printf("\n\t\t compose:(%u,%u)/%ux%u",
index fcf3ec5..d0c37f3 100644 (file)
@@ -129,7 +129,7 @@ int v4l2_subdev_get_selection(struct media_entity *entity,
                *rect = u.sel.r;
                return 0;
        }
                *rect = u.sel.r;
                return 0;
        }
-       if (errno != ENOTTY || target != V4L2_SUBDEV_SEL_TGT_CROP)
+       if (errno != ENOTTY || target != V4L2_SEL_TGT_CROP)
                return -errno;
 
        memset(&u.crop, 0, sizeof(u.crop));
                return -errno;
 
        memset(&u.crop, 0, sizeof(u.crop));
@@ -169,7 +169,7 @@ int v4l2_subdev_set_selection(struct media_entity *entity,
                *rect = u.sel.r;
                return 0;
        }
                *rect = u.sel.r;
                return 0;
        }
-       if (errno != ENOTTY || target != V4L2_SUBDEV_SEL_TGT_CROP)
+       if (errno != ENOTTY || target != V4L2_SEL_TGT_CROP)
                return -errno;
 
        memset(&u.crop, 0, sizeof(u.crop));
                return -errno;
 
        memset(&u.crop, 0, sizeof(u.crop));
@@ -519,11 +519,11 @@ static int v4l2_subdev_parse_setup_format(struct media_device *media,
                        return ret;
        }
 
                        return ret;
        }
 
-       ret = set_selection(pad, V4L2_SUBDEV_SEL_TGT_CROP, &crop);
+       ret = set_selection(pad, V4L2_SEL_TGT_CROP, &crop);
        if (ret < 0)
                return ret;
 
        if (ret < 0)
                return ret;
 
-       ret = set_selection(pad, V4L2_SUBDEV_SEL_TGT_COMPOSE, &compose);
+       ret = set_selection(pad, V4L2_SEL_TGT_COMPOSE, &compose);
        if (ret < 0)
                return ret;
 
        if (ret < 0)
                return ret;