diff options
author | Mike Isely <isely@pobox.com> | 2006-04-19 23:56:17 -0500 |
---|---|---|
committer | Mike Isely <isely@pobox.com> | 2006-04-19 23:56:17 -0500 |
commit | bbfdc6d1fdaea36ca996bb4cfdcc493d998a65f6 (patch) | |
tree | 9a781db7c357c0ce566a98a5c13f57a9f8be7fda /linux/drivers/media/video/pvrusb2/pvrusb2-encoder.c | |
parent | a3f7122e105b35188a9e1bc89fdc15758fae8b15 (diff) | |
download | mediapointer-dvb-s2-bbfdc6d1fdaea36ca996bb4cfdcc493d998a65f6.tar.gz mediapointer-dvb-s2-bbfdc6d1fdaea36ca996bb4cfdcc493d998a65f6.tar.bz2 |
Rework pvrusb2 internal controls implementation
From: Mike Isely <isely@pobox.com>
Rework controls internal architecture. Rework video standard
handling. This is a major change.
Signed-off-by: Mike Isely <isely@pobox.com>
Diffstat (limited to 'linux/drivers/media/video/pvrusb2/pvrusb2-encoder.c')
-rw-r--r-- | linux/drivers/media/video/pvrusb2/pvrusb2-encoder.c | 26 |
1 files changed, 12 insertions, 14 deletions
diff --git a/linux/drivers/media/video/pvrusb2/pvrusb2-encoder.c b/linux/drivers/media/video/pvrusb2/pvrusb2-encoder.c index 2a93bcc96..c60786390 100644 --- a/linux/drivers/media/video/pvrusb2/pvrusb2-encoder.c +++ b/linux/drivers/media/video/pvrusb2/pvrusb2-encoder.c @@ -268,10 +268,10 @@ static int pvr2_write_encoder_vcmd (struct pvr2_hdw *hdw, u8 cmd, int pvr2_encoder_configure(struct pvr2_hdw *hdw) { int ret = 0, audio, i; - int vd_std = hdw->controls[PVR2_CID_STDCUR].value; - int height = hdw->controls[PVR2_CID_VRES].value; - int width = hdw->controls[PVR2_CID_HRES].value; - int height_full = !hdw->controls[PVR2_CID_INTERLACE].value; + v4l2_std_id vd_std = hdw->video_std_cur; + int height = hdw->res_ver_val; + int width = hdw->res_hor_val; + int height_full = !hdw->interlace_val; int is_30fps, is_ntsc; @@ -370,9 +370,9 @@ int pvr2_encoder_configure(struct pvr2_hdw *hdw) /* set video bitrate */ ret |= pvr2_write_encoder_vcmd( hdw, CX2341X_ENC_SET_BIT_RATE, 3, - (hdw->controls[PVR2_CID_VBR].value ? 1 : 0), - hdw->controls[PVR2_CID_AVERAGEVIDEOBITRATE].value, - (u32) (hdw->controls[PVR2_CID_PEAKVIDEOBITRATE].value) / 400); + (hdw->vbr_val ? 1 : 0), + hdw->videobitrate_val, + hdw->videopeak_val / 400); /* setup GOP structure (GOP size = 0f or 0c, 3-1 = 2 B-frames) */ ret |= pvr2_write_encoder_vcmd(hdw, CX2341X_ENC_SET_GOP_PROPERTIES, 2, is_30fps ? 0x0f : 0x0c, 0x03); @@ -384,13 +384,11 @@ int pvr2_encoder_configure(struct pvr2_hdw *hdw) ret |= pvr2_write_encoder_vcmd(hdw,CX2341X_ENC_SET_GOP_CLOSURE,1,0); /* set audio stream properties 0x40b9? 0100 0000 1011 1001 */ - audio = (pvr_tbl_audiobitrate[hdw->controls[ - PVR2_CID_AUDIOBITRATE].value] | - pvr_tbl_srate[hdw->controls[PVR2_CID_SRATE].value] | - hdw->controls[PVR2_CID_AUDIOLAYER].value << 2 | - (hdw->controls[PVR2_CID_AUDIOCRC].value ? 1 << 14 : 0) | - pvr_tbl_emphasis[hdw->controls[ - PVR2_CID_AUDIOEMPHASIS].value]); + audio = (pvr_tbl_audiobitrate[hdw->audiobitrate_val] | + pvr_tbl_srate[hdw->srate_val] | + hdw->audiolayer_val << 2 | + (hdw->audiocrc_val ? 1 << 14 : 0) | + pvr_tbl_emphasis[hdw->audioemphasis_val]); ret |= pvr2_write_encoder_vcmd(hdw,CX2341X_ENC_SET_AUDIO_PROPERTIES,1, audio); |