V4L/DVB (4200): Disable bitrate_mode when encoding mpeg-1.
authorHans Verkuil <hverkuil@xs4all.nl>
Mon, 19 Jun 2006 21:00:06 +0000 (18:00 -0300)
committerMauro Carvalho Chehab <mchehab@infradead.org>
Sun, 25 Jun 2006 05:05:23 +0000 (02:05 -0300)
MPEG-1 always uses CBR, so make the BITRATE_MODE control inactive.

Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
drivers/media/video/cx2341x.c

index 4c457dc6a403609fab7e9978558b72aa03adfb16..7cd1c4cf5aec71af1154c813f4543ebcf379244e 100644 (file)
@@ -406,6 +406,12 @@ int cx2341x_ctrl_query(struct cx2341x_mpeg_params *params, struct v4l2_queryctrl
                        qctrl->flags |= V4L2_CTRL_FLAG_READ_ONLY;
                return err;
 
+       case V4L2_CID_MPEG_VIDEO_BITRATE_MODE:
+               err = v4l2_ctrl_query_fill_std(qctrl);
+               if (err == 0 && params->video_encoding == V4L2_MPEG_VIDEO_ENCODING_MPEG_1)
+                       qctrl->flags |= V4L2_CTRL_FLAG_INACTIVE;
+               return err;
+
        case V4L2_CID_MPEG_VIDEO_BITRATE_PEAK:
                err = v4l2_ctrl_query_fill_std(qctrl);
                if (err == 0 && params->video_bitrate_mode == V4L2_MPEG_VIDEO_BITRATE_MODE_CBR)