From 3181695b5223ac391b793929899e7f8c937cdb73 Mon Sep 17 00:00:00 2001 From: Hans Verkuil Date: Sat, 2 Mar 2013 12:20:49 +0100 Subject: [PATCH] v4l2-ctl: improve interval reporting. Shorten the text and drop the fps step value which was wrong and not useful. Signed-off-by: Hans Verkuil --- utils/v4l2-ctl/v4l2-ctl-vidcap.cpp | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/utils/v4l2-ctl/v4l2-ctl-vidcap.cpp b/utils/v4l2-ctl/v4l2-ctl-vidcap.cpp index 1ba5131..6cd17a3 100644 --- a/utils/v4l2-ctl/v4l2-ctl-vidcap.cpp +++ b/utils/v4l2-ctl/v4l2-ctl-vidcap.cpp @@ -86,7 +86,7 @@ static std::string fract2sec(const struct v4l2_fract &f) { char buf[100]; - sprintf(buf, "%.3f s", (1.0 * f.numerator) / f.denominator); + sprintf(buf, "%.3f", (1.0 * f.numerator) / f.denominator); return buf; } @@ -94,7 +94,7 @@ static std::string fract2fps(const struct v4l2_fract &f) { char buf[100]; - sprintf(buf, "%.3f fps", (1.0 * f.denominator) / f.numerator); + sprintf(buf, "%.3f", (1.0 * f.denominator) / f.numerator); return buf; } @@ -119,18 +119,15 @@ static void print_frmival(const struct v4l2_frmivalenum &frmival, const char *pr { printf("%s\tInterval: %s ", prefix, frmtype2s(frmival.type).c_str()); if (frmival.type == V4L2_FRMIVAL_TYPE_DISCRETE) { - printf("%s (%s)\n", fract2sec(frmival.discrete).c_str(), + printf("%ss (%s fps)\n", fract2sec(frmival.discrete).c_str(), fract2fps(frmival.discrete).c_str()); } else if (frmival.type == V4L2_FRMIVAL_TYPE_STEPWISE) { - printf("%s - %s with step %s\n", + printf("%ss - %ss with step %ss (%s-%s fps)\n", fract2sec(frmival.stepwise.min).c_str(), fract2sec(frmival.stepwise.max).c_str(), - fract2sec(frmival.stepwise.step).c_str()); - printf("%s\t : ", prefix); - printf("(%s - %s with step %s)\n", - fract2fps(frmival.stepwise.min).c_str(), + fract2sec(frmival.stepwise.step).c_str(), fract2fps(frmival.stepwise.max).c_str(), - fract2fps(frmival.stepwise.step).c_str()); + fract2fps(frmival.stepwise.min).c_str()); } } -- 2.7.4