diff options
author | Mike Isely <isely@pobox.com> | 2008-06-30 02:35:52 -0400 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@infradead.org> | 2008-07-20 06:15:52 -0400 |
commit | 00528d9c2e9e15625883c161867cba61725ba335 (patch) | |
tree | 22ed2d4ea946c5b71351dc2cd10192490b3ad175 /drivers/media/video | |
parent | ab062fe3b540c157eb66c4acedbedbc200cfd9e2 (diff) |
V4L/DVB (8176): pvrusb2: Update video_gop_size
When switching video standard, ensure that video GOP size remains
appropriately configured.
Signed-off-by: Mike Isely <isely@pobox.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
Diffstat (limited to 'drivers/media/video')
-rw-r--r-- | drivers/media/video/pvrusb2/pvrusb2-hdw.c | 21 |
1 files changed, 19 insertions, 2 deletions
diff --git a/drivers/media/video/pvrusb2/pvrusb2-hdw.c b/drivers/media/video/pvrusb2/pvrusb2-hdw.c index de0f41b956bd..a5217a2cf4c0 100644 --- a/drivers/media/video/pvrusb2/pvrusb2-hdw.c +++ b/drivers/media/video/pvrusb2/pvrusb2-hdw.c | |||
@@ -2456,18 +2456,35 @@ static int pvr2_hdw_commit_execute(struct pvr2_hdw *hdw) | |||
2456 | /* Handle some required side effects when the video standard is | 2456 | /* Handle some required side effects when the video standard is |
2457 | changed.... */ | 2457 | changed.... */ |
2458 | if (hdw->std_dirty) { | 2458 | if (hdw->std_dirty) { |
2459 | /* Rewrite the vertical resolution to be appropriate to the | ||
2460 | video standard that has been selected. */ | ||
2461 | int nvres; | 2459 | int nvres; |
2460 | int gop_size; | ||
2462 | if (hdw->std_mask_cur & V4L2_STD_525_60) { | 2461 | if (hdw->std_mask_cur & V4L2_STD_525_60) { |
2463 | nvres = 480; | 2462 | nvres = 480; |
2463 | gop_size = 15; | ||
2464 | } else { | 2464 | } else { |
2465 | nvres = 576; | 2465 | nvres = 576; |
2466 | gop_size = 12; | ||
2466 | } | 2467 | } |
2468 | /* Rewrite the vertical resolution to be appropriate to the | ||
2469 | video standard that has been selected. */ | ||
2467 | if (nvres != hdw->res_ver_val) { | 2470 | if (nvres != hdw->res_ver_val) { |
2468 | hdw->res_ver_val = nvres; | 2471 | hdw->res_ver_val = nvres; |
2469 | hdw->res_ver_dirty = !0; | 2472 | hdw->res_ver_dirty = !0; |
2470 | } | 2473 | } |
2474 | /* Rewrite the GOP size to be appropriate to the video | ||
2475 | standard that has been selected. */ | ||
2476 | if (gop_size != hdw->enc_ctl_state.video_gop_size) { | ||
2477 | struct v4l2_ext_controls cs; | ||
2478 | struct v4l2_ext_control c1; | ||
2479 | memset(&cs, 0, sizeof(cs)); | ||
2480 | memset(&c1, 0, sizeof(c1)); | ||
2481 | cs.controls = &c1; | ||
2482 | cs.count = 1; | ||
2483 | c1.id = V4L2_CID_MPEG_VIDEO_GOP_SIZE; | ||
2484 | c1.value = gop_size; | ||
2485 | cx2341x_ext_ctrls(&hdw->enc_ctl_state, 0, &cs, | ||
2486 | VIDIOC_S_EXT_CTRLS); | ||
2487 | } | ||
2471 | } | 2488 | } |
2472 | 2489 | ||
2473 | if (hdw->input_dirty && hdw->state_pathway_ok && | 2490 | if (hdw->input_dirty && hdw->state_pathway_ok && |