提交 81dde91f 编写于 作者: H Hans Verkuil 提交者: Mauro Carvalho Chehab

V4L/DVB (10687): v4l2-common/v4l2-spec: support/document write-only and button controls

The controls V4L2_CID_PAN_RESET and V4L2_CID_TILT_RESET changed their type
to button controls (these are unused at the moment, so this is a safe change).

The controls V4L2_CID_PAN_RELATIVE, V4L2_CID_TILT_RELATIVE, V4L2_CID_FOCUS_RELATIVE
and V4L2_CID_ZOOM_RELATIVE are marked as write-only controls.

Cc: Laurent Pinchart <laurent.pinchart@skynet.be>
Signed-off-by: NHans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: NMauro Carvalho Chehab <mchehab@redhat.com>
上级 1a367f3b
...@@ -390,16 +390,16 @@ const char *v4l2_ctrl_get_name(u32 id) ...@@ -390,16 +390,16 @@ const char *v4l2_ctrl_get_name(u32 id)
switch (id) { switch (id) {
/* USER controls */ /* USER controls */
case V4L2_CID_USER_CLASS: return "User Controls"; case V4L2_CID_USER_CLASS: return "User Controls";
case V4L2_CID_BRIGHTNESS: return "Brightness";
case V4L2_CID_CONTRAST: return "Contrast";
case V4L2_CID_SATURATION: return "Saturation";
case V4L2_CID_HUE: return "Hue";
case V4L2_CID_AUDIO_VOLUME: return "Volume"; case V4L2_CID_AUDIO_VOLUME: return "Volume";
case V4L2_CID_AUDIO_MUTE: return "Mute";
case V4L2_CID_AUDIO_BALANCE: return "Balance"; case V4L2_CID_AUDIO_BALANCE: return "Balance";
case V4L2_CID_AUDIO_BASS: return "Bass"; case V4L2_CID_AUDIO_BASS: return "Bass";
case V4L2_CID_AUDIO_TREBLE: return "Treble"; case V4L2_CID_AUDIO_TREBLE: return "Treble";
case V4L2_CID_AUDIO_MUTE: return "Mute";
case V4L2_CID_AUDIO_LOUDNESS: return "Loudness"; case V4L2_CID_AUDIO_LOUDNESS: return "Loudness";
case V4L2_CID_BRIGHTNESS: return "Brightness";
case V4L2_CID_CONTRAST: return "Contrast";
case V4L2_CID_SATURATION: return "Saturation";
case V4L2_CID_HUE: return "Hue";
case V4L2_CID_BLACK_LEVEL: return "Black Level"; case V4L2_CID_BLACK_LEVEL: return "Black Level";
case V4L2_CID_AUTO_WHITE_BALANCE: return "White Balance, Automatic"; case V4L2_CID_AUTO_WHITE_BALANCE: return "White Balance, Automatic";
case V4L2_CID_DO_WHITE_BALANCE: return "Do White Balance"; case V4L2_CID_DO_WHITE_BALANCE: return "Do White Balance";
...@@ -499,16 +499,25 @@ int v4l2_ctrl_query_fill(struct v4l2_queryctrl *qctrl, s32 min, s32 max, s32 ste ...@@ -499,16 +499,25 @@ int v4l2_ctrl_query_fill(struct v4l2_queryctrl *qctrl, s32 min, s32 max, s32 ste
case V4L2_CID_HFLIP: case V4L2_CID_HFLIP:
case V4L2_CID_VFLIP: case V4L2_CID_VFLIP:
case V4L2_CID_HUE_AUTO: case V4L2_CID_HUE_AUTO:
case V4L2_CID_CHROMA_AGC:
case V4L2_CID_COLOR_KILLER:
case V4L2_CID_MPEG_AUDIO_MUTE: case V4L2_CID_MPEG_AUDIO_MUTE:
case V4L2_CID_MPEG_VIDEO_MUTE: case V4L2_CID_MPEG_VIDEO_MUTE:
case V4L2_CID_MPEG_VIDEO_GOP_CLOSURE: case V4L2_CID_MPEG_VIDEO_GOP_CLOSURE:
case V4L2_CID_MPEG_VIDEO_PULLDOWN: case V4L2_CID_MPEG_VIDEO_PULLDOWN:
case V4L2_CID_EXPOSURE_AUTO_PRIORITY: case V4L2_CID_EXPOSURE_AUTO_PRIORITY:
case V4L2_CID_FOCUS_AUTO:
case V4L2_CID_PRIVACY: case V4L2_CID_PRIVACY:
qctrl->type = V4L2_CTRL_TYPE_BOOLEAN; qctrl->type = V4L2_CTRL_TYPE_BOOLEAN;
min = 0; min = 0;
max = step = 1; max = step = 1;
break; break;
case V4L2_CID_PAN_RESET:
case V4L2_CID_TILT_RESET:
qctrl->type = V4L2_CTRL_TYPE_BUTTON;
qctrl->flags |= V4L2_CTRL_FLAG_WRITE_ONLY;
min = max = step = def = 0;
break;
case V4L2_CID_POWER_LINE_FREQUENCY: case V4L2_CID_POWER_LINE_FREQUENCY:
case V4L2_CID_MPEG_AUDIO_SAMPLING_FREQ: case V4L2_CID_MPEG_AUDIO_SAMPLING_FREQ:
case V4L2_CID_MPEG_AUDIO_ENCODING: case V4L2_CID_MPEG_AUDIO_ENCODING:
...@@ -557,8 +566,17 @@ int v4l2_ctrl_query_fill(struct v4l2_queryctrl *qctrl, s32 min, s32 max, s32 ste ...@@ -557,8 +566,17 @@ int v4l2_ctrl_query_fill(struct v4l2_queryctrl *qctrl, s32 min, s32 max, s32 ste
case V4L2_CID_CONTRAST: case V4L2_CID_CONTRAST:
case V4L2_CID_SATURATION: case V4L2_CID_SATURATION:
case V4L2_CID_HUE: case V4L2_CID_HUE:
case V4L2_CID_RED_BALANCE:
case V4L2_CID_BLUE_BALANCE:
case V4L2_CID_GAMMA:
qctrl->flags |= V4L2_CTRL_FLAG_SLIDER; qctrl->flags |= V4L2_CTRL_FLAG_SLIDER;
break; break;
case V4L2_CID_PAN_RELATIVE:
case V4L2_CID_TILT_RELATIVE:
case V4L2_CID_FOCUS_RELATIVE:
case V4L2_CID_ZOOM_RELATIVE:
qctrl->flags |= V4L2_CTRL_FLAG_WRITE_ONLY;
break;
} }
qctrl->minimum = min; qctrl->minimum = min;
qctrl->maximum = max; qctrl->maximum = max;
...@@ -578,6 +596,7 @@ int v4l2_ctrl_query_fill_std(struct v4l2_queryctrl *qctrl) ...@@ -578,6 +596,7 @@ int v4l2_ctrl_query_fill_std(struct v4l2_queryctrl *qctrl)
/* USER controls */ /* USER controls */
case V4L2_CID_USER_CLASS: case V4L2_CID_USER_CLASS:
case V4L2_CID_MPEG_CLASS: case V4L2_CID_MPEG_CLASS:
case V4L2_CID_CAMERA_CLASS:
return v4l2_ctrl_query_fill(qctrl, 0, 0, 0, 0); return v4l2_ctrl_query_fill(qctrl, 0, 0, 0, 0);
case V4L2_CID_AUDIO_VOLUME: case V4L2_CID_AUDIO_VOLUME:
return v4l2_ctrl_query_fill(qctrl, 0, 65535, 65535 / 100, 58880); return v4l2_ctrl_query_fill(qctrl, 0, 65535, 65535 / 100, 58880);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册