diff options
author | Sakari Ailus <sakari.ailus@iki.fi> | 2012-05-23 01:30:57 +0300 |
---|---|---|
committer | Laurent Pinchart <laurent.pinchart@ideasonboard.com> | 2012-05-25 12:19:29 +0200 |
commit | 79fc1080b905dc3d61a93c31f68acaf3b4985c57 (patch) | |
tree | 5736f16181fb81ed10604485c54fd6ac644ba1ec /src/main.c | |
parent | 4aa40df9cfaf6f94b9207023d8ac9250847d2150 (diff) |
New, more flexible syntax for format
More flexible and extensible syntax for format which allows better usage
of the selection API.
Continue supporting the old syntax but remove the documentation for it. It
was not supported in an official release and its use is thus deprecated.
Signed-off-by: Sakari Ailus <sakari.ailus@iki.fi>
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Diffstat (limited to 'src/main.c')
-rw-r--r-- | src/main.c | 20 |
1 files changed, 13 insertions, 7 deletions
@@ -59,16 +59,25 @@ static void v4l2_subdev_print_format(struct media_entity *entity, if (ret != 0) return; - printf("[%s %ux%u", v4l2_subdev_pixelcode_to_string(format.code), + printf("\t\t[fmt:%s/%ux%u", + v4l2_subdev_pixelcode_to_string(format.code), format.width, format.height); ret = v4l2_subdev_get_selection(entity, &rect, pad, + V4L2_SUBDEV_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, V4L2_SUBDEV_SEL_TGT_CROP_ACTUAL, which); if (ret == 0) - printf(" (%u,%u)/%ux%u", rect.left, rect.top, + printf("\n\t\t crop:(%u,%u)/%ux%u", rect.left, rect.top, rect.width, rect.height); - printf("]"); + + printf("]\n"); } static const char *media_entity_type_to_string(unsigned type) @@ -252,13 +261,11 @@ static void media_print_topology_text(struct media_device *media) for (j = 0; j < entity->info.pads; j++) { struct media_pad *pad = &entity->pads[j]; - printf("\tpad%u: %s ", j, media_pad_type_to_string(pad->flags)); + printf("\tpad%u: %s\n", j, media_pad_type_to_string(pad->flags)); if (media_entity_type(entity) == MEDIA_ENT_T_V4L2_SUBDEV) v4l2_subdev_print_format(entity, j, V4L2_SUBDEV_FORMAT_ACTIVE); - printf("\n"); - for (k = 0; k < entity->num_links; k++) { struct media_link *link = &entity->links[k]; struct media_pad *source = link->source; @@ -364,7 +371,6 @@ int main(int argc, char **argv) v4l2_subdev_print_format(pad->entity, pad->index, V4L2_SUBDEV_FORMAT_ACTIVE); - printf("\n"); } if (media_opts.print || media_opts.print_dot) { |