From bd9140189ddca1f9bfc0d5d42e10451f1dd05b45 Mon Sep 17 00:00:00 2001 From: Hans Verkuil Date: Sun, 12 Nov 2006 13:24:27 +0100 Subject: Improve usage message and short options for v4l2-ctl From: Hans Verkuil Several uncommon actions had a short option, while some common actions only had a long option. Reorganized this. Also split the usage message in common and uncommon options. Signed-off-by: Hans Verkuil --- v4l2-apps/util/v4l2-ctl.cpp | 69 ++++++++++++++++++++++++--------------------- 1 file changed, 37 insertions(+), 32 deletions(-) (limited to 'v4l2-apps/util/v4l2-ctl.cpp') diff --git a/v4l2-apps/util/v4l2-ctl.cpp b/v4l2-apps/util/v4l2-ctl.cpp index a90dd76eb..0e90c064d 100644 --- a/v4l2-apps/util/v4l2-ctl.cpp +++ b/v4l2-apps/util/v4l2-ctl.cpp @@ -51,10 +51,8 @@ In general the lower case is used to set something and the upper case is used to retrieve a setting. */ enum Option { - OptGetAudioInput = 'A', - OptSetAudioInput = 'a', - OptGetAudioOutput = 'B', - OptSetAudioOutput = 'b', + OptGetSlicedVbiFormat = 'B', + OptSetSlicedVbiFormat = 'b', OptGetCtrl = 'C', OptSetCtrl = 'c', OptSetDevice = 'd', @@ -70,8 +68,6 @@ enum Option { OptListInputs = 'n', OptGetOutput = 'O', OptSetOutput = 'o', - OptListAudioOutputs = 'Q', - OptListAudioInputs = 'q', OptGetStandard = 'S', OptSetStandard = 's', OptGetTuner = 'T', @@ -79,9 +75,7 @@ enum Option { OptGetVideoFormat = 'V', OptSetVideoFormat = 'v', - OptGetSlicedVbiFormat = 128, - OptSetSlicedVbiFormat, - OptGetSlicedVbiOutFormat, + OptGetSlicedVbiOutFormat = 128, OptSetSlicedVbiOutFormat, OptGetOverlayFormat, //OptSetOverlayFormat, TODO @@ -102,6 +96,12 @@ enum Option { OptGetSlicedVbiOutCap, OptGetVideoCrop, OptSetVideoCrop, + OptGetAudioInput, + OptSetAudioInput, + OptGetAudioOutput, + OptSetAudioOutput, + OptListAudioOutputs, + OptListAudioInputs, OptLast = 256 }; @@ -199,15 +199,18 @@ static struct option long_options[] = { static void usage(void) { printf("Usage:\n"); + printf("Common options:\n"); printf(" --all display all information available\n"); - printf(" -A, --get-audio-input\n"); - printf(" query the audio input [VIDIOC_G_AUDIO]\n"); - printf(" -a, --set-audio-input=\n"); - printf(" set the audio input to [VIDIOC_S_AUDIO]\n"); - printf(" -B, --get-audio-output\n"); - printf(" query the audio output [VIDIOC_G_AUDOUT]\n"); - printf(" -b, --set-audio-output=\n"); - printf(" set the audio output to [VIDIOC_S_AUDOUT]\n"); + printf(" -B, --get-fmt-sliced-vbi\n"); + printf(" query the sliced VBI capture format [VIDIOC_G_FMT]\n"); + printf(" -b, --set-fmt-sliced-vbi=\n"); + printf(" set the sliced VBI capture format to [VIDIOC_S_FMT]\n"); + printf(" is a comma separated list of:\n"); + printf(" off: turn off sliced VBI (cannot be combined with other modes)\n"); + printf(" teletext: teletext (PAL/SECAM)\n"); + printf(" cc: closed caption (NTSC)\n"); + printf(" wss: widescreen signal (PAL/SECAM)\n"); + printf(" vps: VPS (PAL/SECAM)\n"); printf(" -C, --get-ctrl=[,...]\n"); printf(" get the value of the controls [VIDIOC_G_EXT_CTRLS]\n"); printf(" -c, --set-ctrl==[,=...]\n"); @@ -252,30 +255,19 @@ static void usage(void) printf(" query the video capture format [VIDIOC_G_FMT]\n"); printf(" -v, --set-fmt-video=width=,height=\n"); printf(" set the video capture format [VIDIOC_S_FMT]\n"); + printf(" --verbose turn on verbose ioctl error reporting.\n"); + printf("\n"); + printf("Uncommon options:\n"); printf(" --get-fmt-video-out\n"); printf(" query the video output format [VIDIOC_G_FMT]\n"); printf(" --set-fmt-video-out=width=,height=\n"); printf(" set the video output format [VIDIOC_S_FMT]\n"); printf(" --get-fmt-overlay\n"); printf(" query the video overlay format [VIDIOC_G_FMT]\n"); - printf(" --get-crop-video\n"); - printf(" query the video capture crop window [VIDIOC_G_CROP]\n"); - printf(" --set-crop-video=top=,left=,width=,height=\n"); - printf(" set the video capture crop window [VIDIOC_S_CROP]\n"); printf(" --get-sliced-vbi-cap\n"); printf(" query the sliced VBI capture capabilities [VIDIOC_G_SLICED_VBI_CAP]\n"); printf(" --get-sliced-vbi-out-cap\n"); printf(" query the sliced VBI output capabilities [VIDIOC_G_SLICED_VBI_CAP]\n"); - printf(" --get-fmt-sliced-vbi\n"); - printf(" query the sliced VBI capture format [VIDIOC_G_FMT]\n"); - printf(" --set-fmt-sliced-vbi=\n"); - printf(" set the sliced VBI capture format to [VIDIOC_S_FMT]\n"); - printf(" is a comma separated list of:\n"); - printf(" off: turn off sliced VBI (cannot be combined with other modes)\n"); - printf(" teletext: teletext (PAL/SECAM)\n"); - printf(" cc: closed caption (NTSC)\n"); - printf(" wss: widescreen signal (PAL/SECAM)\n"); - printf(" vps: VPS (PAL/SECAM)\n"); printf(" --get-fmt-sliced-vbi-out\n"); printf(" query the sliced VBI output format [VIDIOC_G_FMT]\n"); printf(" --set-fmt-sliced-vbi-out=\n"); @@ -288,7 +280,20 @@ static void usage(void) printf(" vps: VPS (PAL/SECAM)\n"); printf(" --get-fmt-vbi query the VBI capture format [VIDIOC_G_FMT]\n"); printf(" --get-fmt-vbi-out query the VBI output format [VIDIOC_G_FMT]\n"); - printf(" --verbose turn on verbose ioctl error reporting.\n"); + printf(" --get-crop-video\n"); + printf(" query the video capture crop window [VIDIOC_G_CROP]\n"); + printf(" --set-crop-video=top=,left=,width=,height=\n"); + printf(" set the video capture crop window [VIDIOC_S_CROP]\n"); + printf(" --get-audio-input query the audio input [VIDIOC_G_AUDIO]\n"); + printf(" --set-audio-input=\n"); + printf(" set the audio input to [VIDIOC_S_AUDIO]\n"); + printf(" --get-audio-output query the audio output [VIDIOC_G_AUDOUT]\n"); + printf(" --set-audio-output=\n"); + printf(" set the audio output to [VIDIOC_S_AUDOUT]\n"); + printf(" --list-audio-outputs\n"); + printf(" display audio outputs [VIDIOC_ENUMAUDOUT]\n"); + printf(" --list-audio-inputs\n"); + printf(" display audio inputs [VIDIOC_ENUMAUDIO]\n"); printf("\n"); printf("Expert options:\n"); printf(" --streamoff turn the stream off [VIDIOC_STREAMOFF]\n"); -- cgit v1.2.3 From b13643285e0e18e972d16cd49ab402b9ee99cd94 Mon Sep 17 00:00:00 2001 From: Hans Verkuil Date: Sun, 12 Nov 2006 13:26:12 +0100 Subject: Print buffer type for struct v4l2_sliced_vbi_cap. From: Hans Verkuil This was commented out because the type was missing in v4l2_sliced_vbi_cap. It's now added, so this can now be used. Signed-off-by: Hans Verkuil --- v4l2-apps/util/v4l2-ctl.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'v4l2-apps/util/v4l2-ctl.cpp') diff --git a/v4l2-apps/util/v4l2-ctl.cpp b/v4l2-apps/util/v4l2-ctl.cpp index 0e90c064d..7dabb3969 100644 --- a/v4l2-apps/util/v4l2-ctl.cpp +++ b/v4l2-apps/util/v4l2-ctl.cpp @@ -409,7 +409,7 @@ static std::string flags2s(unsigned val, const flag_def *def) static void print_sliced_vbi_cap(struct v4l2_sliced_vbi_cap &cap) { -// printf("\tType : %s\n", buftype2s(vfmt.type).c_str()); + printf("\tType : %s\n", buftype2s(cap.type).c_str()); printf("\tService Set : %s\n", flags2s(cap.service_set, service_def).c_str()); for (int i = 0; i < 24; i++) { -- cgit v1.2.3