aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/video/saa7164/saa7164-encoder.c
diff options
context:
space:
mode:
authorSteven Toth <stoth@kernellabs.com>2010-07-31 14:05:35 -0400
committerMauro Carvalho Chehab <mchehab@redhat.com>2010-10-21 05:54:49 -0400
commit5fa56ccdacc54f5f694141c1a74f781cf77874bb (patch)
tree9e94fce2d895a7742557ced8eb354c670128766c /drivers/media/video/saa7164/saa7164-encoder.c
parentf91d095c92e8fdcb6bd8cb35e8fa9c87d9c10768 (diff)
[media] saa7164: allow variable length GOP sizes and switch encoder default to CBR
Signed-off-by: Steven Toth <stoth@kernellabs.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/video/saa7164/saa7164-encoder.c')
-rw-r--r--drivers/media/video/saa7164/saa7164-encoder.c13
1 files changed, 10 insertions, 3 deletions
diff --git a/drivers/media/video/saa7164/saa7164-encoder.c b/drivers/media/video/saa7164/saa7164-encoder.c
index c357e2db1ac3..cedeeece3c3f 100644
--- a/drivers/media/video/saa7164/saa7164-encoder.c
+++ b/drivers/media/video/saa7164/saa7164-encoder.c
@@ -42,14 +42,14 @@ static const u32 saa7164_v4l2_ctrls[] = {
42 V4L2_CID_HUE, 42 V4L2_CID_HUE,
43 V4L2_CID_AUDIO_VOLUME, 43 V4L2_CID_AUDIO_VOLUME,
44 V4L2_CID_SHARPNESS, 44 V4L2_CID_SHARPNESS,
45 V4L2_CID_MPEG_STREAM_TYPE,
45 V4L2_CID_MPEG_VIDEO_ASPECT, 46 V4L2_CID_MPEG_VIDEO_ASPECT,
47 V4L2_CID_MPEG_VIDEO_B_FRAMES,
46 V4L2_CID_MPEG_VIDEO_GOP_SIZE, 48 V4L2_CID_MPEG_VIDEO_GOP_SIZE,
47 V4L2_CID_MPEG_STREAM_TYPE,
48 V4L2_CID_MPEG_AUDIO_MUTE, 49 V4L2_CID_MPEG_AUDIO_MUTE,
49 V4L2_CID_MPEG_VIDEO_BITRATE_MODE, 50 V4L2_CID_MPEG_VIDEO_BITRATE_MODE,
50 V4L2_CID_MPEG_VIDEO_BITRATE, 51 V4L2_CID_MPEG_VIDEO_BITRATE,
51 V4L2_CID_MPEG_VIDEO_BITRATE_PEAK, 52 V4L2_CID_MPEG_VIDEO_BITRATE_PEAK,
52 V4L2_CID_MPEG_VIDEO_B_FRAMES,
53 0 53 0
54}; 54};
55 55
@@ -392,6 +392,9 @@ static int saa7164_get_ctrl(struct saa7164_port *port,
392 case V4L2_CID_MPEG_VIDEO_BITRATE_PEAK: 392 case V4L2_CID_MPEG_VIDEO_BITRATE_PEAK:
393 ctrl->value = params->bitrate_peak; 393 ctrl->value = params->bitrate_peak;
394 break; 394 break;
395 case V4L2_CID_MPEG_VIDEO_GOP_SIZE:
396 ctrl->value = params->gop_size;
397 break;
395 default: 398 default:
396 return -EINVAL; 399 return -EINVAL;
397 } 400 }
@@ -535,6 +538,9 @@ static int saa7164_set_ctrl(struct saa7164_port *port,
535 case V4L2_CID_MPEG_VIDEO_BITRATE_PEAK: 538 case V4L2_CID_MPEG_VIDEO_BITRATE_PEAK:
536 params->bitrate_peak = ctrl->value; 539 params->bitrate_peak = ctrl->value;
537 break; 540 break;
541 case V4L2_CID_MPEG_VIDEO_GOP_SIZE:
542 params->gop_size = ctrl->value;
543 break;
538 default: 544 default:
539 return -EINVAL; 545 return -EINVAL;
540 } 546 }
@@ -1336,11 +1342,12 @@ int saa7164_encoder_register(struct saa7164_port *port)
1336 port->ctl_sharpness = 8; 1342 port->ctl_sharpness = 8;
1337 port->encoder_params.bitrate = ENCODER_DEF_BITRATE; 1343 port->encoder_params.bitrate = ENCODER_DEF_BITRATE;
1338 port->encoder_params.bitrate_peak = ENCODER_DEF_BITRATE; 1344 port->encoder_params.bitrate_peak = ENCODER_DEF_BITRATE;
1339 port->encoder_params.bitrate_mode = V4L2_MPEG_VIDEO_BITRATE_MODE_VBR; 1345 port->encoder_params.bitrate_mode = V4L2_MPEG_VIDEO_BITRATE_MODE_CBR;
1340 port->encoder_params.stream_type = V4L2_MPEG_STREAM_TYPE_MPEG2_PS; 1346 port->encoder_params.stream_type = V4L2_MPEG_STREAM_TYPE_MPEG2_PS;
1341 port->encoder_params.ctl_mute = 0; 1347 port->encoder_params.ctl_mute = 0;
1342 port->encoder_params.ctl_aspect = V4L2_MPEG_VIDEO_ASPECT_4x3; 1348 port->encoder_params.ctl_aspect = V4L2_MPEG_VIDEO_ASPECT_4x3;
1343 port->encoder_params.refdist = 1; 1349 port->encoder_params.refdist = 1;
1350 port->encoder_params.gop_size = SAA7164_ENCODER_DEFAULT_GOP_SIZE;
1344 1351
1345 if (port->encodernorm.id & V4L2_STD_525_60) 1352 if (port->encodernorm.id & V4L2_STD_525_60)
1346 port->height = 480; 1353 port->height = 480;