diff options
author | Laurent Pinchart <laurent.pinchart@ideasonboard.com> | 2010-07-01 10:46:46 +0200 |
---|---|---|
committer | Laurent Pinchart <laurent.pinchart@ideasonboard.com> | 2010-07-01 10:47:20 +0200 |
commit | 7bb54a6e388c5f116c60f9fa7ef053e2dc935fcb (patch) | |
tree | 2bc1e0818f5906df23e9757b69ddd806413cbd50 | |
parent | a04e11ca5bbf2a44539ee14e3077358a21262ba2 (diff) |
Print crop rectangle when printing the topology
For subdev pads that support cropping, print the active crop rectangle
in media_print_topology_text().
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
-rw-r--r-- | media.c | 13 |
1 files changed, 11 insertions, 2 deletions
@@ -335,15 +335,24 @@ static void media_print_topology_text(struct media_device *media) for (j = 0; j < entity->info.pads; j++) { struct media_entity_pad *pad = &entity->pads[j]; struct v4l2_mbus_framefmt format; + struct v4l2_rect rect; printf("\tpad%u: %s", j, media_pad_type_to_string(pad->type)); if (entity->info.type == MEDIA_ENTITY_TYPE_SUBDEV) { ret = v4l2_subdev_get_format(entity, &format, j, V4L2_SUBDEV_FORMAT_ACTIVE); - if (ret == 0) - printf(" [%s %ux%u]", pixelcode_to_string(format.code), + if (ret == 0) { + printf(" [%s %ux%u", pixelcode_to_string(format.code), format.width, format.height); + + ret = v4l2_subdev_get_crop(entity, &rect, j, + V4L2_SUBDEV_FORMAT_ACTIVE); + if (ret == 0) + printf(" (%u,%u)/%ux%u", rect.left, rect.top, + rect.width, rect.height); + printf("]"); + } } printf("\n"); |