From be6abc78395a142abedba32d2aa34cc0113d4261 Mon Sep 17 00:00:00 2001 From: Hans Verkuil Date: Wed, 20 Mar 2013 09:15:57 +0100 Subject: [PATCH] v4l2-ctl: fix the field-per-second calculation The height in the bt_timings struct is the height of the full frame, so for the fields-per-second calculation the height should be divided by two. Signed-off-by: Hans Verkuil --- utils/v4l2-ctl/v4l2-ctl-stds.cpp | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/utils/v4l2-ctl/v4l2-ctl-stds.cpp b/utils/v4l2-ctl/v4l2-ctl-stds.cpp index d39faca..3370132 100644 --- a/utils/v4l2-ctl/v4l2-ctl-stds.cpp +++ b/utils/v4l2-ctl/v4l2-ctl-stds.cpp @@ -259,10 +259,16 @@ static void print_dv_timings(const struct v4l2_dv_timings *t) (bt->polarities & V4L2_DV_VSYNC_POS_POL) ? '+' : '-', (bt->polarities & V4L2_DV_HSYNC_POS_POL) ? '+' : '-'); printf("\tPixelclock: %lld Hz", bt->pixelclock); - if (bt->width && bt->height) - printf(" (%.2f fields per second)", (double)bt->pixelclock / + if (bt->width && bt->height) { + if (bt->interlaced) + printf(" (%.2f fields per second)", (double)bt->pixelclock / + ((bt->width + bt->hfrontporch + bt->hsync + bt->hbackporch) * + (bt->height / 2 + bt->vfrontporch + bt->vsync + bt->vbackporch))); + else + printf(" (%.2f frames per second)", (double)bt->pixelclock / ((bt->width + bt->hfrontporch + bt->hsync + bt->hbackporch) * (bt->height + bt->vfrontporch + bt->vsync + bt->vbackporch))); + } printf("\n"); printf("\tHorizontal frontporch: %d\n", bt->hfrontporch); printf("\tHorizontal sync: %d\n", bt->hsync); -- 2.7.4