static void print_dv_timings(const struct v4l2_dv_timings *t)
{
const struct v4l2_bt_timings *bt;
+ double tot_width, tot_height;
switch (t->type) {
case V4L2_DV_BT_656_1120:
bt = &t->bt;
+ tot_height = bt->height +
+ bt->vfrontporch + bt->vsync + bt->vbackporch +
+ bt->il_vfrontporch + bt->il_vsync + bt->il_vbackporch;
+ tot_width = bt->width +
+ bt->hfrontporch + bt->hsync + bt->hbackporch;
+ if (options[OptConcise]) {
+ printf("\t%dx%d%c%.2f %s\n", bt->width, bt->height,
+ bt->interlaced ? 'i' : 'p',
+ (double)bt->pixelclock /
+ (tot_width * (tot_height / (bt->interlaced ? 2 : 1))),
+ flags2s(bt->flags, dv_flags_def).c_str());
+ break;
+ }
printf("\tActive width: %d\n", bt->width);
printf("\tActive height: %d\n", bt->height);
printf("\tTotal width: %d\n",bt->width +
(bt->polarities & V4L2_DV_HSYNC_POS_POL) ? '+' : '-');
printf("\tPixelclock: %lld Hz", bt->pixelclock);
if (bt->width && bt->height) {
- double tot_height = bt->height +
- bt->vfrontporch + bt->vsync + bt->vbackporch +
- bt->il_vfrontporch + bt->il_vsync + bt->il_vbackporch;
- double tot_width = bt->width +
- bt->hfrontporch + bt->hsync + bt->hbackporch;
-
if (bt->interlaced)
printf(" (%.2f fields per second)", (double)bt->pixelclock /
(tot_width * (tot_height / 2)));
printf("ioctl: VIDIOC_ENUMSTD\n");
vs.index = 0;
while (test_ioctl(fd, VIDIOC_ENUMSTD, &vs) >= 0) {
- if (vs.index)
- printf("\n");
- printf("\tIndex : %d\n", vs.index);
- printf("\tID : 0x%016llX\n", (unsigned long long)vs.id);
- printf("\tName : %s\n", vs.name);
- printf("\tFrame period: %d/%d\n",
- vs.frameperiod.numerator,
- vs.frameperiod.denominator);
- printf("\tFrame lines : %d\n", vs.framelines);
+ if (options[OptConcise]) {
+ printf("\t%2d: 0x%016llX %s\n", vs.index,
+ (unsigned long long)vs.id, vs.name);
+ } else {
+ if (vs.index)
+ printf("\n");
+ printf("\tIndex : %d\n", vs.index);
+ printf("\tID : 0x%016llX\n", (unsigned long long)vs.id);
+ printf("\tName : %s\n", vs.name);
+ printf("\tFrame period: %d/%d\n",
+ vs.frameperiod.numerator,
+ vs.frameperiod.denominator);
+ printf("\tFrame lines : %d\n", vs.framelines);
+ }
vs.index++;
}
}
dv_enum_timings.index = 0;
printf("ioctl: VIDIOC_ENUM_DV_TIMINGS\n");
while (test_ioctl(fd, VIDIOC_ENUM_DV_TIMINGS, &dv_enum_timings) >= 0) {
- if (dv_enum_timings.index)
- printf("\n");
- printf("\tIndex: %d\n", dv_enum_timings.index);
+ if (options[OptConcise]) {
+ printf("\t%d:", dv_enum_timings.index);
+ } else {
+ if (dv_enum_timings.index)
+ printf("\n");
+ printf("\tIndex: %d\n", dv_enum_timings.index);
+ }
print_dv_timings(&dv_enum_timings.timings);
dv_enum_timings.index++;
}
{"help-streaming", no_argument, 0, OptHelpStreaming},
{"help-all", no_argument, 0, OptHelpAll},
{"wrapper", no_argument, 0, OptUseWrapper},
+ {"concise", no_argument, 0, OptConcise},
{"get-output", no_argument, 0, OptGetOutput},
{"set-output", required_argument, 0, OptSetOutput},
{"list-outputs", no_argument, 0, OptListOutputs},