summaryrefslogtreecommitdiff
path: root/linux/drivers/media/video/cx2341x.c
diff options
context:
space:
mode:
authorHans Verkuil <hverkuil@xs4all.nl>2007-02-20 23:58:54 +0100
committerHans Verkuil <hverkuil@xs4all.nl>2007-02-20 23:58:54 +0100
commitd075312502f9b70ad11286485861ed9ec0362620 (patch)
tree6babd81d4dcf972f7baabd8f9db75cd4c93e2f54 /linux/drivers/media/video/cx2341x.c
parent499698f41d8cb0580773a42f3bc3f1a341cf71c4 (diff)
downloadmediapointer-dvb-s2-d075312502f9b70ad11286485861ed9ec0362620.tar.gz
mediapointer-dvb-s2-d075312502f9b70ad11286485861ed9ec0362620.tar.bz2
Split VIDEO_MUTE into MUTE and MUTE_YUV
From: Hans Verkuil <hverkuil@xs4all.nl> It is bad practice to basically combine two functions (mute on/off and precise video mute YUV value) in one control. Split them. Also ensure that the default mute value is black. Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Diffstat (limited to 'linux/drivers/media/video/cx2341x.c')
-rw-r--r--linux/drivers/media/video/cx2341x.c17
1 files changed, 13 insertions, 4 deletions
diff --git a/linux/drivers/media/video/cx2341x.c b/linux/drivers/media/video/cx2341x.c
index 0494310c5..18e86cd4e 100644
--- a/linux/drivers/media/video/cx2341x.c
+++ b/linux/drivers/media/video/cx2341x.c
@@ -66,6 +66,7 @@ const u32 cx2341x_mpeg_ctrls[] = {
V4L2_CID_MPEG_VIDEO_BITRATE_PEAK,
V4L2_CID_MPEG_VIDEO_TEMPORAL_DECIMATION,
V4L2_CID_MPEG_VIDEO_MUTE,
+ V4L2_CID_MPEG_VIDEO_MUTE_YUV,
V4L2_CID_MPEG_CX2341X_VIDEO_SPATIAL_FILTER_MODE,
V4L2_CID_MPEG_CX2341X_VIDEO_SPATIAL_FILTER,
V4L2_CID_MPEG_CX2341X_VIDEO_LUMA_SPATIAL_FILTER_TYPE,
@@ -142,6 +143,9 @@ static int cx2341x_get_ctrl(struct cx2341x_mpeg_params *params,
case V4L2_CID_MPEG_VIDEO_MUTE:
ctrl->value = params->video_mute;
break;
+ case V4L2_CID_MPEG_VIDEO_MUTE_YUV:
+ ctrl->value = params->video_mute_yuv;
+ break;
case V4L2_CID_MPEG_STREAM_TYPE:
ctrl->value = params->stream_type;
break;
@@ -263,7 +267,10 @@ static int cx2341x_set_ctrl(struct cx2341x_mpeg_params *params,
params->video_temporal_decimation = ctrl->value;
break;
case V4L2_CID_MPEG_VIDEO_MUTE:
- params->video_mute = ctrl->value;
+ params->video_mute = (ctrl->value != 0);
+ break;
+ case V4L2_CID_MPEG_VIDEO_MUTE_YUV:
+ params->video_mute_yuv = ctrl->value;
break;
case V4L2_CID_MPEG_STREAM_TYPE:
params->stream_type = ctrl->value;
@@ -716,6 +723,7 @@ void cx2341x_fill_defaults(struct cx2341x_mpeg_params *p)
.video_bitrate_peak = 8000000,
.video_temporal_decimation = 0,
.video_mute = 0,
+ .video_mute_yuv = 0x008080, /* YCbCr value for black */
/* encoding filters */
.video_spatial_filter_mode = V4L2_MPEG_CX2341X_VIDEO_SPATIAL_FILTER_MODE_MANUAL,
@@ -870,8 +878,9 @@ int cx2341x_update(void *priv, cx2341x_mbox_func func,
new->video_temporal_decimation);
if (err) return err;
}
- if (old == NULL || old->video_mute != new->video_mute) {
- err = cx2341x_api(priv, func, CX2341X_ENC_MUTE_VIDEO, 1, new->video_mute);
+ if (old == NULL || old->video_mute != new->video_mute ||
+ (new->video_mute && old->video_mute_yuv != new->video_mute_yuv)) {
+ err = cx2341x_api(priv, func, CX2341X_ENC_MUTE_VIDEO, 1, new->video_mute | (new->video_mute_yuv << 8));
if (err) return err;
}
if (old == NULL || old->stream_insert_nav_packets != new->stream_insert_nav_packets) {
@@ -921,7 +930,7 @@ void cx2341x_log_status(struct cx2341x_mpeg_params *p, const char *prefix)
prefix,
p->width / (is_mpeg1 ? 2 : 1), p->height / (is_mpeg1 ? 2 : 1),
p->is_50hz ? 25 : 30,
- (p->video_mute & 1) ? " (muted)" : "");
+ (p->video_mute) ? " (muted)" : "");
printk(KERN_INFO "%s: Video: %s, %s, %s, %d",
prefix,
cx2341x_menu_item(p, V4L2_CID_MPEG_VIDEO_ENCODING),