diff options
author | Mauro Carvalho Chehab <mchehab@infradead.org> | 2006-10-13 08:00:31 -0300 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@infradead.org> | 2006-10-13 08:00:31 -0300 |
commit | b8ebfdd7de56e85303b60ab999b39806006fc46c (patch) | |
tree | aa1f4eb09a9f351f989d0fa5d5dd61a0a718fc34 /v4l2-apps/util | |
parent | ef7138e66f9b6543dc62506c657ed01618ce8237 (diff) | |
parent | 477883c9a396fef3696c00a138f20d50629aae62 (diff) | |
download | mediapointer-dvb-s2-b8ebfdd7de56e85303b60ab999b39806006fc46c.tar.gz mediapointer-dvb-s2-b8ebfdd7de56e85303b60ab999b39806006fc46c.tar.bz2 |
merge: http://linuxtv.org/hg/~hverkuil/v4l-dvb
From: Mauro Carvalho Chehab <mchehab@infradead.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
Diffstat (limited to 'v4l2-apps/util')
-rw-r--r-- | v4l2-apps/util/v4l2-ctl.cpp | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/v4l2-apps/util/v4l2-ctl.cpp b/v4l2-apps/util/v4l2-ctl.cpp index df886581d..403bda79d 100644 --- a/v4l2-apps/util/v4l2-ctl.cpp +++ b/v4l2-apps/util/v4l2-ctl.cpp @@ -93,6 +93,7 @@ enum Option { OptStreamOff, OptStreamOn, OptListStandards, + OptListFormats, OptLogStatus, OptVerbose, OptGetVideoOutFormat, @@ -169,6 +170,7 @@ static struct option long_options[] = { {"streamoff", no_argument, 0, OptStreamOff}, {"streamon", no_argument, 0, OptStreamOn}, {"list-standards", no_argument, 0, OptListStandards}, + {"list-formats", no_argument, 0, OptListFormats}, {"get-standard", no_argument, 0, OptGetStandard}, {"set-standard", required_argument, 0, OptSetStandard}, {"info", no_argument, 0, OptGetDriverInfo}, @@ -245,6 +247,7 @@ static void usage(void) printf(" -t, --set-tuner=<mode>\n"); printf(" set the audio mode of the tuner [VIDIOC_S_TUNER]\n"); printf(" Possible values: 0 (mono), 1 (stereo), 2 (lang2), 3 (lang1), 4 (both)\n"); + printf(" --list-formats display supported video formats [VIDIOC_ENUM_FMT]\n"); printf(" -V, --get-fmt-video\n"); printf(" query the video capture format [VIDIOC_G_FMT]\n"); printf(" -v, --set-fmt-video=width=<x>,height=<y>\n"); @@ -641,6 +644,24 @@ static int printfmt(struct v4l2_format vfmt) return 0; } +static void print_video_formats(int fd, enum v4l2_buf_type type) +{ + struct v4l2_fmtdesc fmt; + + fmt.index = 0; + fmt.type = type; + while (ioctl(fd, VIDIOC_ENUM_FMT, &fmt) >= 0) { + printf("\tType : %s\n", buftype2s(type).c_str()); + printf("\tPixelformat : %s", fcc2s(fmt.pixelformat).c_str()); + if (fmt.flags) + printf(" (compressed)"); + printf("\n"); + printf("\tName : %s\n", fmt.description); + printf("\n"); + fmt.index++; + } +} + static char *pts_to_string(char *str, unsigned long pts) { static char buf[256]; @@ -1774,6 +1795,13 @@ int main(int argc, char **argv) } } + if (options[OptListFormats]) { + printf("ioctl: VIDIOC_ENUM_FMT\n"); + print_video_formats(fd, V4L2_BUF_TYPE_VIDEO_CAPTURE); + print_video_formats(fd, V4L2_BUF_TYPE_VIDEO_OUTPUT); + print_video_formats(fd, V4L2_BUF_TYPE_VIDEO_OVERLAY); + } + if (options[OptGetSlicedVbiCap]) { struct v4l2_sliced_vbi_cap cap; |