[PATCH 2/4] media-ctl: print the configured frame interval

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



After the pad format, also print the frame interval, if already configured.

Signed-off-by: Philipp Zabel <p.zabel@xxxxxxxxxxxxxx>
---
 utils/media-ctl/media-ctl.c | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/utils/media-ctl/media-ctl.c b/utils/media-ctl/media-ctl.c
index 50adbe91..1be880c6 100644
--- a/utils/media-ctl/media-ctl.c
+++ b/utils/media-ctl/media-ctl.c
@@ -79,6 +79,7 @@ static void v4l2_subdev_print_format(struct media_entity *entity,
 	unsigned int pad, enum v4l2_subdev_format_whence which)
 {
 	struct v4l2_mbus_framefmt format;
+	struct v4l2_fract interval = { 0, 0 };
 	struct v4l2_rect rect;
 	int ret;
 
@@ -86,10 +87,17 @@ static void v4l2_subdev_print_format(struct media_entity *entity,
 	if (ret != 0)
 		return;
 
+	ret = v4l2_subdev_get_frame_interval(entity, &interval, pad);
+	if (ret != 0 && ret != -ENOTTY)
+		return;
+
 	printf("\t\t[fmt:%s/%ux%u",
 	       v4l2_subdev_pixelcode_to_string(format.code),
 	       format.width, format.height);
 
+	if (interval.numerator || interval.denominator)
+		printf("@%u/%u", interval.numerator, interval.denominator);
+
 	if (format.field)
 		printf(" field:%s", v4l2_subdev_field_to_string(format.field));
 
-- 
2.11.0

--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Linux Input]     [Video for Linux]     [Gstreamer Embedded]     [Mplayer Users]     [Linux USB Devel]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]
  Powered by Linux