This is an automatic generated email to let you know that the following patch were queued at the http://git.linuxtv.org/v4l-utils.git tree:
Subject: v4l2-compliance: implement verbosity level, improve warnings. Author: Hans Verkuil <[email protected]> Date: Fri Jan 21 23:38:31 2011 +0100 Signed-off-by: Hans Verkuil <[email protected]> utils/v4l2-compliance/v4l2-compliance.cpp | 12 ++++++++---- utils/v4l2-compliance/v4l2-compliance.h | 2 +- utils/v4l2-compliance/v4l2-test-controls.cpp | 11 +++++++---- utils/v4l2-compliance/v4l2-test-input-output.cpp | 6 ++++-- utils/v4l2-compliance/v4l2-test-io-config.cpp | 3 ++- 5 files changed, 22 insertions(+), 12 deletions(-) --- http://git.linuxtv.org/v4l-utils.git?a=commitdiff;h=6db93d6a363781e2d0ad627b1a1556ba7d065d78 diff --git a/utils/v4l2-compliance/v4l2-compliance.cpp b/utils/v4l2-compliance/v4l2-compliance.cpp index 2d122d5..8c4b589 100644 --- a/utils/v4l2-compliance/v4l2-compliance.cpp +++ b/utils/v4l2-compliance/v4l2-compliance.cpp @@ -73,7 +73,7 @@ static struct option long_options[] = { {"radio-device", required_argument, 0, OptSetRadioDevice}, {"vbi-device", required_argument, 0, OptSetVbiDevice}, {"help", no_argument, 0, OptHelp}, - {"verbose", no_argument, 0, OptVerbose}, + {"verbose", required_argument, 0, OptVerbose}, {"trace", no_argument, 0, OptTrace}, {"wrapper", no_argument, 0, OptUseWrapper}, {0, 0, 0, 0} @@ -91,7 +91,9 @@ static void usage(void) printf(" -V, --vbi-device=<dev> use device <dev> as the vbi device\n"); printf(" if <dev> is a single digit, then /dev/vbi<dev> is used\n"); printf(" -h, --help display this help message\n"); - printf(" -v, --verbose turn on verbose reporting.\n"); + printf(" -v, --verbose=<level> turn on verbose reporting.\n"); + printf(" level 1: show warnings\n"); + printf(" level 2: show warnings and info messages\n"); printf(" -T, --trace trace all called ioctls.\n"); printf(" -w, --wrapper use the libv4l2 wrapper library.\n"); exit(0); @@ -218,7 +220,7 @@ static int testCap(struct node *node) if (vcap.bus_info[0]) return fail("invalid bus_info\n"); else - warn("empty bus_info\n"); + warn("VIDIOC_QUERYCAP: empty bus_info\n"); } if (check_0(vcap.reserved, sizeof(vcap.reserved))) return fail("non-zero reserved fields\n"); @@ -351,6 +353,9 @@ int main(int argc, char **argv) vbi_device = newdev; } break; + case OptVerbose: + verbose = atoi(optarg); + break; case ':': fprintf(stderr, "Option `%s' requires a value\n", argv[optind]); @@ -371,7 +376,6 @@ int main(int argc, char **argv) usage(); return 1; } - verbose = options[OptVerbose]; wrapper = options[OptUseWrapper]; struct utsname uts; diff --git a/utils/v4l2-compliance/v4l2-compliance.h b/utils/v4l2-compliance/v4l2-compliance.h index d882b5c..d65208c 100644 --- a/utils/v4l2-compliance/v4l2-compliance.h +++ b/utils/v4l2-compliance/v4l2-compliance.h @@ -59,7 +59,7 @@ struct node { #define info(fmt, args...) \ do { \ - if (verbose) \ + if (verbose > 1) \ printf("\t\tinfo: " fmt, ##args); \ } while (0) diff --git a/utils/v4l2-compliance/v4l2-test-controls.cpp b/utils/v4l2-compliance/v4l2-test-controls.cpp index b9a9880..53411ef 100644 --- a/utils/v4l2-compliance/v4l2-test-controls.cpp +++ b/utils/v4l2-compliance/v4l2-test-controls.cpp @@ -84,7 +84,7 @@ static int checkQCtrl(struct node *node, struct test_queryctrl &qctrl) // This really should be a fail, but there are so few // drivers that do this right that I made it a warning // for now. - warn("(max - min) %% step != 0\n"); + warn("%s: (max - min) %% step != 0\n", qctrl.name); } break; case V4L2_CTRL_TYPE_CTRL_CLASS: @@ -280,7 +280,8 @@ static int checkSimpleCtrl(struct v4l2_control &ctrl, struct test_queryctrl &qct // This really should be a fail, but there are so few // drivers that do this right that I made it a warning // for now. - warn("returned control value not a multiple of step\n"); + warn("%s: returned control value %d not a multiple of step\n", + qctrl.name, ctrl.value); } break; case V4L2_CTRL_TYPE_BUTTON: @@ -371,7 +372,8 @@ int testSimpleControls(struct node *node) ctrl.value = iter->minimum + 1; ret = doioctl(node, VIDIOC_S_CTRL, &ctrl); if (ret == ERANGE) - warn("returns ERANGE for in-range, but non-step-multiple value\n"); + warn("%s: returns ERANGE for in-range, but non-step-multiple value\n", + iter->name); else if (ret) return fail("returns error for in-range, but non-step-multiple value\n"); } @@ -436,7 +438,8 @@ static int checkExtendedCtrl(struct v4l2_ext_control &ctrl, struct test_queryctr // This really should be a fail, but there are so few // drivers that do this right that I made it a warning // for now. - warn("returned control value not a multiple of step\n"); + warn("%s: returned control value %d not a multiple of step\n", + qctrl.name, ctrl.value); } break; case V4L2_CTRL_TYPE_BUTTON: diff --git a/utils/v4l2-compliance/v4l2-test-input-output.cpp b/utils/v4l2-compliance/v4l2-test-input-output.cpp index 4502b05..20bf525 100644 --- a/utils/v4l2-compliance/v4l2-test-input-output.cpp +++ b/utils/v4l2-compliance/v4l2-test-input-output.cpp @@ -186,7 +186,8 @@ int testTunerFreq(struct node *node) if (freq.frequency == 0) return fail("frequency not set\n"); if (freq.frequency < tuner.rangelow || freq.frequency > tuner.rangehigh) - warn("returned frequency out of range\n"); + warn("returned tuner %d frequency out of range (%d not in [%d...%d])\n", + t, freq.frequency, tuner.rangelow, tuner.rangehigh); freq.type = (enum v4l2_tuner_type)0; ret = doioctl(node, VIDIOC_S_FREQUENCY, &freq); @@ -489,7 +490,8 @@ int testModulatorFreq(struct node *node) if (freq.frequency == 0) return fail("frequency not set\n"); if (freq.frequency < modulator.rangelow || freq.frequency > modulator.rangehigh) - warn("returned frequency out of range\n"); + warn("returned modulator %d frequency out of range (%d not in [%d...%d])\n", + m, freq.frequency, modulator.rangelow, modulator.rangehigh); ret = doioctl(node, VIDIOC_S_FREQUENCY, &freq); if (ret) diff --git a/utils/v4l2-compliance/v4l2-test-io-config.cpp b/utils/v4l2-compliance/v4l2-test-io-config.cpp index 8102906..c60c222 100644 --- a/utils/v4l2-compliance/v4l2-test-io-config.cpp +++ b/utils/v4l2-compliance/v4l2-test-io-config.cpp @@ -76,7 +76,8 @@ static int checkStd(struct node *node, bool has_std, v4l2_std_id mask) if (enumstd.framelines == 0) return fail("framelines not filled\n"); if (enumstd.framelines != 625 && enumstd.framelines != 525) - warn("strange framelines value (%d)\n", enumstd.framelines); + warn("strange framelines value %d for standard %08llx\n", + enumstd.framelines, enumstd.id); if (enumstd.frameperiod.numerator == 0 || enumstd.frameperiod.denominator == 0) return fail("frameperiod is not filled\n"); if (enumstd.index != i) _______________________________________________ linuxtv-commits mailing list [email protected] http://www.linuxtv.org/cgi-bin/mailman/listinfo/linuxtv-commits
